diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml index fbb9d8d..44171b0 100644 --- a/.github/workflows/ci-go.yml +++ b/.github/workflows/ci-go.yml @@ -6,6 +6,7 @@ on: - '**.go' - go.* - Makefile + - spec/** run-name: CI Go by @${{ github.actor }} ${{ github.sha }} jobs: build-test: @@ -31,5 +32,19 @@ jobs: with: version: ${{ steps.extract_version.outputs.golangci_lint_version }} args: ./cmd/... ./internal/... + - name: generated code matches the spec + run: | + make generate-api + git status --porcelain internal/api internal/commands spec + test -z "$(git status --porcelain internal/api internal/commands spec)" + - name: command surface keeps every command in the base branch + env: + BASE_REF: ${{ github.base_ref }} + run: | + git fetch --depth=1 origin "$BASE_REF" + git show FETCH_HEAD:spec/mcp-tools.tsv > "$RUNNER_TEMP/base-tools.tsv" || : > "$RUNNER_TEMP/base-tools.tsv" + if git show FETCH_HEAD:spec/command-surface.tsv > "$RUNNER_TEMP/base-surface.tsv"; then + go run ./scripts/commandsurface --base "$RUNNER_TEMP/base-surface.tsv" --base-tools "$RUNNER_TEMP/base-tools.tsv" + fi - name: test run: make unit diff --git a/.github/workflows/spec-drift.yml b/.github/workflows/spec-drift.yml new file mode 100644 index 0000000..6f2bc4f --- /dev/null +++ b/.github/workflows/spec-drift.yml @@ -0,0 +1,140 @@ +# Opens a pull request when the OpenAPI pin in the Makefile is behind the bundle +# published in the monorepo. It only pushes a branch and opens a pull request: +# it never merges, and release.yml runs only on a push to main. +# +# Each token has one repository and the least permission. The steps that run Go +# from this repository have no token in their environment. +# +# Create the spec-sync environment with a main-only deployment branch policy before +# you add the app key to it as an environment secret. GitHub creates a missing +# environment with no policy when a job names it, so without this step a modified +# workflow on another branch could read the key. +name: Spec Drift +on: + schedule: + - cron: '0 20 * * 1' + workflow_dispatch: +run-name: Spec Drift by @${{ github.actor }} +permissions: + contents: read +concurrency: + group: spec-drift + cancel-in-progress: false +env: + SPEC_REPO: nullify-platform/nullify + SPEC_PATH: public-docs/.gitbook/assets/api/nullify-openapi-bundle.yaml + BRANCH: automation/spec-sync +jobs: + open-sync-pr: + if: github.repository == 'Nullify-Platform/cli' + runs-on: ubuntu-24.04 + environment: spec-sync + steps: + - name: Require the app key + env: + APP_KEY: ${{ secrets.SPEC_SYNC_GITHUB_APP_KEY }} + run: | + if [ -z "$APP_KEY" ]; then + echo "::error::Secret SPEC_SYNC_GITHUB_APP_KEY is missing from the spec-sync environment. Add the private key of GitHub App 359904 as an environment secret." + exit 1 + fi + - name: Mint a token that reads only the monorepo + id: read-token + uses: actions/create-github-app-token@v3 + with: + app-id: 359904 + private-key: ${{ secrets.SPEC_SYNC_GITHUB_APP_KEY }} + owner: Nullify-Platform + repositories: nullify + permission-contents: read + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + - name: Compare the pin with the newest bundle commit + id: drift + env: + GH_TOKEN: ${{ steps.read-token.outputs.token }} + OWN_TOKEN: ${{ github.token }} + run: | + latest=$(gh api "repos/$SPEC_REPO/commits?path=$SPEC_PATH&sha=main&per_page=1" --jq '.[0].sha') + pinned=$(sed -n 's/^SPEC_REF ?= //p' Makefile) + proposed=$(GH_TOKEN="$OWN_TOKEN" gh api "repos/$GITHUB_REPOSITORY/contents/Makefile?ref=$BRANCH" -H "Accept: application/vnd.github.raw" 2>/dev/null | sed -n 's/^SPEC_REF ?= //p' || true) + test -n "$latest" + echo "latest=$latest" >> "$GITHUB_OUTPUT" + echo "pinned=$pinned" >> "$GITHUB_OUTPUT" + if [ "$latest" = "$pinned" ] || [ "$latest" = "$proposed" ]; then + echo "drifted=false" >> "$GITHUB_OUTPUT" + else + echo "drifted=true" >> "$GITHUB_OUTPUT" + fi + - name: Download the newest bundle + if: steps.drift.outputs.drifted == 'true' + env: + GH_TOKEN: ${{ steps.read-token.outputs.token }} + LATEST: ${{ steps.drift.outputs.latest }} + run: | + sed -i "s/^SPEC_REF ?= .*/SPEC_REF ?= $LATEST/" Makefile + make fetch-spec + - name: Regenerate with no token in the environment + if: steps.drift.outputs.drifted == 'true' + id: regen + run: | + make generate-api + if make command-surface > surface.log 2>&1; then + echo "surface_ok=true" >> "$GITHUB_OUTPUT" + else + echo "surface_ok=false" >> "$GITHUB_OUTPUT" + fi + - name: Mint a token that writes only to this repository + if: steps.drift.outputs.drifted == 'true' + id: write-token + uses: actions/create-github-app-token@v3 + with: + app-id: 359904 + private-key: ${{ secrets.SPEC_SYNC_GITHUB_APP_KEY }} + owner: Nullify-Platform + repositories: cli + permission-contents: write + permission-pull-requests: write + - name: Open or update the pull request + if: steps.drift.outputs.drifted == 'true' + env: + GH_TOKEN: ${{ steps.write-token.outputs.token }} + LATEST: ${{ steps.drift.outputs.latest }} + PINNED: ${{ steps.drift.outputs.pinned }} + SURFACE_OK: ${{ steps.regen.outputs.surface_ok }} + run: | + { + echo "The published OpenAPI bundle moved from \`$PINNED\` to \`$LATEST\`." + echo + if [ "$SURFACE_OK" = "true" ]; then + echo "No command or MCP tool disappeared. New commands and any spec changes are in the diff." + else + echo "A command, flag or MCP tool disappeared. Record each one in \`internal/commands/surface_decisions.go\` or \`mcp.Decisions\`, and run \`make command-surface\`:" + echo + echo '```' + cat surface.log + echo '```' + fi + echo + echo "\`AllowlistTypeUnrecorded\` is on the \`bughunt\`, \`sca_dependencies\`, \`sca_containers\` and \`secrets_sensitive_data\` rows in \`internal/findings/types.go\`. If this bundle includes monorepo #17588, remove it from the SCA and sensitive-data rows. Keep it on \`bughunt\` unless the bundle adds an allowlist type input for bug hunt." + echo + echo "This pull request needs a person to review and merge it. A merge to main releases to customers." + } > "$RUNNER_TEMP/body.md" + rm -f surface.log + + git config user.name "nullify-spec-sync[bot]" + git config user.email "nullify-spec-sync[bot]@users.noreply.github.com" + git switch -C "$BRANCH" + git add -A + git commit -m "feat(api): sync the OpenAPI spec to ${LATEST:0:12}" + git -c credential.helper= -c 'credential.helper=!gh auth git-credential' push --force origin "$BRANCH" + + if [ "$(gh pr list --head "$BRANCH" --state open --json number --jq length)" = "0" ]; then + gh pr create --draft --head "$BRANCH" --title "feat(api): sync the OpenAPI spec" --body-file "$RUNNER_TEMP/body.md" + else + gh pr edit "$BRANCH" --body-file "$RUNNER_TEMP/body.md" + fi diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a1e385f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,97 @@ +# Changelog + +## Unreleased + +### Changed + +- `nullify fix` now follows the run. It used to send the request, read the diff and exit 0 without waiting for the run. CI callers now wait up to 50 minutes by default, because a run can take 45. `--timeout` sets the wait. A failed run, or a run still going at the timeout, exits 1 and prints how to check it. The run continues on the server. `--no-wait` gives the fast return: it starts the run, prints its state and exits 0. If the token expires during the wait, the command refreshes it and continues. If it cannot refresh it, the command prints `run_id`, `state` and `check_with`, and exits 3. +- `nullify mcp serve` and `nullify fix` honour `NULLIFY_HTTP_TIMEOUT`. +- `nullify ci gate` is unchanged. +- `nullify fix`: any API failure on the start request now exits 3, including 403 and 409. It exited 1 before. +- The MCP search with `limit: 0` is now an error. +- `nullify api admin delete-mapping` and `update-mapping` now print the fields of the published response only, because the published API now describes these responses. Other fields are dropped. +- For a search, `sca` means dependencies and containers. For a verb on one finding, `sca` still means the dependency route. The MCP tool `type` parameters accept the same names as the CLI. +- `get_findings_for_repo` returns `total`, `returned` and `truncated` per section, and says that cloud and bug hunt findings have no repository instead of an empty list. +- `nullify_fix_finding` now starts the run and returns at once, with a non-error result. It no longer waits and no longer takes `create_pr`. Use `nullify_get_fix_status` and `nullify_get_fix_diff`. + +### Added + +- `nullify api` now follows the API published on 2 November 2026 (it was pinned to 26 May). This adds about 530 commands, including `nullify api cspm` allowlist, unallowlist, archive, unarchive, mark and unmark false positive, patch, triage and ticket delete, and a new `nullify api dast` group. +- `nullify findings` subcommands: `list`, `get`, `triage`, `allowlist`, `unallowlist`, `archive`, `unarchive`, `mark-false-positive`, `unmark-false-positive`, `create-ticket`, `delete-ticket`, `feedback` and `get-feedback`. +- `nullify findings --type` accepts `scpm`. `--from` and `--to` set time bounds. The output adds `returned` and `truncated`. Each row is the JSON that the server sent, so it holds only the fields of that row and any field that the CLI does not know. +- MCP tools in the default set: `nullify_submit_finding_feedback`, `nullify_get_finding_feedback`. `nullify_allowlist_finding`, `nullify_unallowlist_finding` and `nullify_get_finding_triage` work for CSPM, and `nullify_unallowlist_finding` and `nullify_create_ticket` work for bug hunt. +- MCP tools in the new `findings-write` set and in `all`, not in the default set: `nullify_archive_finding`, `nullify_unarchive_finding`, `nullify_mark_false_positive`, `nullify_unmark_false_positive`, `nullify_delete_ticket`. +- `nullify findings fix-status` and `fix-diff`, with the MCP tools `nullify_get_fix_status` and `nullify_get_fix_diff`. +- MCP `list_action_items`. Every MCP tool now has read-only or destructive annotations. + +### Known limits + +- `nullify fix` exits 1 when a run succeeded but its diff cannot be read, even when it prints a new pull request. The exit is the same as before. +- `nullify findings unallowlist --reason` is required for every type, but the CSPM route does not record it. CSPM returns a `warning` field, and the CLI also writes the warning to stderr. +- `nullify findings` and the MCP search tools use the unified search. It returns triaged findings only, and a repository filter matches the exact stored name. With no `--type` inside a repository, cloud and bug hunt findings are excluded. +- `--allowlist-type` and the MCP `allowlist_type` are required for every finding type, but the server may not record them for `bughunt`, `sca_dependencies`, `sca_containers` and `secrets_sensitive_data`. These types return a `warning` field, and the CLI also writes the warning to stderr. The reason is recorded. Bug hunt has no such input. SCA and sensitive-data handlers ignore the type until monorepo #17588 deploys: remove `AllowlistTypeUnrecorded` from these rows when the spec moves past that pull request. + + +### Fixed + +- `nullify fix --create-pr` stops when the server rescues an abandoned pull-request step and moves the run to `cached`. It exits 1 and says that no new pull request was opened. It used to wait for the whole timeout and then say that the run was still going. +- `nullify findings` and the MCP search reject a `--from` or `--to` that is not RFC 3339, plain dates included. The server ignored such a value, so the result was not filtered and the command exited 0. +- `nullify findings --type secrets` and `--type bughunt` sent filter values that the API rejects, and exited 3 with a 400. +- The MCP `type=scpm` search sent `Platform`, which the API accepts but which matches no finding, so it always returned nothing. `--type Platform` now means `scpm`. `--type Unknown` is rejected, because it also matches no finding. +- `nullify findings --type cspm` no longer filters by the repository of the working directory. Cloud findings have no repository, so that result was always empty. +- `nullify findings` rejects a `--limit` of zero or less, an unknown `--type` and an unknown `--status`. Each of these returned a wrong result before. Text after `nullify findings` that is not a subcommand is now an error, so a mistyped verb does not list findings. +- `nullify fix --create-pr` called a route that the API removed. The fix run opens the pull request itself, so the command now waits for that pull request and reports it. `nullify fix` also waits for the fix to end before it reads the diff, and accepts every type with autofix. +- `nullify_fix_finding` no longer calls the removed diff routes for CSPM, SCPM and pentest. +- `nullify fix` reported success for a failed fix. A failed state, a run still going at the timeout, and `--create-pr` with no new pull request now exit non-zero. The output adds `state` and `run_id`. `--create-pr` reports only a pull request that this run opened, never an older one. +- `nullify findings` could list sensitive-data secrets but every verb used the credential routes. `--type secrets_sensitive_data` uses `/secrets/sensitivedata/findings/...`, and each verb accepts the `type` value of a listed row. `--type secrets` still lists both. +- Unallowlisting a secret sends the `unallowlistType` that the API requires, with the value that the dashboard sends. +- MCP allowlist and unallowlist reject an empty reason or an invalid allowlist type before they call the API. + +### Moved + +These commands keep working. Each prints a deprecation notice on stderr and calls the new route. + +| Old command | New command | +|-------------|-------------| +| `nullify api asset-graph list-reachability` | `nullify api context list-reachability` | +| `nullify api asset-graph list-search` | `nullify api context list-search` | +| `nullify api asset-graph list-subgraph` | `nullify api context list-subgraph` | +| `nullify api asset-graph list-summary` | `nullify api context list-asset-graph-summary` | +| `nullify api infrastructure list-graphs` | `nullify api context list-graphs` | +| `nullify api infrastructure list-info` | `nullify api context list-info` | +| `nullify api infrastructure list-summary` | `nullify api context list-infrastructure-graphs-summary` | +| `nullify api infrastructure get-graphs` | `nullify api context get-graphs` | +| `nullify api infrastructure get-download` | `nullify api context get-download` | +| `nullify api infrastructure get-graphs-versions` | `nullify api context get-infrastructure-graphs-versions` | +| `nullify api infrastructure get-graphs-versions-2` | `nullify api context get-infrastructure-graphs-versions-2` | + +### Removed + +The API no longer serves these routes, so these commands could only return 404. None of the routes is in the service specs of the deployed API. + +| Command | Replacement | +|---------|-------------| +| `nullify api admin create-initialize`, `create-uninitialize` | `nullify api admin update-repositories-scan-scope` | +| `nullify api context list-cloud-accounts` | `nullify api context list-asset-inventory` | +| `nullify api context list-cloud-resources`, `list-resources` | `nullify api context list-asset-inventory` | +| `nullify api context list-public-facing` | `nullify api context list-public` | +| `nullify api cspm get-diff` | `nullify api cspm get-state` | +| `nullify api scpm get-diff` | `nullify api scpm get-state` | +| `nullify pentest get-pentest-findings-autofix-cache-diff` | `nullify api dast get-state` | +| `nullify api scpm create-cache-by-id`, `create-create_pr-by-id` | `nullify api scpm create-fix-by-id` | +| `nullify api scpm create-retriage` | `nullify api orchestrator create-retriage`, with a new body | +| `nullify api scpm list-dependencies` | `nullify api scpm create-dependencies-analyze`, `create-batch` | +| `nullify api sca get-sbom` | `nullify sbom get`, `nullify api context get-sboms-repository-latest` | +| `nullify api orchestrator create-complete` | None: the route exists only in a local stack | +| `nullify api manager list-credits`, `create-credits` | None: the credits system is gone | +| `nullify api manager list-customer-questions`, `get-customer-questions`, `delete-customer-questions`, `delete-customer-questions-2`, `delete-questions`, `patch-answers` | `nullify api manager list-action-items` | +| `nullify api manager list-escalations`, `patch-escalations` | `nullify api manager list-action-items` | + +The MCP tool `list_escalations` is removed. Its route `GET /manager/escalations` is gone from prod (#5596), so the tool only returned errors. Use `list_action_items`, which returns a different schema, so it is not an alias. `spec/mcp-tools.tsv` now locks the MCP tool names, annotations and tool sets. + +### Deprecated flags + +The API no longer accepts these filters. The flags stay accepted, have no effect and print a notice. + +- `nullify api cspm list-scans --region`, `--scan-type` +- `nullify api asset-graph list-reachability --account-id`, `list-subgraph --account-id` diff --git a/Makefile b/Makefile index 51694ab..3364dc2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build clean lint lint-go lint-docker fetch-spec generate-api unit cov +.PHONY: build clean lint lint-go lint-docker fetch-spec generate-api command-surface unit cov # set the version as the latest commit sha if it's not already defined ifndef VERSION @@ -37,8 +37,9 @@ lint-docker: # OpenAPI bundle sourcing. The spec is published in the (private) nullify # monorepo; we pin a commit and vendor the bundle into spec/ so generation is # reproducible and offline. To update: bump SPEC_REF, run `make fetch-spec`, -# then `make generate-api`, and commit both spec/ and the regenerated code. -SPEC_REF ?= 7b34970bbbeeabf665cd71fa0eb0e07eaac534a3 +# `make generate-api` and `make command-surface`, and commit spec/ and the +# regenerated code. The spec-drift workflow does this on a schedule. +SPEC_REF ?= 1b9c3dd0cf497030de8646ae1b8e1f407d25e04a SPEC_REPO ?= nullify-platform/nullify SPEC_PATH_IN_REPO ?= public-docs/.gitbook/assets/api/nullify-openapi-bundle.yaml SPEC_LOCAL ?= spec/nullify-openapi-bundle.yaml @@ -54,6 +55,14 @@ fetch-spec: generate-api: go run ./scripts/generate --spec $(SPEC_LOCAL) --output internal/api --cmd-output internal/commands +# command-surface checks the command tree against spec/command-surface.tsv and the +# MCP tools against spec/mcp-tools.tsv, and rewrites both snapshots. It fails on a +# command, flag or tool that disappeared unless internal/commands/surface_decisions.go +# or mcp.Decisions records the decision. A tool that changes its annotation or +# tool sets needs a decision too. +command-surface: + go run ./scripts/commandsurface --write + unit: go test -v -skip TestIntegration ./... diff --git a/README.md b/README.md index 3148b3c..8ca164b 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,14 @@ nullify auth switch |---------|-------------| | `nullify init` | Interactive setup wizard (instance, auth, MCP config) | | `nullify status` | Security posture overview with finding counts by scanner | -| `nullify findings` | List findings across all scanner types with filters | +| `nullify findings` | List findings across all scanner types with filters (same as `nullify findings list`) | +| `nullify findings allowlist` | Suppress a finding, with a required reason and allowlist type | +| `nullify findings unallowlist` | Re-open an allowlisted finding, with a required reason | +| `nullify findings archive` / `unarchive` | Archive or restore a finding (CSPM) | +| `nullify findings mark-false-positive` / `unmark-false-positive` | Set or clear the false positive mark | +| `nullify findings get` / `triage` | Read a finding or its AI triage | +| `nullify findings create-ticket` / `delete-ticket` | Manage the ticket of a finding | +| `nullify findings feedback` / `get-feedback` | Record or read feedback on a finding of any type | ### Authentication | Command | Description | @@ -187,8 +194,40 @@ nullify findings --repo my-repo --status open # Limit results nullify findings --limit 50 + +# List CSPM or SCPM findings in one UTC window +nullify findings list --type cspm --from 2026-11-01T00:00:00Z --to 2026-11-02T00:00:00Z +nullify findings list --type scpm ``` +`--type` accepts `sast`, `sca_dependencies`, `sca_containers`, `secrets`, `secrets_sensitive_data`, `pentest`, `bughunt`, `cspm` and `scpm`. An unknown type is an error. + +`--type secrets` lists credentials and sensitive data together. To act on a listed finding, pass the `type` value of its row, for example `nullify findings get abc123 --type SecretsSensitiveData`. In a verb, `secrets` means credentials only. + +The output reports `total`, `returned` and `truncated`: + +| Result | Meaning | +|--------|---------| +| `total` 0, exit 0 | No finding matches the filters | +| `truncated` true, exit 0 | More findings exist; raise `--limit` | +| Exit 3 | An API or network failure, including no access (401 or 403) | + +Act on a finding. Allowlisting needs a reason and an explicit type: `UserFalsePositive` when triage was wrong, `UserAssumeRisk` when the risk is real and accepted, `UserFixed` or `UserOther` otherwise. The server may not record the type for `bughunt`, `sca_dependencies`, `sca_containers` and `secrets_sensitive_data` yet. For these types the command writes a warning to stderr and adds a `warning` field to the result. The reason is recorded. For a CSPM false positive, use `findings mark-false-positive`: allowlisting with `UserFalsePositive` does not set `is_false_positive` on a CSPM finding. + +```sh +nullify findings mark-false-positive abc123 --type cspm --reason "Bucket is public by design" +nullify findings allowlist abc123 --type sast --allowlist-type UserFalsePositive --reason "Test fixture" +nullify findings unallowlist abc123 --type cspm --reason "Bucket is no longer public" +nullify findings archive abc123 --type cspm +nullify findings feedback abc123 --verdict wrong --comment "Not reachable from the internet" +``` + +Raw API commands follow the API spec: `nullify api cspm create-allowlist-by-id`, `create-unallowlist-by-id`, `create-archive-by-id`, `create-unarchive-by-id`, `create-mark-false-positive-by-id`, `create-unmark-false-positive-by-id`, `patch-findings`, `get-triage` and `delete-ticket`. + +## Command stability + +`spec/command-names.lock` fixes the name of each API command, and `spec/command-surface.tsv` lists every command and flag. CI fails if a command or flag disappears unless `internal/commands/surface_decisions.go` records the decision. A moved command keeps working as a deprecated alias that calls the new route. See [CHANGELOG.md](CHANGELOG.md) for the moves. + ## Pentest Scans ### Cloud Scan @@ -263,9 +302,11 @@ Add a security report to your pull request: The CLI includes a built-in [Model Context Protocol](https://modelcontextprotocol.io/) server with 50+ tools, giving AI coding assistants full access to your security data. Capabilities include: - **Query** — findings, repositories, SBOMs, cloud accounts, metrics, trends -- **Triage** — mark findings as false positive, accepted risk, or reopen -- **Remediate** — generate AI-powered fix diffs and open PRs, end-to-end -- **Track** — campaigns, escalations, SLA policies, code reviews +- **Triage** — allowlist, archive or mark false positive across every finding type, including CSPM, reopen, and record feedback +- **Remediate** — start AI-powered fixes, then follow them with `nullify_get_fix_status` and `nullify_get_fix_diff` +- **Track** — campaigns, action items, SLA policies, code reviews + +`nullify mcp serve --tools findings-write` adds the tools that the default set leaves out: archive, unarchive, mark and unmark false positive, and delete ticket. `--tools all` also has them. Every tool that changes state carries the destructive annotation, so a client can ask a person first. `spec/mcp-tools.tsv` lists every tool, its access and its tool sets. ### Setup diff --git a/cmd/cli/cmd/ci_gate_test.go b/cmd/cli/cmd/ci_gate_test.go new file mode 100644 index 0000000..2a9d458 --- /dev/null +++ b/cmd/cli/cmd/ci_gate_test.go @@ -0,0 +1,80 @@ +package cmd + +import ( + "context" + "io" + "net/http" + "slices" + "strings" + "sync" + "testing" + "time" + + "github.com/nullify-platform/cli/internal/auth" + "github.com/stretchr/testify/require" +) + +func gateRequests(severities ...string) []string { + var want []string + for _, path := range []string{ + "/sast/findings", "/sca/dependencies/findings", "/sca/containers/findings", "/secrets/findings", + "/dast/pentest/findings", "/dast/bughunt/findings", "/cspm/findings", + } { + for _, severity := range severities { + want = append(want, path+"?limit=1&repository=acme%2Fapp&severity="+severity+"&status=open") + } + } + slices.Sort(want) + return want +} + +func TestCIGateRequestsAndExitCodes(t *testing.T) { + tests := []struct { + name string + threshold string + findType string + status int + body string + exit int + requests []string + }{ + {name: "the default set", threshold: "high", status: http.StatusOK, body: `{"total":0}`, exit: ExitSuccess, requests: gateRequests("critical", "high")}, + {name: "every severity", threshold: "low", status: http.StatusOK, body: `{"total":0}`, exit: ExitSuccess, requests: gateRequests("critical", "high", "low", "medium")}, + {name: "a list route type", threshold: "critical", findType: "cspm", status: http.StatusOK, body: `{"total":0}`, exit: ExitSuccess, requests: []string{"/cspm/findings?limit=1&repository=acme%2Fapp&severity=critical&status=open"}}, + {name: "scpm is not a gate type", threshold: "critical", findType: "scpm", status: http.StatusOK, body: `{"total":0}`, exit: ExitSuccess, requests: gateRequests("critical")}, + {name: "sensitive data is not a gate type", threshold: "critical", findType: "secrets_sensitive_data", status: http.StatusOK, body: `{"total":0}`, exit: ExitSuccess, requests: gateRequests("critical")}, + {name: "a monorepo name is not a gate type", threshold: "critical", findType: "dast_pentest", status: http.StatusOK, body: `{"total":0}`, exit: ExitSuccess, requests: gateRequests("critical")}, + {name: "findings fail the gate", threshold: "critical", findType: "sast", status: http.StatusOK, body: `{"total":2}`, exit: ExitFindings, requests: []string{"/sast/findings?limit=1&repository=acme%2Fapp&severity=critical&status=open"}}, + {name: "a failed request exits 3", threshold: "critical", findType: "sast", status: http.StatusForbidden, body: `{}`, exit: ExitNetworkError, requests: []string{"/sast/findings?limit=1&repository=acme%2Fapp&severity=critical&status=open"}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Setenv("HOME", t.TempDir()) + t.Setenv("NULLIFY_HOST", "acme.nullify.ai") + t.Setenv("NULLIFY_TOKEN", "") + require.ErrorIs(t, auth.SaveHostCredentials("acme.nullify.ai", auth.HostCredentials{AccessToken: "token", RefreshToken: "r", ExpiresAt: time.Now().Add(time.Hour).Unix()}), nil) + + var mu sync.Mutex + var requests []string + transport := http.DefaultTransport + t.Cleanup(func() { http.DefaultTransport = transport }) + http.DefaultTransport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + mu.Lock() + defer mu.Unlock() + requests = append(requests, r.URL.RequestURI()) + return &http.Response{StatusCode: tt.status, Header: http.Header{}, Body: io.NopCloser(strings.NewReader(tt.body))}, nil + }) + + require.ErrorIs(t, ciGateCmd.Flags().Set("severity-threshold", tt.threshold), nil) + require.ErrorIs(t, ciGateCmd.Flags().Set("type", tt.findType), nil) + require.ErrorIs(t, ciGateCmd.Flags().Set("repo", "acme/app"), nil) + ciGateCmd.SetContext(context.Background()) + + err := ciGateCmd.RunE(ciGateCmd, nil) + + require.Equal(t, tt.exit, ExitCodeForError(err)) + slices.Sort(requests) + require.Equal(t, tt.requests, requests) + }) + } +} diff --git a/cmd/cli/cmd/findings.go b/cmd/cli/cmd/findings.go index 86e9d0d..951793b 100644 --- a/cmd/cli/cmd/findings.go +++ b/cmd/cli/cmd/findings.go @@ -1,24 +1,35 @@ package cmd import ( - "bytes" "encoding/json" + "errors" "fmt" "os" "strings" + "github.com/nullify-platform/cli/internal/findings" "github.com/nullify-platform/cli/internal/lib" "github.com/nullify-platform/cli/internal/output" "github.com/spf13/cobra" ) +const findingsListLong = `Query and display security findings from all Nullify scanners. +Supports SAST, SCA (dependencies and containers), Secrets, Pentest, BugHunt, CSPM and SCPM. +Auto-detects the current repository from git if --repo is not specified, except for --type cspm and --type bughunt, because these findings have no repository. +With no --type inside a repository, the repository filter therefore excludes cloud and bug hunt findings. +Results are paginated automatically up to --limit total findings. + +The search returns triaged findings only: a finding whose triage has not finished or has failed is not listed. +A repository filter matches the exact stored name, so a wrong name returns nothing. Pass owner/name: a bare name misses pentest findings that hold the full name. + +The output reports total, returned and truncated. An empty result has total 0. +A truncated result has truncated true. A failure to read, such as no access, +exits with code 3 and is never an empty result.` + var findingsCmd = &cobra.Command{ Use: "findings", - Short: "List security findings across all scanner types", - Long: `Query and display security findings from all Nullify scanners. -Supports SAST, SCA (dependencies and containers), Secrets, Pentest, BugHunt, and CSPM. -Auto-detects the current repository from git if --repo is not specified. -Results are paginated automatically up to --limit total findings.`, + Short: "List and act on security findings across all scanner types", + Long: findingsListLong, Example: ` # List all findings nullify findings @@ -29,166 +40,221 @@ Results are paginated automatically up to --limit total findings.`, nullify findings -o table --repo my-repo # Fetch up to 500 findings - nullify findings --limit 500`, - RunE: func(cmd *cobra.Command, args []string) error { - ctx := cmd.Context() + nullify findings --limit 500 + + # Allowlist a CSPM finding that triage got wrong + nullify findings mark-false-positive abc123 --type cspm --reason "Bucket is public by design" + nullify findings allowlist abc123 --type sast --allowlist-type UserFalsePositive --reason "Test fixture"`, + Args: cobra.NoArgs, + RunE: runFindingsList, +} + +var findingsListCmd = &cobra.Command{ + Use: "list", + Short: "List security findings across all scanner types", + Long: findingsListLong, + Example: ` # List CSPM findings from one UTC window + nullify findings list --type cspm --from 2026-11-01T00:00:00Z --to 2026-11-02T00:00:00Z + + # List SCPM findings + nullify findings list --type scpm --limit 500`, + Args: cobra.NoArgs, + RunE: runFindingsList, +} + +func runFindingsList(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() - authCtx, err := resolveCommandAuth(ctx) + severity, _ := cmd.Flags().GetString("severity") + status, _ := cmd.Flags().GetString("status") + findingType, _ := cmd.Flags().GetString("type") + repo, _ := cmd.Flags().GetString("repo") + from, _ := cmd.Flags().GetString("from") + to, _ := cmd.Flags().GetString("to") + limit, _ := cmd.Flags().GetInt("limit") + debug, _ := cmd.Flags().GetBool("debug") + + opts := findings.SearchOptions{ + Severity: severity, + Status: status, + From: from, + To: to, + Limit: limit, + } + + if findingType != "" { + apiTypes, err := findings.APITypesFor(findingType) if err != nil { return err } - nullifyClient := authCtx.Client() - queryParams := authCtx.QueryParams - - severity, _ := cmd.Flags().GetString("severity") - status, _ := cmd.Flags().GetString("status") - findingType, _ := cmd.Flags().GetString("type") - repo, _ := cmd.Flags().GetString("repo") - limit, _ := cmd.Flags().GetInt("limit") - debug, _ := cmd.Flags().GetBool("debug") - - if repo == "" { - repo = lib.DetectRepoFromGit() - } + opts.APITypes = apiTypes + } + opts.Repository = findingsRepository(repo, opts.APITypes, lib.DetectRepoFullNameFromGit) + if debug { + opts.Debug = os.Stderr + } - qs := lib.BuildQueryString(queryParams) - path := "/admin/findings" + qs + authCtx, err := resolveCommandAuth(ctx) + if err != nil { + return err + } - type findingsOutput struct { - Findings []json.RawMessage `json:"findings"` - Total int `json:"total"` - } + result, err := findings.Search(ctx, authCtx.APIClient(), opts) + if err != nil { + return findingsError(err) + } + + if result.Truncated && !quiet { + fmt.Fprintf(os.Stderr, "Showing %d of %d findings; raise --limit to read more\n", result.Returned, result.Total) + } + + out, err := json.MarshalIndent(result, "", " ") + if err != nil { + return err + } + if err := output.Print(cmd, out); err != nil { + fmt.Fprintln(os.Stderr, string(out)) + } + return nil +} - type unifiedResponse struct { - Findings []json.RawMessage `json:"findings"` - Total int `json:"total"` - HasMoreData bool `json:"hasMoreData"` - ScrollID *string `json:"scrollId"` - Page int `json:"page"` +// findingsRepository returns the repository filter: the flag if set, otherwise the +// repository of the working directory for types that can belong to a repository. +func findingsRepository(flag string, apiTypes []string, detect func() string) string { + if flag != "" || !findings.HasRepository(apiTypes) { + return flag + } + return detect() +} + +// findingsError sets the exit code for a failed finding operation: 1 for invalid +// input and 3 for an API failure, access failures included. +func findingsError(err error) error { + for _, invalid := range []error{ + findings.ErrUnknownType, findings.ErrUnsupported, findings.ErrFindingIDRequired, + findings.ErrReasonRequired, findings.ErrInvalidAllowlistType, findings.ErrInvalidVerdict, + findings.ErrInvalidLimit, findings.ErrInvalidStatus, findings.ErrInvalidTime, findings.ErrInvalidTimeout, + } { + if errors.Is(err, invalid) { + return err } + } + return networkError("%w", err) +} - allFindings := make([]json.RawMessage, 0) - var scrollID string - nextPage := 1 - var lastTotal int +func addFindingsListFlags(cmd *cobra.Command) { + cmd.Flags().String("severity", "", "Filter by severity (critical, high, medium, low)") + cmd.Flags().String("status", "", "Filter by status ("+strings.Join(findings.Statuses, ", ")+")") + cmd.Flags().String("type", "", "Filter by type ("+strings.Join(findings.Names(), ", ")+")") + cmd.Flags().String("repo", "", "Exact repository name, owner/name preferred (auto-detected from git if not set, except for cspm and bughunt)") + cmd.Flags().String("from", "", "Only findings at or after this RFC 3339 time, such as 2026-11-01T00:00:00Z") + cmd.Flags().String("to", "", "Only findings at or before this RFC 3339 time, such as 2026-11-01T00:00:00Z") + cmd.Flags().Int("limit", 100, "Maximum total findings to return (fetches multiple pages as needed)") + cmd.Flags().Bool("debug", false, "Print one line per page to stderr") +} - for { - pageSize := 100 - remaining := limit - len(allFindings) - if remaining <= 0 { - break - } - if remaining < pageSize { - pageSize = remaining - } +func init() { + rootCmd.AddCommand(findingsCmd) + addFindingsListFlags(findingsCmd) + addFindingsListFlags(findingsListCmd) + findingsCmd.AddCommand(findingsListCmd) + addFindingVerbCommands(findingsCmd) +} - query := map[string]any{ - "pageSize": pageSize, - "page": nextPage, - } - if repo != "" { - query["repository"] = []string{repo} - } - if severity != "" { - query["severity"] = []string{strings.ToUpper(severity)} - } - if findingType != "" { - if apiType, ok := findingTypeToAPI[findingType]; ok { - query["type"] = []string{apiType} - } else { - query["type"] = []string{findingType} - } - } - if scrollID != "" { - query["scrollId"] = scrollID - } - if status != "" { - switch status { - case "open": - f := false - query["isResolved"] = f - case "fixed": - t := true - query["isFixed"] = t - case "false_positive": - t := true - query["isFalsePositive"] = t - case "accepted_risk": - t := true - query["isAllowlisted"] = t - } - } +func addFindingVerbCommands(parent *cobra.Command) { + for _, verb := range findings.Verbs { + parent.AddCommand(newFindingVerbCommand(verb)) + } + parent.AddCommand(newFindingFeedbackCommand(), newFindingGetFeedbackCommand()) +} - reqBody := map[string]any{"query": query} - bodyBytes, err := json.Marshal(reqBody) - if err != nil { - return networkError("%w", err) - } +func newFindingVerbCommand(verb findings.Verb) *cobra.Command { + cmd := &cobra.Command{ + Use: verb.Name + " ", + Short: verb.Description, + Long: verb.Description + "\n\nSupported types: " + strings.Join(verb.Types(), ", "), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + findingType, _ := cmd.Flags().GetString("type") + reason, _ := cmd.Flags().GetString("reason") + allowlistType, _ := cmd.Flags().GetString("allowlist-type") - if debug { - fmt.Fprintf(os.Stderr, "[debug] POST %s%s\n", nullifyClient.BaseURL, path) - fmt.Fprintf(os.Stderr, "[debug] body: %s\n", string(bodyBytes)) + authCtx, err := resolveCommandAuth(cmd.Context()) + if err != nil { + return err } - respBody, err := lib.DoPostJSON(ctx, nullifyClient.HttpClient, nullifyClient.BaseURL, path, bytes.NewReader(bodyBytes)) + data, err := verb.Run(cmd.Context(), authCtx.APIClient(), findingType, args[0], findings.Params{Reason: reason, AllowlistType: allowlistType}) if err != nil { - return networkError("%w", err) + return findingsError(err) } + return reportVerb(cmd, verb, findingType, data) + }, + } - if debug { - preview := respBody - if len(preview) > 500 { - preview = preview[:500] + "..." - } - fmt.Fprintf(os.Stderr, "[debug] response: %s\n", preview) - } + cmd.Flags().String("type", "", "Finding type ("+strings.Join(verb.Types(), ", ")+")") + _ = cmd.MarkFlagRequired("type") + if verb.NeedsAllowlistType { + cmd.Flags().String("allowlist-type", "", "Why the finding is allowlisted ("+strings.Join(findings.AllowlistTypes, ", ")+")") + _ = cmd.MarkFlagRequired("allowlist-type") + } + if verb.NeedsReason { + cmd.Flags().String("reason", "", "Human-readable reason") + _ = cmd.MarkFlagRequired("reason") + } + return cmd +} - var resp unifiedResponse - if err := json.Unmarshal([]byte(respBody), &resp); err != nil { - return reportError( - cmd, - networkError("parsing response: %w", err), - "Error parsing response: %v\n", - err, - ) - } +func reportVerb(cmd *cobra.Command, verb findings.Verb, findingType string, data []byte) error { + if warning := verb.Warning(findingType); warning != "" { + fmt.Fprintln(cmd.ErrOrStderr(), "Warning: "+warning) + } + return output.Print(cmd, data) +} - allFindings = append(allFindings, resp.Findings...) - lastTotal = resp.Total +func newFindingFeedbackCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "feedback ", + Short: "Record feedback on a finding of any type. This never changes the finding.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + verdict, _ := cmd.Flags().GetString("verdict") + comment, _ := cmd.Flags().GetString("comment") - if debug { - fmt.Fprintf(os.Stderr, "[debug] page %d fetched: %d findings, hasMoreData=%v, total=%d\n", nextPage, len(resp.Findings), resp.HasMoreData, resp.Total) + authCtx, err := resolveCommandAuth(cmd.Context()) + if err != nil { + return err } - if !resp.HasMoreData || len(resp.Findings) == 0 { - break - } - if resp.ScrollID != nil && *resp.ScrollID != "" { - scrollID = *resp.ScrollID - } else { - nextPage = resp.Page + 1 + data, err := findings.SubmitFeedback(cmd.Context(), authCtx.APIClient(), args[0], verdict, comment) + if err != nil { + return findingsError(err) } - } - - result := findingsOutput{ - Findings: allFindings, - Total: lastTotal, - } - out, _ := json.MarshalIndent(result, "", " ") - if err := output.Print(cmd, out); err != nil { - fmt.Fprintln(os.Stderr, string(out)) - } - return nil - }, + return output.Print(cmd, data) + }, + } + cmd.Flags().String("verdict", "", "Feedback verdict ("+strings.Join(findings.FeedbackVerdicts, ", ")+")") + _ = cmd.MarkFlagRequired("verdict") + cmd.Flags().String("comment", "", "Optional comment") + return cmd } -func init() { - rootCmd.AddCommand(findingsCmd) +func newFindingGetFeedbackCommand() *cobra.Command { + return &cobra.Command{ + Use: "get-feedback ", + Short: "List the feedback recorded on a finding of any type", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + authCtx, err := resolveCommandAuth(cmd.Context()) + if err != nil { + return err + } - findingsCmd.Flags().String("severity", "", "Filter by severity (critical, high, medium, low)") - findingsCmd.Flags().String("status", "", "Filter by status (open, fixed, false_positive, accepted_risk)") - findingsCmd.Flags().String("type", "", "Filter by type (sast, sca_dependencies, sca_containers, secrets, pentest, bughunt, cspm)") - findingsCmd.Flags().String("repo", "", "Repository name (auto-detected from git if not set)") - findingsCmd.Flags().Int("limit", 100, "Maximum total findings to return (fetches multiple pages as needed)") - findingsCmd.Flags().Bool("debug", false, "Print request URLs, bodies, and responses to stderr") + data, err := findings.ListFeedback(cmd.Context(), authCtx.APIClient(), args[0]) + if err != nil { + return findingsError(err) + } + return output.Print(cmd, data) + }, + } } diff --git a/cmd/cli/cmd/fix.go b/cmd/cli/cmd/fix.go index 68ec1aa..d2cf207 100644 --- a/cmd/cli/cmd/fix.go +++ b/cmd/cli/cmd/fix.go @@ -2,11 +2,13 @@ package cmd import ( "encoding/json" + "errors" "fmt" - "net/url" "os" + "strings" - "github.com/nullify-platform/cli/internal/lib" + "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/findings" "github.com/nullify-platform/cli/internal/output" "github.com/spf13/cobra" ) @@ -14,108 +16,113 @@ import ( var fixCmd = &cobra.Command{ Use: "fix ", Short: "Generate an autofix for a finding", - Long: `Generate an automated fix for a security finding and optionally create a PR. + Long: `Generate an automated fix for a security finding and wait for it to finish. -Supports SAST and SCA dependency findings.`, +The fix run opens any pull request itself. --create-pr waits for a pull request +that this run opened and reports it. + +The command exits non-zero when the fix failed, when it is still running at +--timeout, or when --create-pr finds no new pull request. A run that is still +running continues on the server. --no-wait starts the run, prints its state and +exits 0. Check a run with nullify findings fix-status.`, Example: ` # Fix a SAST finding nullify fix abc123 --type sast - # Fix and create a PR + # Fix and report the pull request nullify fix abc123 --type sast --create-pr # Fix an SCA dependency finding - nullify fix def456 --type sca`, + nullify fix def456 --type sca + + # Start the run and continue at once + nullify fix abc123 --type sast --no-wait + nullify findings fix-status abc123 --type sast`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - ctx := cmd.Context() - findingID := args[0] - - authCtx, err := resolveCommandAuth(ctx) - if err != nil { - return err - } - nullifyClient := authCtx.Client() - queryParams := authCtx.QueryParams - findingType, _ := cmd.Flags().GetString("type") createPR, _ := cmd.Flags().GetBool("create-pr") + noWait, _ := cmd.Flags().GetBool("no-wait") + timeout, _ := cmd.Flags().GetDuration("timeout") - var basePath string - switch findingType { - case "sast": - basePath = "/sast/findings" - case "sca": - basePath = "/sca/dependencies/findings" - default: - return fmt.Errorf("--type must be 'sast' or 'sca'") + authCtx, err := resolveCommandAuth(cmd.Context()) + if err != nil { + return err } - qs := lib.BuildQueryString(queryParams) - - // Step 1: Generate autofix if !quiet { fmt.Fprintf(os.Stderr, "Generating fix for %s finding %s...\n", findingType, findingID) } - _, err = lib.DoPost(ctx, nullifyClient.HttpClient, nullifyClient.BaseURL, - fmt.Sprintf("%s/%s/autofix/fix%s", basePath, url.PathEscape(findingID), qs)) + apiClient, err := newRefreshingAPIClient(cmd.Context(), authCtx, authCtx.QueryParams) if err != nil { - return reportError( - cmd, - fmt.Errorf("generating fix: %w", err), - "Error generating fix: %v\n", - err, - ) + return fmt.Errorf("failed to create client: %w", err) } + return runFix(cmd, apiClient, findingID, findingType, noWait, findings.FixOptions{WaitForPR: createPR, Timeout: timeout}) + }, +} - // Step 2: Get diff - diffBody, err := lib.DoGet(ctx, nullifyClient.HttpClient, nullifyClient.BaseURL, - fmt.Sprintf("%s/%s/autofix/cache/diff%s", basePath, url.PathEscape(findingID), qs)) +func runFix(cmd *cobra.Command, c *api.Client, findingID, findingType string, noWait bool, opts findings.FixOptions) error { + if noWait { + start, err := findings.StartFix(cmd.Context(), c, findingType, findingID) if err != nil { - return reportError( - cmd, - fmt.Errorf("getting diff: %w", err), - "Error getting diff: %v\n", - err, - ) + return findingsError(err) } + return reportFix(cmd, findingID, findingType, findings.FixResult{State: start.State, RunID: start.RunID}) + } - result := map[string]any{ - "finding_id": findingID, - "type": findingType, - "diff": json.RawMessage(diffBody), - } - - // Step 3: Optionally create PR - if createPR { - if !quiet { - fmt.Fprintf(os.Stderr, "Creating PR...\n") - } - prBody, err := lib.DoPost(ctx, nullifyClient.HttpClient, nullifyClient.BaseURL, - fmt.Sprintf("%s/%s/autofix/cache/create_pr%s", basePath, url.PathEscape(findingID), qs)) - if err != nil { - return reportError( - cmd, - fmt.Errorf("creating PR: %w", err), - "Error creating PR: %v\n", - err, - ) - } - result["pr"] = json.RawMessage(prBody) + fixResult, err := findings.Fix(cmd.Context(), c, findingType, findingID, opts) + if err != nil { + if fixResult.CheckWith != "" { + _ = reportFix(cmd, findingID, findingType, fixResult) } + return findingsError(err) + } + return reportFix(cmd, findingID, findingType, fixResult) +} - out, _ := json.MarshalIndent(result, "", " ") - if err := output.Print(cmd, out); err != nil { - fmt.Fprintln(os.Stderr, string(out)) - } - return nil - }, +// reportFix prints the outcome and returns the failure of the run, so that a fix +// that did not deliver its result exits non-zero after it prints what it has. +func reportFix(cmd *cobra.Command, findingID, findingType string, fixResult findings.FixResult) error { + result := map[string]any{ + "finding_id": findingID, + "type": findingType, + "state": fixResult.State, + } + if fixResult.RunID != "" { + result["run_id"] = fixResult.RunID + } + if fixResult.CheckWith != "" { + result["check_with"] = fixResult.CheckWith + } + if errors.Is(fixResult.Failure, findings.ErrAutofixStillRunning) { + result["still_running"] = true + } + if len(fixResult.Diff) > 0 { + result["diff"] = fixResult.Diff + } + if fixResult.PullRequest != nil { + result["pr"] = fixResult.PullRequest + } + + out, err := json.MarshalIndent(result, "", " ") + if err != nil { + return err + } + if err := output.Print(cmd, out); err != nil { + fmt.Fprintln(os.Stderr, string(out)) + } + return fixResult.Failure } func init() { rootCmd.AddCommand(fixCmd) - fixCmd.Flags().String("type", "", "Finding type (sast, sca)") + autofixTypes := findings.NamesWith(func(t findings.Type) bool { return t.AutofixFix != nil }) + fixCmd.Flags().String("type", "", "Finding type (sca, "+strings.Join(autofixTypes, ", ")+")") _ = fixCmd.MarkFlagRequired("type") - fixCmd.Flags().Bool("create-pr", false, "Create a PR with the fix") + fixCmd.Flags().Bool("create-pr", false, "Wait for and report a pull request that this run opens") + fixCmd.Flags().Bool("no-wait", false, "Start the run, print its state and exit 0") + fixCmd.Flags().Duration("timeout", findings.DefaultFixTimeout, "How long to wait for the run") + fixCmd.MarkFlagsMutuallyExclusive("no-wait", "create-pr") + fixCmd.MarkFlagsMutuallyExclusive("no-wait", "timeout") } diff --git a/cmd/cli/cmd/mcp.go b/cmd/cli/cmd/mcp.go index 55e5a6f..8333c2b 100644 --- a/cmd/cli/cmd/mcp.go +++ b/cmd/cli/cmd/mcp.go @@ -54,7 +54,7 @@ var mcpServeCmd = &cobra.Command{ return fmt.Errorf("invalid --tools value %q. Valid values: %s", toolsFlag, strings.Join(validSets, ", ")) } - apiClient, err := newMCPAPIClient(ctx, authCtx, queryParams) + apiClient, err := newRefreshingAPIClient(ctx, authCtx, queryParams) if err != nil { return fmt.Errorf("failed to create client: %w", err) } @@ -72,11 +72,11 @@ func init() { mcpCmd.AddCommand(mcpServeCmd) mcpServeCmd.Flags().String("repo", "", "Repository name to scope findings to (auto-detected from git remote if not set)") - mcpServeCmd.Flags().String("tools", "default", "Tool set to register (default, all, minimal, findings, admin)") + mcpServeCmd.Flags().String("tools", "default", "Tool set to register ("+strings.Join(mcp.ValidToolSets(), ", ")+")") } -// newMCPAPIClient drives the API client through a refreshing, retrying transport so long MCP sessions survive token rotation. -func newMCPAPIClient(ctx context.Context, authCtx *commandAuthContext, queryParams map[string]string) (*api.Client, error) { +// newRefreshingAPIClient drives the API client through a refreshing, retrying transport so long MCP sessions and long autofix waits survive token rotation. +func newRefreshingAPIClient(ctx context.Context, authCtx *commandAuthContext, queryParams map[string]string) (*api.Client, error) { tokenProvider, refreshProvider := mcpTokenProviders(ctx, authCtx.AuthHost) httpClient, err := client.NewRefreshingHTTPClient(authCtx.DataHost, tokenProvider, refreshProvider) if err != nil { diff --git a/cmd/cli/cmd/root.go b/cmd/cli/cmd/root.go index becf611..404f7be 100644 --- a/cmd/cli/cmd/root.go +++ b/cmd/cli/cmd/root.go @@ -143,27 +143,24 @@ func init() { } // Register generated API commands under 'api' parent for cleaner top-level help - commands.RegisterAdminCommands(apiCmd, getAPIClient) - commands.RegisterContextCommands(apiCmd, getAPIClient) + commands.RegisterAPICommands(apiCmd, getAPIClient) commands.RegisterContextPushCommand(apiCmd, getAPIClient) commands.ApplyContextCommandDefaults(apiCmd, getAPIClient) - commands.RegisterCspmCommands(apiCmd, getAPIClient) // Register pentest and bughunt subcommands from generated DAST commands commands.RegisterPentestSubcommands(pentestCmd, getAPIClient) commands.RegisterBughuntSubcommands(bughuntCmd, getAPIClient) - commands.RegisterManagerCommands(apiCmd, getAPIClient) - commands.RegisterSastCommands(apiCmd, getAPIClient) - commands.RegisterScaCommands(apiCmd, getAPIClient) - commands.RegisterSecretsCommands(apiCmd, getAPIClient) - commands.RegisterScpmCommands(apiCmd, getAPIClient) - commands.RegisterOrchestratorCommands(apiCmd, getAPIClient) - commands.RegisterAssetGraphCommands(apiCmd, getAPIClient) - commands.RegisterInfrastructureCommands(apiCmd, getAPIClient) // Hand-written workflow — not generated from OpenAPI. Routes through // scpm's /scpm/dependencies/analyze. Wired at top level (not under // apiCmd) so `nullify deps analyze` reads naturally in CI scripts. commands.RegisterDepsAnalyzeCommand(rootCmd, getAPIClient) + + commands.ApplySurfaceDecisions(rootCmd, commands.Decisions) +} + +// Root returns the root command, with every subcommand registered. +func Root() *cobra.Command { + return rootCmd } func setupLogger(ctx context.Context) (context.Context, error) { diff --git a/cmd/cli/cmd/runtime_auth_test.go b/cmd/cli/cmd/runtime_auth_test.go index bfd1378..bcef7fd 100644 --- a/cmd/cli/cmd/runtime_auth_test.go +++ b/cmd/cli/cmd/runtime_auth_test.go @@ -282,7 +282,7 @@ func TestMCPClientUsesAuthHostForTokensAndDataHostForRequests(t *testing.T) { })) authCtx := &commandAuthContext{AuthHost: auth.RouterHost, DataHost: "acme.nullify.ai"} - apiClient, err := newMCPAPIClient(context.Background(), authCtx, map[string]string{"repository": "r"}) + apiClient, err := newRefreshingAPIClient(context.Background(), authCtx, map[string]string{"repository": "r"}) require.NoError(t, err) require.Equal(t, "https://api.acme.nullify.ai", apiClient.BaseURL) require.Equal(t, map[string]string{"repository": "r"}, apiClient.DefaultParams) diff --git a/cmd/cli/cmd/scanners.go b/cmd/cli/cmd/scanners.go index 2ced7c4..f8b53b6 100644 --- a/cmd/cli/cmd/scanners.go +++ b/cmd/cli/cmd/scanners.go @@ -1,17 +1,5 @@ package cmd -// findingTypeToAPI maps CLI type slugs to the API's FindingType values. -// The unified /admin/findings endpoint uses PascalCase type names. -var findingTypeToAPI = map[string]string{ - "sast": "Code", - "sca_dependencies": "Dependencies", - "sca_containers": "Containers", - "secrets": "Secrets", - "pentest": "Pentest", - "bughunt": "BugHunting", - "cspm": "Cloud", -} - // scannerEndpoint represents a scanner type and its API path. type scannerEndpoint struct { name string diff --git a/cmd/cli/cmd/surface_test.go b/cmd/cli/cmd/surface_test.go new file mode 100644 index 0000000..d3363ac --- /dev/null +++ b/cmd/cli/cmd/surface_test.go @@ -0,0 +1,332 @@ +package cmd + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "os" + "slices" + "strings" + "testing" + "time" + + "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/apierror" + "github.com/nullify-platform/cli/internal/auth" + "github.com/nullify-platform/cli/internal/commands" + "github.com/nullify-platform/cli/internal/findings" + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" +) + +const surfaceSnapshot = "../../../spec/command-surface.tsv" + +func TestCommandSurfaceMatchesSnapshot(t *testing.T) { + content, err := os.ReadFile(surfaceSnapshot) + require.ErrorIs(t, err, nil) + snapshot, err := commands.ParseSurface(string(content)) + require.ErrorIs(t, err, nil) + + live := commands.Surface(rootCmd) + + require.ErrorIs(t, commands.CheckSurface(snapshot, live, commands.Decisions), nil) + require.ErrorIs(t, commands.CheckSnapshotComplete(snapshot, live), nil) + require.Equal(t, string(content), commands.FormatSurface(live), "run make command-surface") +} + +func TestRemovedCommandsStayRemoved(t *testing.T) { + live := map[string]bool{} + for _, e := range commands.Surface(rootCmd) { + live[e.Command] = true + } + + for _, removed := range commands.Decisions.RemovedCommands { + t.Run(removed.Command, func(t *testing.T) { + require.False(t, live[removed.Command]) + }) + } +} + +func TestMovedCommandsCallTheNewRoute(t *testing.T) { + byPath := map[string]string{} + for _, e := range commands.Surface(rootCmd) { + byPath[e.Command] = e.Route + } + + for _, moved := range commands.Decisions.Moved { + t.Run(moved.From, func(t *testing.T) { + require.NotEmpty(t, byPath[moved.To]) + require.Equal(t, byPath[moved.To], byPath[moved.From]) + }) + } +} + +func TestMovedCommandRunsAndWarns(t *testing.T) { + var requested string + root := &cobra.Command{Use: "nullify"} + apiRoot := &cobra.Command{Use: "api"} + root.AddCommand(apiRoot) + commands.RegisterAPICommands(apiRoot, func(context.Context) (*api.Client, error) { + return &api.Client{ + BaseURL: "https://example.com", + HTTPClient: &http.Client{Transport: roundTripperFunc(func(r *http.Request) (*http.Response, error) { + requested = r.URL.Path + return nil, fmt.Errorf("stop") + })}, + }, nil + }) + commands.ApplySurfaceDecisions(root, commands.Decisions) + + var stderr bytes.Buffer + root.SetErr(&stderr) + root.SetOut(&stderr) + root.SetArgs([]string{"api", "asset-graph", "list-search", "--q", "bucket"}) + + require.Error(t, root.Execute()) + + require.Equal(t, "/context/asset-graph/search", requested) + require.Contains(t, stderr.String(), "nullify api context list-search") +} + +func TestFindingVerbsRequireTheirFlags(t *testing.T) { + tests := []struct { + name string + args []string + want string + }{ + {name: "allowlist needs every flag", args: []string{"findings", "allowlist", "f1"}, want: `required flag(s) "allowlist-type", "reason", "type" not set`}, + {name: "allowlist needs an explicit allowlist type", args: []string{"findings", "allowlist", "f1", "--type", "cspm", "--reason", "r"}, want: `required flag(s) "allowlist-type" not set`}, + {name: "allowlist needs a reason", args: []string{"findings", "allowlist", "f1", "--type", "cspm", "--allowlist-type", "UserFixed"}, want: `required flag(s) "reason" not set`}, + {name: "unallowlist needs a reason", args: []string{"findings", "unallowlist", "f1", "--type", "cspm"}, want: `required flag(s) "reason" not set`}, + {name: "mark false positive needs a reason", args: []string{"findings", "mark-false-positive", "f1", "--type", "cspm"}, want: `required flag(s) "reason" not set`}, + {name: "archive needs a type", args: []string{"findings", "archive", "f1"}, want: `required flag(s) "type" not set`}, + {name: "feedback needs a verdict", args: []string{"findings", "feedback", "f1"}, want: `required flag(s) "verdict" not set`}, + {name: "a typo in a verb is not a list", args: []string{"findings", "alowlist", "f1"}, want: `unknown command`}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + parent := &cobra.Command{Use: "findings", Args: cobra.NoArgs, RunE: runFindingsList} + addFindingVerbCommands(parent) + root := &cobra.Command{Use: "nullify"} + root.AddCommand(parent) + + output := executeCommand(t, root, tt.args...) + + require.Contains(t, output, tt.want) + }) + } +} + +func TestFindingsRepository(t *testing.T) { + detect := func() string { return "detected-repo" } + + tests := []struct { + name string + flag string + apiTypes []string + want string + }{ + {name: "no type uses the working directory", want: "detected-repo"}, + {name: "a code search uses the working directory", apiTypes: []string{"Code"}, want: "detected-repo"}, + {name: "a scpm search uses the working directory", apiTypes: []string{"SupplyChain"}, want: "detected-repo"}, + {name: "a cloud search ignores the working directory", apiTypes: []string{"Cloud"}, want: ""}, + {name: "a bug hunt search ignores the working directory", apiTypes: []string{"BugHunt"}, want: ""}, + {name: "an explicit repository always wins", flag: "other", apiTypes: []string{"Cloud"}, want: "other"}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, findingsRepository(tt.flag, tt.apiTypes, detect)) + }) + } +} + +func TestFindingsErrorExitCodes(t *testing.T) { + tests := []struct { + name string + err error + want int + }{ + {name: "no token", err: &apierror.APIError{StatusCode: http.StatusUnauthorized}, want: ExitNetworkError}, + {name: "no access", err: &apierror.APIError{StatusCode: http.StatusForbidden}, want: ExitNetworkError}, + {name: "server failure", err: &apierror.APIError{StatusCode: http.StatusInternalServerError}, want: ExitNetworkError}, + {name: "transport failure", err: fmt.Errorf("connection refused"), want: ExitNetworkError}, + {name: "unknown type", err: findings.ErrUnknownType, want: 1}, + {name: "unsupported", err: findings.ErrUnsupported, want: 1}, + {name: "bad limit", err: findings.ErrInvalidLimit, want: 1}, + {name: "bad time", err: findings.ErrInvalidTime, want: 1}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, ExitCodeForError(findingsError(tt.err))) + }) + } +} + +func TestReportFixExitCode(t *testing.T) { + tests := []struct { + name string + result findings.FixResult + want int + }{ + {name: "success", result: findings.FixResult{State: "cached"}, want: ExitSuccess}, + {name: "failed", result: findings.FixResult{State: "failed_abort", Failure: findings.ErrAutofixFailed}, want: 1}, + {name: "still running", result: findings.FixResult{Failure: findings.ErrAutofixStillRunning}, want: 1}, + {name: "status not readable", result: findings.FixResult{Failure: findings.ErrAutofixStatusUnreadable}, want: 1}, + {name: "no new pull request", result: findings.FixResult{State: "pending_review", Failure: findings.ErrNoPullRequest}, want: 1}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cmd := &cobra.Command{Use: "fix"} + cmd.SetOut(&bytes.Buffer{}) + + require.Equal(t, tt.want, ExitCodeForError(reportFix(cmd, "f1", "sast", tt.result))) + }) + } +} + +func TestRunFix(t *testing.T) { + const started = `{"autoFixState":"in_progress_requested","runId":"r1"}` + const running = `{"status":{"state":"in_progress_agent","terminal":false}}` + const failed = `{"status":{"state":"failed_abort","terminal":true}}` + + tests := []struct { + name string + noWait bool + status string + timeout time.Duration + exit int + requests []string + }{ + {name: "no-wait starts the run and exits 0", noWait: true, status: failed, exit: ExitSuccess, requests: []string{"POST /sast/findings/f1/autofix/fix"}}, + {name: "a failed run exits 1", status: failed, timeout: time.Minute, exit: 1, requests: []string{"POST /sast/findings/f1/autofix/fix", "GET /sast/findings/f1/autofix/status"}}, + {name: "a timed-out run exits 1", status: running, timeout: time.Nanosecond, exit: 1, requests: []string{"POST /sast/findings/f1/autofix/fix", "GET /sast/findings/f1/autofix/status"}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var requests []string + c := &api.Client{ + BaseURL: "https://example.com", + HTTPClient: &http.Client{Transport: roundTripperFunc(func(r *http.Request) (*http.Response, error) { + requests = append(requests, r.Method+" "+r.URL.Path) + body := started + if r.Method == http.MethodGet { + body = tt.status + } + return &http.Response{StatusCode: http.StatusOK, Header: http.Header{}, Body: io.NopCloser(strings.NewReader(body))}, nil + })}, + } + cmd := &cobra.Command{Use: "fix"} + cmd.SetOut(&bytes.Buffer{}) + cmd.SetContext(context.Background()) + + err := runFix(cmd, c, "f1", "sast", tt.noWait, findings.FixOptions{Timeout: tt.timeout}) + + require.Equal(t, tt.exit, ExitCodeForError(err)) + require.Equal(t, tt.requests, requests) + }) + } +} + +func TestFixCommandSurvivesATokenExpiry(t *testing.T) { + tests := []struct { + name string + flagToken string + refreshCode int + exit int + stdout []string + tokens []string + refreshes int + }{ + {name: "a refreshed token continues the wait", refreshCode: http.StatusOK, exit: ExitSuccess, stdout: []string{`"state": "cached"`, `"run_id": "r1"`}, tokens: []string{"Bearer old", "Bearer new"}, refreshes: 1}, + {name: "a failed refresh prints the partial result", refreshCode: http.StatusUnauthorized, exit: ExitNetworkError, stdout: []string{`"state": "in_progress_requested"`, `"run_id": "r1"`, `"check_with": "nullify findings fix-status f1 --type sast"`}, tokens: []string{"Bearer old"}, refreshes: 1}, + {name: "--nullify-token is never replaced by stored credentials", flagToken: "explicit", refreshCode: http.StatusOK, exit: ExitNetworkError, stdout: []string{`"state": "in_progress_requested"`, `"run_id": "r1"`, `"check_with": "nullify findings fix-status f1 --type sast"`}, tokens: []string{"Bearer explicit"}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Setenv("HOME", t.TempDir()) + t.Setenv("NULLIFY_HOST", "acme.nullify.ai") + t.Setenv("NULLIFY_TOKEN", "") + require.ErrorIs(t, auth.SaveHostCredentials("acme.nullify.ai", auth.HostCredentials{AccessToken: "old", RefreshToken: "r", ExpiresAt: time.Now().Add(time.Hour).Unix()}), nil) + + savedToken := nullifyToken + t.Cleanup(func() { nullifyToken = savedToken }) + nullifyToken = tt.flagToken + + var tokens []string + refreshes := 0 + + respond := func(code int, body string) (*http.Response, error) { + return &http.Response{StatusCode: code, Header: http.Header{}, Body: io.NopCloser(strings.NewReader(body))}, nil + } + transport := http.DefaultTransport + t.Cleanup(func() { http.DefaultTransport = transport }) + http.DefaultTransport = roundTripperFunc(func(r *http.Request) (*http.Response, error) { + switch { + case strings.HasSuffix(r.URL.Path, "/auth/refresh_token"): + refreshes++ + return respond(tt.refreshCode, `{"accessToken":"new","expiresIn":3600}`) + case strings.HasSuffix(r.URL.Path, "/autofix/fix"): + tokens = append(tokens, r.Header.Get("Authorization")) + return respond(http.StatusOK, `{"autoFixState":"in_progress_requested","runId":"r1"}`) + } + + tokens = append(tokens, r.Header.Get("Authorization")) + if r.Header.Get("Authorization") != "Bearer new" { + return respond(http.StatusUnauthorized, `{}`) + } + return respond(http.StatusOK, `{"status":{"state":"cached","terminal":true}}`) + }) + + read, write, err := os.Pipe() + require.ErrorIs(t, err, nil) + stdout := os.Stdout + t.Cleanup(func() { os.Stdout = stdout }) + os.Stdout = write + + require.ErrorIs(t, fixCmd.Flags().Set("type", "sast"), nil) + fixCmd.SetContext(context.Background()) + runErr := fixCmd.RunE(fixCmd, []string{"f1"}) + + require.ErrorIs(t, write.Close(), nil) + out, err := io.ReadAll(read) + require.ErrorIs(t, err, nil) + + require.Equal(t, tt.exit, ExitCodeForError(runErr)) + require.Equal(t, tt.tokens, slices.Compact(tokens)) + require.Equal(t, tt.refreshes, refreshes) + for _, want := range tt.stdout { + require.Contains(t, string(out), want) + } + }) + } +} + +func TestReportVerbWarnsOnStderr(t *testing.T) { + tests := []struct { + name string + findType string + want string + }{ + {name: "the type may not be recorded", findType: "bughunt", want: "Warning: " + findings.AllowlistTypeWarning + "\n"}, + {name: "the type is recorded", findType: "cspm", want: ""}, + } + + var allowlist findings.Verb + for _, verb := range findings.Verbs { + if verb.Name == "allowlist" { + allowlist = verb + } + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var stderr bytes.Buffer + cmd := &cobra.Command{Use: "allowlist"} + cmd.SetErr(&stderr) + + require.ErrorIs(t, reportVerb(cmd, allowlist, tt.findType, []byte(`{}`)), nil) + require.Equal(t, tt.want, stderr.String()) + }) + } +} diff --git a/go.mod b/go.mod index 4cf5dbb..dd77d94 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/google/go-github/v85 v85.0.0 github.com/mark3labs/mcp-go v0.54.1 github.com/spf13/cobra v1.10.2 - github.com/spf13/pflag v1.0.10 // indirect + github.com/spf13/pflag v1.0.10 golang.org/x/sync v0.20.0 ) diff --git a/internal/api/admin.go b/internal/api/admin.go index 1be0123..8313f32 100644 --- a/internal/api/admin.go +++ b/internal/api/admin.go @@ -21,35 +21,23 @@ var _ = fmt.Sprintf var _ = url.PathEscape var _ = models.RequestScope{} -// ListAdminAssessmentsScanCoverageInput is the input for ListAdminAssessmentsScanCoverage — Get Scan Coverage. -type ListAdminAssessmentsScanCoverageInput struct { - Limit *int `url:"limit,omitempty" json:"-"` - Offset *int `url:"offset,omitempty" json:"-"` - Search *string `url:"search,omitempty" json:"-"` - Type *string `url:"type,omitempty" json:"-"` +// ListAdminAccessMeInput is the input for ListAdminAccessMe — Get Caller Access. +type ListAdminAccessMeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminAssessmentsScanCoverage - Get Scan Coverage -// GET /admin/assessments/scan-coverage -func (c *Client) ListAdminAssessmentsScanCoverage(ctx context.Context, in ListAdminAssessmentsScanCoverageInput) (*models.EndpointsGetScanCoverageOutput, error) { - path := "/admin/assessments/scan-coverage" +// ListAdminAccessMe - Get Caller Access +// GET /admin/access/me +func (c *Client) ListAdminAccessMe(ctx context.Context, in ListAdminAccessMeInput) (*models.EndpointsAdminGetCallerAccessOutput, error) { + path := "/admin/access/me" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Type != nil { - query.Set("type", string(*in.Type)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.Offset != nil { - query.Set("offset", strconv.Itoa(int(*in.Offset))) - } - if in.Search != nil { - query.Set("search", string(*in.Search)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -62,42 +50,30 @@ func (c *Client) ListAdminAssessmentsScanCoverage(ctx context.Context, in ListAd if err != nil { return nil, err } - var out models.EndpointsGetScanCoverageOutput + var out models.EndpointsAdminGetCallerAccessOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminAssessmentsScanCoverageFindingsInput is the input for ListAdminAssessmentsScanCoverageFindings — Get Scan Coverage Findings. -type ListAdminAssessmentsScanCoverageFindingsInput struct { - Limit *int `url:"limit,omitempty" json:"-"` - Offset *int `url:"offset,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` - Type *string `url:"type,omitempty" json:"-"` +// ListAdminAccessPreferencesInput is the input for ListAdminAccessPreferences — Get RBAC Preferences. +type ListAdminAccessPreferencesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminAssessmentsScanCoverageFindings - Get Scan Coverage Findings -// GET /admin/assessments/scan-coverage/findings -func (c *Client) ListAdminAssessmentsScanCoverageFindings(ctx context.Context, in ListAdminAssessmentsScanCoverageFindingsInput) (*models.EndpointsGetScanCoverageFindingsOutput, error) { - path := "/admin/assessments/scan-coverage/findings" +// ListAdminAccessPreferences - Get RBAC Preferences +// GET /admin/access/preferences +func (c *Client) ListAdminAccessPreferences(ctx context.Context, in ListAdminAccessPreferencesInput) (*models.EndpointsAdminGetRBACPreferencesOutput, error) { + path := "/admin/access/preferences" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Type != nil { - query.Set("type", string(*in.Type)) - } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.Offset != nil { - query.Set("offset", strconv.Itoa(int(*in.Offset))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -110,66 +86,34 @@ func (c *Client) ListAdminAssessmentsScanCoverageFindings(ctx context.Context, i if err != nil { return nil, err } - var out models.EndpointsGetScanCoverageFindingsOutput + var out models.EndpointsAdminGetRBACPreferencesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminChecklistInput is the input for ListAdminChecklist — Get Checklist. -type ListAdminChecklistInput struct { +// UpdateAdminAccessPreferencesInput is the input for UpdateAdminAccessPreferences — Set RBAC Preferences. +type UpdateAdminAccessPreferencesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DefaultInviteeRole string `json:"defaultInviteeRole"` + TeamScopedRoles []string `json:"teamScopedRoles,omitempty"` models.RequestScope } -// ListAdminChecklist - Get Checklist -// GET /admin/checklist -func (c *Client) ListAdminChecklist(ctx context.Context, in ListAdminChecklistInput) (*models.EndpointsAdminChecklistOutput, error) { - path := "/admin/checklist" +// UpdateAdminAccessPreferences - Set RBAC Preferences +// PUT /admin/access/preferences +func (c *Client) UpdateAdminAccessPreferences(ctx context.Context, in UpdateAdminAccessPreferencesInput) (*models.EndpointsAdminPutRBACPreferencesOutput, error) { + path := "/admin/access/preferences" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsAdminChecklistOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// CreateAdminContextIngestInput is the input for CreateAdminContextIngest — Get Context Upload Credentials. -type CreateAdminContextIngestInput struct { - Branch *string `json:"branch,omitempty"` - CommitSha *string `json:"commitSha,omitempty"` - ContextType string `json:"contextType"` - Environment *models.EndpointsContextEnvironment `json:"environment,omitempty"` - FromPR *int `json:"fromPR,omitempty"` - Name string `json:"name"` - PrNumber *int `json:"prNumber,omitempty"` - Repository string `json:"repository"` -} - -// CreateAdminContextIngest - Get Context Upload Credentials -// POST /admin/context/ingest -func (c *Client) CreateAdminContextIngest(ctx context.Context, in CreateAdminContextIngestInput) (*models.EndpointsContextIngestOutput, error) { - path := "/admin/context/ingest" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } + in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) if len(query) > 0 { @@ -177,63 +121,60 @@ func (c *Client) CreateAdminContextIngest(ctx context.Context, in CreateAdminCon } bodyBytes, err := json.Marshal(struct { - Branch *string `json:"branch,omitempty"` - CommitSha *string `json:"commitSha,omitempty"` - ContextType string `json:"contextType"` - Environment *models.EndpointsContextEnvironment `json:"environment,omitempty"` - FromPR *int `json:"fromPR,omitempty"` - Name string `json:"name"` - PrNumber *int `json:"prNumber,omitempty"` - Repository string `json:"repository"` + DefaultInviteeRole string `json:"defaultInviteeRole"` + TeamScopedRoles []string `json:"teamScopedRoles,omitempty"` }{ - Branch: in.Branch, - CommitSha: in.CommitSha, - ContextType: in.ContextType, - Environment: in.Environment, - FromPR: in.FromPR, - Name: in.Name, - PrNumber: in.PrNumber, - Repository: in.Repository, + DefaultInviteeRole: in.DefaultInviteeRole, + TeamScopedRoles: in.TeamScopedRoles, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsContextIngestOutput + var out models.EndpointsAdminPutRBACPreferencesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminEventsInput is the input for CreateAdminEvents — List Unified Events. -type CreateAdminEventsInput struct { - AfterID *string `json:"afterId,omitempty"` - AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` - AutofixID *string `json:"autofixId,omitempty"` - BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` - CampaignID *string `json:"campaignId,omitempty"` - EventTypes []string `json:"eventTypes,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - Limit *int `json:"limit,omitempty"` - PrCanonicalID *string `json:"prCanonicalId,omitempty"` - RunID *string `json:"runId,omitempty"` - Services []string `json:"services,omitempty"` +// ListAdminAccessUsersInput is the input for ListAdminAccessUsers — List User Roles. +type ListAdminAccessUsersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + Offset *int32 `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + StartKey *string `url:"startKey,omitempty" json:"-"` models.RequestScope } -// CreateAdminEvents - List Unified Events -// POST /admin/events -func (c *Client) CreateAdminEvents(ctx context.Context, in CreateAdminEventsInput) (*models.EndpointsAdminListUnifiedEventsOutput, error) { - path := "/admin/events" +// ListAdminAccessUsers - List User Roles +// GET /admin/access/users +func (c *Client) ListAdminAccessUsers(ctx context.Context, in ListAdminAccessUsersInput) (*models.EndpointsAdminListUserRolesOutput, error) { + path := "/admin/access/users" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.StartKey != nil { + query.Set("startKey", string(*in.StartKey)) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -241,61 +182,35 @@ func (c *Client) CreateAdminEvents(ctx context.Context, in CreateAdminEventsInpu fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - AfterID *string `json:"afterId,omitempty"` - AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` - AutofixID *string `json:"autofixId,omitempty"` - BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` - CampaignID *string `json:"campaignId,omitempty"` - EventTypes []string `json:"eventTypes,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - Limit *int `json:"limit,omitempty"` - PrCanonicalID *string `json:"prCanonicalId,omitempty"` - RunID *string `json:"runId,omitempty"` - Services []string `json:"services,omitempty"` - }{ - AfterID: in.AfterID, - AfterTimeUnix: in.AfterTimeUnix, - AutofixID: in.AutofixID, - BeforeTimeUnix: in.BeforeTimeUnix, - CampaignID: in.CampaignID, - EventTypes: in.EventTypes, - FindingIds: in.FindingIds, - Limit: in.Limit, - PrCanonicalID: in.PrCanonicalID, - RunID: in.RunID, - Services: in.Services, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminListUnifiedEventsOutput + var out models.EndpointsAdminListUserRolesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetAdminFindingFindingIdInput is the input for GetAdminFindingFindingId — Get Finding. -type GetAdminFindingFindingIdInput struct { - FindingID string `path:"findingId" json:"-"` +// ListAdminAccessUsersOrgOwnersInput is the input for ListAdminAccessUsersOrgOwners — List Organization Owners. +type ListAdminAccessUsersOrgOwnersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetAdminFindingFindingId - Get Finding -// GET /admin/finding/{findingId} -func (c *Client) GetAdminFindingFindingId(ctx context.Context, in GetAdminFindingFindingIdInput) (*models.EndpointsAdminGetFindingOutput, error) { - path := "/admin/finding/{findingId}" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListAdminAccessUsersOrgOwners - List Organization Owners +// GET /admin/access/users/org-owners +func (c *Client) ListAdminAccessUsersOrgOwners(ctx context.Context, in ListAdminAccessUsersOrgOwnersInput) (*models.EndpointsAdminListOrgOwnersOutput, error) { + path := "/admin/access/users/org-owners" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -307,28 +222,33 @@ func (c *Client) GetAdminFindingFindingId(ctx context.Context, in GetAdminFindin if err != nil { return nil, err } - var out models.EndpointsAdminGetFindingOutput + var out models.EndpointsAdminListOrgOwnersOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminFindingsInput is the input for CreateAdminFindings — Query Findings. -type CreateAdminFindingsInput struct { - Query models.ModelsUnifiedFindingsQuery `json:"query"` +// UpdateAdminAccessUsersRolesInput is the input for UpdateAdminAccessUsersRoles — Set User Roles. +type UpdateAdminAccessUsersRolesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Role string `json:"role"` + Users []models.EndpointsAdminSetUserRoleTarget `json:"users,omitempty"` models.RequestScope } -// CreateAdminFindings - Query Findings -// POST /admin/findings -func (c *Client) CreateAdminFindings(ctx context.Context, in CreateAdminFindingsInput) (*models.EndpointsAdminQueryFindingsOutput, error) { - path := "/admin/findings" +// UpdateAdminAccessUsersRoles - Set User Roles +// PUT /admin/access/users/roles +func (c *Client) UpdateAdminAccessUsersRoles(ctx context.Context, in UpdateAdminAccessUsersRolesInput) (*models.EndpointsAdminBatchSetUserRolesOutput, error) { + path := "/admin/access/users/roles" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -337,39 +257,68 @@ func (c *Client) CreateAdminFindings(ctx context.Context, in CreateAdminFindings } bodyBytes, err := json.Marshal(struct { - Query models.ModelsUnifiedFindingsQuery `json:"query"` + Role string `json:"role"` + Users []models.EndpointsAdminSetUserRoleTarget `json:"users,omitempty"` }{ - Query: in.Query, + Role: in.Role, + Users: in.Users, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminQueryFindingsOutput + var out models.EndpointsAdminBatchSetUserRolesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminFindingsDownloadInput is the input for CreateAdminFindingsDownload — Download Findings. -type CreateAdminFindingsDownloadInput struct { - Query models.ModelsUnifiedFindingsQuery `json:"query"` +// ListAdminAssessmentsScanCoverageInput is the input for ListAdminAssessmentsScanCoverage — Get Scan Coverage. +type ListAdminAssessmentsScanCoverageInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + SortBy *string `url:"sortBy,omitempty" json:"-"` + SortOrder *string `url:"sortOrder,omitempty" json:"-"` + Type *string `url:"type,omitempty" json:"-"` models.RequestScope } -// CreateAdminFindingsDownload - Download Findings -// POST /admin/findings/download -func (c *Client) CreateAdminFindingsDownload(ctx context.Context, in CreateAdminFindingsDownloadInput) (*models.EndpointsAdminFindingsDownloadOutput, error) { - path := "/admin/findings/download" +// ListAdminAssessmentsScanCoverage - Get Scan Coverage +// GET /admin/assessments/scan-coverage +func (c *Client) ListAdminAssessmentsScanCoverage(ctx context.Context, in ListAdminAssessmentsScanCoverageInput) (*models.EndpointsGetScanCoverageOutput, error) { + path := "/admin/assessments/scan-coverage" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Type != nil { + query.Set("type", string(*in.Type)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.SortBy != nil { + query.Set("sortBy", string(*in.SortBy)) + } + if in.SortOrder != nil { + query.Set("sortOrder", string(*in.SortOrder)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -377,43 +326,55 @@ func (c *Client) CreateAdminFindingsDownload(ctx context.Context, in CreateAdmin fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Query models.ModelsUnifiedFindingsQuery `json:"query"` - }{ - Query: in.Query, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminFindingsDownloadOutput + var out models.EndpointsGetScanCoverageOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminFixEffortInput is the input for ListAdminFixEffort — Get Fix Effort Mapping. -type ListAdminFixEffortInput struct { +// ListAdminAssessmentsScanCoverageFindingsInput is the input for ListAdminAssessmentsScanCoverageFindings — Get Scan Coverage Findings. +type ListAdminAssessmentsScanCoverageFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + Type *string `url:"type,omitempty" json:"-"` models.RequestScope } -// ListAdminFixEffort - Get Fix Effort Mapping -// GET /admin/fix-effort -func (c *Client) ListAdminFixEffort(ctx context.Context, in ListAdminFixEffortInput) (*models.EndpointsAdminGetFixEffortOutput, error) { - path := "/admin/fix-effort" +// ListAdminAssessmentsScanCoverageFindings - Get Scan Coverage Findings +// GET /admin/assessments/scan-coverage/findings +func (c *Client) ListAdminAssessmentsScanCoverageFindings(ctx context.Context, in ListAdminAssessmentsScanCoverageFindingsInput) (*models.EndpointsGetScanCoverageFindingsOutput, error) { + path := "/admin/assessments/scan-coverage/findings" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { + if in.Type != nil { + query.Set("type", string(*in.Type)) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { fullURL += "?" + query.Encode() } @@ -421,28 +382,31 @@ func (c *Client) ListAdminFixEffort(ctx context.Context, in ListAdminFixEffortIn if err != nil { return nil, err } - var out models.EndpointsAdminGetFixEffortOutput + var out models.EndpointsGetScanCoverageFindingsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// UpdateAdminFixEffortInput is the input for UpdateAdminFixEffort — Put Fix Effort Mapping. -type UpdateAdminFixEffortInput struct { - FixEffort models.EndpointsAdminFixEffortMapInput `json:"fixEffort"` +// ListAdminChecklistInput is the input for ListAdminChecklist — Get Checklist. +type ListAdminChecklistInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// UpdateAdminFixEffort - Put Fix Effort Mapping -// PUT /admin/fix-effort -func (c *Client) UpdateAdminFixEffort(ctx context.Context, in UpdateAdminFixEffortInput) (*models.EndpointsAdminPutFixEffortOutput, error) { - path := "/admin/fix-effort" +// ListAdminChecklist - Get Checklist +// GET /admin/checklist +func (c *Client) ListAdminChecklist(ctx context.Context, in ListAdminChecklistInput) (*models.EndpointsAdminChecklistOutput, error) { + path := "/admin/checklist" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -450,62 +414,34 @@ func (c *Client) UpdateAdminFixEffort(ctx context.Context, in UpdateAdminFixEffo fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - FixEffort models.EndpointsAdminFixEffortMapInput `json:"fixEffort"` - }{ - FixEffort: in.FixEffort, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminPutFixEffortOutput + var out models.EndpointsAdminChecklistOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminGetFileContentsInput is the input for ListAdminGetFileContents — Get File Contents. -type ListAdminGetFileContentsInput struct { - EndLine *int `url:"endLine,omitempty" json:"-"` - FilePath *string `url:"filePath,omitempty" json:"-"` - ProjectID *string `url:"projectId,omitempty" json:"-"` - Reference *string `url:"reference,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` - StartLine *int `url:"startLine,omitempty" json:"-"` +// ListAdminConfigRoutingExclusionsInput is the input for ListAdminConfigRoutingExclusions — Get Routing Exclusions. +type ListAdminConfigRoutingExclusionsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminGetFileContents - Get File Contents -// GET /admin/getFileContents -func (c *Client) ListAdminGetFileContents(ctx context.Context, in ListAdminGetFileContentsInput) (*models.EndpointsAdminFileContentsOutput, error) { - path := "/admin/getFileContents" +// ListAdminConfigRoutingExclusions - Get Routing Exclusions +// GET /admin/config/routing-exclusions +func (c *Client) ListAdminConfigRoutingExclusions(ctx context.Context, in ListAdminConfigRoutingExclusionsInput) (*models.EndpointsAdminRoutingExclusionsOutput, error) { + path := "/admin/config/routing-exclusions" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) - } - if in.Reference != nil { - query.Set("reference", string(*in.Reference)) - } - if in.FilePath != nil { - query.Set("filePath", string(*in.FilePath)) - } - if in.ProjectID != nil { - query.Set("projectId", string(*in.ProjectID)) - } - if in.StartLine != nil { - query.Set("startLine", strconv.Itoa(int(*in.StartLine))) - } - if in.EndLine != nil { - query.Set("endLine", strconv.Itoa(int(*in.EndLine))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -518,28 +454,32 @@ func (c *Client) ListAdminGetFileContents(ctx context.Context, in ListAdminGetFi if err != nil { return nil, err } - var out models.EndpointsAdminFileContentsOutput + var out models.EndpointsAdminRoutingExclusionsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminGetFileOwnersInput is the input for CreateAdminGetFileOwners — Get File Owners. -type CreateAdminGetFileOwnersInput struct { - Files []models.EndpointsFileOwnersRequest `json:"files,omitempty"` +// UpdateAdminConfigRoutingExclusionsInput is the input for UpdateAdminConfigRoutingExclusions — Set Routing Exclusions. +type UpdateAdminConfigRoutingExclusionsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Users []models.EndpointsAdminRoutingExclusionUser `json:"users,omitempty"` models.RequestScope } -// CreateAdminGetFileOwners - Get File Owners -// POST /admin/getFileOwners -func (c *Client) CreateAdminGetFileOwners(ctx context.Context, in CreateAdminGetFileOwnersInput) (*models.EndpointsAdminFileOwnersOutput, error) { - path := "/admin/getFileOwners" +// UpdateAdminConfigRoutingExclusions - Set Routing Exclusions +// PUT /admin/config/routing-exclusions +func (c *Client) UpdateAdminConfigRoutingExclusions(ctx context.Context, in UpdateAdminConfigRoutingExclusionsInput) (*models.EndpointsAdminRoutingExclusionsOutput, error) { + path := "/admin/config/routing-exclusions" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -548,45 +488,41 @@ func (c *Client) CreateAdminGetFileOwners(ctx context.Context, in CreateAdminGet } bodyBytes, err := json.Marshal(struct { - Files []models.EndpointsFileOwnersRequest `json:"files,omitempty"` + Users []models.EndpointsAdminRoutingExclusionUser `json:"users,omitempty"` }{ - Files: in.Files, + Users: in.Users, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminFileOwnersOutput + var out models.EndpointsAdminRoutingExclusionsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminGetPullRequestInput is the input for ListAdminGetPullRequest — Get PR State. -type ListAdminGetPullRequestInput struct { - PrID *string `url:"prId,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` +// ListAdminConfigSecurityOwnerInput is the input for ListAdminConfigSecurityOwner — Get Security Owner. +type ListAdminConfigSecurityOwnerInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminGetPullRequest - Get PR State -// GET /admin/getPullRequest -func (c *Client) ListAdminGetPullRequest(ctx context.Context, in ListAdminGetPullRequestInput) (*models.EndpointsGetPullRequestStateOutput, error) { - path := "/admin/getPullRequest" +// ListAdminConfigSecurityOwner - Get Security Owner +// GET /admin/config/security-owner +func (c *Client) ListAdminConfigSecurityOwner(ctx context.Context, in ListAdminConfigSecurityOwnerInput) (*models.EndpointsAdminSecurityOwnerOutput, error) { + path := "/admin/config/security-owner" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) - } - if in.PrID != nil { - query.Set("prId", string(*in.PrID)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -599,27 +535,33 @@ func (c *Client) ListAdminGetPullRequest(ctx context.Context, in ListAdminGetPul if err != nil { return nil, err } - var out models.EndpointsGetPullRequestStateOutput + var out models.EndpointsAdminSecurityOwnerOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminInstallationsInput is the input for ListAdminInstallations — Get App Installations. -type ListAdminInstallationsInput struct { +// UpdateAdminConfigSecurityOwnerInput is the input for UpdateAdminConfigSecurityOwner — Set Security Owner. +type UpdateAdminConfigSecurityOwnerInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TeamID string `json:"teamId"` + UserID string `json:"userId"` models.RequestScope } -// ListAdminInstallations - Get App Installations -// GET /admin/installations -func (c *Client) ListAdminInstallations(ctx context.Context, in ListAdminInstallationsInput) (*models.EndpointsAdminGetUserInstallationsOutput, error) { - path := "/admin/installations" +// UpdateAdminConfigSecurityOwner - Set Security Owner +// PUT /admin/config/security-owner +func (c *Client) UpdateAdminConfigSecurityOwner(ctx context.Context, in UpdateAdminConfigSecurityOwnerInput) (*models.EndpointsAdminSecurityOwnerOutput, error) { + path := "/admin/config/security-owner" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -627,31 +569,53 @@ func (c *Client) ListAdminInstallations(ctx context.Context, in ListAdminInstall fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + TeamID string `json:"teamId"` + UserID string `json:"userId"` + }{ + TeamID: in.TeamID, + UserID: in.UserID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminGetUserInstallationsOutput + var out models.EndpointsAdminSecurityOwnerOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsAzureInput is the input for ListAdminIntegrationsAzure — Get Azure Configuration. -type ListAdminIntegrationsAzureInput struct { +// CreateAdminContextIngestInput is the input for CreateAdminContextIngest — Get Context Upload Credentials. +type CreateAdminContextIngestInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + ContextType string `json:"contextType"` + Environment *models.EndpointsContextEnvironment `json:"environment,omitempty"` + FromPR *int `json:"fromPR,omitempty"` + Name string `json:"name"` + PrNumber *int `json:"prNumber,omitempty"` + Repository string `json:"repository"` models.RequestScope } -// ListAdminIntegrationsAzure - Get Azure Configuration -// GET /admin/integrations/azure -func (c *Client) ListAdminIntegrationsAzure(ctx context.Context, in ListAdminIntegrationsAzureInput) (*models.EndpointsAdminGetAzureConfigOutput, error) { - path := "/admin/integrations/azure" +// CreateAdminContextIngest - Get Context Upload Credentials +// POST /admin/context/ingest +func (c *Client) CreateAdminContextIngest(ctx context.Context, in CreateAdminContextIngestInput) (*models.EndpointsContextIngestOutput, error) { + path := "/admin/context/ingest" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -659,31 +623,73 @@ func (c *Client) ListAdminIntegrationsAzure(ctx context.Context, in ListAdminInt fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + ContextType string `json:"contextType"` + Environment *models.EndpointsContextEnvironment `json:"environment,omitempty"` + FromPR *int `json:"fromPR,omitempty"` + Name string `json:"name"` + PrNumber *int `json:"prNumber,omitempty"` + Repository string `json:"repository"` + }{ + Branch: in.Branch, + CommitSha: in.CommitSha, + ContextType: in.ContextType, + Environment: in.Environment, + FromPR: in.FromPR, + Name: in.Name, + PrNumber: in.PrNumber, + Repository: in.Repository, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminGetAzureConfigOutput + var out models.EndpointsContextIngestOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsAzureInput is the input for CreateAdminIntegrationsAzure — Install Azure DevOps Integration. -type CreateAdminIntegrationsAzureInput struct { +// CreateAdminEventsInput is the input for CreateAdminEvents — List Unified Events. +type CreateAdminEventsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AfterID *string `json:"afterId,omitempty"` + AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` + AutofixID *string `json:"autofixId,omitempty"` + BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + EventTypes []string `json:"eventTypes,omitempty"` + ExcludeEventTypes []string `json:"excludeEventTypes,omitempty"` + ExcludeServices []string `json:"excludeServices,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + HideNoise *bool `json:"hideNoise,omitempty"` + Limit *int `json:"limit,omitempty"` + PrCanonicalID *string `json:"prCanonicalId,omitempty"` + Query *string `json:"query,omitempty"` + QueryEventTypes []string `json:"queryEventTypes,omitempty"` + RunID *string `json:"runId,omitempty"` + Services []string `json:"services,omitempty"` models.RequestScope } -// CreateAdminIntegrationsAzure - Install Azure DevOps Integration -// POST /admin/integrations/azure -func (c *Client) CreateAdminIntegrationsAzure(ctx context.Context, in CreateAdminIntegrationsAzureInput) (*models.EndpointsAdminPostAzureInstallOutput, error) { - path := "/admin/integrations/azure" +// CreateAdminEvents - List Unified Events +// POST /admin/events +func (c *Client) CreateAdminEvents(ctx context.Context, in CreateAdminEventsInput) (*models.EndpointsAdminListUnifiedEventsOutput, error) { + path := "/admin/events" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -691,34 +697,73 @@ func (c *Client) CreateAdminIntegrationsAzure(ctx context.Context, in CreateAdmi fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + AfterID *string `json:"afterId,omitempty"` + AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` + AutofixID *string `json:"autofixId,omitempty"` + BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + EventTypes []string `json:"eventTypes,omitempty"` + ExcludeEventTypes []string `json:"excludeEventTypes,omitempty"` + ExcludeServices []string `json:"excludeServices,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + HideNoise *bool `json:"hideNoise,omitempty"` + Limit *int `json:"limit,omitempty"` + PrCanonicalID *string `json:"prCanonicalId,omitempty"` + Query *string `json:"query,omitempty"` + QueryEventTypes []string `json:"queryEventTypes,omitempty"` + RunID *string `json:"runId,omitempty"` + Services []string `json:"services,omitempty"` + }{ + AfterID: in.AfterID, + AfterTimeUnix: in.AfterTimeUnix, + AutofixID: in.AutofixID, + BeforeTimeUnix: in.BeforeTimeUnix, + CampaignID: in.CampaignID, + EventTypes: in.EventTypes, + ExcludeEventTypes: in.ExcludeEventTypes, + ExcludeServices: in.ExcludeServices, + FindingIds: in.FindingIds, + HideNoise: in.HideNoise, + Limit: in.Limit, + PrCanonicalID: in.PrCanonicalID, + Query: in.Query, + QueryEventTypes: in.QueryEventTypes, + RunID: in.RunID, + Services: in.Services, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminPostAzureInstallOutput + var out models.EndpointsAdminListUnifiedEventsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsAzureCredentialsInput is the input for CreateAdminIntegrationsAzureCredentials — Set Azure Credentials. -type CreateAdminIntegrationsAzureCredentialsInput struct { - ClientID string `json:"clientId"` - ClientSecret *string `json:"clientSecret,omitempty"` - TenantID string `json:"tenantId"` +// ListAdminExternalWritesInput is the input for ListAdminExternalWrites — Read External Writes. +type ListAdminExternalWritesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsAzureCredentials - Set Azure Credentials -// POST /admin/integrations/azure/credentials -func (c *Client) CreateAdminIntegrationsAzureCredentials(ctx context.Context, in CreateAdminIntegrationsAzureCredentialsInput) (*models.EndpointsAdminPostAzureCredentialsOutput, error) { - path := "/admin/integrations/azure/credentials" +// ListAdminExternalWrites - Read External Writes +// GET /admin/external-writes +func (c *Client) ListAdminExternalWrites(ctx context.Context, in ListAdminExternalWritesInput) (*models.EndpointsExternalWritesOutput, error) { + path := "/admin/external-writes" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -726,43 +771,40 @@ func (c *Client) CreateAdminIntegrationsAzureCredentials(ctx context.Context, in fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - ClientID string `json:"clientId"` - ClientSecret *string `json:"clientSecret,omitempty"` - TenantID string `json:"tenantId"` - }{ - ClientID: in.ClientID, - ClientSecret: in.ClientSecret, - TenantID: in.TenantID, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminPostAzureCredentialsOutput + var out models.EndpointsExternalWritesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminIntegrationsBuildkiteInput is the input for DeleteAdminIntegrationsBuildkite — Delete Buildkite Integration. -type DeleteAdminIntegrationsBuildkiteInput struct { +// UpdateAdminExternalWritesInput is the input for UpdateAdminExternalWrites — Change External Writes. +type UpdateAdminExternalWritesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + GitWrites *bool `json:"gitWrites,omitempty"` + Messaging *bool `json:"messaging,omitempty"` + PullRequestReviews *bool `json:"pullRequestReviews,omitempty"` + PullRequests *bool `json:"pullRequests,omitempty"` + Tickets *bool `json:"tickets,omitempty"` models.RequestScope } -// DeleteAdminIntegrationsBuildkite - Delete Buildkite Integration -// DELETE /admin/integrations/buildkite -func (c *Client) DeleteAdminIntegrationsBuildkite(ctx context.Context, in DeleteAdminIntegrationsBuildkiteInput) (*models.EndpointsDeleteBuildkiteIntegrationOutput, error) { - path := "/admin/integrations/buildkite" +// UpdateAdminExternalWrites - Change External Writes +// PUT /admin/external-writes +func (c *Client) UpdateAdminExternalWrites(ctx context.Context, in UpdateAdminExternalWritesInput) (*models.EndpointsExternalWritesOutput, error) { + path := "/admin/external-writes" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -770,31 +812,56 @@ func (c *Client) DeleteAdminIntegrationsBuildkite(ctx context.Context, in Delete fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + GitWrites *bool `json:"gitWrites,omitempty"` + Messaging *bool `json:"messaging,omitempty"` + PullRequestReviews *bool `json:"pullRequestReviews,omitempty"` + PullRequests *bool `json:"pullRequests,omitempty"` + Tickets *bool `json:"tickets,omitempty"` + }{ + GitWrites: in.GitWrites, + Messaging: in.Messaging, + PullRequestReviews: in.PullRequestReviews, + PullRequests: in.PullRequests, + Tickets: in.Tickets, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsDeleteBuildkiteIntegrationOutput + var out models.EndpointsExternalWritesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsBuildkiteInput is the input for ListAdminIntegrationsBuildkite — Get Buildkite Integration Status. -type ListAdminIntegrationsBuildkiteInput struct { +// GetAdminFindingFindingIdInput is the input for GetAdminFindingFindingId — Get Finding. +type GetAdminFindingFindingIdInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsBuildkite - Get Buildkite Integration Status -// GET /admin/integrations/buildkite -func (c *Client) ListAdminIntegrationsBuildkite(ctx context.Context, in ListAdminIntegrationsBuildkiteInput) (*models.EndpointsGetBuildkiteIntegrationOutput, error) { - path := "/admin/integrations/buildkite" +// SetFindingID sets the finding that the request targets. +func (in *GetAdminFindingFindingIdInput) SetFindingID(id string) { in.FindingID = id } + +// GetAdminFindingFindingId - Get Finding +// GET /admin/finding/{findingId} +func (c *Client) GetAdminFindingFindingId(ctx context.Context, in GetAdminFindingFindingIdInput) (*models.EndpointsAdminGetFindingOutput, error) { + path := "/admin/finding/{findingId}" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -806,29 +873,32 @@ func (c *Client) ListAdminIntegrationsBuildkite(ctx context.Context, in ListAdmi if err != nil { return nil, err } - var out models.EndpointsGetBuildkiteIntegrationOutput + var out models.EndpointsAdminGetFindingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsBuildkiteTokenInput is the input for CreateAdminIntegrationsBuildkiteToken — Set Buildkite API Token. -type CreateAdminIntegrationsBuildkiteTokenInput struct { - ApiToken string `json:"apiToken"` - OrgSlug string `json:"orgSlug"` +// CreateAdminFindingsInput is the input for CreateAdminFindings — Query Findings. +type CreateAdminFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` models.RequestScope } -// CreateAdminIntegrationsBuildkiteToken - Set Buildkite API Token -// POST /admin/integrations/buildkite/token -func (c *Client) CreateAdminIntegrationsBuildkiteToken(ctx context.Context, in CreateAdminIntegrationsBuildkiteTokenInput) (*models.EndpointsPostBuildkiteTokenOutput, error) { - path := "/admin/integrations/buildkite/token" +// CreateAdminFindings - Query Findings +// POST /admin/findings +func (c *Client) CreateAdminFindings(ctx context.Context, in CreateAdminFindingsInput) (*models.EndpointsAdminQueryFindingsOutput, error) { + path := "/admin/findings" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -837,11 +907,9 @@ func (c *Client) CreateAdminIntegrationsBuildkiteToken(ctx context.Context, in C } bodyBytes, err := json.Marshal(struct { - ApiToken string `json:"apiToken"` - OrgSlug string `json:"orgSlug"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` }{ - ApiToken: in.ApiToken, - OrgSlug: in.OrgSlug, + Query: in.Query, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -850,27 +918,32 @@ func (c *Client) CreateAdminIntegrationsBuildkiteToken(ctx context.Context, in C if err != nil { return nil, err } - var out models.EndpointsPostBuildkiteTokenOutput + var out models.EndpointsAdminQueryFindingsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminIntegrationsCircleciInput is the input for DeleteAdminIntegrationsCircleci — Delete CircleCI Integration. -type DeleteAdminIntegrationsCircleciInput struct { +// CreateAdminFindingsDownloadInput is the input for CreateAdminFindingsDownload — Download Findings. +type CreateAdminFindingsDownloadInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` models.RequestScope } -// DeleteAdminIntegrationsCircleci - Delete CircleCI Integration -// DELETE /admin/integrations/circleci -func (c *Client) DeleteAdminIntegrationsCircleci(ctx context.Context, in DeleteAdminIntegrationsCircleciInput) (*models.EndpointsDeleteCircleCIIntegrationOutput, error) { - path := "/admin/integrations/circleci" +// CreateAdminFindingsDownload - Download Findings +// POST /admin/findings/download +func (c *Client) CreateAdminFindingsDownload(ctx context.Context, in CreateAdminFindingsDownloadInput) (*models.EndpointsAdminFindingsDownloadOutput, error) { + path := "/admin/findings/download" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -878,31 +951,47 @@ func (c *Client) DeleteAdminIntegrationsCircleci(ctx context.Context, in DeleteA fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Query models.ModelsUnifiedFindingsQuery `json:"query"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsDeleteCircleCIIntegrationOutput + var out models.EndpointsAdminFindingsDownloadOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsCircleciInput is the input for ListAdminIntegrationsCircleci — Get CircleCI Integration Status. -type ListAdminIntegrationsCircleciInput struct { +// CreateAdminFindingsGroupsInput is the input for CreateAdminFindingsGroups — Group Findings. +type CreateAdminFindingsGroupsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + GroupBy models.ModelsFindingsGroupBy `json:"groupBy"` + Limit *int `json:"limit,omitempty"` + Page *int `json:"page,omitempty"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` models.RequestScope } -// ListAdminIntegrationsCircleci - Get CircleCI Integration Status -// GET /admin/integrations/circleci -func (c *Client) ListAdminIntegrationsCircleci(ctx context.Context, in ListAdminIntegrationsCircleciInput) (*models.EndpointsGetCircleCIIntegrationOutput, error) { - path := "/admin/integrations/circleci" +// CreateAdminFindingsGroups - Group Findings +// POST /admin/findings/groups +func (c *Client) CreateAdminFindingsGroups(ctx context.Context, in CreateAdminFindingsGroupsInput) (*models.EndpointsAdminFindingsGroupsOutput, error) { + path := "/admin/findings/groups" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -910,32 +999,50 @@ func (c *Client) ListAdminIntegrationsCircleci(ctx context.Context, in ListAdmin fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + GroupBy models.ModelsFindingsGroupBy `json:"groupBy"` + Limit *int `json:"limit,omitempty"` + Page *int `json:"page,omitempty"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` + }{ + GroupBy: in.GroupBy, + Limit: in.Limit, + Page: in.Page, + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetCircleCIIntegrationOutput + var out models.EndpointsAdminFindingsGroupsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsCircleciTokenInput is the input for CreateAdminIntegrationsCircleciToken — Set CircleCI API Token. -type CreateAdminIntegrationsCircleciTokenInput struct { - ApiToken string `json:"apiToken"` +// CreateAdminFindingsProgressInput is the input for CreateAdminFindingsProgress — Post Findings Progress. +type CreateAdminFindingsProgressInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` models.RequestScope } -// CreateAdminIntegrationsCircleciToken - Set CircleCI API Token -// POST /admin/integrations/circleci/token -func (c *Client) CreateAdminIntegrationsCircleciToken(ctx context.Context, in CreateAdminIntegrationsCircleciTokenInput) (*models.EndpointsPostCircleCITokenOutput, error) { - path := "/admin/integrations/circleci/token" +// CreateAdminFindingsProgress - Post Findings Progress +// POST /admin/findings/progress +func (c *Client) CreateAdminFindingsProgress(ctx context.Context, in CreateAdminFindingsProgressInput) (*models.EndpointsAdminQueryFindingsProgressOutput, error) { + path := "/admin/findings/progress" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -944,9 +1051,9 @@ func (c *Client) CreateAdminIntegrationsCircleciToken(ctx context.Context, in Cr } bodyBytes, err := json.Marshal(struct { - ApiToken string `json:"apiToken"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` }{ - ApiToken: in.ApiToken, + Query: in.Query, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -955,27 +1062,31 @@ func (c *Client) CreateAdminIntegrationsCircleciToken(ctx context.Context, in Cr if err != nil { return nil, err } - var out models.EndpointsPostCircleCITokenOutput + var out models.EndpointsAdminQueryFindingsProgressOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminIntegrationsCloudAwsSettingsInput is the input for DeleteAdminIntegrationsCloudAwsSettings — Delete Cloud AWS Settings. -type DeleteAdminIntegrationsCloudAwsSettingsInput struct { +// ListAdminFixEffortInput is the input for ListAdminFixEffort — Get Fix Effort Mapping. +type ListAdminFixEffortInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteAdminIntegrationsCloudAwsSettings - Delete Cloud AWS Settings -// DELETE /admin/integrations/cloud/aws/settings -func (c *Client) DeleteAdminIntegrationsCloudAwsSettings(ctx context.Context, in DeleteAdminIntegrationsCloudAwsSettingsInput) (*models.EndpointsAdminDeleteAWSSettingsOutput, error) { - path := "/admin/integrations/cloud/aws/settings" +// ListAdminFixEffort - Get Fix Effort Mapping +// GET /admin/fix-effort +func (c *Client) ListAdminFixEffort(ctx context.Context, in ListAdminFixEffortInput) (*models.EndpointsAdminGetFixEffortOutput, error) { + path := "/admin/fix-effort" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -983,31 +1094,36 @@ func (c *Client) DeleteAdminIntegrationsCloudAwsSettings(ctx context.Context, in fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminDeleteAWSSettingsOutput + var out models.EndpointsAdminGetFixEffortOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsCloudAwsSettingsInput is the input for ListAdminIntegrationsCloudAwsSettings — Get Cloud AWS Settings. -type ListAdminIntegrationsCloudAwsSettingsInput struct { +// UpdateAdminFixEffortInput is the input for UpdateAdminFixEffort — Put Fix Effort Mapping. +type UpdateAdminFixEffortInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + FixEffort models.EndpointsAdminFixEffortMapInput `json:"fixEffort"` models.RequestScope } -// ListAdminIntegrationsCloudAwsSettings - Get Cloud AWS Settings -// GET /admin/integrations/cloud/aws/settings -func (c *Client) ListAdminIntegrationsCloudAwsSettings(ctx context.Context, in ListAdminIntegrationsCloudAwsSettingsInput) (*models.EndpointsAdminGetAWSSettingsOutput, error) { - path := "/admin/integrations/cloud/aws/settings" +// UpdateAdminFixEffort - Put Fix Effort Mapping +// PUT /admin/fix-effort +func (c *Client) UpdateAdminFixEffort(ctx context.Context, in UpdateAdminFixEffortInput) (*models.EndpointsAdminPutFixEffortOutput, error) { + path := "/admin/fix-effort" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1015,35 +1131,71 @@ func (c *Client) ListAdminIntegrationsCloudAwsSettings(ctx context.Context, in L fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + FixEffort models.EndpointsAdminFixEffortMapInput `json:"fixEffort"` + }{ + FixEffort: in.FixEffort, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminGetAWSSettingsOutput + var out models.EndpointsAdminPutFixEffortOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsCloudAwsSettingsInput is the input for CreateAdminIntegrationsCloudAwsSettings — Upsert Cloud AWS Settings. -type CreateAdminIntegrationsCloudAwsSettingsInput struct { - AwsAccounts []models.ModelsAWSAccount `json:"awsAccounts,omitempty"` - ExternalID *string `json:"externalId,omitempty"` - IamRoleName string `json:"iamRoleName"` - PreferredDeployment string `json:"preferredDeployment"` +// ListAdminGetFileContentsInput is the input for ListAdminGetFileContents — Get File Contents. +type ListAdminGetFileContentsInput struct { + EndLine *int `url:"endLine,omitempty" json:"-"` + FilePath *string `url:"filePath,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + Reference *string `url:"reference,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + ScanFamily *string `url:"scanFamily,omitempty" json:"-"` + StartLine *int `url:"startLine,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsCloudAwsSettings - Upsert Cloud AWS Settings -// POST /admin/integrations/cloud/aws/settings -func (c *Client) CreateAdminIntegrationsCloudAwsSettings(ctx context.Context, in CreateAdminIntegrationsCloudAwsSettingsInput) (*models.EndpointsAdminUpsertAWSSettingsOutput, error) { - path := "/admin/integrations/cloud/aws/settings" +// ListAdminGetFileContents - Get File Contents +// GET /admin/getFileContents +func (c *Client) ListAdminGetFileContents(ctx context.Context, in ListAdminGetFileContentsInput) (*models.EndpointsAdminFileContentsOutput, error) { + path := "/admin/getFileContents" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.Reference != nil { + query.Set("reference", string(*in.Reference)) + } + if in.FilePath != nil { + query.Set("filePath", string(*in.FilePath)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.StartLine != nil { + query.Set("startLine", strconv.Itoa(int(*in.StartLine))) + } + if in.EndLine != nil { + query.Set("endLine", strconv.Itoa(int(*in.EndLine))) + } + if in.ScanFamily != nil { + query.Set("scanFamily", string(*in.ScanFamily)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1051,48 +1203,36 @@ func (c *Client) CreateAdminIntegrationsCloudAwsSettings(ctx context.Context, in fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - AwsAccounts []models.ModelsAWSAccount `json:"awsAccounts,omitempty"` - ExternalID *string `json:"externalId,omitempty"` - IamRoleName string `json:"iamRoleName"` - PreferredDeployment string `json:"preferredDeployment"` - }{ - AwsAccounts: in.AwsAccounts, - ExternalID: in.ExternalID, - IamRoleName: in.IamRoleName, - PreferredDeployment: in.PreferredDeployment, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminUpsertAWSSettingsOutput + var out models.EndpointsAdminFileContentsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsCloudAwsValidateRoleInput is the input for CreateAdminIntegrationsCloudAwsValidateRole — Validate AWS Role. -type CreateAdminIntegrationsCloudAwsValidateRoleInput struct { - AccountIds []string `json:"accountIds,omitempty"` - Onboarding *bool `json:"onboarding,omitempty"` - RoleNameToAssume *string `json:"roleNameToAssume,omitempty"` +// CreateAdminGetFileOwnersInput is the input for CreateAdminGetFileOwners — Get File Owners. +type CreateAdminGetFileOwnersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Files []models.EndpointsFileOwnersRequest `json:"files,omitempty"` models.RequestScope } -// CreateAdminIntegrationsCloudAwsValidateRole - Validate AWS Role -// POST /admin/integrations/cloud/aws/validate-role -func (c *Client) CreateAdminIntegrationsCloudAwsValidateRole(ctx context.Context, in CreateAdminIntegrationsCloudAwsValidateRoleInput) (*models.EndpointsAdminValidateAWSRoleOutput, error) { - path := "/admin/integrations/cloud/aws/validate-role" +// CreateAdminGetFileOwners - Get File Owners +// POST /admin/getFileOwners +func (c *Client) CreateAdminGetFileOwners(ctx context.Context, in CreateAdminGetFileOwnersInput) (*models.EndpointsAdminFileOwnersOutput, error) { + path := "/admin/getFileOwners" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1101,13 +1241,9 @@ func (c *Client) CreateAdminIntegrationsCloudAwsValidateRole(ctx context.Context } bodyBytes, err := json.Marshal(struct { - AccountIds []string `json:"accountIds,omitempty"` - Onboarding *bool `json:"onboarding,omitempty"` - RoleNameToAssume *string `json:"roleNameToAssume,omitempty"` + Files []models.EndpointsFileOwnersRequest `json:"files,omitempty"` }{ - AccountIds: in.AccountIds, - Onboarding: in.Onboarding, - RoleNameToAssume: in.RoleNameToAssume, + Files: in.Files, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -1116,59 +1252,75 @@ func (c *Client) CreateAdminIntegrationsCloudAwsValidateRole(ctx context.Context if err != nil { return nil, err } - var out models.EndpointsAdminValidateAWSRoleOutput + var out models.EndpointsAdminFileOwnersOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminIntegrationsCloudAzureSettingsInput is the input for DeleteAdminIntegrationsCloudAzureSettings — Delete Cloud Azure Settings. -type DeleteAdminIntegrationsCloudAzureSettingsInput struct { +// ListAdminGetPullRequestInput is the input for ListAdminGetPullRequest — Get PR State. +type ListAdminGetPullRequestInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PrID *string `url:"prId,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` models.RequestScope } -// DeleteAdminIntegrationsCloudAzureSettings - Delete Cloud Azure Settings -// DELETE /admin/integrations/cloud/azure/settings -func (c *Client) DeleteAdminIntegrationsCloudAzureSettings(ctx context.Context, in DeleteAdminIntegrationsCloudAzureSettingsInput) (*models.EndpointsAdminDeleteAzureSettingsOutput, error) { - path := "/admin/integrations/cloud/azure/settings" +// ListAdminGetPullRequest - Get PR State +// GET /admin/getPullRequest +func (c *Client) ListAdminGetPullRequest(ctx context.Context, in ListAdminGetPullRequestInput) (*models.EndpointsGetPullRequestStateOutput, error) { + path := "/admin/getPullRequest" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.PrID != nil { + query.Set("prId", string(*in.PrID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } + in.RequestScope.AddTo(query) - data, err := c.do(ctx, "DELETE", fullURL, nil) + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminDeleteAzureSettingsOutput + var out models.EndpointsGetPullRequestStateOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsCloudAzureSettingsInput is the input for ListAdminIntegrationsCloudAzureSettings — Get Cloud Azure Settings. -type ListAdminIntegrationsCloudAzureSettingsInput struct { +// DeleteAdminIdentityEntraInput is the input for DeleteAdminIdentityEntra — Disconnect Microsoft Entra directory binding. +type DeleteAdminIdentityEntraInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsCloudAzureSettings - Get Cloud Azure Settings -// GET /admin/integrations/cloud/azure/settings -func (c *Client) ListAdminIntegrationsCloudAzureSettings(ctx context.Context, in ListAdminIntegrationsCloudAzureSettingsInput) (*models.EndpointsAdminGetAzureSettingsOutput, error) { - path := "/admin/integrations/cloud/azure/settings" +// DeleteAdminIdentityEntra - Disconnect Microsoft Entra directory binding +// DELETE /admin/identity/entra +func (c *Client) DeleteAdminIdentityEntra(ctx context.Context, in DeleteAdminIdentityEntraInput) ([]byte, error) { + path := "/admin/identity/entra" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1176,37 +1328,28 @@ func (c *Client) ListAdminIntegrationsCloudAzureSettings(ctx context.Context, in fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsAdminGetAzureSettingsOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil + data, err := c.do(ctx, "DELETE", fullURL, nil) + return data, err } -// CreateAdminIntegrationsCloudAzureSettingsInput is the input for CreateAdminIntegrationsCloudAzureSettings — Upsert Cloud Azure Settings. -type CreateAdminIntegrationsCloudAzureSettingsInput struct { - ClientID *string `json:"clientId,omitempty"` - ClientSecret *string `json:"clientSecret,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Subscriptions []models.ModelsAzureSubscriptionInput `json:"subscriptions,omitempty"` - TenantID string `json:"tenantId"` - UseManagedIdentity *bool `json:"useManagedIdentity,omitempty"` +// ListAdminIdentityEntraInput is the input for ListAdminIdentityEntra — Get Microsoft Entra directory binding status. +type ListAdminIdentityEntraInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsCloudAzureSettings - Upsert Cloud Azure Settings -// POST /admin/integrations/cloud/azure/settings -func (c *Client) CreateAdminIntegrationsCloudAzureSettings(ctx context.Context, in CreateAdminIntegrationsCloudAzureSettingsInput) (*models.EndpointsAdminUpsertAzureSettingsOutput, error) { - path := "/admin/integrations/cloud/azure/settings" +// ListAdminIdentityEntra - Get Microsoft Entra directory binding status +// GET /admin/identity/entra +func (c *Client) ListAdminIdentityEntra(ctx context.Context, in ListAdminIdentityEntraInput) (*models.EndpointsIdentityEntraGetOutput, error) { + path := "/admin/identity/entra" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1214,49 +1357,35 @@ func (c *Client) CreateAdminIntegrationsCloudAzureSettings(ctx context.Context, fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - ClientID *string `json:"clientId,omitempty"` - ClientSecret *string `json:"clientSecret,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Subscriptions []models.ModelsAzureSubscriptionInput `json:"subscriptions,omitempty"` - TenantID string `json:"tenantId"` - UseManagedIdentity *bool `json:"useManagedIdentity,omitempty"` - }{ - ClientID: in.ClientID, - ClientSecret: in.ClientSecret, - DisplayName: in.DisplayName, - Subscriptions: in.Subscriptions, - TenantID: in.TenantID, - UseManagedIdentity: in.UseManagedIdentity, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminUpsertAzureSettingsOutput + var out models.EndpointsIdentityEntraGetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminIntegrationsCloudGcpSettingsInput is the input for DeleteAdminIntegrationsCloudGcpSettings — Delete Cloud GCP Settings. -type DeleteAdminIntegrationsCloudGcpSettingsInput struct { +// CreateAdminIdentityEntraConnectInput is the input for CreateAdminIdentityEntraConnect — Start Microsoft Entra connect. +type CreateAdminIdentityEntraConnectInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteAdminIntegrationsCloudGcpSettings - Delete Cloud GCP Settings -// DELETE /admin/integrations/cloud/gcp/settings -func (c *Client) DeleteAdminIntegrationsCloudGcpSettings(ctx context.Context, in DeleteAdminIntegrationsCloudGcpSettingsInput) (*models.EndpointsAdminDeleteGCPSettingsOutput, error) { - path := "/admin/integrations/cloud/gcp/settings" +// CreateAdminIdentityEntraConnect - Start Microsoft Entra connect +// POST /admin/identity/entra/connect +func (c *Client) CreateAdminIdentityEntraConnect(ctx context.Context, in CreateAdminIdentityEntraConnectInput) (*models.EndpointsIdentityEntraConnectPostOutput, error) { + path := "/admin/identity/entra/connect" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1264,31 +1393,35 @@ func (c *Client) DeleteAdminIntegrationsCloudGcpSettings(ctx context.Context, in fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminDeleteGCPSettingsOutput + var out models.EndpointsIdentityEntraConnectPostOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsCloudGcpSettingsInput is the input for ListAdminIntegrationsCloudGcpSettings — Get Cloud GCP Settings. -type ListAdminIntegrationsCloudGcpSettingsInput struct { +// ListAdminIdentityEntraHandoffInput is the input for ListAdminIdentityEntraHandoff — List Microsoft Entra consent links. +type ListAdminIdentityEntraHandoffInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsCloudGcpSettings - Get Cloud GCP Settings -// GET /admin/integrations/cloud/gcp/settings -func (c *Client) ListAdminIntegrationsCloudGcpSettings(ctx context.Context, in ListAdminIntegrationsCloudGcpSettingsInput) (*models.EndpointsAdminGetGCPSettingsOutput, error) { - path := "/admin/integrations/cloud/gcp/settings" +// ListAdminIdentityEntraHandoff - List Microsoft Entra consent links +// GET /admin/identity/entra/handoff +func (c *Client) ListAdminIdentityEntraHandoff(ctx context.Context, in ListAdminIdentityEntraHandoffInput) (*models.EndpointsIdentityEntraHandoffListOutput, error) { + path := "/admin/identity/entra/handoff" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1300,33 +1433,32 @@ func (c *Client) ListAdminIntegrationsCloudGcpSettings(ctx context.Context, in L if err != nil { return nil, err } - var out models.EndpointsAdminGetGCPSettingsOutput + var out models.EndpointsIdentityEntraHandoffListOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsCloudGcpSettingsInput is the input for CreateAdminIntegrationsCloudGcpSettings — Upsert Cloud GCP Settings. -type CreateAdminIntegrationsCloudGcpSettingsInput struct { - DisplayName *string `json:"displayName,omitempty"` - GkeClusterOidcIssuerUrls []string `json:"gkeClusterOidcIssuerUrls,omitempty"` - GkeServiceAccountUniqueID *string `json:"gkeServiceAccountUniqueId,omitempty"` - Projects []models.ModelsGCPProjectInput `json:"projects,omitempty"` - WorkloadIdentityProvider string `json:"workloadIdentityProvider"` - WorkloadIdentityServiceAccountEmail string `json:"workloadIdentityServiceAccountEmail"` +// CreateAdminIdentityEntraHandoffInput is the input for CreateAdminIdentityEntraHandoff — Delegate Microsoft Entra directory consent. +type CreateAdminIdentityEntraHandoffInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DirectoryID string `json:"directoryId"` models.RequestScope } -// CreateAdminIntegrationsCloudGcpSettings - Upsert Cloud GCP Settings -// POST /admin/integrations/cloud/gcp/settings -func (c *Client) CreateAdminIntegrationsCloudGcpSettings(ctx context.Context, in CreateAdminIntegrationsCloudGcpSettingsInput) (*models.EndpointsAdminUpsertGCPSettingsOutput, error) { - path := "/admin/integrations/cloud/gcp/settings" +// CreateAdminIdentityEntraHandoff - Delegate Microsoft Entra directory consent +// POST /admin/identity/entra/handoff +func (c *Client) CreateAdminIdentityEntraHandoff(ctx context.Context, in CreateAdminIdentityEntraHandoffInput) (*models.EndpointsIdentityEntraHandoffPostOutput, error) { + path := "/admin/identity/entra/handoff" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1335,19 +1467,9 @@ func (c *Client) CreateAdminIntegrationsCloudGcpSettings(ctx context.Context, in } bodyBytes, err := json.Marshal(struct { - DisplayName *string `json:"displayName,omitempty"` - GkeClusterOidcIssuerUrls []string `json:"gkeClusterOidcIssuerUrls,omitempty"` - GkeServiceAccountUniqueID *string `json:"gkeServiceAccountUniqueId,omitempty"` - Projects []models.ModelsGCPProjectInput `json:"projects,omitempty"` - WorkloadIdentityProvider string `json:"workloadIdentityProvider"` - WorkloadIdentityServiceAccountEmail string `json:"workloadIdentityServiceAccountEmail"` + DirectoryID string `json:"directoryId"` }{ - DisplayName: in.DisplayName, - GkeClusterOidcIssuerUrls: in.GkeClusterOidcIssuerUrls, - GkeServiceAccountUniqueID: in.GkeServiceAccountUniqueID, - Projects: in.Projects, - WorkloadIdentityProvider: in.WorkloadIdentityProvider, - WorkloadIdentityServiceAccountEmail: in.WorkloadIdentityServiceAccountEmail, + DirectoryID: in.DirectoryID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -1356,28 +1478,33 @@ func (c *Client) CreateAdminIntegrationsCloudGcpSettings(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsAdminUpsertGCPSettingsOutput + var out models.EndpointsIdentityEntraHandoffPostOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsCloudGcpValidateInput is the input for CreateAdminIntegrationsCloudGcpValidate — Validate GCP Credentials. -type CreateAdminIntegrationsCloudGcpValidateInput struct { - ProjectIds []string `json:"projectIds,omitempty"` +// DeleteAdminIdentityEntraHandoffIdInput is the input for DeleteAdminIdentityEntraHandoffId — Revoke a Microsoft Entra consent link. +type DeleteAdminIdentityEntraHandoffIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsCloudGcpValidate - Validate GCP Credentials -// POST /admin/integrations/cloud/gcp/validate -func (c *Client) CreateAdminIntegrationsCloudGcpValidate(ctx context.Context, in CreateAdminIntegrationsCloudGcpValidateInput) (*models.EndpointsAdminValidateGCPOutput, error) { - path := "/admin/integrations/cloud/gcp/validate" +// DeleteAdminIdentityEntraHandoffId - Revoke a Microsoft Entra consent link +// DELETE /admin/identity/entra/handoff/{id} +func (c *Client) DeleteAdminIdentityEntraHandoffId(ctx context.Context, in DeleteAdminIdentityEntraHandoffIdInput) ([]byte, error) { + path := "/admin/identity/entra/handoff/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1385,40 +1512,28 @@ func (c *Client) CreateAdminIntegrationsCloudGcpValidate(ctx context.Context, in fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - ProjectIds []string `json:"projectIds,omitempty"` - }{ - ProjectIds: in.ProjectIds, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) - if err != nil { - return nil, err - } - var out models.EndpointsAdminValidateGCPOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil + data, err := c.do(ctx, "DELETE", fullURL, nil) + return data, err } -// CreateAdminIntegrationsCloudK8sWhitelistInput is the input for CreateAdminIntegrationsCloudK8sWhitelist — Whitelist K8s Connector Accounts. -type CreateAdminIntegrationsCloudK8sWhitelistInput struct { - AccountIds []string `json:"accountIds,omitempty"` +// CreateAdminIdentityEntraLinkInput is the input for CreateAdminIdentityEntraLink — Start Microsoft Entra self-service account link. +type CreateAdminIdentityEntraLinkInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsCloudK8sWhitelist - Whitelist K8s Connector Accounts -// POST /admin/integrations/cloud/k8s/whitelist -func (c *Client) CreateAdminIntegrationsCloudK8sWhitelist(ctx context.Context, in CreateAdminIntegrationsCloudK8sWhitelistInput) (*models.EndpointsAdminK8SConnectorWhitelistOutput, error) { - path := "/admin/integrations/cloud/k8s/whitelist" +// CreateAdminIdentityEntraLink - Start Microsoft Entra self-service account link +// POST /admin/identity/entra/link +func (c *Client) CreateAdminIdentityEntraLink(ctx context.Context, in CreateAdminIdentityEntraLinkInput) (*models.EndpointsIdentityEntraLinkPostOutput, error) { + path := "/admin/identity/entra/link" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1426,39 +1541,35 @@ func (c *Client) CreateAdminIntegrationsCloudK8sWhitelist(ctx context.Context, i fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - AccountIds []string `json:"accountIds,omitempty"` - }{ - AccountIds: in.AccountIds, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminK8SConnectorWhitelistOutput + var out models.EndpointsIdentityEntraLinkPostOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsGithubAppSettingsInput is the input for ListAdminIntegrationsGithubAppSettings — Get GitHub App Settings. -type ListAdminIntegrationsGithubAppSettingsInput struct { +// ListAdminIdentityEntraPolicyInput is the input for ListAdminIdentityEntraPolicy — Create Interactor []. +type ListAdminIdentityEntraPolicyInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsGithubAppSettings - Get GitHub App Settings -// GET /admin/integrations/github/app-settings -func (c *Client) ListAdminIntegrationsGithubAppSettings(ctx context.Context, in ListAdminIntegrationsGithubAppSettingsInput) (*models.EndpointsAdminGetGitHubAppSettingsOutput, error) { - path := "/admin/integrations/github/app-settings" +// ListAdminIdentityEntraPolicy - Create Interactor [] +// GET /admin/identity/entra/policy +func (c *Client) ListAdminIdentityEntraPolicy(ctx context.Context, in ListAdminIdentityEntraPolicyInput) (*models.EndpointsWorkspaceEntraSSOPolicyOutput, error) { + path := "/admin/identity/entra/policy" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1470,27 +1581,35 @@ func (c *Client) ListAdminIntegrationsGithubAppSettings(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsAdminGetGitHubAppSettingsOutput + var out models.EndpointsWorkspaceEntraSSOPolicyOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminIntegrationsJenkinsInput is the input for DeleteAdminIntegrationsJenkins — Delete Jenkins Integration. -type DeleteAdminIntegrationsJenkinsInput struct { +// UpdateAdminIdentityEntraPolicyInput is the input for UpdateAdminIdentityEntraPolicy — Create Interactor []. +type UpdateAdminIdentityEntraPolicyInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedUpdatedAt string `json:"expectedUpdatedAt"` + Reason string `json:"reason"` + Required *bool `json:"required,omitempty"` models.RequestScope } -// DeleteAdminIntegrationsJenkins - Delete Jenkins Integration -// DELETE /admin/integrations/jenkins -func (c *Client) DeleteAdminIntegrationsJenkins(ctx context.Context, in DeleteAdminIntegrationsJenkinsInput) (*models.EndpointsDeleteJenkinsIntegrationOutput, error) { - path := "/admin/integrations/jenkins" +// UpdateAdminIdentityEntraPolicy - Create Interactor [] +// PUT /admin/identity/entra/policy +func (c *Client) UpdateAdminIdentityEntraPolicy(ctx context.Context, in UpdateAdminIdentityEntraPolicyInput) (*models.EndpointsWorkspaceEntraSSOPolicyOutput, error) { + path := "/admin/identity/entra/policy" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1498,31 +1617,49 @@ func (c *Client) DeleteAdminIntegrationsJenkins(ctx context.Context, in DeleteAd fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedUpdatedAt string `json:"expectedUpdatedAt"` + Reason string `json:"reason"` + Required *bool `json:"required,omitempty"` + }{ + DryRun: in.DryRun, + ExpectedUpdatedAt: in.ExpectedUpdatedAt, + Reason: in.Reason, + Required: in.Required, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsDeleteJenkinsIntegrationOutput + var out models.EndpointsWorkspaceEntraSSOPolicyOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsJenkinsInput is the input for ListAdminIntegrationsJenkins — Get Jenkins Integration Status. -type ListAdminIntegrationsJenkinsInput struct { +// CreateAdminIdentityEntraSignInInput is the input for CreateAdminIdentityEntraSignIn — Record a Microsoft sign-in. +type CreateAdminIdentityEntraSignInInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsJenkins - Get Jenkins Integration Status -// GET /admin/integrations/jenkins -func (c *Client) ListAdminIntegrationsJenkins(ctx context.Context, in ListAdminIntegrationsJenkinsInput) (*models.EndpointsGetJenkinsIntegrationOutput, error) { - path := "/admin/integrations/jenkins" +// CreateAdminIdentityEntraSignIn - Record a Microsoft sign-in +// POST /admin/identity/entra/sign-in +func (c *Client) CreateAdminIdentityEntraSignIn(ctx context.Context, in CreateAdminIdentityEntraSignInInput) (*models.EndpointsIdentityEntraSignInPostOutput, error) { + path := "/admin/identity/entra/sign-in" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1530,34 +1667,35 @@ func (c *Client) ListAdminIntegrationsJenkins(ctx context.Context, in ListAdminI fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetJenkinsIntegrationOutput + var out models.EndpointsIdentityEntraSignInPostOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsJenkinsTokenInput is the input for CreateAdminIntegrationsJenkinsToken — Set Jenkins API Token. -type CreateAdminIntegrationsJenkinsTokenInput struct { - ApiToken string `json:"apiToken"` - URL string `json:"url"` - Username string `json:"username"` +// ListAdminIdentityScimInput is the input for ListAdminIdentityScim — Get SCIM Identity Settings. +type ListAdminIdentityScimInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsJenkinsToken - Set Jenkins API Token -// POST /admin/integrations/jenkins/token -func (c *Client) CreateAdminIntegrationsJenkinsToken(ctx context.Context, in CreateAdminIntegrationsJenkinsTokenInput) (*models.EndpointsPostJenkinsTokenOutput, error) { - path := "/admin/integrations/jenkins/token" +// ListAdminIdentityScim - Get SCIM Identity Settings +// GET /admin/identity/scim +func (c *Client) ListAdminIdentityScim(ctx context.Context, in ListAdminIdentityScimInput) (*models.EndpointsGetIdentityScimOutput, error) { + path := "/admin/identity/scim" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1565,43 +1703,35 @@ func (c *Client) CreateAdminIntegrationsJenkinsToken(ctx context.Context, in Cre fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - ApiToken string `json:"apiToken"` - URL string `json:"url"` - Username string `json:"username"` - }{ - ApiToken: in.ApiToken, - URL: in.URL, - Username: in.Username, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostJenkinsTokenOutput + var out models.EndpointsGetIdentityScimOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsJiraInput is the input for ListAdminIntegrationsJira — Get Jira Configuration. -type ListAdminIntegrationsJiraInput struct { +// CreateAdminIdentityScimCredentialsInput is the input for CreateAdminIdentityScimCredentials — Create SCIM Credential. +type CreateAdminIdentityScimCredentialsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsJira - Get Jira Configuration -// GET /admin/integrations/jira -func (c *Client) ListAdminIntegrationsJira(ctx context.Context, in ListAdminIntegrationsJiraInput) (*models.EndpointsAdminGetJiraConfigOutput, error) { - path := "/admin/integrations/jira" +// CreateAdminIdentityScimCredentials - Create SCIM Credential +// POST /admin/identity/scim/credentials +func (c *Client) CreateAdminIdentityScimCredentials(ctx context.Context, in CreateAdminIdentityScimCredentialsInput) (*models.EndpointsPostIdentityScimCredentialOutput, error) { + path := "/admin/identity/scim/credentials" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1609,35 +1739,37 @@ func (c *Client) ListAdminIntegrationsJira(ctx context.Context, in ListAdminInte fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminGetJiraConfigOutput + var out models.EndpointsPostIdentityScimCredentialOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsJiraInput is the input for CreateAdminIntegrationsJira — Update Jira Configuration. -type CreateAdminIntegrationsJiraInput struct { - AutoCreate bool `json:"autoCreate"` - IssueType string `json:"issueType"` - ProjectKey string `json:"projectKey"` - SeverityThreshold string `json:"severityThreshold"` +// DeleteAdminIdentityScimCredentialsIdInput is the input for DeleteAdminIdentityScimCredentialsId — Revoke SCIM Credential. +type DeleteAdminIdentityScimCredentialsIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsJira - Update Jira Configuration -// POST /admin/integrations/jira -func (c *Client) CreateAdminIntegrationsJira(ctx context.Context, in CreateAdminIntegrationsJiraInput) (*models.EndpointsUpdateJiraConfigOutput, error) { - path := "/admin/integrations/jira" +// DeleteAdminIdentityScimCredentialsId - Revoke SCIM Credential +// DELETE /admin/identity/scim/credentials/{id} +func (c *Client) DeleteAdminIdentityScimCredentialsId(ctx context.Context, in DeleteAdminIdentityScimCredentialsIdInput) (*models.EndpointsDeleteIdentityScimCredentialOutput, error) { + path := "/admin/identity/scim/credentials/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1645,45 +1777,35 @@ func (c *Client) CreateAdminIntegrationsJira(ctx context.Context, in CreateAdmin fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - AutoCreate bool `json:"autoCreate"` - IssueType string `json:"issueType"` - ProjectKey string `json:"projectKey"` - SeverityThreshold string `json:"severityThreshold"` - }{ - AutoCreate: in.AutoCreate, - IssueType: in.IssueType, - ProjectKey: in.ProjectKey, - SeverityThreshold: in.SeverityThreshold, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsUpdateJiraConfigOutput + var out models.EndpointsDeleteIdentityScimCredentialOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsLinearInstallInput is the input for ListAdminIntegrationsLinearInstall — Start Linear OAuth install. -type ListAdminIntegrationsLinearInstallInput struct { +// ListAdminInstallationsInput is the input for ListAdminInstallations — Get App Installations. +type ListAdminInstallationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsLinearInstall - Start Linear OAuth install -// GET /admin/integrations/linear/install -func (c *Client) ListAdminIntegrationsLinearInstall(ctx context.Context, in ListAdminIntegrationsLinearInstallInput) (*models.EndpointsGetLinearInstallOutput, error) { - path := "/admin/integrations/linear/install" +// ListAdminInstallations - Get App Installations +// GET /admin/installations +func (c *Client) ListAdminInstallations(ctx context.Context, in ListAdminInstallationsInput) (*models.EndpointsAdminGetUserInstallationsOutput, error) { + path := "/admin/installations" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1695,27 +1817,31 @@ func (c *Client) ListAdminIntegrationsLinearInstall(ctx context.Context, in List if err != nil { return nil, err } - var out models.EndpointsGetLinearInstallOutput + var out models.EndpointsAdminGetUserInstallationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsLinearOauthInput is the input for ListAdminIntegrationsLinearOauth — Get Linear OAuth install status. -type ListAdminIntegrationsLinearOauthInput struct { +// ListAdminIntegrationsAsanaOauthInput is the input for ListAdminIntegrationsAsanaOauth — Get Asana install status. +type ListAdminIntegrationsAsanaOauthInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsLinearOauth - Get Linear OAuth install status -// GET /admin/integrations/linear/oauth -func (c *Client) ListAdminIntegrationsLinearOauth(ctx context.Context, in ListAdminIntegrationsLinearOauthInput) (*models.EndpointsGetLinearOAuthStatusOutput, error) { - path := "/admin/integrations/linear/oauth" +// ListAdminIntegrationsAsanaOauth - Get Asana install status +// GET /admin/integrations/asana/oauth +func (c *Client) ListAdminIntegrationsAsanaOauth(ctx context.Context, in ListAdminIntegrationsAsanaOauthInput) (*models.EndpointsGetAsanaStatusOutput, error) { + path := "/admin/integrations/asana/oauth" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1727,27 +1853,35 @@ func (c *Client) ListAdminIntegrationsLinearOauth(ctx context.Context, in ListAd if err != nil { return nil, err } - var out models.EndpointsGetLinearOAuthStatusOutput + var out models.EndpointsGetAsanaStatusOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsNotificationsInput is the input for ListAdminIntegrationsNotifications — Get Notification Config. -type ListAdminIntegrationsNotificationsInput struct { +// CreateAdminIntegrationsAsanaTicketConfigInput is the input for CreateAdminIntegrationsAsanaTicketConfig — Set Asana Ticket Configuration. +type CreateAdminIntegrationsAsanaTicketConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AccessToken string `json:"accessToken"` + ProjectGid string `json:"projectGid"` + WorkspaceID string `json:"workspaceId"` + WorkspaceName *string `json:"workspaceName,omitempty"` models.RequestScope } -// ListAdminIntegrationsNotifications - Get Notification Config -// GET /admin/integrations/notifications -func (c *Client) ListAdminIntegrationsNotifications(ctx context.Context, in ListAdminIntegrationsNotificationsInput) (*models.EndpointsGetAdminNotificationConfigOutput, error) { - path := "/admin/integrations/notifications" +// CreateAdminIntegrationsAsanaTicketConfig - Set Asana Ticket Configuration +// POST /admin/integrations/asana/ticket-config +func (c *Client) CreateAdminIntegrationsAsanaTicketConfig(ctx context.Context, in CreateAdminIntegrationsAsanaTicketConfigInput) (*models.EndpointsAdminPostAsanaTicketConfigOutput, error) { + path := "/admin/integrations/asana/ticket-config" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1755,32 +1889,49 @@ func (c *Client) ListAdminIntegrationsNotifications(ctx context.Context, in List fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + AccessToken string `json:"accessToken"` + ProjectGid string `json:"projectGid"` + WorkspaceID string `json:"workspaceId"` + WorkspaceName *string `json:"workspaceName,omitempty"` + }{ + AccessToken: in.AccessToken, + ProjectGid: in.ProjectGid, + WorkspaceID: in.WorkspaceID, + WorkspaceName: in.WorkspaceName, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetAdminNotificationConfigOutput + var out models.EndpointsAdminPostAsanaTicketConfigOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// UpdateAdminIntegrationsNotificationsInput is the input for UpdateAdminIntegrationsNotifications — Put Notification Config. -type UpdateAdminIntegrationsNotificationsInput struct { - Notifications []models.ModelsNotification `json:"notifications,omitempty"` +// ListAdminIntegrationsAtlassianInput is the input for ListAdminIntegrationsAtlassian — Get Atlassian integration. +type ListAdminIntegrationsAtlassianInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// UpdateAdminIntegrationsNotifications - Put Notification Config -// PUT /admin/integrations/notifications -func (c *Client) UpdateAdminIntegrationsNotifications(ctx context.Context, in UpdateAdminIntegrationsNotificationsInput) (*models.EndpointsPutAdminNotificationConfigOutput, error) { - path := "/admin/integrations/notifications" +// ListAdminIntegrationsAtlassian - Get Atlassian integration +// GET /admin/integrations/atlassian +func (c *Client) ListAdminIntegrationsAtlassian(ctx context.Context, in ListAdminIntegrationsAtlassianInput) (*models.EndpointsGetAtlassianInstallationOutput, error) { + path := "/admin/integrations/atlassian" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1788,39 +1939,37 @@ func (c *Client) UpdateAdminIntegrationsNotifications(ctx context.Context, in Up fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Notifications []models.ModelsNotification `json:"notifications,omitempty"` - }{ - Notifications: in.Notifications, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPutAdminNotificationConfigOutput + var out models.EndpointsGetAtlassianInstallationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsSlackInput is the input for ListAdminIntegrationsSlack — Get Slack Configuration. -type ListAdminIntegrationsSlackInput struct { +// CreateAdminIntegrationsAtlassianInput is the input for CreateAdminIntegrationsAtlassian — Update Atlassian integration choices. +type CreateAdminIntegrationsAtlassianInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InstallationID *string `json:"installationId,omitempty"` + Settings *models.ModelsForgeProductSettings `json:"settings,omitempty"` models.RequestScope } -// ListAdminIntegrationsSlack - Get Slack Configuration -// GET /admin/integrations/slack -func (c *Client) ListAdminIntegrationsSlack(ctx context.Context, in ListAdminIntegrationsSlackInput) (*models.EndpointsGetSlackConfigOutput, error) { - path := "/admin/integrations/slack" +// CreateAdminIntegrationsAtlassian - Update Atlassian integration choices +// POST /admin/integrations/atlassian +func (c *Client) CreateAdminIntegrationsAtlassian(ctx context.Context, in CreateAdminIntegrationsAtlassianInput) (*models.EndpointsPostAtlassianSettingsOutput, error) { + path := "/admin/integrations/atlassian" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1828,31 +1977,45 @@ func (c *Client) ListAdminIntegrationsSlack(ctx context.Context, in ListAdminInt fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + InstallationID *string `json:"installationId,omitempty"` + Settings *models.ModelsForgeProductSettings `json:"settings,omitempty"` + }{ + InstallationID: in.InstallationID, + Settings: in.Settings, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetSlackConfigOutput + var out models.EndpointsPostAtlassianSettingsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsSlackInstallInput is the input for ListAdminIntegrationsSlackInstall — Start Slack distributed install. -type ListAdminIntegrationsSlackInstallInput struct { +// ListAdminIntegrationsAzureInput is the input for ListAdminIntegrationsAzure — Get Azure Configuration. +type ListAdminIntegrationsAzureInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsSlackInstall - Start Slack distributed install -// GET /admin/integrations/slack/install -func (c *Client) ListAdminIntegrationsSlackInstall(ctx context.Context, in ListAdminIntegrationsSlackInstallInput) (*models.EndpointsGetSlackDistributedInstallOutput, error) { - path := "/admin/integrations/slack/install" +// ListAdminIntegrationsAzure - Get Azure Configuration +// GET /admin/integrations/azure +func (c *Client) ListAdminIntegrationsAzure(ctx context.Context, in ListAdminIntegrationsAzureInput) (*models.EndpointsAdminGetAzureConfigOutput, error) { + path := "/admin/integrations/azure" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1864,28 +2027,39 @@ func (c *Client) ListAdminIntegrationsSlackInstall(ctx context.Context, in ListA if err != nil { return nil, err } - var out models.EndpointsGetSlackDistributedInstallOutput + var out models.EndpointsAdminGetAzureConfigOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminIntegrationsSlackKeyInput is the input for CreateAdminIntegrationsSlackKey — Set Slack API Key. -type CreateAdminIntegrationsSlackKeyInput struct { - ApiKey string `json:"apiKey"` +// CreateAdminIntegrationsAzureInput is the input for CreateAdminIntegrationsAzure — Repair Azure DevOps Service Hooks. +type CreateAdminIntegrationsAzureInput struct { + DryRun *bool `url:"dryRun,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Reconcile *bool `url:"reconcile,omitempty" json:"-"` models.RequestScope } -// CreateAdminIntegrationsSlackKey - Set Slack API Key -// POST /admin/integrations/slack/key -func (c *Client) CreateAdminIntegrationsSlackKey(ctx context.Context, in CreateAdminIntegrationsSlackKeyInput) (*models.EndpointsPostSlackAPIKeyOutput, error) { - path := "/admin/integrations/slack/key" +// CreateAdminIntegrationsAzure - Repair Azure DevOps Service Hooks +// POST /admin/integrations/azure +func (c *Client) CreateAdminIntegrationsAzure(ctx context.Context, in CreateAdminIntegrationsAzureInput) (*models.EndpointsAdminPostAzureInstallOutput, error) { + path := "/admin/integrations/azure" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Reconcile != nil { + query.Set("reconcile", strconv.FormatBool(*in.Reconcile)) + } + if in.DryRun != nil { + query.Set("dryRun", strconv.FormatBool(*in.DryRun)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1893,42 +2067,39 @@ func (c *Client) CreateAdminIntegrationsSlackKey(ctx context.Context, in CreateA fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - ApiKey string `json:"apiKey"` - }{ - ApiKey: in.ApiKey, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostSlackAPIKeyOutput + var out models.EndpointsAdminPostAzureInstallOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsTeamsInput is the input for ListAdminIntegrationsTeams — Get Integration Teams. -type ListAdminIntegrationsTeamsInput struct { - Provider *string `url:"provider,omitempty" json:"-"` +// CreateAdminIntegrationsAzureCodeownersPreviewInput is the input for CreateAdminIntegrationsAzureCodeownersPreview — Preview CODEOWNERS as Azure DevOps required-reviewer policies. +type CreateAdminIntegrationsAzureCodeownersPreviewInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationID string `json:"organizationId"` + Path *string `json:"path,omitempty"` + ProjectID string `json:"projectId"` + Ref *string `json:"ref,omitempty"` + RepositoryID string `json:"repositoryId"` models.RequestScope } -// ListAdminIntegrationsTeams - Get Integration Teams -// GET /admin/integrations/teams -func (c *Client) ListAdminIntegrationsTeams(ctx context.Context, in ListAdminIntegrationsTeamsInput) (*models.EndpointsAdminGetIntegrationTeamsOutput, error) { - path := "/admin/integrations/teams" +// CreateAdminIntegrationsAzureCodeownersPreview - Preview CODEOWNERS as Azure DevOps required-reviewer policies +// POST /admin/integrations/azure/codeowners/preview +func (c *Client) CreateAdminIntegrationsAzureCodeownersPreview(ctx context.Context, in CreateAdminIntegrationsAzureCodeownersPreviewInput) (*models.EndpointsAdminPostAzureCodeownersPreviewOutput, error) { + path := "/admin/integrations/azure/codeowners/preview" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Provider != nil { - query.Set("provider", string(*in.Provider)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1937,34 +2108,54 @@ func (c *Client) ListAdminIntegrationsTeams(ctx context.Context, in ListAdminInt fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + OrganizationID string `json:"organizationId"` + Path *string `json:"path,omitempty"` + ProjectID string `json:"projectId"` + Ref *string `json:"ref,omitempty"` + RepositoryID string `json:"repositoryId"` + }{ + OrganizationID: in.OrganizationID, + Path: in.Path, + ProjectID: in.ProjectID, + Ref: in.Ref, + RepositoryID: in.RepositoryID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminGetIntegrationTeamsOutput + var out models.EndpointsAdminPostAzureCodeownersPreviewOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminIntegrationsUsersInput is the input for ListAdminIntegrationsUsers — Get Integration Users. -type ListAdminIntegrationsUsersInput struct { - Provider *string `url:"provider,omitempty" json:"-"` +// DeleteAdminIntegrationsAzureConnectInput is the input for DeleteAdminIntegrationsAzureConnect — Disconnect an Azure DevOps organization. +type DeleteAdminIntegrationsAzureConnectInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationID *string `url:"organizationId,omitempty" json:"-"` models.RequestScope } -// ListAdminIntegrationsUsers - Get Integration Users -// GET /admin/integrations/users -func (c *Client) ListAdminIntegrationsUsers(ctx context.Context, in ListAdminIntegrationsUsersInput) (*models.EndpointsAdminGetIntegrationUsersOutput, error) { - path := "/admin/integrations/users" +// DeleteAdminIntegrationsAzureConnect - Disconnect an Azure DevOps organization +// DELETE /admin/integrations/azure/connect +func (c *Client) DeleteAdminIntegrationsAzureConnect(ctx context.Context, in DeleteAdminIntegrationsAzureConnectInput) (*models.EndpointsAdminDeleteAzureConnectOutput, error) { + path := "/admin/integrations/azure/connect" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Provider != nil { - query.Set("provider", string(*in.Provider)) + if in.OrganizationID != nil { + query.Set("organizationId", string(*in.OrganizationID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1973,32 +2164,42 @@ func (c *Client) ListAdminIntegrationsUsers(ctx context.Context, in ListAdminInt fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminGetIntegrationUsersOutput + var out models.EndpointsAdminDeleteAzureConnectOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminMetricsFindingsInput is the input for CreateAdminMetricsFindings — Post Findings Metrics. -type CreateAdminMetricsFindingsInput struct { - Query models.ModelsLimitedUnifiedFindingsQuery `json:"query"` +// CreateAdminIntegrationsAzureConnectInput is the input for CreateAdminIntegrationsAzureConnect — Start Azure DevOps connect. +type CreateAdminIntegrationsAzureConnectInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AlsoEnableSignIn *bool `json:"alsoEnableSignIn,omitempty"` + EnableBuildGate *bool `json:"enableBuildGate,omitempty"` + EnableWorkItems *bool `json:"enableWorkItems,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + ReauthorizeHandle *string `json:"reauthorizeHandle,omitempty"` + RequestAdminConsent *bool `json:"requestAdminConsent,omitempty"` + ReturnPath *string `json:"returnPath,omitempty"` models.RequestScope } -// CreateAdminMetricsFindings - Post Findings Metrics -// POST /admin/metrics/findings -func (c *Client) CreateAdminMetricsFindings(ctx context.Context, in CreateAdminMetricsFindingsInput) (*models.EndpointsAdminQueryFindingsMetricsOutput, error) { - path := "/admin/metrics/findings" +// CreateAdminIntegrationsAzureConnect - Start Azure DevOps connect +// POST /admin/integrations/azure/connect +func (c *Client) CreateAdminIntegrationsAzureConnect(ctx context.Context, in CreateAdminIntegrationsAzureConnectInput) (*models.EndpointsAdminPostAzureConnectOutput, error) { + path := "/admin/integrations/azure/connect" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2007,9 +2208,21 @@ func (c *Client) CreateAdminMetricsFindings(ctx context.Context, in CreateAdminM } bodyBytes, err := json.Marshal(struct { - Query models.ModelsLimitedUnifiedFindingsQuery `json:"query"` + AlsoEnableSignIn *bool `json:"alsoEnableSignIn,omitempty"` + EnableBuildGate *bool `json:"enableBuildGate,omitempty"` + EnableWorkItems *bool `json:"enableWorkItems,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + ReauthorizeHandle *string `json:"reauthorizeHandle,omitempty"` + RequestAdminConsent *bool `json:"requestAdminConsent,omitempty"` + ReturnPath *string `json:"returnPath,omitempty"` }{ - Query: in.Query, + AlsoEnableSignIn: in.AlsoEnableSignIn, + EnableBuildGate: in.EnableBuildGate, + EnableWorkItems: in.EnableWorkItems, + OrganizationName: in.OrganizationName, + ReauthorizeHandle: in.ReauthorizeHandle, + RequestAdminConsent: in.RequestAdminConsent, + ReturnPath: in.ReturnPath, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2018,27 +2231,33 @@ func (c *Client) CreateAdminMetricsFindings(ctx context.Context, in CreateAdminM if err != nil { return nil, err } - var out models.EndpointsAdminQueryFindingsMetricsOutput + var out models.EndpointsAdminPostAzureConnectOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminMetricsInteractionsInput is the input for ListAdminMetricsInteractions — Get Interactions. -type ListAdminMetricsInteractionsInput struct { +// ListAdminIntegrationsAzureConnectHandleInput is the input for ListAdminIntegrationsAzureConnectHandle — Get Azure DevOps connect status. +type ListAdminIntegrationsAzureConnectHandleInput struct { + Handle string `path:"handle" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminMetricsInteractions - Get Interactions -// GET /admin/metrics/interactions -func (c *Client) ListAdminMetricsInteractions(ctx context.Context, in ListAdminMetricsInteractionsInput) (*models.EndpointsAdminBotInteractionsOutput, error) { - path := "/admin/metrics/interactions" +// ListAdminIntegrationsAzureConnectHandle - Get Azure DevOps connect status +// GET /admin/integrations/azure/connect/{handle} +func (c *Client) ListAdminIntegrationsAzureConnectHandle(ctx context.Context, in ListAdminIntegrationsAzureConnectHandleInput) (*models.EndpointsAdminGetAzureConnectStatusOutput, error) { + path := "/admin/integrations/azure/connect/{handle}" + path = strings.Replace(path, "{handle}", url.PathEscape(in.Handle), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2050,31 +2269,34 @@ func (c *Client) ListAdminMetricsInteractions(ctx context.Context, in ListAdminM if err != nil { return nil, err } - var out models.EndpointsAdminBotInteractionsOutput + var out models.EndpointsAdminGetAzureConnectStatusOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminMetricsOverTimeInput is the input for CreateAdminMetricsOverTime — Get Metrics Over Time. -type CreateAdminMetricsOverTimeInput struct { - Resolution *string `url:"resolution,omitempty" json:"-"` - Query models.ModelsUnifiedFindingsQuery `json:"query"` +// CreateAdminIntegrationsAzureConnectHandleConfirmInput is the input for CreateAdminIntegrationsAzureConnectHandleConfirm — Confirm Azure DevOps connect. +type CreateAdminIntegrationsAzureConnectHandleConfirmInput struct { + Handle string `path:"handle" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationIds []string `json:"organizationIds,omitempty"` + Projects string `json:"projects"` models.RequestScope } -// CreateAdminMetricsOverTime - Get Metrics Over Time -// POST /admin/metrics/over-time -func (c *Client) CreateAdminMetricsOverTime(ctx context.Context, in CreateAdminMetricsOverTimeInput) (*models.EndpointsQueryMetricsOverTimeOutput, error) { - path := "/admin/metrics/over-time" +// CreateAdminIntegrationsAzureConnectHandleConfirm - Confirm Azure DevOps connect +// POST /admin/integrations/azure/connect/{handle}/confirm +func (c *Client) CreateAdminIntegrationsAzureConnectHandleConfirm(ctx context.Context, in CreateAdminIntegrationsAzureConnectHandleConfirmInput) (*models.EndpointsAdminPostAzureConnectConfirmOutput, error) { + path := "/admin/integrations/azure/connect/{handle}/confirm" + path = strings.Replace(path, "{handle}", url.PathEscape(in.Handle), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Resolution != nil { - query.Set("resolution", string(*in.Resolution)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2084,9 +2306,11 @@ func (c *Client) CreateAdminMetricsOverTime(ctx context.Context, in CreateAdminM } bodyBytes, err := json.Marshal(struct { - Query models.ModelsUnifiedFindingsQuery `json:"query"` + OrganizationIds []string `json:"organizationIds,omitempty"` + Projects string `json:"projects"` }{ - Query: in.Query, + OrganizationIds: in.OrganizationIds, + Projects: in.Projects, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2095,28 +2319,33 @@ func (c *Client) CreateAdminMetricsOverTime(ctx context.Context, in CreateAdminM if err != nil { return nil, err } - var out models.EndpointsQueryMetricsOverTimeOutput + var out models.EndpointsAdminPostAzureConnectConfirmOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminMetricsOverviewInput is the input for CreateAdminMetricsOverview — Query Overview. -type CreateAdminMetricsOverviewInput struct { - Query models.ModelsUnifiedFindingsQuery `json:"query"` +// CreateAdminIntegrationsAzureConnectHandleRecheckInput is the input for CreateAdminIntegrationsAzureConnectHandleRecheck — Recheck Azure DevOps permissions. +type CreateAdminIntegrationsAzureConnectHandleRecheckInput struct { + Handle string `path:"handle" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminMetricsOverview - Query Overview -// POST /admin/metrics/overview -func (c *Client) CreateAdminMetricsOverview(ctx context.Context, in CreateAdminMetricsOverviewInput) (*models.EndpointsQueryOverviewOutput, error) { - path := "/admin/metrics/overview" +// CreateAdminIntegrationsAzureConnectHandleRecheck - Recheck Azure DevOps permissions +// POST /admin/integrations/azure/connect/{handle}/recheck +func (c *Client) CreateAdminIntegrationsAzureConnectHandleRecheck(ctx context.Context, in CreateAdminIntegrationsAzureConnectHandleRecheckInput) (*models.EndpointsAdminGetAzureConnectStatusOutput, error) { + path := "/admin/integrations/azure/connect/{handle}/recheck" + path = strings.Replace(path, "{handle}", url.PathEscape(in.Handle), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2124,40 +2353,38 @@ func (c *Client) CreateAdminMetricsOverview(ctx context.Context, in CreateAdminM fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Query models.ModelsUnifiedFindingsQuery `json:"query"` - }{ - Query: in.Query, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsQueryOverviewOutput + var out models.EndpointsAdminGetAzureConnectStatusOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminMetricsRawInput is the input for CreateAdminMetricsRaw — Query Raw Metrics. -type CreateAdminMetricsRawInput struct { - Query models.ModelsUnifiedFindingsMetricsQuery `json:"query"` +// CreateAdminIntegrationsAzureConnectHandleRetryInput is the input for CreateAdminIntegrationsAzureConnectHandleRetry — Retry Azure DevOps connect. +type CreateAdminIntegrationsAzureConnectHandleRetryInput struct { + Handle string `path:"handle" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationID string `json:"organizationId"` models.RequestScope } -// CreateAdminMetricsRaw - Query Raw Metrics -// POST /admin/metrics/raw -func (c *Client) CreateAdminMetricsRaw(ctx context.Context, in CreateAdminMetricsRawInput) (*models.EndpointsQueryMetricsRawOutput, error) { - path := "/admin/metrics/raw" +// CreateAdminIntegrationsAzureConnectHandleRetry - Retry Azure DevOps connect +// POST /admin/integrations/azure/connect/{handle}/retry +func (c *Client) CreateAdminIntegrationsAzureConnectHandleRetry(ctx context.Context, in CreateAdminIntegrationsAzureConnectHandleRetryInput) (*models.EndpointsAdminPostAzureConnectRetryOutput, error) { + path := "/admin/integrations/azure/connect/{handle}/retry" + path = strings.Replace(path, "{handle}", url.PathEscape(in.Handle), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2166,9 +2393,9 @@ func (c *Client) CreateAdminMetricsRaw(ctx context.Context, in CreateAdminMetric } bodyBytes, err := json.Marshal(struct { - Query models.ModelsUnifiedFindingsMetricsQuery `json:"query"` + OrganizationID string `json:"organizationId"` }{ - Query: in.Query, + OrganizationID: in.OrganizationID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2177,50 +2404,36 @@ func (c *Client) CreateAdminMetricsRaw(ctx context.Context, in CreateAdminMetric if err != nil { return nil, err } - var out models.EndpointsQueryMetricsRawOutput + var out models.EndpointsAdminPostAzureConnectRetryOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminMetricsUsageAggregateInput is the input for ListAdminMetricsUsageAggregate — Usage Aggregate. -type ListAdminMetricsUsageAggregateInput struct { - Agent *string `url:"agent,omitempty" json:"-"` - BranchType *string `url:"branchType,omitempty" json:"-"` - Class *string `url:"class,omitempty" json:"-"` - From *string `url:"from,omitempty" json:"-"` - To *string `url:"to,omitempty" json:"-"` - Window *string `url:"window,omitempty" json:"-"` +// CreateAdminIntegrationsAzureCredentialsInput is the input for CreateAdminIntegrationsAzureCredentials — Set Azure Credentials. +type CreateAdminIntegrationsAzureCredentialsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ClientID string `json:"clientId"` + ClientSecret *string `json:"clientSecret,omitempty"` + Organization *string `json:"organization,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + TenantID string `json:"tenantId"` + WorkItemType *string `json:"workItemType,omitempty"` models.RequestScope } -// ListAdminMetricsUsageAggregate - Usage Aggregate -// GET /admin/metrics/usage/aggregate -func (c *Client) ListAdminMetricsUsageAggregate(ctx context.Context, in ListAdminMetricsUsageAggregateInput) (*models.EndpointsAdminUsageMetricsAggregateOutput, error) { - path := "/admin/metrics/usage/aggregate" +// CreateAdminIntegrationsAzureCredentials - Set Azure Credentials +// POST /admin/integrations/azure/credentials +func (c *Client) CreateAdminIntegrationsAzureCredentials(ctx context.Context, in CreateAdminIntegrationsAzureCredentialsInput) (*models.EndpointsAdminPostAzureCredentialsOutput, error) { + path := "/admin/integrations/azure/credentials" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Window != nil { - query.Set("window", string(*in.Window)) - } - if in.Class != nil { - query.Set("class", string(*in.Class)) - } - if in.Agent != nil { - query.Set("agent", string(*in.Agent)) - } - if in.BranchType != nil { - query.Set("branchType", string(*in.BranchType)) - } - if in.From != nil { - query.Set("from", string(*in.From)) - } - if in.To != nil { - query.Set("to", string(*in.To)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2229,66 +2442,60 @@ func (c *Client) ListAdminMetricsUsageAggregate(ctx context.Context, in ListAdmi fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ClientID string `json:"clientId"` + ClientSecret *string `json:"clientSecret,omitempty"` + Organization *string `json:"organization,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + TenantID string `json:"tenantId"` + WorkItemType *string `json:"workItemType,omitempty"` + }{ + ClientID: in.ClientID, + ClientSecret: in.ClientSecret, + Organization: in.Organization, + ProjectName: in.ProjectName, + TenantID: in.TenantID, + WorkItemType: in.WorkItemType, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminUsageMetricsAggregateOutput + var out models.EndpointsAdminPostAzureCredentialsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminMetricsUsageLedgerInput is the input for ListAdminMetricsUsageLedger — Usage Ledger. -type ListAdminMetricsUsageLedgerInput struct { - Agent *string `url:"agent,omitempty" json:"-"` - BranchType *string `url:"branchType,omitempty" json:"-"` - Class *string `url:"class,omitempty" json:"-"` - Cursor *string `url:"cursor,omitempty" json:"-"` - FindingID []string `url:"findingId,omitempty" json:"-"` - From *string `url:"from,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - RunID *string `url:"runId,omitempty" json:"-"` - To *string `url:"to,omitempty" json:"-"` +// DeleteAdminIntegrationsAzureInstallationsInput is the input for DeleteAdminIntegrationsAzureInstallations — Delete Azure DevOps webhook installation. +type DeleteAdminIntegrationsAzureInstallationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationID *string `url:"organizationId,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` models.RequestScope } -// ListAdminMetricsUsageLedger - Usage Ledger -// GET /admin/metrics/usage/ledger -func (c *Client) ListAdminMetricsUsageLedger(ctx context.Context, in ListAdminMetricsUsageLedgerInput) (*models.EndpointsAdminUsageLedgerResponse, error) { - path := "/admin/metrics/usage/ledger" +// DeleteAdminIntegrationsAzureInstallations - Delete Azure DevOps webhook installation +// DELETE /admin/integrations/azure/installations +func (c *Client) DeleteAdminIntegrationsAzureInstallations(ctx context.Context, in DeleteAdminIntegrationsAzureInstallationsInput) (*models.EndpointsAdminDeleteAzureInstallationOutput, error) { + path := "/admin/integrations/azure/installations" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Class != nil { - query.Set("class", string(*in.Class)) - } - if in.Agent != nil { - query.Set("agent", string(*in.Agent)) - } - if in.BranchType != nil { - query.Set("branchType", string(*in.BranchType)) - } - if in.RunID != nil { - query.Set("runId", string(*in.RunID)) - } - for _, v := range in.FindingID { - query.Add("findingId", string(v)) - } - if in.From != nil { - query.Set("from", string(*in.From)) - } - if in.To != nil { - query.Set("to", string(*in.To)) + if in.OrganizationID != nil { + query.Set("organizationId", string(*in.OrganizationID)) } - if in.Cursor != nil { - query.Set("cursor", string(*in.Cursor)) + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2297,50 +2504,34 @@ func (c *Client) ListAdminMetricsUsageLedger(ctx context.Context, in ListAdminMe fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminUsageLedgerResponse + var out models.EndpointsAdminDeleteAzureInstallationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminMetricsUsageTimeseriesInput is the input for ListAdminMetricsUsageTimeseries — Usage Timeseries. -type ListAdminMetricsUsageTimeseriesInput struct { - Agent *string `url:"agent,omitempty" json:"-"` - Class *string `url:"class,omitempty" json:"-"` - From *string `url:"from,omitempty" json:"-"` - Granularity *string `url:"granularity,omitempty" json:"-"` - To *string `url:"to,omitempty" json:"-"` +// ListAdminIntegrationsAzureInstallationsInput is the input for ListAdminIntegrationsAzureInstallations — List Azure DevOps webhook installations. +type ListAdminIntegrationsAzureInstallationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminMetricsUsageTimeseries - Usage Timeseries -// GET /admin/metrics/usage/timeseries -func (c *Client) ListAdminMetricsUsageTimeseries(ctx context.Context, in ListAdminMetricsUsageTimeseriesInput) (*models.EndpointsAdminUsageMetricsTimeseriesOutput, error) { - path := "/admin/metrics/usage/timeseries" +// ListAdminIntegrationsAzureInstallations - List Azure DevOps webhook installations +// GET /admin/integrations/azure/installations +func (c *Client) ListAdminIntegrationsAzureInstallations(ctx context.Context, in ListAdminIntegrationsAzureInstallationsInput) (*models.EndpointsAdminListAzureInstallationsOutput, error) { + path := "/admin/integrations/azure/installations" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Granularity != nil { - query.Set("granularity", string(*in.Granularity)) - } - if in.From != nil { - query.Set("from", string(*in.From)) - } - if in.To != nil { - query.Set("to", string(*in.To)) - } - if in.Class != nil { - query.Set("class", string(*in.Class)) - } - if in.Agent != nil { - query.Set("agent", string(*in.Agent)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2353,27 +2544,33 @@ func (c *Client) ListAdminMetricsUsageTimeseries(ctx context.Context, in ListAdm if err != nil { return nil, err } - var out models.EndpointsAdminUsageMetricsTimeseriesOutput + var out models.EndpointsAdminListAzureInstallationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminOrganizationInput is the input for ListAdminOrganization — Get Organization. -type ListAdminOrganizationInput struct { +// CreateAdminIntegrationsAzureInstallationsInput is the input for CreateAdminIntegrationsAzureInstallations — Register Azure DevOps webhook installation. +type CreateAdminIntegrationsAzureInstallationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationID string `json:"organizationId"` + ProjectID string `json:"projectId"` models.RequestScope } -// ListAdminOrganization - Get Organization -// GET /admin/organization -func (c *Client) ListAdminOrganization(ctx context.Context, in ListAdminOrganizationInput) (*models.EndpointsAdminGetOrganizationOutput, error) { - path := "/admin/organization" +// CreateAdminIntegrationsAzureInstallations - Register Azure DevOps webhook installation +// POST /admin/integrations/azure/installations +func (c *Client) CreateAdminIntegrationsAzureInstallations(ctx context.Context, in CreateAdminIntegrationsAzureInstallationsInput) (*models.EndpointsAdminUpsertAzureInstallationOutput, error) { + path := "/admin/integrations/azure/installations" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2381,34 +2578,46 @@ func (c *Client) ListAdminOrganization(ctx context.Context, in ListAdminOrganiza fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + OrganizationID string `json:"organizationId"` + ProjectID string `json:"projectId"` + }{ + OrganizationID: in.OrganizationID, + ProjectID: in.ProjectID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsAdminGetOrganizationOutput + var out models.EndpointsAdminUpsertAzureInstallationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminPrivacyAcknowledgmentInput is the input for ListAdminPrivacyAcknowledgment — Get Privacy Acknowledgment. -type ListAdminPrivacyAcknowledgmentInput struct { - PolicyVersion *string `url:"policyVersion,omitempty" json:"-"` +// CreateAdminIntegrationsAzureInstallationsSuspendInput is the input for CreateAdminIntegrationsAzureInstallationsSuspend — Suspend or resume an Azure DevOps organization's installations. +type CreateAdminIntegrationsAzureInstallationsSuspendInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationID string `json:"organizationId"` + Suspended bool `json:"suspended"` models.RequestScope } -// ListAdminPrivacyAcknowledgment - Get Privacy Acknowledgment -// GET /admin/privacy/acknowledgment -func (c *Client) ListAdminPrivacyAcknowledgment(ctx context.Context, in ListAdminPrivacyAcknowledgmentInput) (*models.EndpointsGetPrivacyAcknowledgmentOutput, error) { - path := "/admin/privacy/acknowledgment" +// CreateAdminIntegrationsAzureInstallationsSuspend - Suspend or resume an Azure DevOps organization's installations +// POST /admin/integrations/azure/installations/suspend +func (c *Client) CreateAdminIntegrationsAzureInstallationsSuspend(ctx context.Context, in CreateAdminIntegrationsAzureInstallationsSuspendInput) (*models.EndpointsAdminSuspendAzureInstallationOutput, error) { + path := "/admin/integrations/azure/installations/suspend" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.PolicyVersion != nil { - query.Set("policyVersion", string(*in.PolicyVersion)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2417,32 +2626,46 @@ func (c *Client) ListAdminPrivacyAcknowledgment(ctx context.Context, in ListAdmi fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + OrganizationID string `json:"organizationId"` + Suspended bool `json:"suspended"` + }{ + OrganizationID: in.OrganizationID, + Suspended: in.Suspended, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPrivacyAcknowledgmentOutput + var out models.EndpointsAdminSuspendAzureInstallationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminPrivacyAcknowledgmentInput is the input for CreateAdminPrivacyAcknowledgment — Post Privacy Acknowledgment. -type CreateAdminPrivacyAcknowledgmentInput struct { - PolicyVersion string `json:"policyVersion"` +// CreateAdminIntegrationsAzureInstallationsTestInput is the input for CreateAdminIntegrationsAzureInstallationsTest — Test an Azure DevOps organization's provisioning state. +type CreateAdminIntegrationsAzureInstallationsTestInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OrganizationID string `json:"organizationId"` models.RequestScope } -// CreateAdminPrivacyAcknowledgment - Post Privacy Acknowledgment -// POST /admin/privacy/acknowledgment -func (c *Client) CreateAdminPrivacyAcknowledgment(ctx context.Context, in CreateAdminPrivacyAcknowledgmentInput) (*models.EndpointsPostPrivacyAcknowledgmentOutput, error) { - path := "/admin/privacy/acknowledgment" +// CreateAdminIntegrationsAzureInstallationsTest - Test an Azure DevOps organization's provisioning state +// POST /admin/integrations/azure/installations/test +func (c *Client) CreateAdminIntegrationsAzureInstallationsTest(ctx context.Context, in CreateAdminIntegrationsAzureInstallationsTestInput) (*models.EndpointsAdminTestAzureInstallationOutput, error) { + path := "/admin/integrations/azure/installations/test" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2451,9 +2674,9 @@ func (c *Client) CreateAdminPrivacyAcknowledgment(ctx context.Context, in Create } bodyBytes, err := json.Marshal(struct { - PolicyVersion string `json:"policyVersion"` + OrganizationID string `json:"organizationId"` }{ - PolicyVersion: in.PolicyVersion, + OrganizationID: in.OrganizationID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2462,42 +2685,66 @@ func (c *Client) CreateAdminPrivacyAcknowledgment(ctx context.Context, in Create if err != nil { return nil, err } - var out models.EndpointsPostPrivacyAcknowledgmentOutput + var out models.EndpointsAdminTestAzureInstallationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminRepositoriesInput is the input for ListAdminRepositories — Get Repositories. -type ListAdminRepositoriesInput struct { - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - Search *string `url:"search,omitempty" json:"-"` - TeamIDs []string `url:"teamIDs,omitempty" json:"-"` +// DeleteAdminIntegrationsBuildkiteInput is the input for DeleteAdminIntegrationsBuildkite — Delete Buildkite Integration. +type DeleteAdminIntegrationsBuildkiteInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminRepositories - Get Repositories -// GET /admin/repositories -func (c *Client) ListAdminRepositories(ctx context.Context, in ListAdminRepositoriesInput) (*models.EndpointsAdminGetRepositoriesOutput, error) { - path := "/admin/repositories" +// DeleteAdminIntegrationsBuildkite - Delete Buildkite Integration +// DELETE /admin/integrations/buildkite +func (c *Client) DeleteAdminIntegrationsBuildkite(ctx context.Context, in DeleteAdminIntegrationsBuildkiteInput) (*models.EndpointsDeleteBuildkiteIntegrationOutput, error) { + path := "/admin/integrations/buildkite" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() } - if in.Search != nil { - query.Set("search", string(*in.Search)) + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err } - for _, v := range in.TeamIDs { - query.Add("teamIDs", string(v)) + var out models.EndpointsDeleteBuildkiteIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsBuildkiteInput is the input for ListAdminIntegrationsBuildkite — Get Buildkite Integration Status. +type ListAdminIntegrationsBuildkiteInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsBuildkite - Get Buildkite Integration Status +// GET /admin/integrations/buildkite +func (c *Client) ListAdminIntegrationsBuildkite(ctx context.Context, in ListAdminIntegrationsBuildkiteInput) (*models.EndpointsGetBuildkiteIntegrationOutput, error) { + path := "/admin/integrations/buildkite" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2510,28 +2757,32 @@ func (c *Client) ListAdminRepositories(ctx context.Context, in ListAdminReposito if err != nil { return nil, err } - var out models.EndpointsAdminGetRepositoriesOutput + var out models.EndpointsGetBuildkiteIntegrationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminRepositoriesInitializeInput is the input for CreateAdminRepositoriesInitialize — Initialize Repositories. -type CreateAdminRepositoriesInitializeInput struct { - Repositories []models.ModelsGitRepositoryProvider `json:"repositories,omitempty"` +// CreateAdminIntegrationsBuildkiteOrganizationsInput is the input for CreateAdminIntegrationsBuildkiteOrganizations — List Buildkite Organizations For Token. +type CreateAdminIntegrationsBuildkiteOrganizationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApiToken string `json:"apiToken"` models.RequestScope } -// CreateAdminRepositoriesInitialize - Initialize Repositories -// POST /admin/repositories/initialize -func (c *Client) CreateAdminRepositoriesInitialize(ctx context.Context, in CreateAdminRepositoriesInitializeInput) (*models.EndpointsPostInitializeRepositoriesOutput, error) { - path := "/admin/repositories/initialize" +// CreateAdminIntegrationsBuildkiteOrganizations - List Buildkite Organizations For Token +// POST /admin/integrations/buildkite/organizations +func (c *Client) CreateAdminIntegrationsBuildkiteOrganizations(ctx context.Context, in CreateAdminIntegrationsBuildkiteOrganizationsInput) (*models.EndpointsPostBuildkiteOrganizationsOutput, error) { + path := "/admin/integrations/buildkite/organizations" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2540,9 +2791,9 @@ func (c *Client) CreateAdminRepositoriesInitialize(ctx context.Context, in Creat } bodyBytes, err := json.Marshal(struct { - Repositories []models.ModelsGitRepositoryProvider `json:"repositories,omitempty"` + ApiToken string `json:"apiToken"` }{ - Repositories: in.Repositories, + ApiToken: in.ApiToken, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2551,28 +2802,33 @@ func (c *Client) CreateAdminRepositoriesInitialize(ctx context.Context, in Creat if err != nil { return nil, err } - var out models.EndpointsPostInitializeRepositoriesOutput + var out models.EndpointsPostBuildkiteOrganizationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminRepositoriesUninitializeInput is the input for CreateAdminRepositoriesUninitialize — Uninitialize Repositories. -type CreateAdminRepositoriesUninitializeInput struct { - Repositories []models.ModelsGitRepositoryProvider `json:"repositories,omitempty"` +// CreateAdminIntegrationsBuildkiteTokenInput is the input for CreateAdminIntegrationsBuildkiteToken — Set Buildkite API Token. +type CreateAdminIntegrationsBuildkiteTokenInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApiToken string `json:"apiToken"` + OrgSlug *string `json:"orgSlug,omitempty"` models.RequestScope } -// CreateAdminRepositoriesUninitialize - Uninitialize Repositories -// POST /admin/repositories/uninitialize -func (c *Client) CreateAdminRepositoriesUninitialize(ctx context.Context, in CreateAdminRepositoriesUninitializeInput) (*models.EndpointsPostUninitializeRepositoriesOutput, error) { - path := "/admin/repositories/uninitialize" +// CreateAdminIntegrationsBuildkiteToken - Set Buildkite API Token +// POST /admin/integrations/buildkite/token +func (c *Client) CreateAdminIntegrationsBuildkiteToken(ctx context.Context, in CreateAdminIntegrationsBuildkiteTokenInput) (*models.EndpointsPostBuildkiteTokenOutput, error) { + path := "/admin/integrations/buildkite/token" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2581,9 +2837,11 @@ func (c *Client) CreateAdminRepositoriesUninitialize(ctx context.Context, in Cre } bodyBytes, err := json.Marshal(struct { - Repositories []models.ModelsGitRepositoryProvider `json:"repositories,omitempty"` + ApiToken string `json:"apiToken"` + OrgSlug *string `json:"orgSlug,omitempty"` }{ - Repositories: in.Repositories, + ApiToken: in.ApiToken, + OrgSlug: in.OrgSlug, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2592,30 +2850,6784 @@ func (c *Client) CreateAdminRepositoriesUninitialize(ctx context.Context, in Cre if err != nil { return nil, err } - var out models.EndpointsPostUninitializeRepositoriesOutput + var out models.EndpointsPostBuildkiteTokenOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminRepositoryPropertyTeamKeysInput is the input for DeleteAdminRepositoryPropertyTeamKeys — Delete Repository Property Team Key. -type DeleteAdminRepositoryPropertyTeamKeysInput struct { - KeyID *string `url:"keyId,omitempty" json:"-"` +// ListAdminIntegrationsCatalogInput is the input for ListAdminIntegrationsCatalog — Get Integrations Catalog. +type ListAdminIntegrationsCatalogInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteAdminRepositoryPropertyTeamKeys - Delete Repository Property Team Key -// DELETE /admin/repository-property-team-keys -func (c *Client) DeleteAdminRepositoryPropertyTeamKeys(ctx context.Context, in DeleteAdminRepositoryPropertyTeamKeysInput) (*models.EndpointsDeleteRepositoryPropertyTeamKeyOutput, error) { - path := "/admin/repository-property-team-keys" +// ListAdminIntegrationsCatalog - Get Integrations Catalog +// GET /admin/integrations/catalog +func (c *Client) ListAdminIntegrationsCatalog(ctx context.Context, in ListAdminIntegrationsCatalogInput) (*models.EndpointsAdminGetIntegrationsCatalogOutput, error) { + path := "/admin/integrations/catalog" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.KeyID != nil { - query.Set("keyId", string(*in.KeyID)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetIntegrationsCatalogOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsCircleciInput is the input for DeleteAdminIntegrationsCircleci — Delete CircleCI Integration. +type DeleteAdminIntegrationsCircleciInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsCircleci - Delete CircleCI Integration +// DELETE /admin/integrations/circleci +func (c *Client) DeleteAdminIntegrationsCircleci(ctx context.Context, in DeleteAdminIntegrationsCircleciInput) (*models.EndpointsDeleteCircleCIIntegrationOutput, error) { + path := "/admin/integrations/circleci" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteCircleCIIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsCircleciInput is the input for ListAdminIntegrationsCircleci — Get CircleCI Integration Status. +type ListAdminIntegrationsCircleciInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsCircleci - Get CircleCI Integration Status +// GET /admin/integrations/circleci +func (c *Client) ListAdminIntegrationsCircleci(ctx context.Context, in ListAdminIntegrationsCircleciInput) (*models.EndpointsGetCircleCIIntegrationOutput, error) { + path := "/admin/integrations/circleci" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCircleCIIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCircleciTokenInput is the input for CreateAdminIntegrationsCircleciToken — Set CircleCI API Token. +type CreateAdminIntegrationsCircleciTokenInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApiToken string `json:"apiToken"` + models.RequestScope +} + +// CreateAdminIntegrationsCircleciToken - Set CircleCI API Token +// POST /admin/integrations/circleci/token +func (c *Client) CreateAdminIntegrationsCircleciToken(ctx context.Context, in CreateAdminIntegrationsCircleciTokenInput) (*models.EndpointsPostCircleCITokenOutput, error) { + path := "/admin/integrations/circleci/token" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ApiToken string `json:"apiToken"` + }{ + ApiToken: in.ApiToken, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostCircleCITokenOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsCloudAwsSettingsInput is the input for DeleteAdminIntegrationsCloudAwsSettings — Delete Cloud AWS Settings. +type DeleteAdminIntegrationsCloudAwsSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsCloudAwsSettings - Delete Cloud AWS Settings +// DELETE /admin/integrations/cloud/aws/settings +func (c *Client) DeleteAdminIntegrationsCloudAwsSettings(ctx context.Context, in DeleteAdminIntegrationsCloudAwsSettingsInput) (*models.EndpointsAdminDeleteAWSSettingsOutput, error) { + path := "/admin/integrations/cloud/aws/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDeleteAWSSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsCloudAwsSettingsInput is the input for ListAdminIntegrationsCloudAwsSettings — Get Cloud AWS Settings. +type ListAdminIntegrationsCloudAwsSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsCloudAwsSettings - Get Cloud AWS Settings +// GET /admin/integrations/cloud/aws/settings +func (c *Client) ListAdminIntegrationsCloudAwsSettings(ctx context.Context, in ListAdminIntegrationsCloudAwsSettingsInput) (*models.EndpointsAdminGetAWSSettingsOutput, error) { + path := "/admin/integrations/cloud/aws/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetAWSSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudAwsSettingsInput is the input for CreateAdminIntegrationsCloudAwsSettings — Upsert Cloud AWS Settings. +type CreateAdminIntegrationsCloudAwsSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AwsAccounts []models.ModelsAWSAccount `json:"awsAccounts,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + IamRoleName string `json:"iamRoleName"` + PreferredDeployment string `json:"preferredDeployment"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudAwsSettings - Upsert Cloud AWS Settings +// POST /admin/integrations/cloud/aws/settings +func (c *Client) CreateAdminIntegrationsCloudAwsSettings(ctx context.Context, in CreateAdminIntegrationsCloudAwsSettingsInput) (*models.EndpointsAdminUpsertAWSSettingsOutput, error) { + path := "/admin/integrations/cloud/aws/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AwsAccounts []models.ModelsAWSAccount `json:"awsAccounts,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + IamRoleName string `json:"iamRoleName"` + PreferredDeployment string `json:"preferredDeployment"` + }{ + AwsAccounts: in.AwsAccounts, + ExternalID: in.ExternalID, + IamRoleName: in.IamRoleName, + PreferredDeployment: in.PreferredDeployment, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUpsertAWSSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudAwsValidateRoleInput is the input for CreateAdminIntegrationsCloudAwsValidateRole — Validate AWS Role. +type CreateAdminIntegrationsCloudAwsValidateRoleInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AccountIds []string `json:"accountIds,omitempty"` + Onboarding *bool `json:"onboarding,omitempty"` + RoleNameToAssume *string `json:"roleNameToAssume,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudAwsValidateRole - Validate AWS Role +// POST /admin/integrations/cloud/aws/validate-role +func (c *Client) CreateAdminIntegrationsCloudAwsValidateRole(ctx context.Context, in CreateAdminIntegrationsCloudAwsValidateRoleInput) (*models.EndpointsAdminValidateAWSRoleOutput, error) { + path := "/admin/integrations/cloud/aws/validate-role" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AccountIds []string `json:"accountIds,omitempty"` + Onboarding *bool `json:"onboarding,omitempty"` + RoleNameToAssume *string `json:"roleNameToAssume,omitempty"` + }{ + AccountIds: in.AccountIds, + Onboarding: in.Onboarding, + RoleNameToAssume: in.RoleNameToAssume, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminValidateAWSRoleOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsCloudAzureSettingsInput is the input for DeleteAdminIntegrationsCloudAzureSettings — Delete Cloud Azure Settings. +type DeleteAdminIntegrationsCloudAzureSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsCloudAzureSettings - Delete Cloud Azure Settings +// DELETE /admin/integrations/cloud/azure/settings +func (c *Client) DeleteAdminIntegrationsCloudAzureSettings(ctx context.Context, in DeleteAdminIntegrationsCloudAzureSettingsInput) (*models.EndpointsAdminDeleteAzureSettingsOutput, error) { + path := "/admin/integrations/cloud/azure/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDeleteAzureSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsCloudAzureSettingsInput is the input for ListAdminIntegrationsCloudAzureSettings — Get Cloud Azure Settings. +type ListAdminIntegrationsCloudAzureSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsCloudAzureSettings - Get Cloud Azure Settings +// GET /admin/integrations/cloud/azure/settings +func (c *Client) ListAdminIntegrationsCloudAzureSettings(ctx context.Context, in ListAdminIntegrationsCloudAzureSettingsInput) (*models.EndpointsAdminGetAzureSettingsOutput, error) { + path := "/admin/integrations/cloud/azure/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetAzureSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudAzureSettingsInput is the input for CreateAdminIntegrationsCloudAzureSettings — Upsert Cloud Azure Settings. +type CreateAdminIntegrationsCloudAzureSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AuthMode string `json:"authMode"` + ClientID *string `json:"clientId,omitempty"` + ClientSecret *string `json:"clientSecret,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Subscriptions []models.ModelsAzureSubscriptionInput `json:"subscriptions,omitempty"` + TenantID string `json:"tenantId"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudAzureSettings - Upsert Cloud Azure Settings +// POST /admin/integrations/cloud/azure/settings +func (c *Client) CreateAdminIntegrationsCloudAzureSettings(ctx context.Context, in CreateAdminIntegrationsCloudAzureSettingsInput) (*models.EndpointsAdminUpsertAzureSettingsOutput, error) { + path := "/admin/integrations/cloud/azure/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AuthMode string `json:"authMode"` + ClientID *string `json:"clientId,omitempty"` + ClientSecret *string `json:"clientSecret,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Subscriptions []models.ModelsAzureSubscriptionInput `json:"subscriptions,omitempty"` + TenantID string `json:"tenantId"` + }{ + AuthMode: in.AuthMode, + ClientID: in.ClientID, + ClientSecret: in.ClientSecret, + DisplayName: in.DisplayName, + Subscriptions: in.Subscriptions, + TenantID: in.TenantID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUpsertAzureSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudAzureValidateInput is the input for CreateAdminIntegrationsCloudAzureValidate — Validate Azure Credentials. +type CreateAdminIntegrationsCloudAzureValidateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + SubscriptionIds []string `json:"subscriptionIds,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudAzureValidate - Validate Azure Credentials +// POST /admin/integrations/cloud/azure/validate +func (c *Client) CreateAdminIntegrationsCloudAzureValidate(ctx context.Context, in CreateAdminIntegrationsCloudAzureValidateInput) (*models.EndpointsAdminValidateAzureOutput, error) { + path := "/admin/integrations/cloud/azure/validate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + SubscriptionIds []string `json:"subscriptionIds,omitempty"` + }{ + SubscriptionIds: in.SubscriptionIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminValidateAzureOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudGcpAccessTokenInput is the input for CreateAdminIntegrationsCloudGcpAccessToken — Mint GCP Access Token. +type CreateAdminIntegrationsCloudGcpAccessTokenInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudGcpAccessToken - Mint GCP Access Token +// POST /admin/integrations/cloud/gcp/access-token +func (c *Client) CreateAdminIntegrationsCloudGcpAccessToken(ctx context.Context, in CreateAdminIntegrationsCloudGcpAccessTokenInput) (*models.EndpointsAdminMintGCPAccessTokenOutput, error) { + path := "/admin/integrations/cloud/gcp/access-token" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminMintGCPAccessTokenOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsCloudGcpSettingsInput is the input for DeleteAdminIntegrationsCloudGcpSettings — Delete Cloud GCP Settings. +type DeleteAdminIntegrationsCloudGcpSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsCloudGcpSettings - Delete Cloud GCP Settings +// DELETE /admin/integrations/cloud/gcp/settings +func (c *Client) DeleteAdminIntegrationsCloudGcpSettings(ctx context.Context, in DeleteAdminIntegrationsCloudGcpSettingsInput) (*models.EndpointsAdminDeleteGCPSettingsOutput, error) { + path := "/admin/integrations/cloud/gcp/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDeleteGCPSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsCloudGcpSettingsInput is the input for ListAdminIntegrationsCloudGcpSettings — Get Cloud GCP Settings. +type ListAdminIntegrationsCloudGcpSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsCloudGcpSettings - Get Cloud GCP Settings +// GET /admin/integrations/cloud/gcp/settings +func (c *Client) ListAdminIntegrationsCloudGcpSettings(ctx context.Context, in ListAdminIntegrationsCloudGcpSettingsInput) (*models.EndpointsAdminGetGCPSettingsOutput, error) { + path := "/admin/integrations/cloud/gcp/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetGCPSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudGcpSettingsInput is the input for CreateAdminIntegrationsCloudGcpSettings — Upsert Cloud GCP Settings. +type CreateAdminIntegrationsCloudGcpSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DiscoveryScope *string `json:"discoveryScope,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + FolderID *string `json:"folderId,omitempty"` + GkeClusterOidcIssuerUrls []string `json:"gkeClusterOidcIssuerUrls,omitempty"` + GkeServiceAccountUniqueID *string `json:"gkeServiceAccountUniqueId,omitempty"` + OrganizationID *string `json:"organizationId,omitempty"` + Projects []models.ModelsGCPProjectInput `json:"projects,omitempty"` + WorkloadIdentityProvider string `json:"workloadIdentityProvider"` + WorkloadIdentityServiceAccountEmail string `json:"workloadIdentityServiceAccountEmail"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudGcpSettings - Upsert Cloud GCP Settings +// POST /admin/integrations/cloud/gcp/settings +func (c *Client) CreateAdminIntegrationsCloudGcpSettings(ctx context.Context, in CreateAdminIntegrationsCloudGcpSettingsInput) (*models.EndpointsAdminUpsertGCPSettingsOutput, error) { + path := "/admin/integrations/cloud/gcp/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DiscoveryScope *string `json:"discoveryScope,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + FolderID *string `json:"folderId,omitempty"` + GkeClusterOidcIssuerUrls []string `json:"gkeClusterOidcIssuerUrls,omitempty"` + GkeServiceAccountUniqueID *string `json:"gkeServiceAccountUniqueId,omitempty"` + OrganizationID *string `json:"organizationId,omitempty"` + Projects []models.ModelsGCPProjectInput `json:"projects,omitempty"` + WorkloadIdentityProvider string `json:"workloadIdentityProvider"` + WorkloadIdentityServiceAccountEmail string `json:"workloadIdentityServiceAccountEmail"` + }{ + DiscoveryScope: in.DiscoveryScope, + DisplayName: in.DisplayName, + FolderID: in.FolderID, + GkeClusterOidcIssuerUrls: in.GkeClusterOidcIssuerUrls, + GkeServiceAccountUniqueID: in.GkeServiceAccountUniqueID, + OrganizationID: in.OrganizationID, + Projects: in.Projects, + WorkloadIdentityProvider: in.WorkloadIdentityProvider, + WorkloadIdentityServiceAccountEmail: in.WorkloadIdentityServiceAccountEmail, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUpsertGCPSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsCloudGcpSetupInput is the input for ListAdminIntegrationsCloudGcpSetup — Get Cloud GCP Setup. +type ListAdminIntegrationsCloudGcpSetupInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsCloudGcpSetup - Get Cloud GCP Setup +// GET /admin/integrations/cloud/gcp/setup +func (c *Client) ListAdminIntegrationsCloudGcpSetup(ctx context.Context, in ListAdminIntegrationsCloudGcpSetupInput) (*models.EndpointsAdminGetGCPSetupOutput, error) { + path := "/admin/integrations/cloud/gcp/setup" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetGCPSetupOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudGcpValidateInput is the input for CreateAdminIntegrationsCloudGcpValidate — Validate GCP Credentials. +type CreateAdminIntegrationsCloudGcpValidateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ProjectIds []string `json:"projectIds,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudGcpValidate - Validate GCP Credentials +// POST /admin/integrations/cloud/gcp/validate +func (c *Client) CreateAdminIntegrationsCloudGcpValidate(ctx context.Context, in CreateAdminIntegrationsCloudGcpValidateInput) (*models.EndpointsAdminValidateGCPOutput, error) { + path := "/admin/integrations/cloud/gcp/validate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ProjectIds []string `json:"projectIds,omitempty"` + }{ + ProjectIds: in.ProjectIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminValidateGCPOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudK8sClustersInput is the input for CreateAdminIntegrationsCloudK8sClusters — Add or Update a K8s Cluster. +type CreateAdminIntegrationsCloudK8sClustersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CloudAccountID *string `json:"cloudAccountId,omitempty"` + ClusterName string `json:"clusterName"` + ClusterType string `json:"clusterType"` + CollectConfigMaps *bool `json:"collectConfigMaps,omitempty"` + CollectSecrets *bool `json:"collectSecrets,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Region *string `json:"region,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudK8sClusters - Add or Update a K8s Cluster +// POST /admin/integrations/cloud/k8s/clusters +func (c *Client) CreateAdminIntegrationsCloudK8sClusters(ctx context.Context, in CreateAdminIntegrationsCloudK8sClustersInput) (*models.EndpointsAdminUpsertK8SClusterOutput, error) { + path := "/admin/integrations/cloud/k8s/clusters" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CloudAccountID *string `json:"cloudAccountId,omitempty"` + ClusterName string `json:"clusterName"` + ClusterType string `json:"clusterType"` + CollectConfigMaps *bool `json:"collectConfigMaps,omitempty"` + CollectSecrets *bool `json:"collectSecrets,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Region *string `json:"region,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + }{ + CloudAccountID: in.CloudAccountID, + ClusterName: in.ClusterName, + ClusterType: in.ClusterType, + CollectConfigMaps: in.CollectConfigMaps, + CollectSecrets: in.CollectSecrets, + IsEnabled: in.IsEnabled, + Region: in.Region, + ResourceID: in.ResourceID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUpsertK8SClusterOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsCloudK8sClustersClusterIdInput is the input for DeleteAdminIntegrationsCloudK8sClustersClusterId — Remove a K8s Cluster. +type DeleteAdminIntegrationsCloudK8sClustersClusterIdInput struct { + ClusterID string `path:"clusterId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsCloudK8sClustersClusterId - Remove a K8s Cluster +// DELETE /admin/integrations/cloud/k8s/clusters/{clusterId} +func (c *Client) DeleteAdminIntegrationsCloudK8sClustersClusterId(ctx context.Context, in DeleteAdminIntegrationsCloudK8sClustersClusterIdInput) (*models.EndpointsAdminDeleteK8SClusterOutput, error) { + path := "/admin/integrations/cloud/k8s/clusters/{clusterId}" + path = strings.Replace(path, "{clusterId}", url.PathEscape(in.ClusterID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDeleteK8SClusterOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsCloudK8sSettingsInput is the input for DeleteAdminIntegrationsCloudK8sSettings — Delete Cloud K8s Settings. +type DeleteAdminIntegrationsCloudK8sSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsCloudK8sSettings - Delete Cloud K8s Settings +// DELETE /admin/integrations/cloud/k8s/settings +func (c *Client) DeleteAdminIntegrationsCloudK8sSettings(ctx context.Context, in DeleteAdminIntegrationsCloudK8sSettingsInput) (*models.EndpointsAdminDeleteK8SSettingsOutput, error) { + path := "/admin/integrations/cloud/k8s/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDeleteK8SSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsCloudK8sSettingsInput is the input for ListAdminIntegrationsCloudK8sSettings — Get Cloud K8s Settings. +type ListAdminIntegrationsCloudK8sSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsCloudK8sSettings - Get Cloud K8s Settings +// GET /admin/integrations/cloud/k8s/settings +func (c *Client) ListAdminIntegrationsCloudK8sSettings(ctx context.Context, in ListAdminIntegrationsCloudK8sSettingsInput) (*models.EndpointsAdminGetK8SSettingsOutput, error) { + path := "/admin/integrations/cloud/k8s/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetK8SSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudK8sSettingsInput is the input for CreateAdminIntegrationsCloudK8sSettings — Upsert Cloud K8s Settings. +type CreateAdminIntegrationsCloudK8sSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Clusters []models.ModelsK8SClusterInput `json:"clusters,omitempty"` + NullifyRoleArn *string `json:"nullifyRoleArn,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudK8sSettings - Upsert Cloud K8s Settings +// POST /admin/integrations/cloud/k8s/settings +func (c *Client) CreateAdminIntegrationsCloudK8sSettings(ctx context.Context, in CreateAdminIntegrationsCloudK8sSettingsInput) (*models.EndpointsAdminUpsertK8SSettingsOutput, error) { + path := "/admin/integrations/cloud/k8s/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Clusters []models.ModelsK8SClusterInput `json:"clusters,omitempty"` + NullifyRoleArn *string `json:"nullifyRoleArn,omitempty"` + }{ + Clusters: in.Clusters, + NullifyRoleArn: in.NullifyRoleArn, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUpsertK8SSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsCloudK8sWhitelistInput is the input for ListAdminIntegrationsCloudK8sWhitelist — Read collector account access. +type ListAdminIntegrationsCloudK8sWhitelistInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsCloudK8sWhitelist - Read collector account access +// GET /admin/integrations/cloud/k8s/whitelist +func (c *Client) ListAdminIntegrationsCloudK8sWhitelist(ctx context.Context, in ListAdminIntegrationsCloudK8sWhitelistInput) (*models.EndpointsAdminGetK8SCollectorAccountsOutput, error) { + path := "/admin/integrations/cloud/k8s/whitelist" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetK8SCollectorAccountsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsCloudK8sWhitelistInput is the input for CreateAdminIntegrationsCloudK8sWhitelist — Whitelist K8s Connector Accounts. +type CreateAdminIntegrationsCloudK8sWhitelistInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AccountIds []string `json:"accountIds,omitempty"` + ExpectedRevision *int `json:"expectedRevision,omitempty"` + ExpectedStateID *string `json:"expectedStateId,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsCloudK8sWhitelist - Whitelist K8s Connector Accounts +// POST /admin/integrations/cloud/k8s/whitelist +func (c *Client) CreateAdminIntegrationsCloudK8sWhitelist(ctx context.Context, in CreateAdminIntegrationsCloudK8sWhitelistInput) (*models.EndpointsAdminK8SConnectorWhitelistOutput, error) { + path := "/admin/integrations/cloud/k8s/whitelist" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AccountIds []string `json:"accountIds,omitempty"` + ExpectedRevision *int `json:"expectedRevision,omitempty"` + ExpectedStateID *string `json:"expectedStateId,omitempty"` + }{ + AccountIds: in.AccountIds, + ExpectedRevision: in.ExpectedRevision, + ExpectedStateID: in.ExpectedStateID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminK8SConnectorWhitelistOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsConnectionsInput is the input for ListAdminIntegrationsConnections — List Integration Connections. +type ListAdminIntegrationsConnectionsInput struct { + Capability *string `url:"capability,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsConnections - List Integration Connections +// GET /admin/integrations/connections +func (c *Client) ListAdminIntegrationsConnections(ctx context.Context, in ListAdminIntegrationsConnectionsInput) (*models.EndpointsAdminListIntegrationConnectionsOutput, error) { + path := "/admin/integrations/connections" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Capability != nil { + query.Set("capability", string(*in.Capability)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminListIntegrationConnectionsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsConnectionsConnectionIdInput is the input for DeleteAdminIntegrationsConnectionsConnectionId — Disconnect Integration Connection. +type DeleteAdminIntegrationsConnectionsConnectionIdInput struct { + ConnectionID string `path:"connectionId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsConnectionsConnectionId - Disconnect Integration Connection +// DELETE /admin/integrations/connections/{connectionId} +func (c *Client) DeleteAdminIntegrationsConnectionsConnectionId(ctx context.Context, in DeleteAdminIntegrationsConnectionsConnectionIdInput) (*models.EndpointsAdminDisconnectIntegrationConnectionOutput, error) { + path := "/admin/integrations/connections/{connectionId}" + path = strings.Replace(path, "{connectionId}", url.PathEscape(in.ConnectionID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDisconnectIntegrationConnectionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminIntegrationsConnectionsConnectionIdRotateInput is the input for UpdateAdminIntegrationsConnectionsConnectionIdRotate — Rotate Integration Connection. +type UpdateAdminIntegrationsConnectionsConnectionIdRotateInput struct { + ConnectionID string `path:"connectionId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ExpectedAuthorityRevision *int `json:"expectedAuthorityRevision,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + models.RequestScope +} + +// UpdateAdminIntegrationsConnectionsConnectionIdRotate - Rotate Integration Connection +// PUT /admin/integrations/connections/{connectionId}/rotate +func (c *Client) UpdateAdminIntegrationsConnectionsConnectionIdRotate(ctx context.Context, in UpdateAdminIntegrationsConnectionsConnectionIdRotateInput) (*models.EndpointsAdminRotateIntegrationConnectionOutput, error) { + path := "/admin/integrations/connections/{connectionId}/rotate" + path = strings.Replace(path, "{connectionId}", url.PathEscape(in.ConnectionID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ExpectedAuthorityRevision *int `json:"expectedAuthorityRevision,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + }{ + ExpectedAuthorityRevision: in.ExpectedAuthorityRevision, + Fields: in.Fields, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminRotateIntegrationConnectionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsConnectionsConnectionIdTestInput is the input for CreateAdminIntegrationsConnectionsConnectionIdTest — Test Integration Connection. +type CreateAdminIntegrationsConnectionsConnectionIdTestInput struct { + ConnectionID string `path:"connectionId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateAdminIntegrationsConnectionsConnectionIdTest - Test Integration Connection +// POST /admin/integrations/connections/{connectionId}/test +func (c *Client) CreateAdminIntegrationsConnectionsConnectionIdTest(ctx context.Context, in CreateAdminIntegrationsConnectionsConnectionIdTestInput) (*models.EndpointsAdminTestIntegrationConnectionOutput, error) { + path := "/admin/integrations/connections/{connectionId}/test" + path = strings.Replace(path, "{connectionId}", url.PathEscape(in.ConnectionID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminTestIntegrationConnectionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsGithubPackagesDiscoverInput is the input for CreateAdminIntegrationsGithubPackagesDiscover — Discover GitHub Packages Identity. +type CreateAdminIntegrationsGithubPackagesDiscoverInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Token string `json:"token"` + models.RequestScope +} + +// CreateAdminIntegrationsGithubPackagesDiscover - Discover GitHub Packages Identity +// POST /admin/integrations/github-packages/discover +func (c *Client) CreateAdminIntegrationsGithubPackagesDiscover(ctx context.Context, in CreateAdminIntegrationsGithubPackagesDiscoverInput) (*models.EndpointsAdminDiscoverGitHubPackagesCredentialOutput, error) { + path := "/admin/integrations/github-packages/discover" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Token string `json:"token"` + }{ + Token: in.Token, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDiscoverGitHubPackagesCredentialOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsGithubAppSettingsInput is the input for ListAdminIntegrationsGithubAppSettings — Get GitHub App Settings. +type ListAdminIntegrationsGithubAppSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsGithubAppSettings - Get GitHub App Settings +// GET /admin/integrations/github/app-settings +func (c *Client) ListAdminIntegrationsGithubAppSettings(ctx context.Context, in ListAdminIntegrationsGithubAppSettingsInput) (*models.EndpointsAdminGetGitHubAppSettingsOutput, error) { + path := "/admin/integrations/github/app-settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetGitHubAppSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsGitlabConnectInput is the input for CreateAdminIntegrationsGitlabConnect — Connect GitLab. +type CreateAdminIntegrationsGitlabConnectInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateAdminIntegrationsGitlabConnect - Connect GitLab +// POST /admin/integrations/gitlab/connect +func (c *Client) CreateAdminIntegrationsGitlabConnect(ctx context.Context, in CreateAdminIntegrationsGitlabConnectInput) (*models.EndpointsAdminGitLabConnectOutput, error) { + path := "/admin/integrations/gitlab/connect" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGitLabConnectOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsGitlabConnectConfirmInput is the input for CreateAdminIntegrationsGitlabConnectConfirm — Finish GitLab connection. +type CreateAdminIntegrationsGitlabConnectConfirmInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Handle string `json:"handle"` + models.RequestScope +} + +// CreateAdminIntegrationsGitlabConnectConfirm - Finish GitLab connection +// POST /admin/integrations/gitlab/connect/confirm +func (c *Client) CreateAdminIntegrationsGitlabConnectConfirm(ctx context.Context, in CreateAdminIntegrationsGitlabConnectConfirmInput) (*models.EndpointsAdminGitLabConnectStatusOutput, error) { + path := "/admin/integrations/gitlab/connect/confirm" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Handle string `json:"handle"` + }{ + Handle: in.Handle, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGitLabConnectStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsGitlabConnectStatusInput is the input for ListAdminIntegrationsGitlabConnectStatus — GitLab connection status. +type ListAdminIntegrationsGitlabConnectStatusInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Handle *string `url:"handle,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsGitlabConnectStatus - GitLab connection status +// GET /admin/integrations/gitlab/connect/status +func (c *Client) ListAdminIntegrationsGitlabConnectStatus(ctx context.Context, in ListAdminIntegrationsGitlabConnectStatusInput) (*models.EndpointsAdminGitLabConnectStatusOutput, error) { + path := "/admin/integrations/gitlab/connect/status" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Handle != nil { + query.Set("handle", string(*in.Handle)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGitLabConnectStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsJenkinsInput is the input for DeleteAdminIntegrationsJenkins — Delete Jenkins Integration. +type DeleteAdminIntegrationsJenkinsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsJenkins - Delete Jenkins Integration +// DELETE /admin/integrations/jenkins +func (c *Client) DeleteAdminIntegrationsJenkins(ctx context.Context, in DeleteAdminIntegrationsJenkinsInput) (*models.EndpointsDeleteJenkinsIntegrationOutput, error) { + path := "/admin/integrations/jenkins" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteJenkinsIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsJenkinsInput is the input for ListAdminIntegrationsJenkins — Get Jenkins Integration Status. +type ListAdminIntegrationsJenkinsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsJenkins - Get Jenkins Integration Status +// GET /admin/integrations/jenkins +func (c *Client) ListAdminIntegrationsJenkins(ctx context.Context, in ListAdminIntegrationsJenkinsInput) (*models.EndpointsGetJenkinsIntegrationOutput, error) { + path := "/admin/integrations/jenkins" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetJenkinsIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsJenkinsTokenInput is the input for CreateAdminIntegrationsJenkinsToken — Set Jenkins API Token. +type CreateAdminIntegrationsJenkinsTokenInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApiToken string `json:"apiToken"` + URL string `json:"url"` + Username string `json:"username"` + models.RequestScope +} + +// CreateAdminIntegrationsJenkinsToken - Set Jenkins API Token +// POST /admin/integrations/jenkins/token +func (c *Client) CreateAdminIntegrationsJenkinsToken(ctx context.Context, in CreateAdminIntegrationsJenkinsTokenInput) (*models.EndpointsPostJenkinsTokenOutput, error) { + path := "/admin/integrations/jenkins/token" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ApiToken string `json:"apiToken"` + URL string `json:"url"` + Username string `json:"username"` + }{ + ApiToken: in.ApiToken, + URL: in.URL, + Username: in.Username, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostJenkinsTokenOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsJiraInput is the input for ListAdminIntegrationsJira — Get Jira Configuration. +type ListAdminIntegrationsJiraInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsJira - Get Jira Configuration +// GET /admin/integrations/jira +func (c *Client) ListAdminIntegrationsJira(ctx context.Context, in ListAdminIntegrationsJiraInput) (*models.EndpointsAdminGetJiraConfigOutput, error) { + path := "/admin/integrations/jira" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetJiraConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsJiraInput is the input for CreateAdminIntegrationsJira — Update Jira Configuration. +type CreateAdminIntegrationsJiraInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AutoCreate bool `json:"autoCreate"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` + IssueType string `json:"issueType"` + PriorityThreshold string `json:"priorityThreshold"` + ProjectKey string `json:"projectKey"` + models.RequestScope +} + +// CreateAdminIntegrationsJira - Update Jira Configuration +// POST /admin/integrations/jira +func (c *Client) CreateAdminIntegrationsJira(ctx context.Context, in CreateAdminIntegrationsJiraInput) (*models.EndpointsUpdateJiraConfigOutput, error) { + path := "/admin/integrations/jira" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AutoCreate bool `json:"autoCreate"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` + IssueType string `json:"issueType"` + PriorityThreshold string `json:"priorityThreshold"` + ProjectKey string `json:"projectKey"` + }{ + AutoCreate: in.AutoCreate, + DefaultAssigneeID: in.DefaultAssigneeID, + EnabledFindingTypes: in.EnabledFindingTypes, + IssueType: in.IssueType, + PriorityThreshold: in.PriorityThreshold, + ProjectKey: in.ProjectKey, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsUpdateJiraConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsJiraForgeInput is the input for ListAdminIntegrationsJiraForge — Get Jira Forge connection status. +type ListAdminIntegrationsJiraForgeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsJiraForge - Get Jira Forge connection status +// GET /admin/integrations/jira/forge +func (c *Client) ListAdminIntegrationsJiraForge(ctx context.Context, in ListAdminIntegrationsJiraForgeInput) (*models.EndpointsGetJiraForgeStatusOutput, error) { + path := "/admin/integrations/jira/forge" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetJiraForgeStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsJiraInstallInput is the input for ListAdminIntegrationsJiraInstall — Start Jira Forge OAuth connect. +type ListAdminIntegrationsJiraInstallInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + SiteURL *string `url:"siteUrl,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsJiraInstall - Start Jira Forge OAuth connect +// GET /admin/integrations/jira/install +func (c *Client) ListAdminIntegrationsJiraInstall(ctx context.Context, in ListAdminIntegrationsJiraInstallInput) (*models.EndpointsGetJiraInstallOutput, error) { + path := "/admin/integrations/jira/install" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.SiteURL != nil { + query.Set("siteUrl", string(*in.SiteURL)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetJiraInstallOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsLinearInput is the input for ListAdminIntegrationsLinear — Get Linear Configuration. +type ListAdminIntegrationsLinearInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsLinear - Get Linear Configuration +// GET /admin/integrations/linear +func (c *Client) ListAdminIntegrationsLinear(ctx context.Context, in ListAdminIntegrationsLinearInput) (*models.EndpointsAdminGetLinearConfigOutput, error) { + path := "/admin/integrations/linear" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetLinearConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsLinearInstallInput is the input for ListAdminIntegrationsLinearInstall — Start Linear OAuth install. +type ListAdminIntegrationsLinearInstallInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsLinearInstall - Start Linear OAuth install +// GET /admin/integrations/linear/install +func (c *Client) ListAdminIntegrationsLinearInstall(ctx context.Context, in ListAdminIntegrationsLinearInstallInput) (*models.EndpointsGetLinearInstallOutput, error) { + path := "/admin/integrations/linear/install" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetLinearInstallOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsLinearMembersInput is the input for ListAdminIntegrationsLinearMembers — List Linear Team Members. +type ListAdminIntegrationsLinearMembersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Q *string `url:"q,omitempty" json:"-"` + TeamID *string `url:"teamId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsLinearMembers - List Linear Team Members +// GET /admin/integrations/linear/members +func (c *Client) ListAdminIntegrationsLinearMembers(ctx context.Context, in ListAdminIntegrationsLinearMembersInput) (*models.EndpointsAdminGetLinearMembersOutput, error) { + path := "/admin/integrations/linear/members" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.TeamID != nil { + query.Set("teamId", string(*in.TeamID)) + } + if in.Q != nil { + query.Set("q", string(*in.Q)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetLinearMembersOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsLinearOauthInput is the input for ListAdminIntegrationsLinearOauth — Get Linear OAuth install status. +type ListAdminIntegrationsLinearOauthInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsLinearOauth - Get Linear OAuth install status +// GET /admin/integrations/linear/oauth +func (c *Client) ListAdminIntegrationsLinearOauth(ctx context.Context, in ListAdminIntegrationsLinearOauthInput) (*models.EndpointsGetLinearOAuthStatusOutput, error) { + path := "/admin/integrations/linear/oauth" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetLinearOAuthStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsLinearTeamsInput is the input for ListAdminIntegrationsLinearTeams — List Linear Teams. +type ListAdminIntegrationsLinearTeamsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsLinearTeams - List Linear Teams +// GET /admin/integrations/linear/teams +func (c *Client) ListAdminIntegrationsLinearTeams(ctx context.Context, in ListAdminIntegrationsLinearTeamsInput) (*models.EndpointsAdminGetLinearTeamsOutput, error) { + path := "/admin/integrations/linear/teams" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetLinearTeamsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsLinearTicketConfigInput is the input for CreateAdminIntegrationsLinearTicketConfig — Set Linear Ticket Configuration. +type CreateAdminIntegrationsLinearTicketConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AutoCreate *bool `json:"autoCreate,omitempty"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` + PriorityThreshold *string `json:"priorityThreshold,omitempty"` + TeamID string `json:"teamId"` + models.RequestScope +} + +// CreateAdminIntegrationsLinearTicketConfig - Set Linear Ticket Configuration +// POST /admin/integrations/linear/ticket-config +func (c *Client) CreateAdminIntegrationsLinearTicketConfig(ctx context.Context, in CreateAdminIntegrationsLinearTicketConfigInput) (*models.EndpointsAdminPostLinearTicketConfigOutput, error) { + path := "/admin/integrations/linear/ticket-config" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AutoCreate *bool `json:"autoCreate,omitempty"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` + PriorityThreshold *string `json:"priorityThreshold,omitempty"` + TeamID string `json:"teamId"` + }{ + AutoCreate: in.AutoCreate, + DefaultAssigneeID: in.DefaultAssigneeID, + EnabledFindingTypes: in.EnabledFindingTypes, + PriorityThreshold: in.PriorityThreshold, + TeamID: in.TeamID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminPostLinearTicketConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsNotificationsInput is the input for ListAdminIntegrationsNotifications — Get Notification Config. +type ListAdminIntegrationsNotificationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsNotifications - Get Notification Config +// GET /admin/integrations/notifications +func (c *Client) ListAdminIntegrationsNotifications(ctx context.Context, in ListAdminIntegrationsNotificationsInput) (*models.EndpointsGetAdminNotificationConfigOutput, error) { + path := "/admin/integrations/notifications" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetAdminNotificationConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminIntegrationsNotificationsInput is the input for UpdateAdminIntegrationsNotifications — Put Notification Config. +type UpdateAdminIntegrationsNotificationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CentralSecurityChannel *models.ModelsMessageChannelProvider `json:"centralSecurityChannel,omitempty"` + Notifications []models.ModelsNotification `json:"notifications,omitempty"` + models.RequestScope +} + +// UpdateAdminIntegrationsNotifications - Put Notification Config +// PUT /admin/integrations/notifications +func (c *Client) UpdateAdminIntegrationsNotifications(ctx context.Context, in UpdateAdminIntegrationsNotificationsInput) (*models.EndpointsPutAdminNotificationConfigOutput, error) { + path := "/admin/integrations/notifications" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CentralSecurityChannel *models.ModelsMessageChannelProvider `json:"centralSecurityChannel,omitempty"` + Notifications []models.ModelsNotification `json:"notifications,omitempty"` + }{ + CentralSecurityChannel: in.CentralSecurityChannel, + Notifications: in.Notifications, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutAdminNotificationConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsSlackInput is the input for ListAdminIntegrationsSlack — Get Slack Configuration. +type ListAdminIntegrationsSlackInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsSlack - Get Slack Configuration +// GET /admin/integrations/slack +func (c *Client) ListAdminIntegrationsSlack(ctx context.Context, in ListAdminIntegrationsSlackInput) (*models.EndpointsGetSlackConfigOutput, error) { + path := "/admin/integrations/slack" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSlackConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsSlackInstallInput is the input for ListAdminIntegrationsSlackInstall — Start Slack distributed install. +type ListAdminIntegrationsSlackInstallInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsSlackInstall - Start Slack distributed install +// GET /admin/integrations/slack/install +func (c *Client) ListAdminIntegrationsSlackInstall(ctx context.Context, in ListAdminIntegrationsSlackInstallInput) (*models.EndpointsGetSlackDistributedInstallOutput, error) { + path := "/admin/integrations/slack/install" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSlackDistributedInstallOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsSlackKeyInput is the input for CreateAdminIntegrationsSlackKey — Set Slack API Key. +type CreateAdminIntegrationsSlackKeyInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApiKey string `json:"apiKey"` + models.RequestScope +} + +// CreateAdminIntegrationsSlackKey - Set Slack API Key +// POST /admin/integrations/slack/key +func (c *Client) CreateAdminIntegrationsSlackKey(ctx context.Context, in CreateAdminIntegrationsSlackKeyInput) (*models.EndpointsPostSlackAPIKeyOutput, error) { + path := "/admin/integrations/slack/key" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ApiKey string `json:"apiKey"` + }{ + ApiKey: in.ApiKey, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostSlackAPIKeyOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsTeamsInput is the input for ListAdminIntegrationsTeams — Get Integration Teams. +type ListAdminIntegrationsTeamsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsTeams - Get Integration Teams +// GET /admin/integrations/teams +func (c *Client) ListAdminIntegrationsTeams(ctx context.Context, in ListAdminIntegrationsTeamsInput) (*models.EndpointsAdminGetIntegrationTeamsOutput, error) { + path := "/admin/integrations/teams" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetIntegrationTeamsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsThreatIntelDestinationsInput is the input for ListAdminIntegrationsThreatIntelDestinations — Get Threat Investigation Destinations. +type ListAdminIntegrationsThreatIntelDestinationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsThreatIntelDestinations - Get Threat Investigation Destinations +// GET /admin/integrations/threat-intel/destinations +func (c *Client) ListAdminIntegrationsThreatIntelDestinations(ctx context.Context, in ListAdminIntegrationsThreatIntelDestinationsInput) (*models.EndpointsAdminGetThreatNotificationDestinationsOutput, error) { + path := "/admin/integrations/threat-intel/destinations" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetThreatNotificationDestinationsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminIntegrationsThreatIntelDestinationsInput is the input for UpdateAdminIntegrationsThreatIntelDestinations — Update Threat Investigation Destinations. +type UpdateAdminIntegrationsThreatIntelDestinationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + MicrosoftTeamsWebhookURL *string `json:"microsoftTeamsWebhookUrl,omitempty"` + NullifySharedSlack *bool `json:"nullifySharedSlack,omitempty"` + TenantSlackChannelID *string `json:"tenantSlackChannelId,omitempty"` + models.RequestScope +} + +// UpdateAdminIntegrationsThreatIntelDestinations - Update Threat Investigation Destinations +// PUT /admin/integrations/threat-intel/destinations +func (c *Client) UpdateAdminIntegrationsThreatIntelDestinations(ctx context.Context, in UpdateAdminIntegrationsThreatIntelDestinationsInput) (*models.EndpointsAdminPutThreatNotificationDestinationsOutput, error) { + path := "/admin/integrations/threat-intel/destinations" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + MicrosoftTeamsWebhookURL *string `json:"microsoftTeamsWebhookUrl,omitempty"` + NullifySharedSlack *bool `json:"nullifySharedSlack,omitempty"` + TenantSlackChannelID *string `json:"tenantSlackChannelId,omitempty"` + }{ + MicrosoftTeamsWebhookURL: in.MicrosoftTeamsWebhookURL, + NullifySharedSlack: in.NullifySharedSlack, + TenantSlackChannelID: in.TenantSlackChannelID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminPutThreatNotificationDestinationsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsUsersInput is the input for ListAdminIntegrationsUsers — Get Integration Users. +type ListAdminIntegrationsUsersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsUsers - Get Integration Users +// GET /admin/integrations/users +func (c *Client) ListAdminIntegrationsUsers(ctx context.Context, in ListAdminIntegrationsUsersInput) (*models.EndpointsAdminGetIntegrationUsersOutput, error) { + path := "/admin/integrations/users" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetIntegrationUsersOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminIntegrationsProviderIdCapabilityConfigureInput is the input for UpdateAdminIntegrationsProviderIdCapabilityConfigure — Configure Integration. +type UpdateAdminIntegrationsProviderIdCapabilityConfigureInput struct { + ProviderID string `path:"providerId" json:"-"` + Capability string `path:"capability" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Fields map[string]string `json:"fields,omitempty"` + models.RequestScope +} + +// UpdateAdminIntegrationsProviderIdCapabilityConfigure - Configure Integration +// PUT /admin/integrations/{providerId}/{capability}/configure +func (c *Client) UpdateAdminIntegrationsProviderIdCapabilityConfigure(ctx context.Context, in UpdateAdminIntegrationsProviderIdCapabilityConfigureInput) (*models.EndpointsAdminConfigureIntegrationOutput, error) { + path := "/admin/integrations/{providerId}/{capability}/configure" + path = strings.Replace(path, "{providerId}", url.PathEscape(in.ProviderID), 1) + path = strings.Replace(path, "{capability}", url.PathEscape(in.Capability), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Fields map[string]string `json:"fields,omitempty"` + }{ + Fields: in.Fields, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminConfigureIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsProviderIdCapabilityConnectInput is the input for CreateAdminIntegrationsProviderIdCapabilityConnect — Connect Integration. +type CreateAdminIntegrationsProviderIdCapabilityConnectInput struct { + ProviderID string `path:"providerId" json:"-"` + Capability string `path:"capability" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Fields map[string]string `json:"fields,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsProviderIdCapabilityConnect - Connect Integration +// POST /admin/integrations/{providerId}/{capability}/connect +func (c *Client) CreateAdminIntegrationsProviderIdCapabilityConnect(ctx context.Context, in CreateAdminIntegrationsProviderIdCapabilityConnectInput) (*models.EndpointsAdminConnectIntegrationOutput, error) { + path := "/admin/integrations/{providerId}/{capability}/connect" + path = strings.Replace(path, "{providerId}", url.PathEscape(in.ProviderID), 1) + path = strings.Replace(path, "{capability}", url.PathEscape(in.Capability), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Fields map[string]string `json:"fields,omitempty"` + }{ + Fields: in.Fields, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminConnectIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsProviderIdCapabilityConnectionsInput is the input for CreateAdminIntegrationsProviderIdCapabilityConnections — Create Integration Connection. +type CreateAdminIntegrationsProviderIdCapabilityConnectionsInput struct { + ProviderID string `path:"providerId" json:"-"` + Capability string `path:"capability" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DisplayName *string `json:"displayName,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + models.RequestScope +} + +// CreateAdminIntegrationsProviderIdCapabilityConnections - Create Integration Connection +// POST /admin/integrations/{providerId}/{capability}/connections +func (c *Client) CreateAdminIntegrationsProviderIdCapabilityConnections(ctx context.Context, in CreateAdminIntegrationsProviderIdCapabilityConnectionsInput) (*models.EndpointsAdminCreateIntegrationConnectionOutput, error) { + path := "/admin/integrations/{providerId}/{capability}/connections" + path = strings.Replace(path, "{providerId}", url.PathEscape(in.ProviderID), 1) + path = strings.Replace(path, "{capability}", url.PathEscape(in.Capability), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DisplayName *string `json:"displayName,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + }{ + DisplayName: in.DisplayName, + Fields: in.Fields, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminCreateIntegrationConnectionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminIntegrationsProviderIdCapabilityDisconnectInput is the input for DeleteAdminIntegrationsProviderIdCapabilityDisconnect — Disconnect Integration. +type DeleteAdminIntegrationsProviderIdCapabilityDisconnectInput struct { + ProviderID string `path:"providerId" json:"-"` + Capability string `path:"capability" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminIntegrationsProviderIdCapabilityDisconnect - Disconnect Integration +// DELETE /admin/integrations/{providerId}/{capability}/disconnect +func (c *Client) DeleteAdminIntegrationsProviderIdCapabilityDisconnect(ctx context.Context, in DeleteAdminIntegrationsProviderIdCapabilityDisconnectInput) (*models.EndpointsAdminDisconnectIntegrationOutput, error) { + path := "/admin/integrations/{providerId}/{capability}/disconnect" + path = strings.Replace(path, "{providerId}", url.PathEscape(in.ProviderID), 1) + path = strings.Replace(path, "{capability}", url.PathEscape(in.Capability), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDisconnectIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminIntegrationsProviderIdCapabilityInstallInput is the input for ListAdminIntegrationsProviderIdCapabilityInstall — Start Integration OAuth install. +type ListAdminIntegrationsProviderIdCapabilityInstallInput struct { + ProviderID string `path:"providerId" json:"-"` + Capability string `path:"capability" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminIntegrationsProviderIdCapabilityInstall - Start Integration OAuth install +// GET /admin/integrations/{providerId}/{capability}/install +func (c *Client) ListAdminIntegrationsProviderIdCapabilityInstall(ctx context.Context, in ListAdminIntegrationsProviderIdCapabilityInstallInput) (*models.EndpointsGetIntegrationOAuthInstallOutput, error) { + path := "/admin/integrations/{providerId}/{capability}/install" + path = strings.Replace(path, "{providerId}", url.PathEscape(in.ProviderID), 1) + path = strings.Replace(path, "{capability}", url.PathEscape(in.Capability), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetIntegrationOAuthInstallOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminIntegrationsProviderIdCapabilityTestInput is the input for CreateAdminIntegrationsProviderIdCapabilityTest — Test Integration. +type CreateAdminIntegrationsProviderIdCapabilityTestInput struct { + ProviderID string `path:"providerId" json:"-"` + Capability string `path:"capability" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateAdminIntegrationsProviderIdCapabilityTest - Test Integration +// POST /admin/integrations/{providerId}/{capability}/test +func (c *Client) CreateAdminIntegrationsProviderIdCapabilityTest(ctx context.Context, in CreateAdminIntegrationsProviderIdCapabilityTestInput) (*models.EndpointsAdminTestIntegrationOutput, error) { + path := "/admin/integrations/{providerId}/{capability}/test" + path = strings.Replace(path, "{providerId}", url.PathEscape(in.ProviderID), 1) + path = strings.Replace(path, "{capability}", url.PathEscape(in.Capability), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminTestIntegrationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminManagerSettingsInput is the input for ListAdminManagerSettings — Get Manager Settings. +type ListAdminManagerSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminManagerSettings - Get Manager Settings +// GET /admin/manager/settings +func (c *Client) ListAdminManagerSettings(ctx context.Context, in ListAdminManagerSettingsInput) (*models.EndpointsGetManagerSettingsOutput, error) { + path := "/admin/manager/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetManagerSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminManagerSettingsInput is the input for UpdateAdminManagerSettings — Update Manager Settings. +type UpdateAdminManagerSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AutomatedThreatInvestigations *bool `json:"automatedThreatInvestigations,omitempty"` + BlockedActionTypes []string `json:"blockedActionTypes,omitempty"` + DailyUpdatesEnabled *bool `json:"dailyUpdatesEnabled,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + GroundRules *string `json:"groundRules,omitempty"` + WeeklyUpdatesEnabled *bool `json:"weeklyUpdatesEnabled,omitempty"` + models.RequestScope +} + +// UpdateAdminManagerSettings - Update Manager Settings +// PUT /admin/manager/settings +func (c *Client) UpdateAdminManagerSettings(ctx context.Context, in UpdateAdminManagerSettingsInput) (*models.EndpointsPutManagerSettingsOutput, error) { + path := "/admin/manager/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AutomatedThreatInvestigations *bool `json:"automatedThreatInvestigations,omitempty"` + BlockedActionTypes []string `json:"blockedActionTypes,omitempty"` + DailyUpdatesEnabled *bool `json:"dailyUpdatesEnabled,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + GroundRules *string `json:"groundRules,omitempty"` + WeeklyUpdatesEnabled *bool `json:"weeklyUpdatesEnabled,omitempty"` + }{ + AutomatedThreatInvestigations: in.AutomatedThreatInvestigations, + BlockedActionTypes: in.BlockedActionTypes, + DailyUpdatesEnabled: in.DailyUpdatesEnabled, + ExpectedUpdatedAt: in.ExpectedUpdatedAt, + GroundRules: in.GroundRules, + WeeklyUpdatesEnabled: in.WeeklyUpdatesEnabled, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutManagerSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsFindingsInput is the input for CreateAdminMetricsFindings — Post Findings Metrics. +type CreateAdminMetricsFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeFunnel *bool `json:"includeFunnel,omitempty"` + Query models.ModelsLimitedUnifiedFindingsQuery `json:"query"` + models.RequestScope +} + +// CreateAdminMetricsFindings - Post Findings Metrics +// POST /admin/metrics/findings +func (c *Client) CreateAdminMetricsFindings(ctx context.Context, in CreateAdminMetricsFindingsInput) (*models.EndpointsAdminQueryFindingsMetricsOutput, error) { + path := "/admin/metrics/findings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + IncludeFunnel *bool `json:"includeFunnel,omitempty"` + Query models.ModelsLimitedUnifiedFindingsQuery `json:"query"` + }{ + IncludeFunnel: in.IncludeFunnel, + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminQueryFindingsMetricsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsFindingsByRepositoryInput is the input for CreateAdminMetricsFindingsByRepository — Post Findings Metrics By Repository. +type CreateAdminMetricsFindingsByRepositoryInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsLimitedUnifiedFindingsQuery `json:"query"` + models.RequestScope +} + +// CreateAdminMetricsFindingsByRepository - Post Findings Metrics By Repository +// POST /admin/metrics/findings/by-repository +func (c *Client) CreateAdminMetricsFindingsByRepository(ctx context.Context, in CreateAdminMetricsFindingsByRepositoryInput) (*models.EndpointsAdminQueryFindingsMetricsByRepositoryOutput, error) { + path := "/admin/metrics/findings/by-repository" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Query models.ModelsLimitedUnifiedFindingsQuery `json:"query"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminQueryFindingsMetricsByRepositoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsFindingsFrameworksInput is the input for CreateAdminMetricsFindingsFrameworks — Post Findings Compliance Frameworks. +type CreateAdminMetricsFindingsFrameworksInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateAdminMetricsFindingsFrameworks - Post Findings Compliance Frameworks +// POST /admin/metrics/findings/frameworks +func (c *Client) CreateAdminMetricsFindingsFrameworks(ctx context.Context, in CreateAdminMetricsFindingsFrameworksInput) (*models.EndpointsAdminQueryFindingsFrameworksOutput, error) { + path := "/admin/metrics/findings/frameworks" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminQueryFindingsFrameworksOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminMetricsInteractionsInput is the input for ListAdminMetricsInteractions — Get Interactions. +type ListAdminMetricsInteractionsInput struct { + FromDate *string `url:"fromDate,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ToDate *string `url:"toDate,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminMetricsInteractions - Get Interactions +// GET /admin/metrics/interactions +func (c *Client) ListAdminMetricsInteractions(ctx context.Context, in ListAdminMetricsInteractionsInput) (*models.EndpointsAdminBotInteractionsOutput, error) { + path := "/admin/metrics/interactions" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.FromDate != nil { + query.Set("fromDate", string(*in.FromDate)) + } + if in.ToDate != nil { + query.Set("toDate", string(*in.ToDate)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminBotInteractionsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsOverTimeInput is the input for CreateAdminMetricsOverTime — Get Metrics Over Time. +type CreateAdminMetricsOverTimeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Resolution *string `url:"resolution,omitempty" json:"-"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` + models.RequestScope +} + +// CreateAdminMetricsOverTime - Get Metrics Over Time +// POST /admin/metrics/over-time +func (c *Client) CreateAdminMetricsOverTime(ctx context.Context, in CreateAdminMetricsOverTimeInput) (*models.EndpointsQueryMetricsOverTimeOutput, error) { + path := "/admin/metrics/over-time" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Resolution != nil { + query.Set("resolution", string(*in.Resolution)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Query models.ModelsUnifiedFindingsQuery `json:"query"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsQueryMetricsOverTimeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsOverviewInput is the input for CreateAdminMetricsOverview — Query Overview. +type CreateAdminMetricsOverviewInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsUnifiedFindingsQuery `json:"query"` + models.RequestScope +} + +// CreateAdminMetricsOverview - Query Overview +// POST /admin/metrics/overview +func (c *Client) CreateAdminMetricsOverview(ctx context.Context, in CreateAdminMetricsOverviewInput) (*models.EndpointsQueryOverviewOutput, error) { + path := "/admin/metrics/overview" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Query models.ModelsUnifiedFindingsQuery `json:"query"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsQueryOverviewOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsPullrequestsInput is the input for CreateAdminMetricsPullrequests — Post Pull Request Metrics. +type CreateAdminMetricsPullrequestsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsPullRequestMetricsQuery `json:"query"` + models.RequestScope +} + +// CreateAdminMetricsPullrequests - Post Pull Request Metrics +// POST /admin/metrics/pullrequests +func (c *Client) CreateAdminMetricsPullrequests(ctx context.Context, in CreateAdminMetricsPullrequestsInput) (*models.EndpointsAdminQueryPullRequestMetricsOutput, error) { + path := "/admin/metrics/pullrequests" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Query models.ModelsPullRequestMetricsQuery `json:"query"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminQueryPullRequestMetricsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsRawInput is the input for CreateAdminMetricsRaw — Query Raw Metrics. +type CreateAdminMetricsRawInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsUnifiedFindingsMetricsQuery `json:"query"` + models.RequestScope +} + +// CreateAdminMetricsRaw - Query Raw Metrics +// POST /admin/metrics/raw +func (c *Client) CreateAdminMetricsRaw(ctx context.Context, in CreateAdminMetricsRawInput) (*models.EndpointsQueryMetricsRawOutput, error) { + path := "/admin/metrics/raw" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Query models.ModelsUnifiedFindingsMetricsQuery `json:"query"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsQueryMetricsRawOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminMetricsTicketsInput is the input for CreateAdminMetricsTickets — Post Ticket Metrics. +type CreateAdminMetricsTicketsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query models.ModelsTicketMetricsQuery `json:"query"` + models.RequestScope +} + +// CreateAdminMetricsTickets - Post Ticket Metrics +// POST /admin/metrics/tickets +func (c *Client) CreateAdminMetricsTickets(ctx context.Context, in CreateAdminMetricsTicketsInput) (*models.EndpointsAdminQueryTicketMetricsOutput, error) { + path := "/admin/metrics/tickets" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Query models.ModelsTicketMetricsQuery `json:"query"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminQueryTicketMetricsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminMetricsUsageAggregateInput is the input for ListAdminMetricsUsageAggregate — Usage Aggregate. +type ListAdminMetricsUsageAggregateInput struct { + Agent *string `url:"agent,omitempty" json:"-"` + BranchType *string `url:"branchType,omitempty" json:"-"` + Class *string `url:"class,omitempty" json:"-"` + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` + Window *string `url:"window,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminMetricsUsageAggregate - Usage Aggregate +// GET /admin/metrics/usage/aggregate +func (c *Client) ListAdminMetricsUsageAggregate(ctx context.Context, in ListAdminMetricsUsageAggregateInput) (*models.EndpointsAdminUsageMetricsAggregateOutput, error) { + path := "/admin/metrics/usage/aggregate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Window != nil { + query.Set("window", string(*in.Window)) + } + if in.Class != nil { + query.Set("class", string(*in.Class)) + } + if in.Agent != nil { + query.Set("agent", string(*in.Agent)) + } + if in.BranchType != nil { + query.Set("branchType", string(*in.BranchType)) + } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUsageMetricsAggregateOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminMetricsUsageLedgerInput is the input for ListAdminMetricsUsageLedger — Usage Ledger. +type ListAdminMetricsUsageLedgerInput struct { + Agent *string `url:"agent,omitempty" json:"-"` + BranchType *string `url:"branchType,omitempty" json:"-"` + Class *string `url:"class,omitempty" json:"-"` + Cursor *string `url:"cursor,omitempty" json:"-"` + FindingID []string `url:"findingId,omitempty" json:"-"` + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Query *string `url:"query,omitempty" json:"-"` + RunID *string `url:"runId,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminMetricsUsageLedger - Usage Ledger +// GET /admin/metrics/usage/ledger +func (c *Client) ListAdminMetricsUsageLedger(ctx context.Context, in ListAdminMetricsUsageLedgerInput) (*models.EndpointsAdminUsageLedgerResponse, error) { + path := "/admin/metrics/usage/ledger" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Query != nil { + query.Set("query", string(*in.Query)) + } + if in.Class != nil { + query.Set("class", string(*in.Class)) + } + if in.Agent != nil { + query.Set("agent", string(*in.Agent)) + } + if in.BranchType != nil { + query.Set("branchType", string(*in.BranchType)) + } + if in.RunID != nil { + query.Set("runId", string(*in.RunID)) + } + for _, v := range in.FindingID { + query.Add("findingId", string(v)) + } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUsageLedgerResponse + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminMetricsUsageTimeseriesInput is the input for ListAdminMetricsUsageTimeseries — Usage Timeseries. +type ListAdminMetricsUsageTimeseriesInput struct { + Agent *string `url:"agent,omitempty" json:"-"` + Class *string `url:"class,omitempty" json:"-"` + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Granularity *string `url:"granularity,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminMetricsUsageTimeseries - Usage Timeseries +// GET /admin/metrics/usage/timeseries +func (c *Client) ListAdminMetricsUsageTimeseries(ctx context.Context, in ListAdminMetricsUsageTimeseriesInput) (*models.EndpointsAdminUsageMetricsTimeseriesOutput, error) { + path := "/admin/metrics/usage/timeseries" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Granularity != nil { + query.Set("granularity", string(*in.Granularity)) + } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.Class != nil { + query.Set("class", string(*in.Class)) + } + if in.Agent != nil { + query.Set("agent", string(*in.Agent)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminUsageMetricsTimeseriesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminNetworkIpAllowlistInput is the input for ListAdminNetworkIpAllowlist — Get IP Allowlist. +type ListAdminNetworkIpAllowlistInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminNetworkIpAllowlist - Get IP Allowlist +// GET /admin/network/ip-allowlist +func (c *Client) ListAdminNetworkIpAllowlist(ctx context.Context, in ListAdminNetworkIpAllowlistInput) (*models.EndpointsNetworkIPAllowlistOutput, error) { + path := "/admin/network/ip-allowlist" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsNetworkIPAllowlistOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminNetworkIpAllowlistInput is the input for UpdateAdminNetworkIpAllowlist — Replace IP Allowlist. +type UpdateAdminNetworkIpAllowlistInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Entries []models.EndpointsIPAllowlistEntryInput `json:"entries,omitempty"` + ExpectedCidrs []string `json:"expectedCidrs,omitempty"` + models.RequestScope +} + +// UpdateAdminNetworkIpAllowlist - Replace IP Allowlist +// PUT /admin/network/ip-allowlist +func (c *Client) UpdateAdminNetworkIpAllowlist(ctx context.Context, in UpdateAdminNetworkIpAllowlistInput) (*models.EndpointsNetworkIPAllowlistOutput, error) { + path := "/admin/network/ip-allowlist" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Entries []models.EndpointsIPAllowlistEntryInput `json:"entries,omitempty"` + ExpectedCidrs []string `json:"expectedCidrs,omitempty"` + }{ + Entries: in.Entries, + ExpectedCidrs: in.ExpectedCidrs, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsNetworkIPAllowlistOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminNetworkIpAllowlistPreviewInput is the input for CreateAdminNetworkIpAllowlistPreview — Preview IP Allowlist. +type CreateAdminNetworkIpAllowlistPreviewInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Entries []models.EndpointsIPAllowlistEntryInput `json:"entries,omitempty"` + models.RequestScope +} + +// CreateAdminNetworkIpAllowlistPreview - Preview IP Allowlist +// POST /admin/network/ip-allowlist/preview +func (c *Client) CreateAdminNetworkIpAllowlistPreview(ctx context.Context, in CreateAdminNetworkIpAllowlistPreviewInput) (*models.EndpointsNetworkIPAllowlistOutput, error) { + path := "/admin/network/ip-allowlist/preview" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Entries []models.EndpointsIPAllowlistEntryInput `json:"entries,omitempty"` + }{ + Entries: in.Entries, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsNetworkIPAllowlistOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorExternalWritesInitializeInput is the input for CreateAdminOperatorExternalWritesInitialize — Initialize External Write Defaults. +type CreateAdminOperatorExternalWritesInitializeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DryRun *bool `json:"dryRun,omitempty"` + Reason string `json:"reason"` + TenantID string `json:"tenantId"` + models.RequestScope +} + +// CreateAdminOperatorExternalWritesInitialize - Initialize External Write Defaults +// POST /admin/operator/external-writes/initialize +func (c *Client) CreateAdminOperatorExternalWritesInitialize(ctx context.Context, in CreateAdminOperatorExternalWritesInitializeInput) (*models.EndpointsInitializeExternalWritesOutput, error) { + path := "/admin/operator/external-writes/initialize" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DryRun *bool `json:"dryRun,omitempty"` + Reason string `json:"reason"` + TenantID string `json:"tenantId"` + }{ + DryRun: in.DryRun, + Reason: in.Reason, + TenantID: in.TenantID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsInitializeExternalWritesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorGithubTenantRouteInput is the input for CreateAdminOperatorGithubTenantRoute — Preview, write or inspect a GitHub tenant route born paused. +type CreateAdminOperatorGithubTenantRouteInput struct { + DeploymentID *string `json:"deploymentId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedBaseDomain *string `json:"expectedBaseDomain,omitempty"` + ExpectedRegion *string `json:"expectedRegion,omitempty"` + ExpectedStackOwnerIds []int64 `json:"expectedStackOwnerIds,omitempty"` + GithubOwnerID *int64 `json:"githubOwnerId,omitempty"` + Inspect *bool `json:"inspect,omitempty"` + InstallationID *int64 `json:"installationId,omitempty"` + OperationID *string `json:"operationId,omitempty"` + PrepareBeforeInstallation *bool `json:"prepareBeforeInstallation,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// CreateAdminOperatorGithubTenantRoute - Preview, write or inspect a GitHub tenant route born paused +// POST /admin/operator/github-tenant/route +func (c *Client) CreateAdminOperatorGithubTenantRoute(ctx context.Context, in CreateAdminOperatorGithubTenantRouteInput) (*models.ServiceGitHubTenantRouteResult, error) { + path := "/admin/operator/github-tenant/route" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DeploymentID *string `json:"deploymentId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedBaseDomain *string `json:"expectedBaseDomain,omitempty"` + ExpectedRegion *string `json:"expectedRegion,omitempty"` + ExpectedStackOwnerIds []int64 `json:"expectedStackOwnerIds,omitempty"` + GithubOwnerID *int64 `json:"githubOwnerId,omitempty"` + Inspect *bool `json:"inspect,omitempty"` + InstallationID *int64 `json:"installationId,omitempty"` + OperationID *string `json:"operationId,omitempty"` + PrepareBeforeInstallation *bool `json:"prepareBeforeInstallation,omitempty"` + Reason *string `json:"reason,omitempty"` + }{ + DeploymentID: in.DeploymentID, + DryRun: in.DryRun, + ExpectedBaseDomain: in.ExpectedBaseDomain, + ExpectedRegion: in.ExpectedRegion, + ExpectedStackOwnerIds: in.ExpectedStackOwnerIds, + GithubOwnerID: in.GithubOwnerID, + Inspect: in.Inspect, + InstallationID: in.InstallationID, + OperationID: in.OperationID, + PrepareBeforeInstallation: in.PrepareBeforeInstallation, + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.ServiceGitHubTenantRouteResult + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorNativeTenantRouteInput is the input for CreateAdminOperatorNativeTenantRoute — Preview or write a native Azure workspace route. +type CreateAdminOperatorNativeTenantRouteInput struct { + Administrators []models.ServiceNativeBootstrapAdministrator `json:"administrators,omitempty"` + BaseDomain *string `json:"baseDomain,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + DirectoryID *string `json:"directoryId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + Inspect *bool `json:"inspect,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Operator *string `json:"operator,omitempty"` + Reason *string `json:"reason,omitempty"` + Region *string `json:"region,omitempty"` + Stage *string `json:"stage,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} + +// CreateAdminOperatorNativeTenantRoute - Preview or write a native Azure workspace route +// POST /admin/operator/native-tenant/route +func (c *Client) CreateAdminOperatorNativeTenantRoute(ctx context.Context, in CreateAdminOperatorNativeTenantRouteInput) (*models.ServiceNativeTenantBootstrapResult, error) { + path := "/admin/operator/native-tenant/route" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Administrators []models.ServiceNativeBootstrapAdministrator `json:"administrators,omitempty"` + BaseDomain *string `json:"baseDomain,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + DirectoryID *string `json:"directoryId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + Inspect *bool `json:"inspect,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Operator *string `json:"operator,omitempty"` + Reason *string `json:"reason,omitempty"` + Region *string `json:"region,omitempty"` + Stage *string `json:"stage,omitempty"` + TenantID *string `json:"tenantId,omitempty"` + }{ + Administrators: in.Administrators, + BaseDomain: in.BaseDomain, + DeploymentID: in.DeploymentID, + DirectoryID: in.DirectoryID, + DryRun: in.DryRun, + ExpectedState: in.ExpectedState, + Inspect: in.Inspect, + OperationID: in.OperationID, + Operator: in.Operator, + Reason: in.Reason, + Region: in.Region, + Stage: in.Stage, + TenantID: in.TenantID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.ServiceNativeTenantBootstrapResult + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminOperatorPackageFeedsInput is the input for ListAdminOperatorPackageFeeds — Read Staff Package Feeds. +type ListAdminOperatorPackageFeedsInput struct { + ConnectionID *string `url:"connectionId,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminOperatorPackageFeeds - Read Staff Package Feeds +// GET /admin/operator/package-feeds +func (c *Client) ListAdminOperatorPackageFeeds(ctx context.Context, in ListAdminOperatorPackageFeedsInput) (*models.EndpointsAdminCLIPackageFeedsOutput, error) { + path := "/admin/operator/package-feeds" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.ConnectionID != nil { + query.Set("connectionId", string(*in.ConnectionID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminCLIPackageFeedsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorPackageFeedsInput is the input for CreateAdminOperatorPackageFeeds — Control Staff Package Feed. +type CreateAdminOperatorPackageFeedsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConnectionID *string `json:"connectionId,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + Operation string `json:"operation"` + ProviderID *string `json:"providerId,omitempty"` + Reason string `json:"reason"` + models.RequestScope +} + +// CreateAdminOperatorPackageFeeds - Control Staff Package Feed +// POST /admin/operator/package-feeds +func (c *Client) CreateAdminOperatorPackageFeeds(ctx context.Context, in CreateAdminOperatorPackageFeedsInput) (*models.EndpointsAdminCLIPackageFeedControlOutput, error) { + path := "/admin/operator/package-feeds" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ConnectionID *string `json:"connectionId,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + Operation string `json:"operation"` + ProviderID *string `json:"providerId,omitempty"` + Reason string `json:"reason"` + }{ + ConnectionID: in.ConnectionID, + DisplayName: in.DisplayName, + ExpectedRevision: in.ExpectedRevision, + Fields: in.Fields, + Operation: in.Operation, + ProviderID: in.ProviderID, + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminCLIPackageFeedControlOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminOperatorScanEntitlementInput is the input for ListAdminOperatorScanEntitlement — Read Staff Scan Entitlement. +type ListAdminOperatorScanEntitlementInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminOperatorScanEntitlement - Read Staff Scan Entitlement +// GET /admin/operator/scan-entitlement +func (c *Client) ListAdminOperatorScanEntitlement(ctx context.Context, in ListAdminOperatorScanEntitlementInput) (*models.EndpointsOperatorScanEntitlementOutput, error) { + path := "/admin/operator/scan-entitlement" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsOperatorScanEntitlementOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminOperatorScanEntitlementInput is the input for UpdateAdminOperatorScanEntitlement — Replace Staff Scan Entitlement. +type UpdateAdminOperatorScanEntitlementInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CodeRepositoryCap *int `json:"codeRepositoryCap,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + Reason string `json:"reason"` + ScopingEnabled *bool `json:"scopingEnabled,omitempty"` + SecretsMode *string `json:"secretsMode,omitempty"` + SecretsRepositoryCap *int `json:"secretsRepositoryCap,omitempty"` + StaffRepositoryAllowlist *bool `json:"staffRepositoryAllowlist,omitempty"` + TenantID string `json:"tenantId"` + models.RequestScope +} + +// UpdateAdminOperatorScanEntitlement - Replace Staff Scan Entitlement +// PUT /admin/operator/scan-entitlement +func (c *Client) UpdateAdminOperatorScanEntitlement(ctx context.Context, in UpdateAdminOperatorScanEntitlementInput) (*models.EndpointsOperatorScanEntitlementOutput, error) { + path := "/admin/operator/scan-entitlement" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CodeRepositoryCap *int `json:"codeRepositoryCap,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + Reason string `json:"reason"` + ScopingEnabled *bool `json:"scopingEnabled,omitempty"` + SecretsMode *string `json:"secretsMode,omitempty"` + SecretsRepositoryCap *int `json:"secretsRepositoryCap,omitempty"` + StaffRepositoryAllowlist *bool `json:"staffRepositoryAllowlist,omitempty"` + TenantID string `json:"tenantId"` + }{ + CodeRepositoryCap: in.CodeRepositoryCap, + ExpectedUpdatedAt: in.ExpectedUpdatedAt, + Reason: in.Reason, + ScopingEnabled: in.ScopingEnabled, + SecretsMode: in.SecretsMode, + SecretsRepositoryCap: in.SecretsRepositoryCap, + StaffRepositoryAllowlist: in.StaffRepositoryAllowlist, + TenantID: in.TenantID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsOperatorScanEntitlementOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminOperatorScanScopeRepositoriesInput is the input for ListAdminOperatorScanScopeRepositories — Read Staff Repository Scan Scopes. +type ListAdminOperatorScanScopeRepositoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminOperatorScanScopeRepositories - Read Staff Repository Scan Scopes +// GET /admin/operator/scan-scope/repositories +func (c *Client) ListAdminOperatorScanScopeRepositories(ctx context.Context, in ListAdminOperatorScanScopeRepositoriesInput) (*models.EndpointsOperatorRepositoryScanScopesOutput, error) { + path := "/admin/operator/scan-scope/repositories" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsOperatorRepositoryScanScopesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminOperatorScanScopeRepositoriesInput is the input for UpdateAdminOperatorScanScopeRepositories — Set Staff Repository Scan Limits. +type UpdateAdminOperatorScanScopeRepositoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Reason string `json:"reason"` + Repositories []models.EndpointsRepositoryStaffScopeChange `json:"repositories,omitempty"` + TenantID string `json:"tenantId"` + models.RequestScope +} + +// UpdateAdminOperatorScanScopeRepositories - Set Staff Repository Scan Limits +// PUT /admin/operator/scan-scope/repositories +func (c *Client) UpdateAdminOperatorScanScopeRepositories(ctx context.Context, in UpdateAdminOperatorScanScopeRepositoriesInput) (*models.EndpointsOperatorRepositoryStaffScopesOutput, error) { + path := "/admin/operator/scan-scope/repositories" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Reason string `json:"reason"` + Repositories []models.EndpointsRepositoryStaffScopeChange `json:"repositories,omitempty"` + TenantID string `json:"tenantId"` + }{ + Reason: in.Reason, + Repositories: in.Repositories, + TenantID: in.TenantID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsOperatorRepositoryStaffScopesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminOperatorTenantCapabilitiesInput is the input for ListAdminOperatorTenantCapabilities — Read Staff Tenant Capabilities. +type ListAdminOperatorTenantCapabilitiesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminOperatorTenantCapabilities - Read Staff Tenant Capabilities +// GET /admin/operator/tenant-capabilities +func (c *Client) ListAdminOperatorTenantCapabilities(ctx context.Context, in ListAdminOperatorTenantCapabilitiesInput) (*models.EndpointsOperatorTenantCapabilitiesOutput, error) { + path := "/admin/operator/tenant-capabilities" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsOperatorTenantCapabilitiesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminOperatorTenantCapabilitiesInput is the input for UpdateAdminOperatorTenantCapabilities — Force Tenant Capability. +type UpdateAdminOperatorTenantCapabilitiesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Capability string `json:"capability"` + ExpectedStaffUpdatedAt *string `json:"expectedStaffUpdatedAt,omitempty"` + LockReason *string `json:"lockReason,omitempty"` + Reason string `json:"reason"` + Repository *string `json:"repository,omitempty"` + SeedCustomerEnabled *bool `json:"seedCustomerEnabled,omitempty"` + SeedRepositoryDisabled *bool `json:"seedRepositoryDisabled,omitempty"` + SeedStaffIfAbsent *bool `json:"seedStaffIfAbsent,omitempty"` + StaffState string `json:"staffState"` + TenantID string `json:"tenantId"` + models.RequestScope +} + +// UpdateAdminOperatorTenantCapabilities - Force Tenant Capability +// PUT /admin/operator/tenant-capabilities +func (c *Client) UpdateAdminOperatorTenantCapabilities(ctx context.Context, in UpdateAdminOperatorTenantCapabilitiesInput) (*models.EndpointsOperatorTenantCapabilityPutOutput, error) { + path := "/admin/operator/tenant-capabilities" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Capability string `json:"capability"` + ExpectedStaffUpdatedAt *string `json:"expectedStaffUpdatedAt,omitempty"` + LockReason *string `json:"lockReason,omitempty"` + Reason string `json:"reason"` + Repository *string `json:"repository,omitempty"` + SeedCustomerEnabled *bool `json:"seedCustomerEnabled,omitempty"` + SeedRepositoryDisabled *bool `json:"seedRepositoryDisabled,omitempty"` + SeedStaffIfAbsent *bool `json:"seedStaffIfAbsent,omitempty"` + StaffState string `json:"staffState"` + TenantID string `json:"tenantId"` + }{ + Capability: in.Capability, + ExpectedStaffUpdatedAt: in.ExpectedStaffUpdatedAt, + LockReason: in.LockReason, + Reason: in.Reason, + Repository: in.Repository, + SeedCustomerEnabled: in.SeedCustomerEnabled, + SeedRepositoryDisabled: in.SeedRepositoryDisabled, + SeedStaffIfAbsent: in.SeedStaffIfAbsent, + StaffState: in.StaffState, + TenantID: in.TenantID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsOperatorTenantCapabilityPutOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorWorkspaceBootstrapApproveInput is the input for CreateAdminOperatorWorkspaceBootstrapApprove — Approve an exact provisioning request. +type CreateAdminOperatorWorkspaceBootstrapApproveInput struct { + Action *string `json:"action,omitempty"` + Confirm *bool `json:"confirm,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + ExpectedOperationRevision *int64 `json:"expectedOperationRevision,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + Reason *string `json:"reason,omitempty"` + RequestID *string `json:"requestId,omitempty"` + SetupKind *string `json:"setupKind,omitempty"` +} + +// CreateAdminOperatorWorkspaceBootstrapApprove - Approve an exact provisioning request +// POST /admin/operator/workspace-bootstrap/approve +func (c *Client) CreateAdminOperatorWorkspaceBootstrapApprove(ctx context.Context, in CreateAdminOperatorWorkspaceBootstrapApproveInput) (*models.EndpointsWorkspaceProvisioningApproveOutput, error) { + path := "/admin/operator/workspace-bootstrap/approve" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Action *string `json:"action,omitempty"` + Confirm *bool `json:"confirm,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + ExpectedOperationRevision *int64 `json:"expectedOperationRevision,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + Reason *string `json:"reason,omitempty"` + RequestID *string `json:"requestId,omitempty"` + SetupKind *string `json:"setupKind,omitempty"` + }{ + Action: in.Action, + Confirm: in.Confirm, + DeploymentID: in.DeploymentID, + ExpectedOperationRevision: in.ExpectedOperationRevision, + ExpectedRevision: in.ExpectedRevision, + Reason: in.Reason, + RequestID: in.RequestID, + SetupKind: in.SetupKind, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsWorkspaceProvisioningApproveOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorWorkspaceBootstrapInvitationInput is the input for CreateAdminOperatorWorkspaceBootstrapInvitation — Preview or issue a workspace bootstrap invitation. +type CreateAdminOperatorWorkspaceBootstrapInvitationInput struct { + DeploymentID *string `json:"deploymentId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedDirectoryID *string `json:"expectedDirectoryId,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + Reason *string `json:"reason,omitempty"` + Recipient *string `json:"recipient,omitempty"` +} + +// CreateAdminOperatorWorkspaceBootstrapInvitation - Preview or issue a workspace bootstrap invitation +// POST /admin/operator/workspace-bootstrap/invitation +func (c *Client) CreateAdminOperatorWorkspaceBootstrapInvitation(ctx context.Context, in CreateAdminOperatorWorkspaceBootstrapInvitationInput) (*models.EndpointsWorkspaceBootstrapOperatorOutput, error) { + path := "/admin/operator/workspace-bootstrap/invitation" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DeploymentID *string `json:"deploymentId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedDirectoryID *string `json:"expectedDirectoryId,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + Reason *string `json:"reason,omitempty"` + Recipient *string `json:"recipient,omitempty"` + }{ + DeploymentID: in.DeploymentID, + DryRun: in.DryRun, + ExpectedDirectoryID: in.ExpectedDirectoryID, + ExpectedState: in.ExpectedState, + Reason: in.Reason, + Recipient: in.Recipient, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsWorkspaceBootstrapOperatorOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminOperatorWorkspaceBootstrapOperationInput is the input for ListAdminOperatorWorkspaceBootstrapOperation — Inspect a durable workspace claim. +type ListAdminOperatorWorkspaceBootstrapOperationInput struct { + OperationID *string `url:"operationId,omitempty" json:"-"` +} + +// ListAdminOperatorWorkspaceBootstrapOperation - Inspect a durable workspace claim +// GET /admin/operator/workspace-bootstrap/operation +func (c *Client) ListAdminOperatorWorkspaceBootstrapOperation(ctx context.Context, in ListAdminOperatorWorkspaceBootstrapOperationInput) (*models.WorkspacebootstrapOperatorInspection, error) { + path := "/admin/operator/workspace-bootstrap/operation" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.OperationID != nil { + query.Set("operationId", string(*in.OperationID)) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.WorkspacebootstrapOperatorInspection + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorWorkspaceBootstrapRenewInput is the input for CreateAdminOperatorWorkspaceBootstrapRenew — Preview or renew an organization-pinned workspace invitation. +type CreateAdminOperatorWorkspaceBootstrapRenewInput struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// CreateAdminOperatorWorkspaceBootstrapRenew - Preview or renew an organization-pinned workspace invitation +// POST /admin/operator/workspace-bootstrap/renew +func (c *Client) CreateAdminOperatorWorkspaceBootstrapRenew(ctx context.Context, in CreateAdminOperatorWorkspaceBootstrapRenewInput) (*models.WorkspacebootstrapOperatorInspection, error) { + path := "/admin/operator/workspace-bootstrap/renew" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Reason *string `json:"reason,omitempty"` + }{ + DryRun: in.DryRun, + ExpectedRevision: in.ExpectedRevision, + ExpectedState: in.ExpectedState, + OperationID: in.OperationID, + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.WorkspacebootstrapOperatorInspection + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminOperatorWorkspaceBootstrapRequestsInput is the input for ListAdminOperatorWorkspaceBootstrapRequests — List provisioning requests. +type ListAdminOperatorWorkspaceBootstrapRequestsInput struct { + BeforeRequestID *string `url:"beforeRequestId,omitempty" json:"-"` +} + +// ListAdminOperatorWorkspaceBootstrapRequests - List provisioning requests +// GET /admin/operator/workspace-bootstrap/requests +func (c *Client) ListAdminOperatorWorkspaceBootstrapRequests(ctx context.Context, in ListAdminOperatorWorkspaceBootstrapRequestsInput) (*models.EndpointsWorkspaceProvisioningQueueOutput, error) { + path := "/admin/operator/workspace-bootstrap/requests" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.BeforeRequestID != nil { + query.Set("beforeRequestId", string(*in.BeforeRequestID)) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsWorkspaceProvisioningQueueOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminOperatorWorkspaceBootstrapRevokeInput is the input for CreateAdminOperatorWorkspaceBootstrapRevoke — Preview or revoke a workspace claim without stage receipts. +type CreateAdminOperatorWorkspaceBootstrapRevokeInput struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// CreateAdminOperatorWorkspaceBootstrapRevoke - Preview or revoke a workspace claim without stage receipts +// POST /admin/operator/workspace-bootstrap/revoke +func (c *Client) CreateAdminOperatorWorkspaceBootstrapRevoke(ctx context.Context, in CreateAdminOperatorWorkspaceBootstrapRevokeInput) (*models.WorkspacebootstrapOperatorInspection, error) { + path := "/admin/operator/workspace-bootstrap/revoke" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Reason *string `json:"reason,omitempty"` + }{ + DryRun: in.DryRun, + ExpectedRevision: in.ExpectedRevision, + ExpectedState: in.ExpectedState, + OperationID: in.OperationID, + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.WorkspacebootstrapOperatorInspection + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminOrganizationInput is the input for ListAdminOrganization — Get Organization. +type ListAdminOrganizationInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeDirectory *bool `url:"includeDirectory,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminOrganization - Get Organization +// GET /admin/organization +func (c *Client) ListAdminOrganization(ctx context.Context, in ListAdminOrganizationInput) (*models.EndpointsAdminGetOrganizationOutput, error) { + path := "/admin/organization" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.IncludeDirectory != nil { + query.Set("includeDirectory", strconv.FormatBool(*in.IncludeDirectory)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetOrganizationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminPrGateSettingsInput is the input for ListAdminPrGateSettings — Get PR Gate Settings. +type ListAdminPrGateSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminPrGateSettings - Get PR Gate Settings +// GET /admin/pr-gate-settings +func (c *Client) ListAdminPrGateSettings(ctx context.Context, in ListAdminPrGateSettingsInput) (*models.EndpointsAdminGetPRGateSettingsOutput, error) { + path := "/admin/pr-gate-settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetPRGateSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminPrGateSettingsInput is the input for UpdateAdminPrGateSettings — Put PR Gate Settings. +type UpdateAdminPrGateSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AllowApprovingReviews *bool `json:"allowApprovingReviews,omitempty"` + AllowRequestChangesReviews *bool `json:"allowRequestChangesReviews,omitempty"` + CvssEnforcement *bool `json:"cvssEnforcement,omitempty"` + Enabled bool `json:"enabled"` + ExpectedPrScansEnabled *bool `json:"expectedPrScansEnabled,omitempty"` + ExpectedPushScansEnabled *bool `json:"expectedPushScansEnabled,omitempty"` + FailOnIncompleteCoverage *bool `json:"failOnIncompleteCoverage,omitempty"` + FindingsPolicy *models.EndpointsPRGateFindingsPolicy `json:"findingsPolicy,omitempty"` + MinPriority models.ModelsPriorityEnum `json:"minPriority"` + Mode *string `json:"mode,omitempty"` + PrReviewsEnabled *bool `json:"prReviewsEnabled,omitempty"` + PrScansEnabled *bool `json:"prScansEnabled,omitempty"` + PushScansEnabled *bool `json:"pushScansEnabled,omitempty"` + ScaBlockCvssThreshold *float64 `json:"scaBlockCvssThreshold,omitempty"` + models.RequestScope +} + +// UpdateAdminPrGateSettings - Put PR Gate Settings +// PUT /admin/pr-gate-settings +func (c *Client) UpdateAdminPrGateSettings(ctx context.Context, in UpdateAdminPrGateSettingsInput) (*models.EndpointsAdminPutPRGateSettingsOutput, error) { + path := "/admin/pr-gate-settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AllowApprovingReviews *bool `json:"allowApprovingReviews,omitempty"` + AllowRequestChangesReviews *bool `json:"allowRequestChangesReviews,omitempty"` + CvssEnforcement *bool `json:"cvssEnforcement,omitempty"` + Enabled bool `json:"enabled"` + ExpectedPrScansEnabled *bool `json:"expectedPrScansEnabled,omitempty"` + ExpectedPushScansEnabled *bool `json:"expectedPushScansEnabled,omitempty"` + FailOnIncompleteCoverage *bool `json:"failOnIncompleteCoverage,omitempty"` + FindingsPolicy *models.EndpointsPRGateFindingsPolicy `json:"findingsPolicy,omitempty"` + MinPriority models.ModelsPriorityEnum `json:"minPriority"` + Mode *string `json:"mode,omitempty"` + PrReviewsEnabled *bool `json:"prReviewsEnabled,omitempty"` + PrScansEnabled *bool `json:"prScansEnabled,omitempty"` + PushScansEnabled *bool `json:"pushScansEnabled,omitempty"` + ScaBlockCvssThreshold *float64 `json:"scaBlockCvssThreshold,omitempty"` + }{ + AllowApprovingReviews: in.AllowApprovingReviews, + AllowRequestChangesReviews: in.AllowRequestChangesReviews, + CvssEnforcement: in.CvssEnforcement, + Enabled: in.Enabled, + ExpectedPrScansEnabled: in.ExpectedPrScansEnabled, + ExpectedPushScansEnabled: in.ExpectedPushScansEnabled, + FailOnIncompleteCoverage: in.FailOnIncompleteCoverage, + FindingsPolicy: in.FindingsPolicy, + MinPriority: in.MinPriority, + Mode: in.Mode, + PrReviewsEnabled: in.PrReviewsEnabled, + PrScansEnabled: in.PrScansEnabled, + PushScansEnabled: in.PushScansEnabled, + ScaBlockCvssThreshold: in.ScaBlockCvssThreshold, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminPutPRGateSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminPrivacyAcknowledgmentInput is the input for ListAdminPrivacyAcknowledgment — Get Privacy Acknowledgment. +type ListAdminPrivacyAcknowledgmentInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PolicyVersion *string `url:"policyVersion,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminPrivacyAcknowledgment - Get Privacy Acknowledgment +// GET /admin/privacy/acknowledgment +func (c *Client) ListAdminPrivacyAcknowledgment(ctx context.Context, in ListAdminPrivacyAcknowledgmentInput) (*models.EndpointsGetPrivacyAcknowledgmentOutput, error) { + path := "/admin/privacy/acknowledgment" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.PolicyVersion != nil { + query.Set("policyVersion", string(*in.PolicyVersion)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPrivacyAcknowledgmentOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminPrivacyAcknowledgmentInput is the input for CreateAdminPrivacyAcknowledgment — Post Privacy Acknowledgment. +type CreateAdminPrivacyAcknowledgmentInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PolicyVersion string `json:"policyVersion"` + models.RequestScope +} + +// CreateAdminPrivacyAcknowledgment - Post Privacy Acknowledgment +// POST /admin/privacy/acknowledgment +func (c *Client) CreateAdminPrivacyAcknowledgment(ctx context.Context, in CreateAdminPrivacyAcknowledgmentInput) (*models.EndpointsPostPrivacyAcknowledgmentOutput, error) { + path := "/admin/privacy/acknowledgment" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + PolicyVersion string `json:"policyVersion"` + }{ + PolicyVersion: in.PolicyVersion, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostPrivacyAcknowledgmentOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminPullrequestsInput is the input for ListAdminPullrequests — Get Pull Request Record. +type ListAdminPullrequestsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ID *string `url:"id,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminPullrequests - Get Pull Request Record +// GET /admin/pullrequests +func (c *Client) ListAdminPullrequests(ctx context.Context, in ListAdminPullrequestsInput) (*models.EndpointsAdminGetPullRequestRecordOutput, error) { + path := "/admin/pullrequests" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.ID != nil { + query.Set("id", string(*in.ID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetPullRequestRecordOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminPullrequestsInput is the input for CreateAdminPullrequests — Query Pull Requests. +type CreateAdminPullrequestsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Query *models.ModelsFindingPullRequestQuery `json:"query,omitempty"` + models.RequestScope +} + +// CreateAdminPullrequests - Query Pull Requests +// POST /admin/pullrequests +func (c *Client) CreateAdminPullrequests(ctx context.Context, in CreateAdminPullrequestsInput) (*models.EndpointsAdminQueryPullRequestsOutput, error) { + path := "/admin/pullrequests" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Query *models.ModelsFindingPullRequestQuery `json:"query,omitempty"` + }{ + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminQueryPullRequestsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminPullrequestsRefreshCiInput is the input for CreateAdminPullrequestsRefreshCi — Refresh Pull Request CI. +type CreateAdminPullrequestsRefreshCiInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Ids []string `json:"ids,omitempty"` + models.RequestScope +} + +// CreateAdminPullrequestsRefreshCi - Refresh Pull Request CI +// POST /admin/pullrequests/refresh-ci +func (c *Client) CreateAdminPullrequestsRefreshCi(ctx context.Context, in CreateAdminPullrequestsRefreshCiInput) (*models.EndpointsAdminRefreshPullRequestsCIOutput, error) { + path := "/admin/pullrequests/refresh-ci" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Ids []string `json:"ids,omitempty"` + }{ + Ids: in.Ids, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminRefreshPullRequestsCIOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminRepositoriesInput is the input for ListAdminRepositories — Get Repositories. +type ListAdminRepositoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Ids []string `url:"ids,omitempty" json:"-"` + IncludeArchived *bool `url:"includeArchived,omitempty" json:"-"` + IncludeArchivedEnrolled []string `url:"includeArchivedEnrolled,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + TeamIDs []string `url:"teamIDs,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminRepositories - Get Repositories +// GET /admin/repositories +func (c *Client) ListAdminRepositories(ctx context.Context, in ListAdminRepositoriesInput) (*models.EndpointsAdminGetRepositoriesOutput, error) { + path := "/admin/repositories" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + for _, v := range in.TeamIDs { + query.Add("teamIDs", string(v)) + } + if in.IncludeArchived != nil { + query.Set("includeArchived", strconv.FormatBool(*in.IncludeArchived)) + } + for _, v := range in.IncludeArchivedEnrolled { + query.Add("includeArchivedEnrolled", string(v)) + } + for _, v := range in.Ids { + query.Add("ids", string(v)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetRepositoriesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminRepositoriesRecommendationsInput is the input for ListAdminRepositoriesRecommendations — Get Repository PoV Recommendations. +type ListAdminRepositoriesRecommendationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminRepositoriesRecommendations - Get Repository PoV Recommendations +// GET /admin/repositories/recommendations +func (c *Client) ListAdminRepositoriesRecommendations(ctx context.Context, in ListAdminRepositoriesRecommendationsInput) (*models.EndpointsAdminGetRepoRecommendationsOutput, error) { + path := "/admin/repositories/recommendations" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetRepoRecommendationsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminRepositoriesScanScopeInput is the input for UpdateAdminRepositoriesScanScope — Update Repository Scan Scopes. +type UpdateAdminRepositoriesScanScopeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Repositories []models.EndpointsRepositoryScanScopeChange `json:"repositories,omitempty"` + models.RequestScope +} + +// UpdateAdminRepositoriesScanScope - Update Repository Scan Scopes +// PUT /admin/repositories/scan-scope +func (c *Client) UpdateAdminRepositoriesScanScope(ctx context.Context, in UpdateAdminRepositoriesScanScopeInput) (*models.EndpointsPutRepositoryScanScopesOutput, error) { + path := "/admin/repositories/scan-scope" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Repositories []models.EndpointsRepositoryScanScopeChange `json:"repositories,omitempty"` + }{ + Repositories: in.Repositories, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutRepositoryScanScopesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminRepositoriesRepositoryIdDirectoriesInput is the input for ListAdminRepositoriesRepositoryIdDirectories — List Repository Directories. +type ListAdminRepositoriesRepositoryIdDirectoriesInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Path *string `url:"path,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminRepositoriesRepositoryIdDirectories - List Repository Directories +// GET /admin/repositories/{repositoryId}/directories +func (c *Client) ListAdminRepositoriesRepositoryIdDirectories(ctx context.Context, in ListAdminRepositoriesRepositoryIdDirectoriesInput) (*models.EndpointsGetRepositoryDirectoriesOutput, error) { + path := "/admin/repositories/{repositoryId}/directories" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Path != nil { + query.Set("path", string(*in.Path)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRepositoryDirectoriesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminRepositoryPropertyTeamKeysInput is the input for DeleteAdminRepositoryPropertyTeamKeys — Delete Repository Property Team Key. +type DeleteAdminRepositoryPropertyTeamKeysInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + KeyID *string `url:"keyId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminRepositoryPropertyTeamKeys - Delete Repository Property Team Key +// DELETE /admin/repository-property-team-keys +func (c *Client) DeleteAdminRepositoryPropertyTeamKeys(ctx context.Context, in DeleteAdminRepositoryPropertyTeamKeysInput) (*models.EndpointsDeleteRepositoryPropertyTeamKeyOutput, error) { + path := "/admin/repository-property-team-keys" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.KeyID != nil { + query.Set("keyId", string(*in.KeyID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteRepositoryPropertyTeamKeyOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminRepositoryPropertyTeamKeysInput is the input for ListAdminRepositoryPropertyTeamKeys — List Repository Property Team Keys. +type ListAdminRepositoryPropertyTeamKeysInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminRepositoryPropertyTeamKeys - List Repository Property Team Keys +// GET /admin/repository-property-team-keys +func (c *Client) ListAdminRepositoryPropertyTeamKeys(ctx context.Context, in ListAdminRepositoryPropertyTeamKeysInput) (*models.EndpointsGetRepositoryPropertyTeamKeysOutput, error) { + path := "/admin/repository-property-team-keys" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRepositoryPropertyTeamKeysOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminRepositoryPropertyTeamKeysInput is the input for CreateAdminRepositoryPropertyTeamKeys — Create Repository Property Team Key. +type CreateAdminRepositoryPropertyTeamKeysInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PropertyKey string `json:"propertyKey"` + ProviderID models.ModelsProviderID `json:"providerId"` + models.RequestScope +} + +// CreateAdminRepositoryPropertyTeamKeys - Create Repository Property Team Key +// POST /admin/repository-property-team-keys +func (c *Client) CreateAdminRepositoryPropertyTeamKeys(ctx context.Context, in CreateAdminRepositoryPropertyTeamKeysInput) (*models.EndpointsPostRepositoryPropertyTeamKeyOutput, error) { + path := "/admin/repository-property-team-keys" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + PropertyKey string `json:"propertyKey"` + ProviderID models.ModelsProviderID `json:"providerId"` + }{ + PropertyKey: in.PropertyKey, + ProviderID: in.ProviderID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostRepositoryPropertyTeamKeyOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetAdminRunsKindIdInput is the input for GetAdminRunsKindId — Get Run Snapshot. +type GetAdminRunsKindIdInput struct { + Kind string `path:"kind" json:"-"` + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetAdminRunsKindId - Get Run Snapshot +// GET /admin/runs/{kind}/{id} +func (c *Client) GetAdminRunsKindId(ctx context.Context, in GetAdminRunsKindIdInput) (*models.RunsnapshotSnapshot, error) { + path := "/admin/runs/{kind}/{id}" + path = strings.Replace(path, "{kind}", url.PathEscape(in.Kind), 1) + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.RunsnapshotSnapshot + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminScanScopeInput is the input for ListAdminScanScope — Get Scan Scope. +type ListAdminScanScopeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminScanScope - Get Scan Scope +// GET /admin/scan-scope +func (c *Client) ListAdminScanScope(ctx context.Context, in ListAdminScanScopeInput) (*models.EndpointsScanScopeOutput, error) { + path := "/admin/scan-scope" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsScanScopeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminScanScopeInput is the input for UpdateAdminScanScope — Update Scan Scope Settings. +type UpdateAdminScanScopeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ScopingEnabled *bool `json:"scopingEnabled,omitempty"` + SecretsMode *string `json:"secretsMode,omitempty"` + models.RequestScope +} + +// UpdateAdminScanScope - Update Scan Scope Settings +// PUT /admin/scan-scope +func (c *Client) UpdateAdminScanScope(ctx context.Context, in UpdateAdminScanScopeInput) (*models.EndpointsPutScanScopeOutput, error) { + path := "/admin/scan-scope" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ScopingEnabled *bool `json:"scopingEnabled,omitempty"` + SecretsMode *string `json:"secretsMode,omitempty"` + }{ + ScopingEnabled: in.ScopingEnabled, + SecretsMode: in.SecretsMode, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutScanScopeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminScansOrchestratorInput is the input for ListAdminScansOrchestrator — List Orchestrator Scans. +type ListAdminScansOrchestratorInput struct { + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + ScanType []string `url:"scanType,omitempty" json:"-"` + Status []string `url:"status,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminScansOrchestrator - List Orchestrator Scans +// GET /admin/scans/orchestrator +func (c *Client) ListAdminScansOrchestrator(ctx context.Context, in ListAdminScansOrchestratorInput) (*models.EndpointsListMergedScansOutput, error) { + path := "/admin/scans/orchestrator" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + for _, v := range in.ScanType { + query.Add("scanType", string(v)) + } + for _, v := range in.Status { + query.Add("status", string(v)) + } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListMergedScansOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminServiceAccountsInput is the input for DeleteAdminServiceAccounts — Delete Service Account. +type DeleteAdminServiceAccountsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ServiceAccountID *string `url:"serviceAccountId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminServiceAccounts - Delete Service Account +// DELETE /admin/service_accounts +func (c *Client) DeleteAdminServiceAccounts(ctx context.Context, in DeleteAdminServiceAccountsInput) (*models.EndpointsDeleteServiceAccountOutput, error) { + path := "/admin/service_accounts" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.ServiceAccountID != nil { + query.Set("serviceAccountId", string(*in.ServiceAccountID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteServiceAccountOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminServiceAccountsInput is the input for ListAdminServiceAccounts — Get Service Accounts. +type ListAdminServiceAccountsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminServiceAccounts - Get Service Accounts +// GET /admin/service_accounts +func (c *Client) ListAdminServiceAccounts(ctx context.Context, in ListAdminServiceAccountsInput) (*models.EndpointsGetServiceAccountsOutput, error) { + path := "/admin/service_accounts" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetServiceAccountsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminServiceAccountsInput is the input for CreateAdminServiceAccounts — Create Service Account. +type CreateAdminServiceAccountsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name string `json:"name"` + Platform models.ModelsProviderID `json:"platform"` + Role *string `json:"role,omitempty"` + models.RequestScope +} + +// CreateAdminServiceAccounts - Create Service Account +// POST /admin/service_accounts +func (c *Client) CreateAdminServiceAccounts(ctx context.Context, in CreateAdminServiceAccountsInput) (*models.EndpointsPostServiceAccountOutput, error) { + path := "/admin/service_accounts" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Name string `json:"name"` + Platform models.ModelsProviderID `json:"platform"` + Role *string `json:"role,omitempty"` + }{ + Name: in.Name, + Platform: in.Platform, + Role: in.Role, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostServiceAccountOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminSettingsCspmScanCadenceInput is the input for ListAdminSettingsCspmScanCadence — Get CSPM Scan Cadence. +type ListAdminSettingsCspmScanCadenceInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminSettingsCspmScanCadence - Get CSPM Scan Cadence +// GET /admin/settings/cspm-scan-cadence +func (c *Client) ListAdminSettingsCspmScanCadence(ctx context.Context, in ListAdminSettingsCspmScanCadenceInput) (*models.EndpointsCSPMScanCadenceOutput, error) { + path := "/admin/settings/cspm-scan-cadence" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsCSPMScanCadenceOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminSettingsCspmScanCadenceInput is the input for UpdateAdminSettingsCspmScanCadence — Set CSPM Scan Cadence. +type UpdateAdminSettingsCspmScanCadenceInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CspmScanCadence *string `json:"cspmScanCadence,omitempty"` + models.RequestScope +} + +// UpdateAdminSettingsCspmScanCadence - Set CSPM Scan Cadence +// PUT /admin/settings/cspm-scan-cadence +func (c *Client) UpdateAdminSettingsCspmScanCadence(ctx context.Context, in UpdateAdminSettingsCspmScanCadenceInput) (*models.EndpointsCSPMScanCadenceOutput, error) { + path := "/admin/settings/cspm-scan-cadence" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CspmScanCadence *string `json:"cspmScanCadence,omitempty"` + }{ + CspmScanCadence: in.CspmScanCadence, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsCSPMScanCadenceOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminSettingsInferenceRegionInput is the input for ListAdminSettingsInferenceRegion — Get Inference Region. +type ListAdminSettingsInferenceRegionInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminSettingsInferenceRegion - Get Inference Region +// GET /admin/settings/inference-region +func (c *Client) ListAdminSettingsInferenceRegion(ctx context.Context, in ListAdminSettingsInferenceRegionInput) (*models.EndpointsInferenceRegionOutput, error) { + path := "/admin/settings/inference-region" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsInferenceRegionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminSettingsInferenceRegionInput is the input for UpdateAdminSettingsInferenceRegion — Set Inference Region. +type UpdateAdminSettingsInferenceRegionInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InferenceRegion models.ModelsInferenceRegion `json:"inferenceRegion"` + models.RequestScope +} + +// UpdateAdminSettingsInferenceRegion - Set Inference Region +// PUT /admin/settings/inference-region +func (c *Client) UpdateAdminSettingsInferenceRegion(ctx context.Context, in UpdateAdminSettingsInferenceRegionInput) (*models.EndpointsInferenceRegionOutput, error) { + path := "/admin/settings/inference-region" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + InferenceRegion models.ModelsInferenceRegion `json:"inferenceRegion"` + }{ + InferenceRegion: in.InferenceRegion, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsInferenceRegionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminSlaInput is the input for ListAdminSla — Get SLAs. +type ListAdminSlaInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminSla - Get SLAs +// GET /admin/sla +func (c *Client) ListAdminSla(ctx context.Context, in ListAdminSlaInput) (*models.EndpointsGetSLAsOutput, error) { + path := "/admin/sla" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSLAsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminSlaInput is the input for CreateAdminSla — Post SLA. +type CreateAdminSlaInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AllowExtensions bool `json:"allowExtensions"` + MaxDaysToFix int `json:"maxDaysToFix"` + Priority models.ModelsPriorityLabel `json:"priority"` + Severity models.ModelsSeverity `json:"severity"` + models.RequestScope +} + +// CreateAdminSla - Post SLA +// POST /admin/sla +func (c *Client) CreateAdminSla(ctx context.Context, in CreateAdminSlaInput) (*models.EndpointsPostSLAOutput, error) { + path := "/admin/sla" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AllowExtensions bool `json:"allowExtensions"` + MaxDaysToFix int `json:"maxDaysToFix"` + Priority models.ModelsPriorityLabel `json:"priority"` + Severity models.ModelsSeverity `json:"severity"` + }{ + AllowExtensions: in.AllowExtensions, + MaxDaysToFix: in.MaxDaysToFix, + Priority: in.Priority, + Severity: in.Severity, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostSLAOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminSlaBulkInput is the input for UpdateAdminSlaBulk — Put Bulk SLA. +type UpdateAdminSlaBulkInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Slas []models.ModelsSLA `json:"slas,omitempty"` + models.RequestScope +} + +// UpdateAdminSlaBulk - Put Bulk SLA +// PUT /admin/sla/bulk +func (c *Client) UpdateAdminSlaBulk(ctx context.Context, in UpdateAdminSlaBulkInput) (*models.EndpointsPutBulkSLAOutput, error) { + path := "/admin/sla/bulk" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Slas []models.ModelsSLA `json:"slas,omitempty"` + }{ + Slas: in.Slas, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutBulkSLAOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchAdminSlaSlaIdInput is the input for PatchAdminSlaSlaId — Patch SLA. +type PatchAdminSlaSlaIdInput struct { + SlaID string `path:"slaId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AllowExtensions *bool `json:"allowExtensions,omitempty"` + MaxDaysToFix *int `json:"maxDaysToFix,omitempty"` + Priority *models.ModelsPriorityLabel `json:"priority,omitempty"` + Severity *models.ModelsSeverity `json:"severity,omitempty"` + models.RequestScope +} + +// PatchAdminSlaSlaId - Patch SLA +// PATCH /admin/sla/{slaId} +func (c *Client) PatchAdminSlaSlaId(ctx context.Context, in PatchAdminSlaSlaIdInput) (*models.EndpointsPatchSLAOutput, error) { + path := "/admin/sla/{slaId}" + path = strings.Replace(path, "{slaId}", url.PathEscape(in.SlaID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AllowExtensions *bool `json:"allowExtensions,omitempty"` + MaxDaysToFix *int `json:"maxDaysToFix,omitempty"` + Priority *models.ModelsPriorityLabel `json:"priority,omitempty"` + Severity *models.ModelsSeverity `json:"severity,omitempty"` + }{ + AllowExtensions: in.AllowExtensions, + MaxDaysToFix: in.MaxDaysToFix, + Priority: in.Priority, + Severity: in.Severity, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchSLAOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminSupportAccessInput is the input for DeleteAdminSupportAccess — Revoke Support Access. +type DeleteAdminSupportAccessInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminSupportAccess - Revoke Support Access +// DELETE /admin/support-access +func (c *Client) DeleteAdminSupportAccess(ctx context.Context, in DeleteAdminSupportAccessInput) (*models.EndpointsAdminRevokeSupportAccessOutput, error) { + path := "/admin/support-access" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminRevokeSupportAccessOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminSupportAccessInput is the input for ListAdminSupportAccess — Get Support Access. +type ListAdminSupportAccessInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminSupportAccess - Get Support Access +// GET /admin/support-access +func (c *Client) ListAdminSupportAccess(ctx context.Context, in ListAdminSupportAccessInput) (*models.EndpointsAdminGetSupportAccessOutput, error) { + path := "/admin/support-access" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsAdminGetSupportAccessOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminSupportAccessInput is the input for CreateAdminSupportAccess — Elevate Support Access. +type CreateAdminSupportAccessInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Agent *string `json:"agent,omitempty"` + Reason string `json:"reason"` + TtlSeconds *int64 `json:"ttlSeconds,omitempty"` + models.RequestScope +} + +// CreateAdminSupportAccess - Elevate Support Access +// POST /admin/support-access +func (c *Client) CreateAdminSupportAccess(ctx context.Context, in CreateAdminSupportAccessInput) (*models.EndpointsAdminElevateSupportAccessOutput, error) { + path := "/admin/support-access" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Agent *string `json:"agent,omitempty"` + Reason string `json:"reason"` + TtlSeconds *int64 `json:"ttlSeconds,omitempty"` + }{ + Agent: in.Agent, + Reason: in.Reason, + TtlSeconds: in.TtlSeconds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminElevateSupportAccessOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminTeamSourcePreferencesInput is the input for ListAdminTeamSourcePreferences — Get Team Source Preferences. +type ListAdminTeamSourcePreferencesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminTeamSourcePreferences - Get Team Source Preferences +// GET /admin/team-source-preferences +func (c *Client) ListAdminTeamSourcePreferences(ctx context.Context, in ListAdminTeamSourcePreferencesInput) (*models.EndpointsGetTeamSourcePreferencesOutput, error) { + path := "/admin/team-source-preferences" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetTeamSourcePreferencesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateAdminTeamSourcePreferencesInput is the input for UpdateAdminTeamSourcePreferences — Update Team Source Preferences. +type UpdateAdminTeamSourcePreferencesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + GithubTeamsEnabled bool `json:"githubTeamsEnabled"` + RepositoryPropertyEnabled bool `json:"repositoryPropertyEnabled"` + models.RequestScope +} + +// UpdateAdminTeamSourcePreferences - Update Team Source Preferences +// PUT /admin/team-source-preferences +func (c *Client) UpdateAdminTeamSourcePreferences(ctx context.Context, in UpdateAdminTeamSourcePreferencesInput) (*models.EndpointsPutTeamSourcePreferencesOutput, error) { + path := "/admin/team-source-preferences" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + GithubTeamsEnabled bool `json:"githubTeamsEnabled"` + RepositoryPropertyEnabled bool `json:"repositoryPropertyEnabled"` + }{ + GithubTeamsEnabled: in.GithubTeamsEnabled, + RepositoryPropertyEnabled: in.RepositoryPropertyEnabled, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutTeamSourcePreferencesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminTeamSyncRunsInput is the input for ListAdminTeamSyncRuns — List Team Sync Runs. +type ListAdminTeamSyncRunsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + Source *string `url:"source,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminTeamSyncRuns - List Team Sync Runs +// GET /admin/team-sync-runs +func (c *Client) ListAdminTeamSyncRuns(ctx context.Context, in ListAdminTeamSyncRunsInput) (*models.EndpointsGetTeamSyncRunsOutput, error) { + path := "/admin/team-sync-runs" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Source != nil { + query.Set("source", string(*in.Source)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetTeamSyncRunsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamSyncRunsInput is the input for CreateAdminTeamSyncRuns — Trigger Team Sync. +type CreateAdminTeamSyncRunsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Source *string `json:"source,omitempty"` + models.RequestScope +} + +// CreateAdminTeamSyncRuns - Trigger Team Sync +// POST /admin/team-sync-runs +func (c *Client) CreateAdminTeamSyncRuns(ctx context.Context, in CreateAdminTeamSyncRunsInput) (*models.EndpointsPostTeamSyncRunOutput, error) { + path := "/admin/team-sync-runs" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Source *string `json:"source,omitempty"` + }{ + Source: in.Source, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostTeamSyncRunOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetAdminTeamTeamIDInput is the input for GetAdminTeamTeamID — Get Team. +type GetAdminTeamTeamIDInput struct { + TeamID string `path:"teamID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetAdminTeamTeamID - Get Team +// GET /admin/team/{teamID} +func (c *Client) GetAdminTeamTeamID(ctx context.Context, in GetAdminTeamTeamIDInput) (*models.EndpointsGetTeamOutput, error) { + path := "/admin/team/{teamID}" + path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetTeamOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminTeamsInput is the input for ListAdminTeams — Get All Teams. +type ListAdminTeamsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + SkipUserEnrichment *bool `url:"skipUserEnrichment,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminTeams - Get All Teams +// GET /admin/teams +func (c *Client) ListAdminTeams(ctx context.Context, in ListAdminTeamsInput) (*models.EndpointsGetTeamsOutput, error) { + path := "/admin/teams" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.SkipUserEnrichment != nil { + query.Set("skipUserEnrichment", strconv.FormatBool(*in.SkipUserEnrichment)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetTeamsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsInput is the input for CreateAdminTeams — Post Team. +type CreateAdminTeamsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` + Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` + Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` + GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` + Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` + LeadID *string `json:"leadId,omitempty"` + MemberIds []string `json:"memberIds,omitempty"` + MessageChannelProvider models.ModelsMessageChannelProvider `json:"messageChannelProvider"` + Name string `json:"name"` + Privacy models.ModelsTeamPrivacy `json:"privacy"` + Slug string `json:"slug"` + TicketProjectProvider models.ModelsTicketProjectProvider `json:"ticketProjectProvider"` + models.RequestScope +} + +// CreateAdminTeams - Post Team +// POST /admin/teams +func (c *Client) CreateAdminTeams(ctx context.Context, in CreateAdminTeamsInput) (*models.EndpointsPostTeamOutput, error) { + path := "/admin/teams" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` + Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` + Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` + GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` + Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` + LeadID *string `json:"leadId,omitempty"` + MemberIds []string `json:"memberIds,omitempty"` + MessageChannelProvider models.ModelsMessageChannelProvider `json:"messageChannelProvider"` + Name string `json:"name"` + Privacy models.ModelsTeamPrivacy `json:"privacy"` + Slug string `json:"slug"` + TicketProjectProvider models.ModelsTicketProjectProvider `json:"ticketProjectProvider"` + }{ + CodeOwnerships: in.CodeOwnerships, + Github: in.Github, + Gitlab: in.Gitlab, + GroundRules: in.GroundRules, + Jira: in.Jira, + LeadID: in.LeadID, + MemberIds: in.MemberIds, + MessageChannelProvider: in.MessageChannelProvider, + Name: in.Name, + Privacy: in.Privacy, + Slug: in.Slug, + TicketProjectProvider: in.TicketProjectProvider, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostTeamOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminTeamsAppzipInput is the input for ListAdminTeamsAppzip — Get Teams App Zip. +type ListAdminTeamsAppzipInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminTeamsAppzip - Get Teams App Zip +// GET /admin/teams/appzip +func (c *Client) ListAdminTeamsAppzip(ctx context.Context, in ListAdminTeamsAppzipInput) (*models.EndpointsGetTeamsAppZipOutput, error) { + path := "/admin/teams/appzip" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetTeamsAppZipOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsCompassInput is the input for CreateAdminTeamsCompass — Post Compass/Atlassian Team. +type CreateAdminTeamsCompassInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DisplayName string `json:"displayName"` + Lead string `json:"lead"` + Members []string `json:"members,omitempty"` + ProviderID *models.ModelsProviderID `json:"providerId,omitempty"` + Repositories []string `json:"repositories,omitempty"` + TeamKey *string `json:"teamKey,omitempty"` + models.RequestScope +} + +// CreateAdminTeamsCompass - Post Compass/Atlassian Team +// POST /admin/teams/compass +func (c *Client) CreateAdminTeamsCompass(ctx context.Context, in CreateAdminTeamsCompassInput) (*models.EndpointsPostCompassTeamOutput, error) { + path := "/admin/teams/compass" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DisplayName string `json:"displayName"` + Lead string `json:"lead"` + Members []string `json:"members,omitempty"` + ProviderID *models.ModelsProviderID `json:"providerId,omitempty"` + Repositories []string `json:"repositories,omitempty"` + TeamKey *string `json:"teamKey,omitempty"` + }{ + DisplayName: in.DisplayName, + Lead: in.Lead, + Members: in.Members, + ProviderID: in.ProviderID, + Repositories: in.Repositories, + TeamKey: in.TeamKey, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostCompassTeamOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminTeamsFindingsInput is the input for ListAdminTeamsFindings — Get All Team Findings mapping. +type ListAdminTeamsFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminTeamsFindings - Get All Team Findings mapping +// GET /admin/teams/findings +func (c *Client) ListAdminTeamsFindings(ctx context.Context, in ListAdminTeamsFindingsInput) (*models.EndpointsListTeamFindingsOutput, error) { + path := "/admin/teams/findings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListTeamFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsFindingsInput is the input for CreateAdminTeamsFindings — Manual Team Findings Assignment. +type CreateAdminTeamsFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Actor *string `json:"actor,omitempty"` + Mappings []models.EndpointsPostTeamFindingsMapping `json:"mappings,omitempty"` + models.RequestScope +} + +// CreateAdminTeamsFindings - Manual Team Findings Assignment +// POST /admin/teams/findings +func (c *Client) CreateAdminTeamsFindings(ctx context.Context, in CreateAdminTeamsFindingsInput) (*models.EndpointsPostTeamFindingsOutput, error) { + path := "/admin/teams/findings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Actor *string `json:"actor,omitempty"` + Mappings []models.EndpointsPostTeamFindingsMapping `json:"mappings,omitempty"` + }{ + Actor: in.Actor, + Mappings: in.Mappings, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostTeamFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsFindingsSyncInput is the input for CreateAdminTeamsFindingsSync — Sync Team Findings. +type CreateAdminTeamsFindingsSyncInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Async *bool `json:"async,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + FindingTypes []string `json:"findingTypes,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + RepositoryNames []string `json:"repositoryNames,omitempty"` + models.RequestScope +} + +// CreateAdminTeamsFindingsSync - Sync Team Findings +// POST /admin/teams/findings/sync +func (c *Client) CreateAdminTeamsFindingsSync(ctx context.Context, in CreateAdminTeamsFindingsSyncInput) (*models.EndpointsPostTeamFindingsSyncOutput, error) { + path := "/admin/teams/findings/sync" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Async *bool `json:"async,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + FindingTypes []string `json:"findingTypes,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + RepositoryNames []string `json:"repositoryNames,omitempty"` + }{ + Async: in.Async, + FindingIds: in.FindingIds, + FindingTypes: in.FindingTypes, + RepositoryIds: in.RepositoryIds, + RepositoryNames: in.RepositoryNames, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostTeamFindingsSyncOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsMergeInput is the input for CreateAdminTeamsMerge — Merge Teams. +type CreateAdminTeamsMergeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Sources []models.EndpointsTeamMergeSource `json:"sources,omitempty"` + TargetTeamID *string `json:"targetTeamId,omitempty"` + models.RequestScope +} + +// CreateAdminTeamsMerge - Merge Teams +// POST /admin/teams/merge +func (c *Client) CreateAdminTeamsMerge(ctx context.Context, in CreateAdminTeamsMergeInput) (*models.EndpointsPostTeamMergeOutput, error) { + path := "/admin/teams/merge" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Sources []models.EndpointsTeamMergeSource `json:"sources,omitempty"` + TargetTeamID *string `json:"targetTeamId,omitempty"` + }{ + Sources: in.Sources, + TargetTeamID: in.TargetTeamID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostTeamMergeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsSlaBreakdownInput is the input for CreateAdminTeamsSlaBreakdown — Get Team SLA Breakdown. +type CreateAdminTeamsSlaBreakdownInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + FindingIDs []string `json:"findingIDs,omitempty"` + models.RequestScope +} + +// CreateAdminTeamsSlaBreakdown - Get Team SLA Breakdown +// POST /admin/teams/sla-breakdown +func (c *Client) CreateAdminTeamsSlaBreakdown(ctx context.Context, in CreateAdminTeamsSlaBreakdownInput) (*models.EndpointsPostTeamSLABreakdownOutput, error) { + path := "/admin/teams/sla-breakdown" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + FindingIDs []string `json:"findingIDs,omitempty"` + }{ + FindingIDs: in.FindingIDs, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostTeamSLABreakdownOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteAdminTeamsTeamIDInput is the input for DeleteAdminTeamsTeamID — Delete Manual Team. +type DeleteAdminTeamsTeamIDInput struct { + TeamID string `path:"teamID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteAdminTeamsTeamID - Delete Manual Team +// DELETE /admin/teams/{teamID} +func (c *Client) DeleteAdminTeamsTeamID(ctx context.Context, in DeleteAdminTeamsTeamIDInput) (*models.EndpointsDeleteTeamOutput, error) { + path := "/admin/teams/{teamID}" + path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTeamOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchAdminTeamsTeamIDInput is the input for PatchAdminTeamsTeamID — Patch Team. +type PatchAdminTeamsTeamIDInput struct { + TeamID string `path:"teamID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AddMemberIds []string `json:"addMemberIds,omitempty"` + ClearLead *bool `json:"clearLead,omitempty"` + CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` + Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` + Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` + GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` + Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` + LeadID *string `json:"leadId,omitempty"` + MemberIds []string `json:"memberIds,omitempty"` + MessageChannelProvider *models.ModelsMessageChannelProvider `json:"messageChannelProvider,omitempty"` + Name *string `json:"name,omitempty"` + Privacy *models.ModelsTeamPrivacy `json:"privacy,omitempty"` + RemoveMemberIds []string `json:"removeMemberIds,omitempty"` + Slug *string `json:"slug,omitempty"` + TicketBoardID *string `json:"ticketBoardId,omitempty"` + TicketProjectProvider *models.ModelsTicketProjectProvider `json:"ticketProjectProvider,omitempty"` + models.RequestScope +} + +// PatchAdminTeamsTeamID - Patch Team +// PATCH /admin/teams/{teamID} +func (c *Client) PatchAdminTeamsTeamID(ctx context.Context, in PatchAdminTeamsTeamIDInput) (*models.EndpointsPatchTeamOutput, error) { + path := "/admin/teams/{teamID}" + path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AddMemberIds []string `json:"addMemberIds,omitempty"` + ClearLead *bool `json:"clearLead,omitempty"` + CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` + Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` + Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` + GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` + Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` + LeadID *string `json:"leadId,omitempty"` + MemberIds []string `json:"memberIds,omitempty"` + MessageChannelProvider *models.ModelsMessageChannelProvider `json:"messageChannelProvider,omitempty"` + Name *string `json:"name,omitempty"` + Privacy *models.ModelsTeamPrivacy `json:"privacy,omitempty"` + RemoveMemberIds []string `json:"removeMemberIds,omitempty"` + Slug *string `json:"slug,omitempty"` + TicketBoardID *string `json:"ticketBoardId,omitempty"` + TicketProjectProvider *models.ModelsTicketProjectProvider `json:"ticketProjectProvider,omitempty"` + }{ + AddMemberIds: in.AddMemberIds, + ClearLead: in.ClearLead, + CodeOwnerships: in.CodeOwnerships, + Github: in.Github, + Gitlab: in.Gitlab, + GroundRules: in.GroundRules, + Jira: in.Jira, + LeadID: in.LeadID, + MemberIds: in.MemberIds, + MessageChannelProvider: in.MessageChannelProvider, + Name: in.Name, + Privacy: in.Privacy, + RemoveMemberIds: in.RemoveMemberIds, + Slug: in.Slug, + TicketBoardID: in.TicketBoardID, + TicketProjectProvider: in.TicketProjectProvider, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchTeamOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsTeamIDCodeOwnershipInput is the input for CreateAdminTeamsTeamIDCodeOwnership — Make Team The Owner Of A Repository. +type CreateAdminTeamsTeamIDCodeOwnershipInput struct { + TeamID string `path:"teamID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Actor *string `json:"actor,omitempty"` + RepositoryID string `json:"repositoryId"` + models.RequestScope +} + +// CreateAdminTeamsTeamIDCodeOwnership - Make Team The Owner Of A Repository +// POST /admin/teams/{teamID}/code-ownership +func (c *Client) CreateAdminTeamsTeamIDCodeOwnership(ctx context.Context, in CreateAdminTeamsTeamIDCodeOwnershipInput) (*models.EndpointsPostTeamCodeOwnershipOutput, error) { + path := "/admin/teams/{teamID}/code-ownership" + path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Actor *string `json:"actor,omitempty"` + RepositoryID string `json:"repositoryId"` + }{ + Actor: in.Actor, + RepositoryID: in.RepositoryID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostTeamCodeOwnershipOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminTeamsTeamIDEventsInput is the input for CreateAdminTeamsTeamIDEvents — List Team Unified Events. +type CreateAdminTeamsTeamIDEventsInput struct { + TeamID string `path:"teamID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AfterID *string `json:"afterId,omitempty"` + AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` + AutofixID *string `json:"autofixId,omitempty"` + BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + EventTypes []string `json:"eventTypes,omitempty"` + ExcludeEventTypes []string `json:"excludeEventTypes,omitempty"` + ExcludeServices []string `json:"excludeServices,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + HideNoise *bool `json:"hideNoise,omitempty"` + Limit *int `json:"limit,omitempty"` + PrCanonicalID *string `json:"prCanonicalId,omitempty"` + Query *string `json:"query,omitempty"` + QueryEventTypes []string `json:"queryEventTypes,omitempty"` + RunID *string `json:"runId,omitempty"` + Services []string `json:"services,omitempty"` + models.RequestScope +} + +// CreateAdminTeamsTeamIDEvents - List Team Unified Events +// POST /admin/teams/{teamID}/events +func (c *Client) CreateAdminTeamsTeamIDEvents(ctx context.Context, in CreateAdminTeamsTeamIDEventsInput) (*models.EndpointsAdminListUnifiedEventsOutput, error) { + path := "/admin/teams/{teamID}/events" + path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AfterID *string `json:"afterId,omitempty"` + AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` + AutofixID *string `json:"autofixId,omitempty"` + BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + EventTypes []string `json:"eventTypes,omitempty"` + ExcludeEventTypes []string `json:"excludeEventTypes,omitempty"` + ExcludeServices []string `json:"excludeServices,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + HideNoise *bool `json:"hideNoise,omitempty"` + Limit *int `json:"limit,omitempty"` + PrCanonicalID *string `json:"prCanonicalId,omitempty"` + Query *string `json:"query,omitempty"` + QueryEventTypes []string `json:"queryEventTypes,omitempty"` + RunID *string `json:"runId,omitempty"` + Services []string `json:"services,omitempty"` + }{ + AfterID: in.AfterID, + AfterTimeUnix: in.AfterTimeUnix, + AutofixID: in.AutofixID, + BeforeTimeUnix: in.BeforeTimeUnix, + CampaignID: in.CampaignID, + EventTypes: in.EventTypes, + ExcludeEventTypes: in.ExcludeEventTypes, + ExcludeServices: in.ExcludeServices, + FindingIds: in.FindingIds, + HideNoise: in.HideNoise, + Limit: in.Limit, + PrCanonicalID: in.PrCanonicalID, + Query: in.Query, + QueryEventTypes: in.QueryEventTypes, + RunID: in.RunID, + Services: in.Services, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminListUnifiedEventsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminTeamsTeamIDFindingsInput is the input for ListAdminTeamsTeamIDFindings — Get Team Findings mapping. +type ListAdminTeamsTeamIDFindingsInput struct { + TeamID string `path:"teamID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminTeamsTeamIDFindings - Get Team Findings mapping +// GET /admin/teams/{teamID}/findings +func (c *Client) ListAdminTeamsTeamIDFindings(ctx context.Context, in ListAdminTeamsTeamIDFindingsInput) (*models.EndpointsGetTeamFindingsOutput, error) { + path := "/admin/teams/{teamID}/findings" + path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2624,31 +9636,35 @@ func (c *Client) DeleteAdminRepositoryPropertyTeamKeys(ctx context.Context, in D fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteRepositoryPropertyTeamKeyOutput + var out models.EndpointsGetTeamFindingsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminRepositoryPropertyTeamKeysInput is the input for ListAdminRepositoryPropertyTeamKeys — List Repository Property Team Keys. -type ListAdminRepositoryPropertyTeamKeysInput struct { +// ListAdminTenantCapabilitiesInput is the input for ListAdminTenantCapabilities — List Tenant Capabilities. +type ListAdminTenantCapabilitiesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminRepositoryPropertyTeamKeys - List Repository Property Team Keys -// GET /admin/repository-property-team-keys -func (c *Client) ListAdminRepositoryPropertyTeamKeys(ctx context.Context, in ListAdminRepositoryPropertyTeamKeysInput) (*models.EndpointsGetRepositoryPropertyTeamKeysOutput, error) { - path := "/admin/repository-property-team-keys" +// ListAdminTenantCapabilities - List Tenant Capabilities +// GET /admin/tenant-capabilities +func (c *Client) ListAdminTenantCapabilities(ctx context.Context, in ListAdminTenantCapabilitiesInput) (*models.EndpointsTenantCapabilitiesOutput, error) { + path := "/admin/tenant-capabilities" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2660,29 +9676,35 @@ func (c *Client) ListAdminRepositoryPropertyTeamKeys(ctx context.Context, in Lis if err != nil { return nil, err } - var out models.EndpointsGetRepositoryPropertyTeamKeysOutput + var out models.EndpointsTenantCapabilitiesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminRepositoryPropertyTeamKeysInput is the input for CreateAdminRepositoryPropertyTeamKeys — Create Repository Property Team Key. -type CreateAdminRepositoryPropertyTeamKeysInput struct { - PropertyKey string `json:"propertyKey"` - ProviderID models.ModelsProviderID `json:"providerId"` +// UpdateAdminTenantCapabilitiesCapabilityInput is the input for UpdateAdminTenantCapabilitiesCapability — Set Tenant Capability. +type UpdateAdminTenantCapabilitiesCapabilityInput struct { + Capability string `path:"capability" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Enabled *bool `json:"enabled,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` models.RequestScope } -// CreateAdminRepositoryPropertyTeamKeys - Create Repository Property Team Key -// POST /admin/repository-property-team-keys -func (c *Client) CreateAdminRepositoryPropertyTeamKeys(ctx context.Context, in CreateAdminRepositoryPropertyTeamKeysInput) (*models.EndpointsPostRepositoryPropertyTeamKeyOutput, error) { - path := "/admin/repository-property-team-keys" +// UpdateAdminTenantCapabilitiesCapability - Set Tenant Capability +// PUT /admin/tenant-capabilities/{capability} +func (c *Client) UpdateAdminTenantCapabilitiesCapability(ctx context.Context, in UpdateAdminTenantCapabilitiesCapabilityInput) (*models.EndpointsPutTenantCapabilityOutput, error) { + path := "/admin/tenant-capabilities/{capability}" + path = strings.Replace(path, "{capability}", url.PathEscape(in.Capability), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2691,43 +9713,67 @@ func (c *Client) CreateAdminRepositoryPropertyTeamKeys(ctx context.Context, in C } bodyBytes, err := json.Marshal(struct { - PropertyKey string `json:"propertyKey"` - ProviderID models.ModelsProviderID `json:"providerId"` + Enabled *bool `json:"enabled,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` }{ - PropertyKey: in.PropertyKey, - ProviderID: in.ProviderID, + Enabled: in.Enabled, + ExpectedUpdatedAt: in.ExpectedUpdatedAt, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPostRepositoryPropertyTeamKeyOutput + var out models.EndpointsPutTenantCapabilityOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminServiceAccountsInput is the input for DeleteAdminServiceAccounts — Delete Service Account. -type DeleteAdminServiceAccountsInput struct { - ServiceAccountID *string `url:"serviceAccountId,omitempty" json:"-"` +// ListAdminTicketingActivityInput is the input for ListAdminTicketingActivity — List Ticketing Activity. +type ListAdminTicketingActivityInput struct { + Actor *string `url:"actor,omitempty" json:"-"` + EventType *string `url:"eventType,omitempty" json:"-"` + FromTime *string `url:"fromTime,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + Offset *int32 `url:"offset,omitempty" json:"-"` + ToTime *string `url:"toTime,omitempty" json:"-"` models.RequestScope } -// DeleteAdminServiceAccounts - Delete Service Account -// DELETE /admin/service_accounts -func (c *Client) DeleteAdminServiceAccounts(ctx context.Context, in DeleteAdminServiceAccountsInput) (*models.EndpointsDeleteServiceAccountOutput, error) { - path := "/admin/service_accounts" +// ListAdminTicketingActivity - List Ticketing Activity +// GET /admin/ticketing/activity +func (c *Client) ListAdminTicketingActivity(ctx context.Context, in ListAdminTicketingActivityInput) (*models.EndpointsGetTicketActivityOutput, error) { + path := "/admin/ticketing/activity" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.ServiceAccountID != nil { - query.Set("serviceAccountId", string(*in.ServiceAccountID)) + if in.EventType != nil { + query.Set("eventType", string(*in.EventType)) + } + if in.Actor != nil { + query.Set("actor", string(*in.Actor)) + } + if in.FromTime != nil { + query.Set("fromTime", string(*in.FromTime)) + } + if in.ToTime != nil { + query.Set("toTime", string(*in.ToTime)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2736,31 +9782,37 @@ func (c *Client) DeleteAdminServiceAccounts(ctx context.Context, in DeleteAdminS fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteServiceAccountOutput + var out models.EndpointsGetTicketActivityOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminServiceAccountsInput is the input for ListAdminServiceAccounts — Get Service Accounts. -type ListAdminServiceAccountsInput struct { +// GetAdminTicketingBulkOperationsOperationIdInput is the input for GetAdminTicketingBulkOperationsOperationId — Get Bulk Operation Status. +type GetAdminTicketingBulkOperationsOperationIdInput struct { + OperationID string `path:"operationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminServiceAccounts - Get Service Accounts -// GET /admin/service_accounts -func (c *Client) ListAdminServiceAccounts(ctx context.Context, in ListAdminServiceAccountsInput) (*models.EndpointsGetServiceAccountsOutput, error) { - path := "/admin/service_accounts" +// GetAdminTicketingBulkOperationsOperationId - Get Bulk Operation Status +// GET /admin/ticketing/bulk-operations/{operationId} +func (c *Client) GetAdminTicketingBulkOperationsOperationId(ctx context.Context, in GetAdminTicketingBulkOperationsOperationIdInput) (*models.EndpointsGetBulkOperationOutput, error) { + path := "/admin/ticketing/bulk-operations/{operationId}" + path = strings.Replace(path, "{operationId}", url.PathEscape(in.OperationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2772,29 +9824,33 @@ func (c *Client) ListAdminServiceAccounts(ctx context.Context, in ListAdminServi if err != nil { return nil, err } - var out models.EndpointsGetServiceAccountsOutput + var out models.EndpointsGetBulkOperationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminServiceAccountsInput is the input for CreateAdminServiceAccounts — Create Service Account. -type CreateAdminServiceAccountsInput struct { - Name string `json:"name"` - Platform models.ModelsProviderID `json:"platform"` +// CreateAdminTicketingBulkOperationsOperationIdCancelInput is the input for CreateAdminTicketingBulkOperationsOperationIdCancel — Request Bulk Operation Cancellation. +type CreateAdminTicketingBulkOperationsOperationIdCancelInput struct { + OperationID string `path:"operationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminServiceAccounts - Create Service Account -// POST /admin/service_accounts -func (c *Client) CreateAdminServiceAccounts(ctx context.Context, in CreateAdminServiceAccountsInput) (*models.EndpointsPostServiceAccountOutput, error) { - path := "/admin/service_accounts" +// CreateAdminTicketingBulkOperationsOperationIdCancel - Request Bulk Operation Cancellation +// POST /admin/ticketing/bulk-operations/{operationId}/cancel +func (c *Client) CreateAdminTicketingBulkOperationsOperationIdCancel(ctx context.Context, in CreateAdminTicketingBulkOperationsOperationIdCancelInput) (*models.EndpointsPostBulkOperationCancelOutput, error) { + path := "/admin/ticketing/bulk-operations/{operationId}/cancel" + path = strings.Replace(path, "{operationId}", url.PathEscape(in.OperationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2802,41 +9858,35 @@ func (c *Client) CreateAdminServiceAccounts(ctx context.Context, in CreateAdminS fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Name string `json:"name"` - Platform models.ModelsProviderID `json:"platform"` - }{ - Name: in.Name, - Platform: in.Platform, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostServiceAccountOutput + var out models.EndpointsPostBulkOperationCancelOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminSlaInput is the input for ListAdminSla — Get SLAs. -type ListAdminSlaInput struct { +// ListAdminTicketingSavedFiltersInput is the input for ListAdminTicketingSavedFilters — List Saved Ticket Filters. +type ListAdminTicketingSavedFiltersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListAdminSla - Get SLAs -// GET /admin/sla -func (c *Client) ListAdminSla(ctx context.Context, in ListAdminSlaInput) (*models.EndpointsGetSLAsOutput, error) { - path := "/admin/sla" +// ListAdminTicketingSavedFilters - List Saved Ticket Filters +// GET /admin/ticketing/saved-filters +func (c *Client) ListAdminTicketingSavedFilters(ctx context.Context, in ListAdminTicketingSavedFiltersInput) (*models.EndpointsGetTicketSavedFiltersOutput, error) { + path := "/admin/ticketing/saved-filters" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2848,31 +9898,33 @@ func (c *Client) ListAdminSla(ctx context.Context, in ListAdminSlaInput) (*model if err != nil { return nil, err } - var out models.EndpointsGetSLAsOutput + var out models.EndpointsGetTicketSavedFiltersOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminSlaInput is the input for CreateAdminSla — Post SLA. -type CreateAdminSlaInput struct { - AllowExtensions bool `json:"allowExtensions"` - MaxDaysToFix int `json:"maxDaysToFix"` - Priority models.ModelsPriorityLabel `json:"priority"` - Severity models.ModelsSeverity `json:"severity"` +// CreateAdminTicketingSavedFiltersInput is the input for CreateAdminTicketingSavedFilters — Create Saved Ticket Filter. +type CreateAdminTicketingSavedFiltersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Name string `json:"name"` models.RequestScope } -// CreateAdminSla - Post SLA -// POST /admin/sla -func (c *Client) CreateAdminSla(ctx context.Context, in CreateAdminSlaInput) (*models.EndpointsPostSLAOutput, error) { - path := "/admin/sla" +// CreateAdminTicketingSavedFilters - Create Saved Ticket Filter +// POST /admin/ticketing/saved-filters +func (c *Client) CreateAdminTicketingSavedFilters(ctx context.Context, in CreateAdminTicketingSavedFiltersInput) (*models.EndpointsPostTicketSavedFilterOutput, error) { + path := "/admin/ticketing/saved-filters" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2881,15 +9933,11 @@ func (c *Client) CreateAdminSla(ctx context.Context, in CreateAdminSlaInput) (*m } bodyBytes, err := json.Marshal(struct { - AllowExtensions bool `json:"allowExtensions"` - MaxDaysToFix int `json:"maxDaysToFix"` - Priority models.ModelsPriorityLabel `json:"priority"` - Severity models.ModelsSeverity `json:"severity"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Name string `json:"name"` }{ - AllowExtensions: in.AllowExtensions, - MaxDaysToFix: in.MaxDaysToFix, - Priority: in.Priority, - Severity: in.Severity, + Filter: in.Filter, + Name: in.Name, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2898,28 +9946,73 @@ func (c *Client) CreateAdminSla(ctx context.Context, in CreateAdminSlaInput) (*m if err != nil { return nil, err } - var out models.EndpointsPostSLAOutput + var out models.EndpointsPostTicketSavedFilterOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// UpdateAdminSlaBulkInput is the input for UpdateAdminSlaBulk — Put Bulk SLA. -type UpdateAdminSlaBulkInput struct { - Slas []models.ModelsSLA `json:"slas,omitempty"` +// DeleteAdminTicketingSavedFiltersIdInput is the input for DeleteAdminTicketingSavedFiltersId — Delete Saved Ticket Filter. +type DeleteAdminTicketingSavedFiltersIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// UpdateAdminSlaBulk - Put Bulk SLA -// PUT /admin/sla/bulk -func (c *Client) UpdateAdminSlaBulk(ctx context.Context, in UpdateAdminSlaBulkInput) (*models.EndpointsPutBulkSLAOutput, error) { - path := "/admin/sla/bulk" +// DeleteAdminTicketingSavedFiltersId - Delete Saved Ticket Filter +// DELETE /admin/ticketing/saved-filters/{id} +func (c *Client) DeleteAdminTicketingSavedFiltersId(ctx context.Context, in DeleteAdminTicketingSavedFiltersIdInput) (*models.EndpointsDeleteTicketSavedFilterOutput, error) { + path := "/admin/ticketing/saved-filters/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSavedFilterOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchAdminTicketingSavedFiltersIdInput is the input for PatchAdminTicketingSavedFiltersId — Update Saved Ticket Filter. +type PatchAdminTicketingSavedFiltersIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Filter *models.EndpointsTicketWorkbenchFilter `json:"filter,omitempty"` + Name *string `json:"name,omitempty"` + models.RequestScope +} + +// PatchAdminTicketingSavedFiltersId - Update Saved Ticket Filter +// PATCH /admin/ticketing/saved-filters/{id} +func (c *Client) PatchAdminTicketingSavedFiltersId(ctx context.Context, in PatchAdminTicketingSavedFiltersIdInput) (*models.EndpointsPatchTicketSavedFilterOutput, error) { + path := "/admin/ticketing/saved-filters/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2928,44 +10021,49 @@ func (c *Client) UpdateAdminSlaBulk(ctx context.Context, in UpdateAdminSlaBulkIn } bodyBytes, err := json.Marshal(struct { - Slas []models.ModelsSLA `json:"slas,omitempty"` + Filter *models.EndpointsTicketWorkbenchFilter `json:"filter,omitempty"` + Name *string `json:"name,omitempty"` }{ - Slas: in.Slas, + Filter: in.Filter, + Name: in.Name, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPutBulkSLAOutput + var out models.EndpointsPatchTicketSavedFilterOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchAdminSlaSlaIdInput is the input for PatchAdminSlaSlaId — Patch SLA. -type PatchAdminSlaSlaIdInput struct { - SlaID string `path:"slaId" json:"-"` - AllowExtensions *bool `json:"allowExtensions,omitempty"` - MaxDaysToFix *int `json:"maxDaysToFix,omitempty"` - Priority *models.ModelsPriorityLabel `json:"priority,omitempty"` - Severity *models.ModelsSeverity `json:"severity,omitempty"` +// CreateAdminTicketingSettingsFindingTypeInput is the input for CreateAdminTicketingSettingsFindingType — Save Ticket Settings. +type CreateAdminTicketingSettingsFindingTypeInput struct { + FindingType string `path:"findingType" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + MigrationAction *models.DatabaseTicketMigrationAction `json:"migrationAction,omitempty"` + Proposal models.EndpointsTicketSettingsProposal `json:"proposal"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` models.RequestScope } -// PatchAdminSlaSlaId - Patch SLA -// PATCH /admin/sla/{slaId} -func (c *Client) PatchAdminSlaSlaId(ctx context.Context, in PatchAdminSlaSlaIdInput) (*models.EndpointsPatchSLAOutput, error) { - path := "/admin/sla/{slaId}" - path = strings.Replace(path, "{slaId}", url.PathEscape(in.SlaID), 1) +// CreateAdminTicketingSettingsFindingType - Save Ticket Settings +// POST /admin/ticketing/settings/{findingType} +func (c *Client) CreateAdminTicketingSettingsFindingType(ctx context.Context, in CreateAdminTicketingSettingsFindingTypeInput) (*models.EndpointsPostTicketSettingsOutput, error) { + path := "/admin/ticketing/settings/{findingType}" + path = strings.Replace(path, "{findingType}", url.PathEscape(in.FindingType), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2974,44 +10072,56 @@ func (c *Client) PatchAdminSlaSlaId(ctx context.Context, in PatchAdminSlaSlaIdIn } bodyBytes, err := json.Marshal(struct { - AllowExtensions *bool `json:"allowExtensions,omitempty"` - MaxDaysToFix *int `json:"maxDaysToFix,omitempty"` - Priority *models.ModelsPriorityLabel `json:"priority,omitempty"` - Severity *models.ModelsSeverity `json:"severity,omitempty"` + MigrationAction *models.DatabaseTicketMigrationAction `json:"migrationAction,omitempty"` + Proposal models.EndpointsTicketSettingsProposal `json:"proposal"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` }{ - AllowExtensions: in.AllowExtensions, - MaxDaysToFix: in.MaxDaysToFix, - Priority: in.Priority, - Severity: in.Severity, + MigrationAction: in.MigrationAction, + Proposal: in.Proposal, + UserCanonicalID: in.UserCanonicalID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchSLAOutput + var out models.EndpointsPostTicketSettingsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminTeamSourcePreferencesInput is the input for ListAdminTeamSourcePreferences — Get Team Source Preferences. -type ListAdminTeamSourcePreferencesInput struct { +// ListAdminTicketingSettingsFindingTypeHistoryInput is the input for ListAdminTicketingSettingsFindingTypeHistory — List Ticket Settings History. +type ListAdminTicketingSettingsFindingTypeHistoryInput struct { + FindingType string `path:"findingType" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + Offset *int32 `url:"offset,omitempty" json:"-"` models.RequestScope } -// ListAdminTeamSourcePreferences - Get Team Source Preferences -// GET /admin/team-source-preferences -func (c *Client) ListAdminTeamSourcePreferences(ctx context.Context, in ListAdminTeamSourcePreferencesInput) (*models.EndpointsGetTeamSourcePreferencesOutput, error) { - path := "/admin/team-source-preferences" +// ListAdminTicketingSettingsFindingTypeHistory - List Ticket Settings History +// GET /admin/ticketing/settings/{findingType}/history +func (c *Client) ListAdminTicketingSettingsFindingTypeHistory(ctx context.Context, in ListAdminTicketingSettingsFindingTypeHistoryInput) (*models.EndpointsGetTicketSettingsHistoryOutput, error) { + path := "/admin/ticketing/settings/{findingType}/history" + path = strings.Replace(path, "{findingType}", url.PathEscape(in.FindingType), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3023,29 +10133,35 @@ func (c *Client) ListAdminTeamSourcePreferences(ctx context.Context, in ListAdmi if err != nil { return nil, err } - var out models.EndpointsGetTeamSourcePreferencesOutput + var out models.EndpointsGetTicketSettingsHistoryOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// UpdateAdminTeamSourcePreferencesInput is the input for UpdateAdminTeamSourcePreferences — Update Team Source Preferences. -type UpdateAdminTeamSourcePreferencesInput struct { - GithubTeamsEnabled bool `json:"githubTeamsEnabled"` - RepositoryPropertyEnabled bool `json:"repositoryPropertyEnabled"` +// CreateAdminTicketingSettingsFindingTypePreviewInput is the input for CreateAdminTicketingSettingsFindingTypePreview — Preview Ticket Settings Impact. +type CreateAdminTicketingSettingsFindingTypePreviewInput struct { + FindingType string `path:"findingType" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Proposal models.EndpointsTicketSettingsProposal `json:"proposal"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` models.RequestScope } -// UpdateAdminTeamSourcePreferences - Update Team Source Preferences -// PUT /admin/team-source-preferences -func (c *Client) UpdateAdminTeamSourcePreferences(ctx context.Context, in UpdateAdminTeamSourcePreferencesInput) (*models.EndpointsPutTeamSourcePreferencesOutput, error) { - path := "/admin/team-source-preferences" +// CreateAdminTicketingSettingsFindingTypePreview - Preview Ticket Settings Impact +// POST /admin/ticketing/settings/{findingType}/preview +func (c *Client) CreateAdminTicketingSettingsFindingTypePreview(ctx context.Context, in CreateAdminTicketingSettingsFindingTypePreviewInput) (*models.EndpointsPostTicketSettingsPreviewOutput, error) { + path := "/admin/ticketing/settings/{findingType}/preview" + path = strings.Replace(path, "{findingType}", url.PathEscape(in.FindingType), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3054,48 +10170,108 @@ func (c *Client) UpdateAdminTeamSourcePreferences(ctx context.Context, in Update } bodyBytes, err := json.Marshal(struct { - GithubTeamsEnabled bool `json:"githubTeamsEnabled"` - RepositoryPropertyEnabled bool `json:"repositoryPropertyEnabled"` + Proposal models.EndpointsTicketSettingsProposal `json:"proposal"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` }{ - GithubTeamsEnabled: in.GithubTeamsEnabled, - RepositoryPropertyEnabled: in.RepositoryPropertyEnabled, + Proposal: in.Proposal, + UserCanonicalID: in.UserCanonicalID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPutTeamSourcePreferencesOutput + var out models.EndpointsPostTicketSettingsPreviewOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminTeamSyncRunsInput is the input for ListAdminTeamSyncRuns — List Team Sync Runs. -type ListAdminTeamSyncRunsInput struct { +// ListAdminTicketingTicketsInput is the input for ListAdminTicketingTickets — List Tickets (Power-User Workbench). +type ListAdminTicketingTicketsInput struct { + BoardID *string `url:"boardId,omitempty" json:"-"` + ClosedAfter *string `url:"closedAfter,omitempty" json:"-"` + ClosedBefore *string `url:"closedBefore,omitempty" json:"-"` + CreatedAfter *string `url:"createdAfter,omitempty" json:"-"` + CreatedBefore *string `url:"createdBefore,omitempty" json:"-"` + FindingType []string `url:"findingType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + HasSyncError *string `url:"hasSyncError,omitempty" json:"-"` + LastSyncedBefore *string `url:"lastSyncedBefore,omitempty" json:"-"` Limit *int32 `url:"limit,omitempty" json:"-"` - Source *string `url:"source,omitempty" json:"-"` + Offset *int32 `url:"offset,omitempty" json:"-"` + OutOfEligibilitySinceAfter *string `url:"outOfEligibilitySinceAfter,omitempty" json:"-"` + Platform []string `url:"platform,omitempty" json:"-"` + Q *string `url:"q,omitempty" json:"-"` + SavedFilterID *string `url:"savedFilterId,omitempty" json:"-"` + Source []string `url:"source,omitempty" json:"-"` + Status []string `url:"status,omitempty" json:"-"` models.RequestScope } -// ListAdminTeamSyncRuns - List Team Sync Runs -// GET /admin/team-sync-runs -func (c *Client) ListAdminTeamSyncRuns(ctx context.Context, in ListAdminTeamSyncRunsInput) (*models.EndpointsGetTeamSyncRunsOutput, error) { - path := "/admin/team-sync-runs" +// ListAdminTicketingTickets - List Tickets (Power-User Workbench) +// GET /admin/ticketing/tickets +func (c *Client) ListAdminTicketingTickets(ctx context.Context, in ListAdminTicketingTicketsInput) (*models.EndpointsGetTicketWorkbenchListOutput, error) { + path := "/admin/ticketing/tickets" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Source != nil { - query.Set("source", string(*in.Source)) + for _, v := range in.Source { + query.Add("source", string(v)) + } + for _, v := range in.Status { + query.Add("status", string(v)) + } + for _, v := range in.FindingType { + query.Add("findingType", string(v)) + } + for _, v := range in.Platform { + query.Add("platform", string(v)) + } + if in.BoardID != nil { + query.Set("boardId", string(*in.BoardID)) + } + if in.CreatedAfter != nil { + query.Set("createdAfter", string(*in.CreatedAfter)) + } + if in.CreatedBefore != nil { + query.Set("createdBefore", string(*in.CreatedBefore)) + } + if in.ClosedAfter != nil { + query.Set("closedAfter", string(*in.ClosedAfter)) + } + if in.ClosedBefore != nil { + query.Set("closedBefore", string(*in.ClosedBefore)) + } + if in.LastSyncedBefore != nil { + query.Set("lastSyncedBefore", string(*in.LastSyncedBefore)) + } + if in.OutOfEligibilitySinceAfter != nil { + query.Set("outOfEligibilitySinceAfter", string(*in.OutOfEligibilitySinceAfter)) + } + if in.HasSyncError != nil { + query.Set("hasSyncError", string(*in.HasSyncError)) + } + if in.Q != nil { + query.Set("q", string(*in.Q)) + } + if in.SavedFilterID != nil { + query.Set("savedFilterId", string(*in.SavedFilterID)) } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3107,28 +10283,35 @@ func (c *Client) ListAdminTeamSyncRuns(ctx context.Context, in ListAdminTeamSync if err != nil { return nil, err } - var out models.EndpointsGetTeamSyncRunsOutput + var out models.EndpointsGetTicketWorkbenchListOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminTeamSyncRunsInput is the input for CreateAdminTeamSyncRuns — Trigger Team Sync. -type CreateAdminTeamSyncRunsInput struct { - Source *string `json:"source,omitempty"` +// CreateAdminTicketingTicketsBulkAddCommentInput is the input for CreateAdminTicketingTicketsBulkAddComment — Bulk Add Comment To Tickets. +type CreateAdminTicketingTicketsBulkAddCommentInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkAddCommentParams `json:"params,omitempty"` models.RequestScope } -// CreateAdminTeamSyncRuns - Trigger Team Sync -// POST /admin/team-sync-runs -func (c *Client) CreateAdminTeamSyncRuns(ctx context.Context, in CreateAdminTeamSyncRunsInput) (*models.EndpointsPostTeamSyncRunOutput, error) { - path := "/admin/team-sync-runs" +// CreateAdminTicketingTicketsBulkAddComment - Bulk Add Comment To Tickets +// POST /admin/ticketing/tickets/bulk-add-comment +func (c *Client) CreateAdminTicketingTicketsBulkAddComment(ctx context.Context, in CreateAdminTicketingTicketsBulkAddCommentInput) (*models.EndpointsPostBulkAddCommentOutput, error) { + path := "/admin/ticketing/tickets/bulk-add-comment" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3137,9 +10320,15 @@ func (c *Client) CreateAdminTeamSyncRuns(ctx context.Context, in CreateAdminTeam } bodyBytes, err := json.Marshal(struct { - Source *string `json:"source,omitempty"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkAddCommentParams `json:"params,omitempty"` }{ - Source: in.Source, + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3148,29 +10337,35 @@ func (c *Client) CreateAdminTeamSyncRuns(ctx context.Context, in CreateAdminTeam if err != nil { return nil, err } - var out models.EndpointsPostTeamSyncRunOutput + var out models.EndpointsPostBulkAddCommentOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetAdminTeamTeamIDInput is the input for GetAdminTeamTeamID — Get Team. -type GetAdminTeamTeamIDInput struct { - TeamID string `path:"teamID" json:"-"` +// CreateAdminTicketingTicketsBulkCloseInput is the input for CreateAdminTicketingTicketsBulkClose — Bulk Close Tickets. +type CreateAdminTicketingTicketsBulkCloseInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkCloseParams `json:"params,omitempty"` models.RequestScope } -// GetAdminTeamTeamID - Get Team -// GET /admin/team/{teamID} -func (c *Client) GetAdminTeamTeamID(ctx context.Context, in GetAdminTeamTeamIDInput) (*models.EndpointsGetTeamOutput, error) { - path := "/admin/team/{teamID}" - path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) +// CreateAdminTicketingTicketsBulkClose - Bulk Close Tickets +// POST /admin/ticketing/tickets/bulk-close +func (c *Client) CreateAdminTicketingTicketsBulkClose(ctx context.Context, in CreateAdminTicketingTicketsBulkCloseInput) (*models.EndpointsPostBulkCloseOutput, error) { + path := "/admin/ticketing/tickets/bulk-close" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3178,42 +10373,52 @@ func (c *Client) GetAdminTeamTeamID(ctx context.Context, in GetAdminTeamTeamIDIn fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkCloseParams `json:"params,omitempty"` + }{ + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetTeamOutput + var out models.EndpointsPostBulkCloseOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminTeamsInput is the input for ListAdminTeams — Get All Teams. -type ListAdminTeamsInput struct { - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - Search *string `url:"search,omitempty" json:"-"` +// CreateAdminTicketingTicketsBulkMoveInput is the input for CreateAdminTicketingTicketsBulkMove — Bulk Move Tickets. +type CreateAdminTicketingTicketsBulkMoveInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkMoveParams `json:"params,omitempty"` models.RequestScope } -// ListAdminTeams - Get All Teams -// GET /admin/teams -func (c *Client) ListAdminTeams(ctx context.Context, in ListAdminTeamsInput) (*models.EndpointsGetTeamsOutput, error) { - path := "/admin/teams" +// CreateAdminTicketingTicketsBulkMove - Bulk Move Tickets +// POST /admin/ticketing/tickets/bulk-move +func (c *Client) CreateAdminTicketingTicketsBulkMove(ctx context.Context, in CreateAdminTicketingTicketsBulkMoveInput) (*models.EndpointsPostBulkMoveOutput, error) { + path := "/admin/ticketing/tickets/bulk-move" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.Search != nil { - query.Set("search", string(*in.Search)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -3222,43 +10427,53 @@ func (c *Client) ListAdminTeams(ctx context.Context, in ListAdminTeamsInput) (*m fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkMoveParams `json:"params,omitempty"` + }{ + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetTeamsOutput + var out models.EndpointsPostBulkMoveOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminTeamsInput is the input for CreateAdminTeams — Post Team. -type CreateAdminTeamsInput struct { - CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` - Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` - Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` - GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` - Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` - LeadID *string `json:"leadId,omitempty"` - MemberIds []string `json:"memberIds,omitempty"` - MessageChannelProvider models.ModelsMessageChannelProvider `json:"messageChannelProvider"` - Name string `json:"name"` - Privacy models.ModelsTeamPrivacy `json:"privacy"` - Slug string `json:"slug"` - TicketProjectProvider models.ModelsTicketProjectProvider `json:"ticketProjectProvider"` +// CreateAdminTicketingTicketsBulkReassignAssigneeInput is the input for CreateAdminTicketingTicketsBulkReassignAssignee — Bulk Reassign Ticket Assignee. +type CreateAdminTicketingTicketsBulkReassignAssigneeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkReassignAssigneeParams `json:"params,omitempty"` models.RequestScope } -// CreateAdminTeams - Post Team -// POST /admin/teams -func (c *Client) CreateAdminTeams(ctx context.Context, in CreateAdminTeamsInput) (*models.EndpointsPostTeamOutput, error) { - path := "/admin/teams" +// CreateAdminTicketingTicketsBulkReassignAssignee - Bulk Reassign Ticket Assignee +// POST /admin/ticketing/tickets/bulk-reassign-assignee +func (c *Client) CreateAdminTicketingTicketsBulkReassignAssignee(ctx context.Context, in CreateAdminTicketingTicketsBulkReassignAssigneeInput) (*models.EndpointsPostBulkReassignAssigneeOutput, error) { + path := "/admin/ticketing/tickets/bulk-reassign-assignee" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3267,31 +10482,15 @@ func (c *Client) CreateAdminTeams(ctx context.Context, in CreateAdminTeamsInput) } bodyBytes, err := json.Marshal(struct { - CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` - Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` - Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` - GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` - Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` - LeadID *string `json:"leadId,omitempty"` - MemberIds []string `json:"memberIds,omitempty"` - MessageChannelProvider models.ModelsMessageChannelProvider `json:"messageChannelProvider"` - Name string `json:"name"` - Privacy models.ModelsTeamPrivacy `json:"privacy"` - Slug string `json:"slug"` - TicketProjectProvider models.ModelsTicketProjectProvider `json:"ticketProjectProvider"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkReassignAssigneeParams `json:"params,omitempty"` }{ - CodeOwnerships: in.CodeOwnerships, - Github: in.Github, - Gitlab: in.Gitlab, - GroundRules: in.GroundRules, - Jira: in.Jira, - LeadID: in.LeadID, - MemberIds: in.MemberIds, - MessageChannelProvider: in.MessageChannelProvider, - Name: in.Name, - Privacy: in.Privacy, - Slug: in.Slug, - TicketProjectProvider: in.TicketProjectProvider, + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3300,27 +10499,35 @@ func (c *Client) CreateAdminTeams(ctx context.Context, in CreateAdminTeamsInput) if err != nil { return nil, err } - var out models.EndpointsPostTeamOutput + var out models.EndpointsPostBulkReassignAssigneeOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminTeamsAppzipInput is the input for ListAdminTeamsAppzip — Get Teams App Zip. -type ListAdminTeamsAppzipInput struct { +// CreateAdminTicketingTicketsBulkReassignTeamInput is the input for CreateAdminTicketingTicketsBulkReassignTeam — Bulk Reassign Tickets to Team. +type CreateAdminTicketingTicketsBulkReassignTeamInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkReassignTeamParams `json:"params,omitempty"` models.RequestScope } -// ListAdminTeamsAppzip - Get Teams App Zip -// GET /admin/teams/appzip -func (c *Client) ListAdminTeamsAppzip(ctx context.Context, in ListAdminTeamsAppzipInput) (*models.EndpointsGetTeamsAppZipOutput, error) { - path := "/admin/teams/appzip" +// CreateAdminTicketingTicketsBulkReassignTeam - Bulk Reassign Tickets to Team +// POST /admin/ticketing/tickets/bulk-reassign-team +func (c *Client) CreateAdminTicketingTicketsBulkReassignTeam(ctx context.Context, in CreateAdminTicketingTicketsBulkReassignTeamInput) (*models.EndpointsPostBulkReassignTeamOutput, error) { + path := "/admin/ticketing/tickets/bulk-reassign-team" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3328,37 +10535,53 @@ func (c *Client) ListAdminTeamsAppzip(ctx context.Context, in ListAdminTeamsAppz fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkReassignTeamParams `json:"params,omitempty"` + }{ + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetTeamsAppZipOutput + var out models.EndpointsPostBulkReassignTeamOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminTeamsCompassInput is the input for CreateAdminTeamsCompass — Post Compass/Atlassian Team. -type CreateAdminTeamsCompassInput struct { - DisplayName string `json:"displayName"` - Lead string `json:"lead"` - Members []string `json:"members,omitempty"` - ProviderID *models.ModelsProviderID `json:"providerId,omitempty"` - Repositories []string `json:"repositories,omitempty"` - TeamKey *string `json:"teamKey,omitempty"` +// CreateAdminTicketingTicketsBulkRelabelInput is the input for CreateAdminTicketingTicketsBulkRelabel — Bulk Relabel Tickets. +type CreateAdminTicketingTicketsBulkRelabelInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkRelabelParams `json:"params,omitempty"` models.RequestScope } -// CreateAdminTeamsCompass - Post Compass/Atlassian Team -// POST /admin/teams/compass -func (c *Client) CreateAdminTeamsCompass(ctx context.Context, in CreateAdminTeamsCompassInput) (*models.EndpointsPostCompassTeamOutput, error) { - path := "/admin/teams/compass" +// CreateAdminTicketingTicketsBulkRelabel - Bulk Relabel Tickets +// POST /admin/ticketing/tickets/bulk-relabel +func (c *Client) CreateAdminTicketingTicketsBulkRelabel(ctx context.Context, in CreateAdminTicketingTicketsBulkRelabelInput) (*models.EndpointsPostBulkRelabelOutput, error) { + path := "/admin/ticketing/tickets/bulk-relabel" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3367,19 +10590,15 @@ func (c *Client) CreateAdminTeamsCompass(ctx context.Context, in CreateAdminTeam } bodyBytes, err := json.Marshal(struct { - DisplayName string `json:"displayName"` - Lead string `json:"lead"` - Members []string `json:"members,omitempty"` - ProviderID *models.ModelsProviderID `json:"providerId,omitempty"` - Repositories []string `json:"repositories,omitempty"` - TeamKey *string `json:"teamKey,omitempty"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkRelabelParams `json:"params,omitempty"` }{ - DisplayName: in.DisplayName, - Lead: in.Lead, - Members: in.Members, - ProviderID: in.ProviderID, - Repositories: in.Repositories, - TeamKey: in.TeamKey, + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3388,27 +10607,35 @@ func (c *Client) CreateAdminTeamsCompass(ctx context.Context, in CreateAdminTeam if err != nil { return nil, err } - var out models.EndpointsPostCompassTeamOutput + var out models.EndpointsPostBulkRelabelOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminTeamsFindingsInput is the input for ListAdminTeamsFindings — Get All Team Findings mapping. -type ListAdminTeamsFindingsInput struct { +// CreateAdminTicketingTicketsBulkReopenInput is the input for CreateAdminTicketingTicketsBulkReopen — Bulk Reopen Tickets. +type CreateAdminTicketingTicketsBulkReopenInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkReopenParams `json:"params,omitempty"` models.RequestScope } -// ListAdminTeamsFindings - Get All Team Findings mapping -// GET /admin/teams/findings -func (c *Client) ListAdminTeamsFindings(ctx context.Context, in ListAdminTeamsFindingsInput) (*models.EndpointsListTeamFindingsOutput, error) { - path := "/admin/teams/findings" +// CreateAdminTicketingTicketsBulkReopen - Bulk Reopen Tickets +// POST /admin/ticketing/tickets/bulk-reopen +func (c *Client) CreateAdminTicketingTicketsBulkReopen(ctx context.Context, in CreateAdminTicketingTicketsBulkReopenInput) (*models.EndpointsPostBulkReopenOutput, error) { + path := "/admin/ticketing/tickets/bulk-reopen" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3416,32 +10643,53 @@ func (c *Client) ListAdminTeamsFindings(ctx context.Context, in ListAdminTeamsFi fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkReopenParams `json:"params,omitempty"` + }{ + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsListTeamFindingsOutput + var out models.EndpointsPostBulkReopenOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminTeamsFindingsInput is the input for CreateAdminTeamsFindings — Manual Team Findings Assignment. -type CreateAdminTeamsFindingsInput struct { - Mappings []models.EndpointsPostTeamFindingsMapping `json:"mappings,omitempty"` +// CreateAdminTicketingTicketsBulkResyncInput is the input for CreateAdminTicketingTicketsBulkResync — Bulk Re-Sync Tickets. +type CreateAdminTicketingTicketsBulkResyncInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkResyncParams `json:"params,omitempty"` models.RequestScope } -// CreateAdminTeamsFindings - Manual Team Findings Assignment -// POST /admin/teams/findings -func (c *Client) CreateAdminTeamsFindings(ctx context.Context, in CreateAdminTeamsFindingsInput) (*models.EndpointsPostTeamFindingsOutput, error) { - path := "/admin/teams/findings" +// CreateAdminTicketingTicketsBulkResync - Bulk Re-Sync Tickets +// POST /admin/ticketing/tickets/bulk-resync +func (c *Client) CreateAdminTicketingTicketsBulkResync(ctx context.Context, in CreateAdminTicketingTicketsBulkResyncInput) (*models.EndpointsPostBulkResyncOutput, error) { + path := "/admin/ticketing/tickets/bulk-resync" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3450,9 +10698,15 @@ func (c *Client) CreateAdminTeamsFindings(ctx context.Context, in CreateAdminTea } bodyBytes, err := json.Marshal(struct { - Mappings []models.EndpointsPostTeamFindingsMapping `json:"mappings,omitempty"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkResyncParams `json:"params,omitempty"` }{ - Mappings: in.Mappings, + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3461,32 +10715,35 @@ func (c *Client) CreateAdminTeamsFindings(ctx context.Context, in CreateAdminTea if err != nil { return nil, err } - var out models.EndpointsPostTeamFindingsOutput + var out models.EndpointsPostBulkResyncOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminTeamsFindingsSyncInput is the input for CreateAdminTeamsFindingsSync — Sync Team Findings. -type CreateAdminTeamsFindingsSyncInput struct { - Async *bool `json:"async,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - FindingTypes []string `json:"findingTypes,omitempty"` - RepositoryIds []string `json:"repositoryIds,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` +// CreateAdminTicketingTicketsBulkSetPriorityInput is the input for CreateAdminTicketingTicketsBulkSetPriority — Bulk Set Ticket Priority. +type CreateAdminTicketingTicketsBulkSetPriorityInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkSetPriorityParams `json:"params,omitempty"` models.RequestScope } -// CreateAdminTeamsFindingsSync - Sync Team Findings -// POST /admin/teams/findings/sync -func (c *Client) CreateAdminTeamsFindingsSync(ctx context.Context, in CreateAdminTeamsFindingsSyncInput) (*models.EndpointsPostTeamFindingsSyncOutput, error) { - path := "/admin/teams/findings/sync" +// CreateAdminTicketingTicketsBulkSetPriority - Bulk Set Ticket Priority +// POST /admin/ticketing/tickets/bulk-set-priority +func (c *Client) CreateAdminTicketingTicketsBulkSetPriority(ctx context.Context, in CreateAdminTicketingTicketsBulkSetPriorityInput) (*models.EndpointsPostBulkSetPriorityOutput, error) { + path := "/admin/ticketing/tickets/bulk-set-priority" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3495,17 +10752,15 @@ func (c *Client) CreateAdminTeamsFindingsSync(ctx context.Context, in CreateAdmi } bodyBytes, err := json.Marshal(struct { - Async *bool `json:"async,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - FindingTypes []string `json:"findingTypes,omitempty"` - RepositoryIds []string `json:"repositoryIds,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter models.EndpointsTicketWorkbenchFilter `json:"filter"` + Params *models.EndpointsBulkSetPriorityParams `json:"params,omitempty"` }{ - Async: in.Async, - FindingIds: in.FindingIds, - FindingTypes: in.FindingTypes, - RepositoryIds: in.RepositoryIds, - RepositoryNames: in.RepositoryNames, + ConfirmationToken: in.ConfirmationToken, + DryRun: in.DryRun, + Filter: in.Filter, + Params: in.Params, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3514,29 +10769,47 @@ func (c *Client) CreateAdminTeamsFindingsSync(ctx context.Context, in CreateAdmi if err != nil { return nil, err } - var out models.EndpointsPostTeamFindingsSyncOutput + var out models.EndpointsPostBulkSetPriorityOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminTeamsMergeInput is the input for CreateAdminTeamsMerge — Merge Teams. -type CreateAdminTeamsMergeInput struct { - Sources []models.EndpointsTeamMergeSource `json:"sources,omitempty"` - TargetTeamID *string `json:"targetTeamId,omitempty"` +// ListAdminTicketingTicketsCountsInput is the input for ListAdminTicketingTicketsCounts — Get Ticket Facet Counts. +type ListAdminTicketingTicketsCountsInput struct { + FindingType []string `url:"findingType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Platform []string `url:"platform,omitempty" json:"-"` + Source []string `url:"source,omitempty" json:"-"` + Status []string `url:"status,omitempty" json:"-"` models.RequestScope } -// CreateAdminTeamsMerge - Merge Teams -// POST /admin/teams/merge -func (c *Client) CreateAdminTeamsMerge(ctx context.Context, in CreateAdminTeamsMergeInput) (*models.EndpointsPostTeamMergeOutput, error) { - path := "/admin/teams/merge" +// ListAdminTicketingTicketsCounts - Get Ticket Facet Counts +// GET /admin/ticketing/tickets/counts +func (c *Client) ListAdminTicketingTicketsCounts(ctx context.Context, in ListAdminTicketingTicketsCountsInput) (*models.EndpointsGetTicketWorkbenchCountsOutput, error) { + path := "/admin/ticketing/tickets/counts" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + for _, v := range in.Source { + query.Add("source", string(v)) + } + for _, v := range in.Status { + query.Add("status", string(v)) + } + for _, v := range in.FindingType { + query.Add("findingType", string(v)) + } + for _, v := range in.Platform { + query.Add("platform", string(v)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3544,43 +10817,37 @@ func (c *Client) CreateAdminTeamsMerge(ctx context.Context, in CreateAdminTeamsM fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Sources []models.EndpointsTeamMergeSource `json:"sources,omitempty"` - TargetTeamID *string `json:"targetTeamId,omitempty"` - }{ - Sources: in.Sources, - TargetTeamID: in.TargetTeamID, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostTeamMergeOutput + var out models.EndpointsGetTicketWorkbenchCountsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteAdminTeamsTeamIDInput is the input for DeleteAdminTeamsTeamID — Delete Manual Team. -type DeleteAdminTeamsTeamIDInput struct { - TeamID string `path:"teamID" json:"-"` +// GetAdminTicketingTicketsTicketIdInput is the input for GetAdminTicketingTicketsTicketId — Get Ticket Drill-Down. +type GetAdminTicketingTicketsTicketIdInput struct { + TicketID string `path:"ticketId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteAdminTeamsTeamID - Delete Manual Team -// DELETE /admin/teams/{teamID} -func (c *Client) DeleteAdminTeamsTeamID(ctx context.Context, in DeleteAdminTeamsTeamIDInput) (*models.EndpointsDeleteTeamOutput, error) { - path := "/admin/teams/{teamID}" - path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) +// GetAdminTicketingTicketsTicketId - Get Ticket Drill-Down +// GET /admin/ticketing/tickets/{ticketId} +func (c *Client) GetAdminTicketingTicketsTicketId(ctx context.Context, in GetAdminTicketingTicketsTicketIdInput) (*models.EndpointsGetTicketWorkbenchDrilldownOutput, error) { + path := "/admin/ticketing/tickets/{ticketId}" + path = strings.Replace(path, "{ticketId}", url.PathEscape(in.TicketID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3588,45 +10855,36 @@ func (c *Client) DeleteAdminTeamsTeamID(ctx context.Context, in DeleteAdminTeams fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteTeamOutput + var out models.EndpointsGetTicketWorkbenchDrilldownOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchAdminTeamsTeamIDInput is the input for PatchAdminTeamsTeamID — Patch Team. -type PatchAdminTeamsTeamIDInput struct { - TeamID string `path:"teamID" json:"-"` - CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` - Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` - Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` - GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` - Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` - LeadID *string `json:"leadId,omitempty"` - MemberIds []string `json:"memberIds,omitempty"` - MessageChannelProvider *models.ModelsMessageChannelProvider `json:"messageChannelProvider,omitempty"` - Name *string `json:"name,omitempty"` - Privacy *models.ModelsTeamPrivacy `json:"privacy,omitempty"` - Slug *string `json:"slug,omitempty"` - TicketProjectProvider *models.ModelsTicketProjectProvider `json:"ticketProjectProvider,omitempty"` +// CreateAdminTriageContextCensusInput is the input for CreateAdminTriageContextCensus — Post Triage Context Census. +type CreateAdminTriageContextCensusInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + FindingIds []string `json:"findingIds,omitempty"` models.RequestScope } -// PatchAdminTeamsTeamID - Patch Team -// PATCH /admin/teams/{teamID} -func (c *Client) PatchAdminTeamsTeamID(ctx context.Context, in PatchAdminTeamsTeamIDInput) (*models.EndpointsPatchTeamOutput, error) { - path := "/admin/teams/{teamID}" - path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) +// CreateAdminTriageContextCensus - Post Triage Context Census +// POST /admin/triage/context-census +func (c *Client) CreateAdminTriageContextCensus(ctx context.Context, in CreateAdminTriageContextCensusInput) (*models.EndpointsAdminTriageContextCensusOutput, error) { + path := "/admin/triage/context-census" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3635,73 +10893,42 @@ func (c *Client) PatchAdminTeamsTeamID(ctx context.Context, in PatchAdminTeamsTe } bodyBytes, err := json.Marshal(struct { - CodeOwnerships []models.ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` - Github *models.ModelsTeamProviderGitHub `json:"github,omitempty"` - Gitlab *models.ModelsTeamProviderGitLab `json:"gitlab,omitempty"` - GroundRules []models.ModelsGroundRule `json:"groundRules,omitempty"` - Jira *models.ModelsTeamProviderJira `json:"jira,omitempty"` - LeadID *string `json:"leadId,omitempty"` - MemberIds []string `json:"memberIds,omitempty"` - MessageChannelProvider *models.ModelsMessageChannelProvider `json:"messageChannelProvider,omitempty"` - Name *string `json:"name,omitempty"` - Privacy *models.ModelsTeamPrivacy `json:"privacy,omitempty"` - Slug *string `json:"slug,omitempty"` - TicketProjectProvider *models.ModelsTicketProjectProvider `json:"ticketProjectProvider,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` }{ - CodeOwnerships: in.CodeOwnerships, - Github: in.Github, - Gitlab: in.Gitlab, - GroundRules: in.GroundRules, - Jira: in.Jira, - LeadID: in.LeadID, - MemberIds: in.MemberIds, - MessageChannelProvider: in.MessageChannelProvider, - Name: in.Name, - Privacy: in.Privacy, - Slug: in.Slug, - TicketProjectProvider: in.TicketProjectProvider, + FindingIds: in.FindingIds, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchTeamOutput + var out models.EndpointsAdminTriageContextCensusOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateAdminTeamsTeamIDEventsInput is the input for CreateAdminTeamsTeamIDEvents — List Team Unified Events. -type CreateAdminTeamsTeamIDEventsInput struct { - TeamID string `path:"teamID" json:"-"` - AfterID *string `json:"afterId,omitempty"` - AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` - AutofixID *string `json:"autofixId,omitempty"` - BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` - CampaignID *string `json:"campaignId,omitempty"` - EventTypes []string `json:"eventTypes,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - Limit *int `json:"limit,omitempty"` - PrCanonicalID *string `json:"prCanonicalId,omitempty"` - RunID *string `json:"runId,omitempty"` - Services []string `json:"services,omitempty"` +// DeleteAdminUiPreferencesInput is the input for DeleteAdminUiPreferences — Delete UI Preferences. +type DeleteAdminUiPreferencesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateAdminTeamsTeamIDEvents - List Team Unified Events -// POST /admin/teams/{teamID}/events -func (c *Client) CreateAdminTeamsTeamIDEvents(ctx context.Context, in CreateAdminTeamsTeamIDEventsInput) (*models.EndpointsAdminListUnifiedEventsOutput, error) { - path := "/admin/teams/{teamID}/events" - path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) +// DeleteAdminUiPreferences - Delete UI Preferences +// DELETE /admin/ui/preferences +func (c *Client) DeleteAdminUiPreferences(ctx context.Context, in DeleteAdminUiPreferencesInput) (*models.EndpointsDeleteUIPreferencesOutput, error) { + path := "/admin/ui/preferences" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3709,61 +10936,72 @@ func (c *Client) CreateAdminTeamsTeamIDEvents(ctx context.Context, in CreateAdmi fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - AfterID *string `json:"afterId,omitempty"` - AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` - AutofixID *string `json:"autofixId,omitempty"` - BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` - CampaignID *string `json:"campaignId,omitempty"` - EventTypes []string `json:"eventTypes,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - Limit *int `json:"limit,omitempty"` - PrCanonicalID *string `json:"prCanonicalId,omitempty"` - RunID *string `json:"runId,omitempty"` - Services []string `json:"services,omitempty"` - }{ - AfterID: in.AfterID, - AfterTimeUnix: in.AfterTimeUnix, - AutofixID: in.AutofixID, - BeforeTimeUnix: in.BeforeTimeUnix, - CampaignID: in.CampaignID, - EventTypes: in.EventTypes, - FindingIds: in.FindingIds, - Limit: in.Limit, - PrCanonicalID: in.PrCanonicalID, - RunID: in.RunID, - Services: in.Services, - }) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) + return nil, err } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + var out models.EndpointsDeleteUIPreferencesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListAdminUiPreferencesInput is the input for ListAdminUiPreferences — Get UI Preferences. +type ListAdminUiPreferencesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListAdminUiPreferences - Get UI Preferences +// GET /admin/ui/preferences +func (c *Client) ListAdminUiPreferences(ctx context.Context, in ListAdminUiPreferencesInput) (*models.EndpointsGetUIPreferencesOutput, error) { + path := "/admin/ui/preferences" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsAdminListUnifiedEventsOutput + var out models.EndpointsGetUIPreferencesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListAdminTeamsTeamIDFindingsInput is the input for ListAdminTeamsTeamIDFindings — Get Team Findings mapping. -type ListAdminTeamsTeamIDFindingsInput struct { - TeamID string `path:"teamID" json:"-"` +// UpdateAdminUiPreferencesInput is the input for UpdateAdminUiPreferences — Put UI Preferences. +type UpdateAdminUiPreferencesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Preferences map[string]json.RawMessage `json:"preferences,omitempty"` models.RequestScope } -// ListAdminTeamsTeamIDFindings - Get Team Findings mapping -// GET /admin/teams/{teamID}/findings -func (c *Client) ListAdminTeamsTeamIDFindings(ctx context.Context, in ListAdminTeamsTeamIDFindingsInput) (*models.EndpointsGetTeamFindingsOutput, error) { - path := "/admin/teams/{teamID}/findings" - path = strings.Replace(path, "{teamID}", url.PathEscape(in.TeamID), 1) +// UpdateAdminUiPreferences - Put UI Preferences +// PUT /admin/ui/preferences +func (c *Client) UpdateAdminUiPreferences(ctx context.Context, in UpdateAdminUiPreferencesInput) (*models.EndpointsPutUIPreferencesOutput, error) { + path := "/admin/ui/preferences" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3771,11 +11009,19 @@ func (c *Client) ListAdminTeamsTeamIDFindings(ctx context.Context, in ListAdminT fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Preferences map[string]json.RawMessage `json:"preferences,omitempty"` + }{ + Preferences: in.Preferences, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetTeamFindingsOutput + var out models.EndpointsPutUIPreferencesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } @@ -3784,6 +11030,7 @@ func (c *Client) ListAdminTeamsTeamIDFindings(ctx context.Context, in ListAdminT // ListAdminUiSavedViewsInput is the input for ListAdminUiSavedViews — Get UI Saved Views. type ListAdminUiSavedViewsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -3796,6 +11043,9 @@ func (c *Client) ListAdminUiSavedViews(ctx context.Context, in ListAdminUiSavedV for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3816,6 +11066,7 @@ func (c *Client) ListAdminUiSavedViews(ctx context.Context, in ListAdminUiSavedV // CreateAdminUiSavedViewsInput is the input for CreateAdminUiSavedViews — Post UI Saved View. type CreateAdminUiSavedViewsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` SavedView models.ModelsUISavedViewAPIInput `json:"savedView"` models.RequestScope } @@ -3829,6 +11080,9 @@ func (c *Client) CreateAdminUiSavedViews(ctx context.Context, in CreateAdminUiSa for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3858,6 +11112,7 @@ func (c *Client) CreateAdminUiSavedViews(ctx context.Context, in CreateAdminUiSa // DeleteAdminUiSavedViewsSavedViewIdInput is the input for DeleteAdminUiSavedViewsSavedViewId — Delete UI Saved View. type DeleteAdminUiSavedViewsSavedViewIdInput struct { SavedViewID string `path:"savedViewId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -3871,6 +11126,9 @@ func (c *Client) DeleteAdminUiSavedViewsSavedViewId(ctx context.Context, in Dele for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3892,6 +11150,7 @@ func (c *Client) DeleteAdminUiSavedViewsSavedViewId(ctx context.Context, in Dele // PatchAdminUiSavedViewsSavedViewIdInput is the input for PatchAdminUiSavedViewsSavedViewId — Patch UI Saved View. type PatchAdminUiSavedViewsSavedViewIdInput struct { SavedViewID string `path:"savedViewId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` SavedView models.ModelsUISavedViewAPIInput `json:"savedView"` models.RequestScope } @@ -3906,6 +11165,9 @@ func (c *Client) PatchAdminUiSavedViewsSavedViewId(ctx context.Context, in Patch for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3934,6 +11196,7 @@ func (c *Client) PatchAdminUiSavedViewsSavedViewId(ctx context.Context, in Patch // ListAdminUserCurrentInput is the input for ListAdminUserCurrent — Get Current User. type ListAdminUserCurrentInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -3946,6 +11209,9 @@ func (c *Client) ListAdminUserCurrent(ctx context.Context, in ListAdminUserCurre for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3966,6 +11232,7 @@ func (c *Client) ListAdminUserCurrent(ctx context.Context, in ListAdminUserCurre // ListAdminUserMappingInput is the input for ListAdminUserMapping — Get User Mapping. type ListAdminUserMappingInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` ProviderID *string `url:"providerId,omitempty" json:"-"` UserID *string `url:"userId,omitempty" json:"-"` models.RequestScope @@ -3980,6 +11247,9 @@ func (c *Client) ListAdminUserMapping(ctx context.Context, in ListAdminUserMappi for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } if in.ProviderID != nil { query.Set("providerId", string(*in.ProviderID)) } @@ -4006,6 +11276,7 @@ func (c *Client) ListAdminUserMapping(ctx context.Context, in ListAdminUserMappi // CreateAdminUserMappingInput is the input for CreateAdminUserMapping — Post Add User Mappings. type CreateAdminUserMappingInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` UseSuggestions bool `json:"useSuggestions"` UserMappings []models.EndpointsUserMappingInput `json:"userMappings,omitempty"` models.RequestScope @@ -4020,6 +11291,9 @@ func (c *Client) CreateAdminUserMapping(ctx context.Context, in CreateAdminUserM for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4050,6 +11324,7 @@ func (c *Client) CreateAdminUserMapping(ctx context.Context, in CreateAdminUserM // ListAdminUserMappingSuggestionsInput is the input for ListAdminUserMappingSuggestions — Get User Mapping Suggestions. type ListAdminUserMappingSuggestionsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4062,6 +11337,9 @@ func (c *Client) ListAdminUserMappingSuggestions(ctx context.Context, in ListAdm for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4083,12 +11361,14 @@ func (c *Client) ListAdminUserMappingSuggestions(ctx context.Context, in ListAdm // DeleteAdminUserMappingUserIdInput is the input for DeleteAdminUserMappingUserId — Delete User Mapping. type DeleteAdminUserMappingUserIdInput struct { UserID string `path:"userId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Hard *bool `url:"hard,omitempty" json:"-"` models.RequestScope } // DeleteAdminUserMappingUserId - Delete User Mapping // DELETE /admin/user/mapping/{userId} -func (c *Client) DeleteAdminUserMappingUserId(ctx context.Context, in DeleteAdminUserMappingUserIdInput) ([]byte, error) { +func (c *Client) DeleteAdminUserMappingUserId(ctx context.Context, in DeleteAdminUserMappingUserIdInput) (*models.EndpointsDeleteUserMappingOutput, error) { path := "/admin/user/mapping/{userId}" path = strings.Replace(path, "{userId}", url.PathEscape(in.UserID), 1) @@ -4096,6 +11376,12 @@ func (c *Client) DeleteAdminUserMappingUserId(ctx context.Context, in DeleteAdmi for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Hard != nil { + query.Set("hard", strconv.FormatBool(*in.Hard)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4104,14 +11390,24 @@ func (c *Client) DeleteAdminUserMappingUserId(ctx context.Context, in DeleteAdmi } data, err := c.do(ctx, "DELETE", fullURL, nil) - return data, err + if err != nil { + return nil, err + } + var out models.EndpointsDeleteUserMappingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } // UpdateAdminUserMappingUserIdInput is the input for UpdateAdminUserMappingUserId — Edit User Mapping. type UpdateAdminUserMappingUserIdInput struct { UserID string `path:"userId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Azure *models.ModelsAzureUserProvider `json:"azure,omitempty"` Bitbucket *models.ModelsBitbucketUserProvider `json:"bitbucket,omitempty"` + ClearSlack *bool `json:"clearSlack,omitempty"` + ClearTeams *bool `json:"clearTeams,omitempty"` Github *models.ModelsGitHubUserProvider `json:"github,omitempty"` Gitlab *models.ModelsGitLabUserProvider `json:"gitlab,omitempty"` Jira *models.ModelsJiraUserProvider `json:"jira,omitempty"` @@ -4123,7 +11419,7 @@ type UpdateAdminUserMappingUserIdInput struct { // UpdateAdminUserMappingUserId - Edit User Mapping // PUT /admin/user/mapping/{userId} -func (c *Client) UpdateAdminUserMappingUserId(ctx context.Context, in UpdateAdminUserMappingUserIdInput) ([]byte, error) { +func (c *Client) UpdateAdminUserMappingUserId(ctx context.Context, in UpdateAdminUserMappingUserIdInput) (*models.EndpointsPutEditUserMappingOutput, error) { path := "/admin/user/mapping/{userId}" path = strings.Replace(path, "{userId}", url.PathEscape(in.UserID), 1) @@ -4131,6 +11427,9 @@ func (c *Client) UpdateAdminUserMappingUserId(ctx context.Context, in UpdateAdmi for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4141,6 +11440,8 @@ func (c *Client) UpdateAdminUserMappingUserId(ctx context.Context, in UpdateAdmi bodyBytes, err := json.Marshal(struct { Azure *models.ModelsAzureUserProvider `json:"azure,omitempty"` Bitbucket *models.ModelsBitbucketUserProvider `json:"bitbucket,omitempty"` + ClearSlack *bool `json:"clearSlack,omitempty"` + ClearTeams *bool `json:"clearTeams,omitempty"` Github *models.ModelsGitHubUserProvider `json:"github,omitempty"` Gitlab *models.ModelsGitLabUserProvider `json:"gitlab,omitempty"` Jira *models.ModelsJiraUserProvider `json:"jira,omitempty"` @@ -4150,6 +11451,8 @@ func (c *Client) UpdateAdminUserMappingUserId(ctx context.Context, in UpdateAdmi }{ Azure: in.Azure, Bitbucket: in.Bitbucket, + ClearSlack: in.ClearSlack, + ClearTeams: in.ClearTeams, Github: in.Github, Gitlab: in.Gitlab, Jira: in.Jira, @@ -4161,11 +11464,19 @@ func (c *Client) UpdateAdminUserMappingUserId(ctx context.Context, in UpdateAdmi return nil, fmt.Errorf("marshal body: %w", err) } data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) - return data, err + if err != nil { + return nil, err + } + var out models.EndpointsPutEditUserMappingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } // ListAdminUserMappingsInput is the input for ListAdminUserMappings — Get User Mappings. type ListAdminUserMappingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4178,6 +11489,9 @@ func (c *Client) ListAdminUserMappings(ctx context.Context, in ListAdminUserMapp for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4199,6 +11513,7 @@ func (c *Client) ListAdminUserMappings(ctx context.Context, in ListAdminUserMapp // GetAdminUserUserIDInput is the input for GetAdminUserUserID — Get User. type GetAdminUserUserIDInput struct { UserID string `path:"userID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4212,6 +11527,9 @@ func (c *Client) GetAdminUserUserID(ctx context.Context, in GetAdminUserUserIDIn for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4232,6 +11550,7 @@ func (c *Client) GetAdminUserUserID(ctx context.Context, in GetAdminUserUserIDIn // ListAdminUsersInput is the input for ListAdminUsers — Get All Users. type ListAdminUsersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4244,6 +11563,9 @@ func (c *Client) ListAdminUsers(ctx context.Context, in ListAdminUsersInput) (*m for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4264,6 +11586,7 @@ func (c *Client) ListAdminUsers(ctx context.Context, in ListAdminUsersInput) (*m // CreateAdminUsersInput is the input for CreateAdminUsers — Post User. type CreateAdminUsersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` User models.EndpointsUserInput `json:"user"` models.RequestScope } @@ -4277,6 +11600,9 @@ func (c *Client) CreateAdminUsers(ctx context.Context, in CreateAdminUsersInput) for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4303,8 +11629,54 @@ func (c *Client) CreateAdminUsers(ctx context.Context, in CreateAdminUsersInput) return &out, nil } +// CreateAdminUsersActivateInput is the input for CreateAdminUsersActivate — Activate Users. +type CreateAdminUsersActivateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Users []models.EndpointsAdminActivateUserTarget `json:"users,omitempty"` + models.RequestScope +} + +// CreateAdminUsersActivate - Activate Users +// POST /admin/users/activate +func (c *Client) CreateAdminUsersActivate(ctx context.Context, in CreateAdminUsersActivateInput) (*models.EndpointsAdminActivateUsersOutput, error) { + path := "/admin/users/activate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Users []models.EndpointsAdminActivateUserTarget `json:"users,omitempty"` + }{ + Users: in.Users, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminActivateUsersOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateAdminUsersBulkSearchMappingsInput is the input for CreateAdminUsersBulkSearchMappings — Post Bulk Get User Mappings. type CreateAdminUsersBulkSearchMappingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` GitCanonicalUserIds []string `json:"gitCanonicalUserIds,omitempty"` GithubCanonicalUserIds []string `json:"githubCanonicalUserIds,omitempty"` models.RequestScope @@ -4319,6 +11691,9 @@ func (c *Client) CreateAdminUsersBulkSearchMappings(ctx context.Context, in Crea for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4347,9 +11722,140 @@ func (c *Client) CreateAdminUsersBulkSearchMappings(ctx context.Context, in Crea return &out, nil } +// CreateAdminUsersDeactivateInput is the input for CreateAdminUsersDeactivate — Deactivate User. +type CreateAdminUsersDeactivateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UserID string `json:"userId"` + models.RequestScope +} + +// CreateAdminUsersDeactivate - Deactivate User +// POST /admin/users/deactivate +func (c *Client) CreateAdminUsersDeactivate(ctx context.Context, in CreateAdminUsersDeactivateInput) (*models.EndpointsAdminDeactivateUserOutput, error) { + path := "/admin/users/deactivate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + UserID string `json:"userId"` + }{ + UserID: in.UserID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminDeactivateUserOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetAdminUsersIdentityProviderIDProviderUserIDInput is the input for GetAdminUsersIdentityProviderIDProviderUserID — Get User By Git Identity. +type GetAdminUsersIdentityProviderIDProviderUserIDInput struct { + ProviderID string `path:"providerID" json:"-"` + ProviderUserID string `path:"providerUserID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetAdminUsersIdentityProviderIDProviderUserID - Get User By Git Identity +// GET /admin/users/identity/{providerID}/{providerUserID} +func (c *Client) GetAdminUsersIdentityProviderIDProviderUserID(ctx context.Context, in GetAdminUsersIdentityProviderIDProviderUserIDInput) (*models.EndpointsGetUserOutput, error) { + path := "/admin/users/identity/{providerID}/{providerUserID}" + path = strings.Replace(path, "{providerID}", url.PathEscape(in.ProviderID), 1) + path = strings.Replace(path, "{providerUserID}", url.PathEscape(in.ProviderUserID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetUserOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateAdminUsersReactivateInput is the input for CreateAdminUsersReactivate — Reactivate User. +type CreateAdminUsersReactivateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UserID string `json:"userId"` + models.RequestScope +} + +// CreateAdminUsersReactivate - Reactivate User +// POST /admin/users/reactivate +func (c *Client) CreateAdminUsersReactivate(ctx context.Context, in CreateAdminUsersReactivateInput) (*models.EndpointsAdminReactivateUserOutput, error) { + path := "/admin/users/reactivate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + UserID string `json:"userId"` + }{ + UserID: in.UserID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsAdminReactivateUserOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // GetAdminUsersProviderIDInput is the input for GetAdminUsersProviderID — Get Provider Users. type GetAdminUsersProviderIDInput struct { ProviderID string `path:"providerID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4363,6 +11869,9 @@ func (c *Client) GetAdminUsersProviderID(ctx context.Context, in GetAdminUsersPr for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4385,6 +11894,7 @@ func (c *Client) GetAdminUsersProviderID(ctx context.Context, in GetAdminUsersPr type GetAdminUsersProviderIDUserIDInput struct { ProviderID string `path:"providerID" json:"-"` UserID string `path:"userID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4399,6 +11909,9 @@ func (c *Client) GetAdminUsersProviderIDUserID(ctx context.Context, in GetAdminU for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4420,6 +11933,7 @@ func (c *Client) GetAdminUsersProviderIDUserID(ctx context.Context, in GetAdminU // DeleteAdminUsersUserIdErasureInput is the input for DeleteAdminUsersUserIdErasure — Delete User Erasure (GDPR Art. 17). type DeleteAdminUsersUserIdErasureInput struct { UserID string `path:"userId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4433,6 +11947,9 @@ func (c *Client) DeleteAdminUsersUserIdErasure(ctx context.Context, in DeleteAdm for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -4455,6 +11972,7 @@ func (c *Client) DeleteAdminUsersUserIdErasure(ctx context.Context, in DeleteAdm type ListAdminUsersUserIdExportInput struct { UserID string `path:"userId" json:"-"` Format *string `url:"format,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -4471,6 +11989,9 @@ func (c *Client) ListAdminUsersUserIdExport(ctx context.Context, in ListAdminUse if in.Format != nil { query.Set("format", string(*in.Format)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) diff --git a/internal/api/asset-graph.go b/internal/api/asset-graph.go deleted file mode 100644 index d16c011..0000000 --- a/internal/api/asset-graph.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by scripts/generate/main.go. DO NOT EDIT. -package api - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "net/url" - "strconv" - "strings" - - "github.com/nullify-platform/cli/internal/api/models" -) - -var _ = bytes.NewReader -var _ = json.Marshal -var _ = strconv.FormatInt -var _ = strings.Replace -var _ = fmt.Sprintf -var _ = url.PathEscape -var _ = models.RequestScope{} - -// ListAssetGraphReachabilityInput is the input for ListAssetGraphReachability — Get Asset Graph Reachability. -type ListAssetGraphReachabilityInput struct { - AccountID *string `url:"accountId,omitempty" json:"-"` - NodeID *string `url:"nodeId,omitempty" json:"-"` - models.RequestScope -} - -// ListAssetGraphReachability - Get Asset Graph Reachability -// GET /asset-graph/reachability -func (c *Client) ListAssetGraphReachability(ctx context.Context, in ListAssetGraphReachabilityInput) (*models.EndpointsGetAssetGraphReachabilityOutput, error) { - path := "/asset-graph/reachability" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - if in.NodeID != nil { - query.Set("nodeId", string(*in.NodeID)) - } - if in.AccountID != nil { - query.Set("accountId", string(*in.AccountID)) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetAssetGraphReachabilityOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListAssetGraphSearchInput is the input for ListAssetGraphSearch — Search Asset Graph. -type ListAssetGraphSearchInput struct { - MaxResults *int `url:"maxResults,omitempty" json:"-"` - ObjectTypes []string `url:"objectTypes,omitempty" json:"-"` - Q *string `url:"q,omitempty" json:"-"` - models.RequestScope -} - -// ListAssetGraphSearch - Search Asset Graph -// GET /asset-graph/search -func (c *Client) ListAssetGraphSearch(ctx context.Context, in ListAssetGraphSearchInput) (*models.EndpointsGetAssetGraphSearchOutput, error) { - path := "/asset-graph/search" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - if in.Q != nil { - query.Set("q", string(*in.Q)) - } - for _, v := range in.ObjectTypes { - query.Add("objectTypes", string(v)) - } - if in.MaxResults != nil { - query.Set("maxResults", strconv.Itoa(int(*in.MaxResults))) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetAssetGraphSearchOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListAssetGraphSubgraphInput is the input for ListAssetGraphSubgraph — Get Asset Graph Subgraph. -type ListAssetGraphSubgraphInput struct { - AccountID *string `url:"accountId,omitempty" json:"-"` - Depth *int `url:"depth,omitempty" json:"-"` - MaxNodes *int `url:"maxNodes,omitempty" json:"-"` - ObjectTypes []string `url:"objectTypes,omitempty" json:"-"` - RootNodeID *string `url:"rootNodeId,omitempty" json:"-"` - models.RequestScope -} - -// ListAssetGraphSubgraph - Get Asset Graph Subgraph -// GET /asset-graph/subgraph -func (c *Client) ListAssetGraphSubgraph(ctx context.Context, in ListAssetGraphSubgraphInput) (*models.EndpointsGetAssetGraphSubgraphOutput, error) { - path := "/asset-graph/subgraph" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - if in.RootNodeID != nil { - query.Set("rootNodeId", string(*in.RootNodeID)) - } - if in.Depth != nil { - query.Set("depth", strconv.Itoa(int(*in.Depth))) - } - if in.MaxNodes != nil { - query.Set("maxNodes", strconv.Itoa(int(*in.MaxNodes))) - } - if in.AccountID != nil { - query.Set("accountId", string(*in.AccountID)) - } - for _, v := range in.ObjectTypes { - query.Add("objectTypes", string(v)) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetAssetGraphSubgraphOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListAssetGraphSummaryInput is the input for ListAssetGraphSummary — Get Asset Graph Summary. -type ListAssetGraphSummaryInput struct { - models.RequestScope -} - -// ListAssetGraphSummary - Get Asset Graph Summary -// GET /asset-graph/summary -func (c *Client) ListAssetGraphSummary(ctx context.Context, in ListAssetGraphSummaryInput) (*models.EndpointsGetAssetGraphSummaryOutput, error) { - path := "/asset-graph/summary" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetAssetGraphSummaryOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} diff --git a/internal/api/client.go b/internal/api/client.go index dd13ab6..67367a1 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -5,9 +5,7 @@ import ( "context" "io" "net/http" - "os" "strings" - "time" "github.com/nullify-platform/cli/internal/apierror" "github.com/nullify-platform/cli/internal/client" @@ -16,22 +14,6 @@ import ( // Version is set at build time via ldflags. var Version = "dev" -// defaultTimeout is the request timeout used when NULLIFY_HTTP_TIMEOUT is unset -// or invalid. 30s is too short for long-running calls (scan-start, autofix), so -// callers can raise it via the env var (e.g. "120s"). -const defaultTimeout = 30 * time.Second - -// httpTimeout returns the request timeout, overridable via the -// NULLIFY_HTTP_TIMEOUT env var (a Go duration string such as "120s"). -func httpTimeout() time.Duration { - if v := os.Getenv("NULLIFY_HTTP_TIMEOUT"); v != "" { - if d, err := time.ParseDuration(v); err == nil && d > 0 { - return d - } - } - return defaultTimeout -} - // Client is a typed HTTP client for the Nullify API. type Client struct { BaseURL string @@ -61,7 +43,7 @@ func NewClient(host string, token string, defaultParams map[string]string, opts Token: token, DefaultParams: defaultParams, HTTPClient: &http.Client{ - Timeout: httpTimeout(), + Timeout: client.HTTPTimeout(), Transport: client.NewRetryTransport(http.DefaultTransport), }, } diff --git a/internal/api/client_test.go b/internal/api/client_test.go index e7cd800..a32a146 100644 --- a/internal/api/client_test.go +++ b/internal/api/client_test.go @@ -6,9 +6,9 @@ import ( "net/http" "net/http/httptest" "testing" - "time" "github.com/nullify-platform/cli/internal/apierror" + "github.com/nullify-platform/cli/internal/client" ) func TestClientDo_Success(t *testing.T) { @@ -98,36 +98,6 @@ func TestClientDo_5xxError(t *testing.T) { } } -func TestHTTPTimeout(t *testing.T) { - t.Run("default when unset", func(t *testing.T) { - t.Setenv("NULLIFY_HTTP_TIMEOUT", "") - if got := httpTimeout(); got != defaultTimeout { - t.Errorf("httpTimeout() = %v, want %v", got, defaultTimeout) - } - }) - - t.Run("overrides from env", func(t *testing.T) { - t.Setenv("NULLIFY_HTTP_TIMEOUT", "120s") - if got := httpTimeout(); got != 120*time.Second { - t.Errorf("httpTimeout() = %v, want %v", got, 120*time.Second) - } - }) - - t.Run("falls back to default on invalid", func(t *testing.T) { - t.Setenv("NULLIFY_HTTP_TIMEOUT", "not-a-duration") - if got := httpTimeout(); got != defaultTimeout { - t.Errorf("httpTimeout() = %v, want %v", got, defaultTimeout) - } - }) - - t.Run("falls back to default on non-positive", func(t *testing.T) { - t.Setenv("NULLIFY_HTTP_TIMEOUT", "0s") - if got := httpTimeout(); got != defaultTimeout { - t.Errorf("httpTimeout() = %v, want %v", got, defaultTimeout) - } - }) -} - func TestNewClient_DefaultsToRetryingClient(t *testing.T) { c := NewClient("example.com", "tok", nil) if c.HTTPClient == nil { @@ -136,8 +106,8 @@ func TestNewClient_DefaultsToRetryingClient(t *testing.T) { if c.HTTPClient.Transport == nil { t.Fatal("expected default HTTPClient.Transport to be non-nil (retry transport)") } - if c.HTTPClient.Timeout != defaultTimeout { - t.Errorf("Timeout = %v, want %v", c.HTTPClient.Timeout, defaultTimeout) + if c.HTTPClient.Timeout != client.DefaultHTTPTimeout { + t.Errorf("Timeout = %v, want %v", c.HTTPClient.Timeout, client.DefaultHTTPTimeout) } if c.BaseURL != "https://api.example.com" { t.Errorf("BaseURL = %q, want %q", c.BaseURL, "https://api.example.com") diff --git a/internal/api/context.go b/internal/api/context.go index 9dee9eb..b3f9a68 100644 --- a/internal/api/context.go +++ b/internal/api/context.go @@ -23,6 +23,10 @@ var _ = models.RequestScope{} // ListContextApplicationsInput is the input for ListContextApplications — Get Applications. type ListContextApplicationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` models.RequestScope } @@ -35,6 +39,18 @@ func (c *Client) ListContextApplications(ctx context.Context, in ListContextAppl for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -55,6 +71,7 @@ func (c *Client) ListContextApplications(ctx context.Context, in ListContextAppl // CreateContextApplicationsInput is the input for CreateContextApplications — Create Application. type CreateContextApplicationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Application models.ModelsAgentAppContextSeed `json:"application"` models.RequestScope } @@ -68,6 +85,9 @@ func (c *Client) CreateContextApplications(ctx context.Context, in CreateContext for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -96,6 +116,7 @@ func (c *Client) CreateContextApplications(ctx context.Context, in CreateContext // CreateContextApplicationsRebuildInput is the input for CreateContextApplicationsRebuild — Rebuild Applications. type CreateContextApplicationsRebuildInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Force bool `json:"force"` ProviderOwnerID string `json:"providerOwnerId"` models.RequestScope @@ -110,6 +131,9 @@ func (c *Client) CreateContextApplicationsRebuild(ctx context.Context, in Create for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -138,9 +162,48 @@ func (c *Client) CreateContextApplicationsRebuild(ctx context.Context, in Create return &out, nil } +// GetContextApplicationsRebuildsRunIdInput is the input for GetContextApplicationsRebuildsRunId — Get Application Rebuild. +type GetContextApplicationsRebuildsRunIdInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextApplicationsRebuildsRunId - Get Application Rebuild +// GET /context/applications/rebuilds/{runId} +func (c *Client) GetContextApplicationsRebuildsRunId(ctx context.Context, in GetContextApplicationsRebuildsRunIdInput) (*models.EndpointsGetApplicationRebuildOutput, error) { + path := "/context/applications/rebuilds/{runId}" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetApplicationRebuildOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // DeleteContextApplicationsApplicationIdInput is the input for DeleteContextApplicationsApplicationId — Delete Application. type DeleteContextApplicationsApplicationIdInput struct { ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -154,6 +217,9 @@ func (c *Client) DeleteContextApplicationsApplicationId(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -175,6 +241,7 @@ func (c *Client) DeleteContextApplicationsApplicationId(ctx context.Context, in // GetContextApplicationsApplicationIdInput is the input for GetContextApplicationsApplicationId — Get Application. type GetContextApplicationsApplicationIdInput struct { ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -188,6 +255,9 @@ func (c *Client) GetContextApplicationsApplicationId(ctx context.Context, in Get for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -209,7 +279,8 @@ func (c *Client) GetContextApplicationsApplicationId(ctx context.Context, in Get // PatchContextApplicationsApplicationIdInput is the input for PatchContextApplicationsApplicationId — Update Application. type PatchContextApplicationsApplicationIdInput struct { ApplicationID string `path:"applicationId" json:"-"` - Application models.ModelsAppContextSeed `json:"application"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Application models.ModelsAgentAppContextSeed `json:"application"` models.RequestScope } @@ -223,6 +294,9 @@ func (c *Client) PatchContextApplicationsApplicationId(ctx context.Context, in P for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -231,7 +305,7 @@ func (c *Client) PatchContextApplicationsApplicationId(ctx context.Context, in P } bodyBytes, err := json.Marshal(struct { - Application models.ModelsAppContextSeed `json:"application"` + Application models.ModelsAgentAppContextSeed `json:"application"` }{ Application: in.Application, }) @@ -249,9 +323,68 @@ func (c *Client) PatchContextApplicationsApplicationId(ctx context.Context, in P return &out, nil } +// ListContextApplicationsApplicationIdExecutionRecipeInput is the input for ListContextApplicationsApplicationIdExecutionRecipe — Get Application Execution Recipe. +type ListContextApplicationsApplicationIdExecutionRecipeInput struct { + ApplicationID string `path:"applicationId" json:"-"` + AllowEdits *bool `url:"allowEdits,omitempty" json:"-"` + Capabilities *string `url:"capabilities,omitempty" json:"-"` + CommitSha *string `url:"commitSha,omitempty" json:"-"` + Docker *bool `url:"docker,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InputHash *string `url:"inputHash,omitempty" json:"-"` + models.RequestScope +} + +// ListContextApplicationsApplicationIdExecutionRecipe - Get Application Execution Recipe +// GET /context/applications/{applicationId}/execution-recipe +func (c *Client) ListContextApplicationsApplicationIdExecutionRecipe(ctx context.Context, in ListContextApplicationsApplicationIdExecutionRecipeInput) (*models.EndpointsGetApplicationExecutionRecipeOutput, error) { + path := "/context/applications/{applicationId}/execution-recipe" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.CommitSha != nil { + query.Set("commitSha", string(*in.CommitSha)) + } + if in.InputHash != nil { + query.Set("inputHash", string(*in.InputHash)) + } + if in.Docker != nil { + query.Set("docker", strconv.FormatBool(*in.Docker)) + } + if in.Capabilities != nil { + query.Set("capabilities", string(*in.Capabilities)) + } + if in.AllowEdits != nil { + query.Set("allowEdits", strconv.FormatBool(*in.AllowEdits)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetApplicationExecutionRecipeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // ListContextApplicationsApplicationIdSchemaInput is the input for ListContextApplicationsApplicationIdSchema — Get Application Schema. type ListContextApplicationsApplicationIdSchemaInput struct { ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -265,6 +398,9 @@ func (c *Client) ListContextApplicationsApplicationIdSchema(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -288,6 +424,7 @@ type ListContextArtifactDeploymentsInput struct { ArtifactID *string `url:"artifactId,omitempty" json:"-"` CloudResourceID *string `url:"cloudResourceId,omitempty" json:"-"` ComputeType *string `url:"computeType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` @@ -325,6 +462,9 @@ func (c *Client) ListContextArtifactDeployments(ctx context.Context, in ListCont if in.IncludeDeleted != nil { query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -346,6 +486,7 @@ func (c *Client) ListContextArtifactDeployments(ctx context.Context, in ListCont // GetContextArtifactDeploymentsDeploymentIdInput is the input for GetContextArtifactDeploymentsDeploymentId — Get Artifact Deployment. type GetContextArtifactDeploymentsDeploymentIdInput struct { DeploymentID string `path:"deploymentId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -359,6 +500,9 @@ func (c *Client) GetContextArtifactDeploymentsDeploymentId(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -379,11 +523,14 @@ func (c *Client) GetContextArtifactDeploymentsDeploymentId(ctx context.Context, // ListContextArtifactsInput is the input for ListContextArtifacts — List Artifacts. type ListContextArtifactsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` ProjectID *string `url:"projectId,omitempty" json:"-"` RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` Type *string `url:"type,omitempty" json:"-"` models.RequestScope } @@ -412,9 +559,18 @@ func (c *Client) ListContextArtifacts(ctx context.Context, in ListContextArtifac if in.NextToken != nil { query.Set("nextToken", string(*in.NextToken)) } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } if in.IncludeDeleted != nil { query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -436,6 +592,7 @@ func (c *Client) ListContextArtifacts(ctx context.Context, in ListContextArtifac // DeleteContextArtifactsArtifactIdInput is the input for DeleteContextArtifactsArtifactId — Delete Artifact. type DeleteContextArtifactsArtifactIdInput struct { ArtifactID string `path:"artifactId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -449,6 +606,9 @@ func (c *Client) DeleteContextArtifactsArtifactId(ctx context.Context, in Delete for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -470,6 +630,7 @@ func (c *Client) DeleteContextArtifactsArtifactId(ctx context.Context, in Delete // GetContextArtifactsArtifactIdInput is the input for GetContextArtifactsArtifactId — Get Artifact. type GetContextArtifactsArtifactIdInput struct { ArtifactID string `path:"artifactId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -483,6 +644,9 @@ func (c *Client) GetContextArtifactsArtifactId(ctx context.Context, in GetContex for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -501,36 +665,40 @@ func (c *Client) GetContextArtifactsArtifactId(ctx context.Context, in GetContex return &out, nil } -// ListContextAssetInventoryCloudAccountsInput is the input for ListContextAssetInventoryCloudAccounts — Get Asset Inventory Cloud Accounts. -type ListContextAssetInventoryCloudAccountsInput struct { - Active *bool `url:"active,omitempty" json:"-"` +// ListContextAssetGraphAttackPathsInput is the input for ListContextAssetGraphAttackPaths — List Asset Graph Attack Paths. +type ListContextAssetGraphAttackPathsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + HasCriticalFinding *bool `url:"hasCriticalFinding,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - Provider *string `url:"provider,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + TerminalNodeKind *models.EndpointsAttackPathTerminalNodeKind `url:"terminalNodeKind,omitempty" json:"-"` models.RequestScope } -// ListContextAssetInventoryCloudAccounts - Get Asset Inventory Cloud Accounts -// GET /context/asset-inventory/cloud-accounts -func (c *Client) ListContextAssetInventoryCloudAccounts(ctx context.Context, in ListContextAssetInventoryCloudAccountsInput) (*models.EndpointsGetCloudAccountRecordsOutput, error) { - path := "/context/asset-inventory/cloud-accounts" +// ListContextAssetGraphAttackPaths - List Asset Graph Attack Paths +// GET /context/asset-graph/attack-paths +func (c *Client) ListContextAssetGraphAttackPaths(ctx context.Context, in ListContextAssetGraphAttackPathsInput) (*models.EndpointsGetAssetGraphAttackPathsOutput, error) { + path := "/context/asset-graph/attack-paths" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Provider != nil { - query.Set("provider", string(*in.Provider)) - } - if in.Active != nil { - query.Set("active", strconv.FormatBool(*in.Active)) + if in.TerminalNodeKind != nil { + query.Set("terminalNodeKind", string(*in.TerminalNodeKind)) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.HasCriticalFinding != nil { + query.Set("hasCriticalFinding", strconv.FormatBool(*in.HasCriticalFinding)) } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -542,54 +710,34 @@ func (c *Client) ListContextAssetInventoryCloudAccounts(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsGetCloudAccountRecordsOutput + var out models.EndpointsGetAssetGraphAttackPathsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextAssetInventoryCloudResourcesInput is the input for ListContextAssetInventoryCloudResources — Get Asset Inventory Cloud Resources. -type ListContextAssetInventoryCloudResourcesInput struct { - AccountID *string `url:"accountId,omitempty" json:"-"` - Active *bool `url:"active,omitempty" json:"-"` - Category *string `url:"category,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - Provider *string `url:"provider,omitempty" json:"-"` - Type *string `url:"type,omitempty" json:"-"` +// ListContextAssetGraphLandingInput is the input for ListContextAssetGraphLanding — Get Asset Graph Landing. +type ListContextAssetGraphLandingInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PerCategory *int `url:"perCategory,omitempty" json:"-"` models.RequestScope } -// ListContextAssetInventoryCloudResources - Get Asset Inventory Cloud Resources -// GET /context/asset-inventory/cloud-resources -func (c *Client) ListContextAssetInventoryCloudResources(ctx context.Context, in ListContextAssetInventoryCloudResourcesInput) (*models.EndpointsGetAssetInventoryCloudResourcesOutput, error) { - path := "/context/asset-inventory/cloud-resources" +// ListContextAssetGraphLanding - Get Asset Graph Landing +// GET /context/asset-graph/landing +func (c *Client) ListContextAssetGraphLanding(ctx context.Context, in ListContextAssetGraphLandingInput) (*models.EndpointsGetAssetGraphLandingOutput, error) { + path := "/context/asset-graph/landing" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Category != nil { - query.Set("category", string(*in.Category)) - } - if in.Type != nil { - query.Set("type", string(*in.Type)) - } - if in.Provider != nil { - query.Set("provider", string(*in.Provider)) - } - if in.AccountID != nil { - query.Set("accountId", string(*in.AccountID)) - } - if in.Active != nil { - query.Set("active", strconv.FormatBool(*in.Active)) - } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.PerCategory != nil { + query.Set("perCategory", strconv.Itoa(int(*in.PerCategory))) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -602,42 +750,34 @@ func (c *Client) ListContextAssetInventoryCloudResources(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsGetAssetInventoryCloudResourcesOutput + var out models.EndpointsGetAssetGraphLandingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextAssetInventoryPublicFacingInput is the input for ListContextAssetInventoryPublicFacing — Get Public Facing Assets. -type ListContextAssetInventoryPublicFacingInput struct { - AccountID *string `url:"accountId,omitempty" json:"-"` - CloudProvider *string `url:"cloudProvider,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` +// ListContextAssetGraphNodeInput is the input for ListContextAssetGraphNode — Get Asset Graph Node. +type ListContextAssetGraphNodeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NodeID *string `url:"nodeId,omitempty" json:"-"` models.RequestScope } -// ListContextAssetInventoryPublicFacing - Get Public Facing Assets -// GET /context/asset-inventory/public-facing -func (c *Client) ListContextAssetInventoryPublicFacing(ctx context.Context, in ListContextAssetInventoryPublicFacingInput) (*models.EndpointsGetPublicFacingAssetsOutput, error) { - path := "/context/asset-inventory/public-facing" +// ListContextAssetGraphNode - Get Asset Graph Node +// GET /context/asset-graph/node +func (c *Client) ListContextAssetGraphNode(ctx context.Context, in ListContextAssetGraphNodeInput) (*models.EndpointsGetAssetGraphNodeOutput, error) { + path := "/context/asset-graph/node" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.CloudProvider != nil { - query.Set("cloudProvider", string(*in.CloudProvider)) - } - if in.AccountID != nil { - query.Set("accountId", string(*in.AccountID)) - } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.NodeID != nil { + query.Set("nodeId", string(*in.NodeID)) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -650,46 +790,46 @@ func (c *Client) ListContextAssetInventoryPublicFacing(ctx context.Context, in L if err != nil { return nil, err } - var out models.EndpointsGetPublicFacingAssetsOutput + var out models.EndpointsGetAssetGraphNodeOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextAssetInventoryResourcesInput is the input for ListContextAssetInventoryResources — Get Asset Inventory Resources. -type ListContextAssetInventoryResourcesInput struct { - Active *bool `url:"active,omitempty" json:"-"` - Category *string `url:"category,omitempty" json:"-"` +// ListContextAssetGraphNodesInput is the input for ListContextAssetGraphNodes — List Asset Graph Nodes. +type ListContextAssetGraphNodesInput struct { + ChildCounts *bool `url:"childCounts,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Kinds []string `url:"kinds,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - Type *string `url:"type,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` models.RequestScope } -// ListContextAssetInventoryResources - Get Asset Inventory Resources -// GET /context/asset-inventory/resources -func (c *Client) ListContextAssetInventoryResources(ctx context.Context, in ListContextAssetInventoryResourcesInput) (*models.EndpointsGetAssetInventoryResourcesOutput, error) { - path := "/context/asset-inventory/resources" +// ListContextAssetGraphNodes - List Asset Graph Nodes +// GET /context/asset-graph/nodes +func (c *Client) ListContextAssetGraphNodes(ctx context.Context, in ListContextAssetGraphNodesInput) (*models.EndpointsGetAssetGraphNodesOutput, error) { + path := "/context/asset-graph/nodes" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Category != nil { - query.Set("category", string(*in.Category)) + for _, v := range in.Kinds { + query.Add("kinds", string(v)) } - if in.Type != nil { - query.Set("type", string(*in.Type)) + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } - if in.Active != nil { - query.Set("active", strconv.FormatBool(*in.Active)) + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.ChildCounts != nil { + query.Set("childCounts", strconv.FormatBool(*in.ChildCounts)) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -702,50 +842,42 @@ func (c *Client) ListContextAssetInventoryResources(ctx context.Context, in List if err != nil { return nil, err } - var out models.EndpointsGetAssetInventoryResourcesOutput + var out models.EndpointsGetAssetGraphNodesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextCicdPipelinesInput is the input for ListContextCicdPipelines — List CI/CD Pipelines. -type ListContextCicdPipelinesInput struct { - IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - Platform *string `url:"platform,omitempty" json:"-"` - ProjectID *string `url:"projectId,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` +// ListContextAssetGraphReachabilityInput is the input for ListContextAssetGraphReachability — Get Asset Graph Reachability. +type ListContextAssetGraphReachabilityInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NodeID *string `url:"nodeId,omitempty" json:"-"` + Port *int `url:"port,omitempty" json:"-"` + Protocol *string `url:"protocol,omitempty" json:"-"` models.RequestScope } -// ListContextCicdPipelines - List CI/CD Pipelines -// GET /context/cicd-pipelines -func (c *Client) ListContextCicdPipelines(ctx context.Context, in ListContextCicdPipelinesInput) (*models.EndpointsListPipelinesOutput, error) { - path := "/context/cicd-pipelines" +// ListContextAssetGraphReachability - Get Asset Graph Reachability +// GET /context/asset-graph/reachability +func (c *Client) ListContextAssetGraphReachability(ctx context.Context, in ListContextAssetGraphReachabilityInput) (*models.EndpointsGetAssetGraphReachabilityOutput, error) { + path := "/context/asset-graph/reachability" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) - } - if in.ProjectID != nil { - query.Set("projectId", string(*in.ProjectID)) - } - if in.Platform != nil { - query.Set("platform", string(*in.Platform)) + if in.NodeID != nil { + query.Set("nodeId", string(*in.NodeID)) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.Port != nil { + query.Set("port", strconv.Itoa(int(*in.Port))) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.Protocol != nil { + query.Set("protocol", string(*in.Protocol)) } - if in.IncludeDeleted != nil { - query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -758,29 +890,39 @@ func (c *Client) ListContextCicdPipelines(ctx context.Context, in ListContextCic if err != nil { return nil, err } - var out models.EndpointsListPipelinesOutput + var out models.EndpointsGetAssetGraphReachabilityOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextCicdPipelinesPipelineIdInput is the input for DeleteContextCicdPipelinesPipelineId — Delete CI/CD Pipeline. -type DeleteContextCicdPipelinesPipelineIdInput struct { - PipelineID string `path:"pipelineId" json:"-"` +// ListContextAssetGraphRetrieveInput is the input for ListContextAssetGraphRetrieve — Retrieve Asset Graph Nodes. +type ListContextAssetGraphRetrieveInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + MaxResults *int `url:"maxResults,omitempty" json:"-"` + Q *string `url:"q,omitempty" json:"-"` models.RequestScope } -// DeleteContextCicdPipelinesPipelineId - Delete CI/CD Pipeline -// DELETE /context/cicd-pipelines/{pipelineId} -func (c *Client) DeleteContextCicdPipelinesPipelineId(ctx context.Context, in DeleteContextCicdPipelinesPipelineIdInput) (*models.EndpointsDeletePipelineOutput, error) { - path := "/context/cicd-pipelines/{pipelineId}" - path = strings.Replace(path, "{pipelineId}", url.PathEscape(in.PipelineID), 1) +// ListContextAssetGraphRetrieve - Retrieve Asset Graph Nodes +// GET /context/asset-graph/retrieve +func (c *Client) ListContextAssetGraphRetrieve(ctx context.Context, in ListContextAssetGraphRetrieveInput) (*models.EndpointsGetAssetGraphRetrieveOutput, error) { + path := "/context/asset-graph/retrieve" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Q != nil { + query.Set("q", string(*in.Q)) + } + if in.MaxResults != nil { + query.Set("maxResults", strconv.Itoa(int(*in.MaxResults))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -788,33 +930,47 @@ func (c *Client) DeleteContextCicdPipelinesPipelineId(ctx context.Context, in De fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeletePipelineOutput + var out models.EndpointsGetAssetGraphRetrieveOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextCicdPipelinesPipelineIdInput is the input for GetContextCicdPipelinesPipelineId — Get CI/CD Pipeline. -type GetContextCicdPipelinesPipelineIdInput struct { - PipelineID string `path:"pipelineId" json:"-"` +// ListContextAssetGraphSearchInput is the input for ListContextAssetGraphSearch — Search Asset Graph. +type ListContextAssetGraphSearchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + MaxResults *int `url:"maxResults,omitempty" json:"-"` + ObjectTypes []string `url:"objectTypes,omitempty" json:"-"` + Q *string `url:"q,omitempty" json:"-"` models.RequestScope } -// GetContextCicdPipelinesPipelineId - Get CI/CD Pipeline -// GET /context/cicd-pipelines/{pipelineId} -func (c *Client) GetContextCicdPipelinesPipelineId(ctx context.Context, in GetContextCicdPipelinesPipelineIdInput) (*models.EndpointsGetPipelineOutput, error) { - path := "/context/cicd-pipelines/{pipelineId}" - path = strings.Replace(path, "{pipelineId}", url.PathEscape(in.PipelineID), 1) +// ListContextAssetGraphSearch - Search Asset Graph +// GET /context/asset-graph/search +func (c *Client) ListContextAssetGraphSearch(ctx context.Context, in ListContextAssetGraphSearchInput) (*models.EndpointsGetAssetGraphSearchOutput, error) { + path := "/context/asset-graph/search" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Q != nil { + query.Set("q", string(*in.Q)) + } + for _, v := range in.ObjectTypes { + query.Add("objectTypes", string(v)) + } + if in.MaxResults != nil { + query.Set("maxResults", strconv.Itoa(int(*in.MaxResults))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -826,44 +982,50 @@ func (c *Client) GetContextCicdPipelinesPipelineId(ctx context.Context, in GetCo if err != nil { return nil, err } - var out models.EndpointsGetPipelineOutput + var out models.EndpointsGetAssetGraphSearchOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextCloudReconAccountsAccountIdDiscoveredNodesInput is the input for ListContextCloudReconAccountsAccountIdDiscoveredNodes — Get Cloud Recon Discovered Nodes. -type ListContextCloudReconAccountsAccountIdDiscoveredNodesInput struct { - AccountID string `path:"accountId" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - ObjectType *string `url:"objectType,omitempty" json:"-"` - Offset *int `url:"offset,omitempty" json:"-"` - Source *string `url:"source,omitempty" json:"-"` +// ListContextAssetGraphSubgraphInput is the input for ListContextAssetGraphSubgraph — Get Asset Graph Subgraph. +type ListContextAssetGraphSubgraphInput struct { + Depth *int `url:"depth,omitempty" json:"-"` + EdgeTypes []string `url:"edgeTypes,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + MaxNodes *int `url:"maxNodes,omitempty" json:"-"` + ObjectTypes []string `url:"objectTypes,omitempty" json:"-"` + RootNodeID *string `url:"rootNodeId,omitempty" json:"-"` models.RequestScope } -// ListContextCloudReconAccountsAccountIdDiscoveredNodes - Get Cloud Recon Discovered Nodes -// GET /context/cloud-recon/accounts/{accountId}/discovered-nodes -func (c *Client) ListContextCloudReconAccountsAccountIdDiscoveredNodes(ctx context.Context, in ListContextCloudReconAccountsAccountIdDiscoveredNodesInput) (*models.EndpointsGetCloudReconDiscoveredNodesOutput, error) { - path := "/context/cloud-recon/accounts/{accountId}/discovered-nodes" - path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) +// ListContextAssetGraphSubgraph - Get Asset Graph Subgraph +// GET /context/asset-graph/subgraph +func (c *Client) ListContextAssetGraphSubgraph(ctx context.Context, in ListContextAssetGraphSubgraphInput) (*models.EndpointsGetAssetGraphSubgraphOutput, error) { + path := "/context/asset-graph/subgraph" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.ObjectType != nil { - query.Set("objectType", string(*in.ObjectType)) + if in.RootNodeID != nil { + query.Set("rootNodeId", string(*in.RootNodeID)) } - if in.Source != nil { - query.Set("source", string(*in.Source)) + if in.Depth != nil { + query.Set("depth", strconv.Itoa(int(*in.Depth))) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.MaxNodes != nil { + query.Set("maxNodes", strconv.Itoa(int(*in.MaxNodes))) } - if in.Offset != nil { - query.Set("offset", strconv.Itoa(int(*in.Offset))) + for _, v := range in.ObjectTypes { + query.Add("objectTypes", string(v)) + } + for _, v := range in.EdgeTypes { + query.Add("edgeTypes", string(v)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -876,40 +1038,30 @@ func (c *Client) ListContextCloudReconAccountsAccountIdDiscoveredNodes(ctx conte if err != nil { return nil, err } - var out models.EndpointsGetCloudReconDiscoveredNodesOutput + var out models.EndpointsGetAssetGraphSubgraphOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextCloudReconAccountsAccountIdHotspotsInput is the input for ListContextCloudReconAccountsAccountIdHotspots — Get Cloud Recon Hotspots. -type ListContextCloudReconAccountsAccountIdHotspotsInput struct { - AccountID string `path:"accountId" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - Offset *int `url:"offset,omitempty" json:"-"` - Severity *string `url:"severity,omitempty" json:"-"` +// ListContextAssetGraphSummaryInput is the input for ListContextAssetGraphSummary — Get Asset Graph Summary. +type ListContextAssetGraphSummaryInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextCloudReconAccountsAccountIdHotspots - Get Cloud Recon Hotspots -// GET /context/cloud-recon/accounts/{accountId}/hotspots -func (c *Client) ListContextCloudReconAccountsAccountIdHotspots(ctx context.Context, in ListContextCloudReconAccountsAccountIdHotspotsInput) (*models.EndpointsGetCloudReconHotspotsOutput, error) { - path := "/context/cloud-recon/accounts/{accountId}/hotspots" - path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) +// ListContextAssetGraphSummary - Get Asset Graph Summary +// GET /context/asset-graph/summary +func (c *Client) ListContextAssetGraphSummary(ctx context.Context, in ListContextAssetGraphSummaryInput) (*models.EndpointsGetAssetGraphSummaryOutput, error) { + path := "/context/asset-graph/summary" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Severity != nil { - query.Set("severity", string(*in.Severity)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.Offset != nil { - query.Set("offset", strconv.Itoa(int(*in.Offset))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -922,29 +1074,79 @@ func (c *Client) ListContextCloudReconAccountsAccountIdHotspots(ctx context.Cont if err != nil { return nil, err } - var out models.EndpointsGetCloudReconHotspotsOutput + var out models.EndpointsGetAssetGraphSummaryOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextCloudReconAccountsAccountIdScansLatestInput is the input for ListContextCloudReconAccountsAccountIdScansLatest — Get Latest Cloud Recon Scan. -type ListContextCloudReconAccountsAccountIdScansLatestInput struct { - AccountID string `path:"accountId" json:"-"` +// ListContextAssetInventoryInput is the input for ListContextAssetInventory — List Asset Inventory. +type ListContextAssetInventoryInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + Category *string `url:"category,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Q *string `url:"q,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + UpdatedAfter *string `url:"updatedAfter,omitempty" json:"-"` models.RequestScope } -// ListContextCloudReconAccountsAccountIdScansLatest - Get Latest Cloud Recon Scan -// GET /context/cloud-recon/accounts/{accountId}/scans/latest -func (c *Client) ListContextCloudReconAccountsAccountIdScansLatest(ctx context.Context, in ListContextCloudReconAccountsAccountIdScansLatestInput) (*models.EndpointsGetLatestCloudReconScanOutput, error) { - path := "/context/cloud-recon/accounts/{accountId}/scans/latest" - path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) +// ListContextAssetInventory - List Asset Inventory +// GET /context/asset-inventory +func (c *Client) ListContextAssetInventory(ctx context.Context, in ListContextAssetInventoryInput) (*models.EndpointsListAssetInventoryOutput, error) { + path := "/context/asset-inventory" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Category != nil { + query.Set("category", string(*in.Category)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.Q != nil { + query.Set("q", string(*in.Q)) + } + if in.UpdatedAfter != nil { + query.Set("updatedAfter", string(*in.UpdatedAfter)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -956,35 +1158,67 @@ func (c *Client) ListContextCloudReconAccountsAccountIdScansLatest(ctx context.C if err != nil { return nil, err } - var out models.EndpointsGetLatestCloudReconScanOutput + var out models.EndpointsListAssetInventoryOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextCloudReconScansInput is the input for CreateContextCloudReconScans — Persist Cloud Recon Scan. -type CreateContextCloudReconScansInput struct { - AccountID string `json:"accountId"` - CompletedAt *string `json:"completedAt,omitempty"` - ModelName *string `json:"modelName,omitempty"` - Payload string `json:"payload"` - Provider string `json:"provider"` - ScanID *string `json:"scanId,omitempty"` - SchemaVersion string `json:"schemaVersion"` - StartedAt string `json:"startedAt"` +// ListContextAssetInventoryAiMlInput is the input for ListContextAssetInventoryAiMl — List AI/ML Assets. +type ListContextAssetInventoryAiMlInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// CreateContextCloudReconScans - Persist Cloud Recon Scan -// POST /context/cloud-recon/scans -func (c *Client) CreateContextCloudReconScans(ctx context.Context, in CreateContextCloudReconScansInput) (*models.EndpointsPostCloudReconScanOutput, error) { - path := "/context/cloud-recon/scans" +// ListContextAssetInventoryAiMl - List AI/ML Assets +// GET /context/asset-inventory/ai-ml +func (c *Client) ListContextAssetInventoryAiMl(ctx context.Context, in ListContextAssetInventoryAiMlInput) (*models.EndpointsListAiMlAssetsOutput, error) { + path := "/context/asset-inventory/ai-ml" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -992,53 +1226,37 @@ func (c *Client) CreateContextCloudReconScans(ctx context.Context, in CreateCont fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - AccountID string `json:"accountId"` - CompletedAt *string `json:"completedAt,omitempty"` - ModelName *string `json:"modelName,omitempty"` - Payload string `json:"payload"` - Provider string `json:"provider"` - ScanID *string `json:"scanId,omitempty"` - SchemaVersion string `json:"schemaVersion"` - StartedAt string `json:"startedAt"` - }{ - AccountID: in.AccountID, - CompletedAt: in.CompletedAt, - ModelName: in.ModelName, - Payload: in.Payload, - Provider: in.Provider, - ScanID: in.ScanID, - SchemaVersion: in.SchemaVersion, - StartedAt: in.StartedAt, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostCloudReconScanOutput + var out models.EndpointsListAiMlAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextCloudReconTenantsCrossAccountTrustsInput is the input for ListContextCloudReconTenantsCrossAccountTrusts — Get Tenant Cloud Recon Cross-Account Trusts. -type ListContextCloudReconTenantsCrossAccountTrustsInput struct { +// GetContextAssetInventoryAiMlIdInput is the input for GetContextAssetInventoryAiMlId — Get AI/ML Asset. +type GetContextAssetInventoryAiMlIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextCloudReconTenantsCrossAccountTrusts - Get Tenant Cloud Recon Cross-Account Trusts -// GET /context/cloud-recon/tenants/cross-account-trusts -func (c *Client) ListContextCloudReconTenantsCrossAccountTrusts(ctx context.Context, in ListContextCloudReconTenantsCrossAccountTrustsInput) (*models.EndpointsGetCloudReconTenantTrustsOutput, error) { - path := "/context/cloud-recon/tenants/cross-account-trusts" +// GetContextAssetInventoryAiMlId - Get AI/ML Asset +// GET /context/asset-inventory/ai-ml/{id} +func (c *Client) GetContextAssetInventoryAiMlId(ctx context.Context, in GetContextAssetInventoryAiMlIdInput) (*models.EndpointsGetAiMlAssetOutput, error) { + path := "/context/asset-inventory/ai-ml/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1050,27 +1268,67 @@ func (c *Client) ListContextCloudReconTenantsCrossAccountTrusts(ctx context.Cont if err != nil { return nil, err } - var out models.EndpointsGetCloudReconTenantTrustsOutput + var out models.EndpointsGetAiMlAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextCloudScanStartInput is the input for CreateContextCloudScanStart — Start Cloud Scan. -type CreateContextCloudScanStartInput struct { +// ListContextAssetInventoryArtifactRepositoriesInput is the input for ListContextAssetInventoryArtifactRepositories — List Artifact Repositories Assets. +type ListContextAssetInventoryArtifactRepositoriesInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// CreateContextCloudScanStart - Start Cloud Scan -// POST /context/cloud-scan/start -func (c *Client) CreateContextCloudScanStart(ctx context.Context, in CreateContextCloudScanStartInput) (*models.EndpointsContextStartCloudScanOutput, error) { - path := "/context/cloud-scan/start" +// ListContextAssetInventoryArtifactRepositories - List Artifact Repositories Assets +// GET /context/asset-inventory/artifact-repositories +func (c *Client) ListContextAssetInventoryArtifactRepositories(ctx context.Context, in ListContextAssetInventoryArtifactRepositoriesInput) (*models.EndpointsListArtifactRepositoriesAssetsOutput, error) { + path := "/context/asset-inventory/artifact-repositories" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1078,33 +1336,37 @@ func (c *Client) CreateContextCloudScanStart(ctx context.Context, in CreateConte fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsContextStartCloudScanOutput + var out models.EndpointsListArtifactRepositoriesAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextCloudScanScanIdStatusInput is the input for ListContextCloudScanScanIdStatus — Get Cloud Scan Status. -type ListContextCloudScanScanIdStatusInput struct { - ScanID string `path:"scanId" json:"-"` +// GetContextAssetInventoryArtifactRepositoriesIdInput is the input for GetContextAssetInventoryArtifactRepositoriesId — Get Artifact Repositories Asset. +type GetContextAssetInventoryArtifactRepositoriesIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextCloudScanScanIdStatus - Get Cloud Scan Status -// GET /context/cloud-scan/{scanId}/status -func (c *Client) ListContextCloudScanScanIdStatus(ctx context.Context, in ListContextCloudScanScanIdStatusInput) (*models.EndpointsContextGetCloudScanStatusOutput, error) { - path := "/context/cloud-scan/{scanId}/status" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// GetContextAssetInventoryArtifactRepositoriesId - Get Artifact Repositories Asset +// GET /context/asset-inventory/artifact-repositories/{id} +func (c *Client) GetContextAssetInventoryArtifactRepositoriesId(ctx context.Context, in GetContextAssetInventoryArtifactRepositoriesIdInput) (*models.EndpointsGetArtifactRepositoriesAssetOutput, error) { + path := "/context/asset-inventory/artifact-repositories/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1116,54 +1378,70 @@ func (c *Client) ListContextCloudScanScanIdStatus(ctx context.Context, in ListCo if err != nil { return nil, err } - var out models.EndpointsContextGetCloudScanStatusOutput + var out models.EndpointsGetArtifactRepositoriesAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextDepsInput is the input for DeleteContextDeps — Delete dependency data. -type DeleteContextDepsInput struct { - Ecosystem *string `url:"ecosystem,omitempty" json:"-"` - Global *bool `url:"global,omitempty" json:"-"` - IntroducedAt *string `url:"introducedAt,omitempty" json:"-"` - Name *string `url:"name,omitempty" json:"-"` +// ListContextAssetInventoryArtifactsInput is the input for ListContextAssetInventoryArtifacts — List Artifacts Assets. +type ListContextAssetInventoryArtifactsInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` ProjectID *string `url:"projectId,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` - Version *string `url:"version,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// DeleteContextDeps - Delete dependency data -// DELETE /context/deps -func (c *Client) DeleteContextDeps(ctx context.Context, in DeleteContextDepsInput) (*models.EndpointsDeleteDepsOutput, error) { - path := "/context/deps" +// ListContextAssetInventoryArtifacts - List Artifacts Assets +// GET /context/asset-inventory/artifacts +func (c *Client) ListContextAssetInventoryArtifacts(ctx context.Context, in ListContextAssetInventoryArtifactsInput) (*models.EndpointsListArtifactsAssetsOutput, error) { + path := "/context/asset-inventory/artifacts" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.ProjectID != nil { - query.Set("projectId", string(*in.ProjectID)) + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) } - if in.Ecosystem != nil { - query.Set("ecosystem", string(*in.Ecosystem)) + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) } - if in.Name != nil { - query.Set("name", string(*in.Name)) + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) } - if in.Version != nil { - query.Set("version", string(*in.Version)) + if in.Region != nil { + query.Set("region", string(*in.Region)) } - if in.IntroducedAt != nil { - query.Set("introducedAt", string(*in.IntroducedAt)) + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) } - if in.Global != nil { - query.Set("global", strconv.FormatBool(*in.Global)) + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } in.RequestScope.AddTo(query) @@ -1172,38 +1450,36 @@ func (c *Client) DeleteContextDeps(ctx context.Context, in DeleteContextDepsInpu fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteDepsOutput + var out models.EndpointsListArtifactsAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsInput is the input for ListContextDeps — List Tenant Wide Dependencies (Historical). -type ListContextDepsInput struct { - Cursor *string `url:"cursor,omitempty" json:"-"` - PageSize *int32 `url:"pageSize,omitempty" json:"-"` +// GetContextAssetInventoryArtifactsIdInput is the input for GetContextAssetInventoryArtifactsId — Get Artifacts Asset. +type GetContextAssetInventoryArtifactsIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextDeps - List Tenant Wide Dependencies (Historical) -// GET /context/deps -func (c *Client) ListContextDeps(ctx context.Context, in ListContextDepsInput) (*models.EndpointsGetDepsOutput, error) { - path := "/context/deps" +// GetContextAssetInventoryArtifactsId - Get Artifacts Asset +// GET /context/asset-inventory/artifacts/{id} +func (c *Client) GetContextAssetInventoryArtifactsId(ctx context.Context, in GetContextAssetInventoryArtifactsIdInput) (*models.EndpointsGetArtifactsAssetOutput, error) { + path := "/context/asset-inventory/artifacts/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) - } - if in.Cursor != nil { - query.Set("cursor", string(*in.Cursor)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1216,62 +1492,66 @@ func (c *Client) ListContextDeps(ctx context.Context, in ListContextDepsInput) ( if err != nil { return nil, err } - var out models.EndpointsGetDepsOutput + var out models.EndpointsGetArtifactsAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsActiveInput is the input for ListContextDepsActive — List Tenant Wide Active Dependencies. -type ListContextDepsActiveInput struct { - Cursor *string `url:"cursor,omitempty" json:"-"` - Direct *bool `url:"direct,omitempty" json:"-"` - Ecosystem *string `url:"ecosystem,omitempty" json:"-"` - Name *string `url:"name,omitempty" json:"-"` - PageSize *int32 `url:"pageSize,omitempty" json:"-"` - ProjectID *string `url:"projectId,omitempty" json:"-"` - Range *string `url:"range,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` - Search *string `url:"search,omitempty" json:"-"` +// ListContextAssetInventoryCdnAndDnsInput is the input for ListContextAssetInventoryCdnAndDns — List CDN and DNS Assets. +type ListContextAssetInventoryCdnAndDnsInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextDepsActive - List Tenant Wide Active Dependencies -// GET /context/deps/active -func (c *Client) ListContextDepsActive(ctx context.Context, in ListContextDepsActiveInput) (*models.EndpointsGetActiveDepsOutput, error) { - path := "/context/deps/active" +// ListContextAssetInventoryCdnAndDns - List CDN and DNS Assets +// GET /context/asset-inventory/cdn-and-dns +func (c *Client) ListContextAssetInventoryCdnAndDns(ctx context.Context, in ListContextAssetInventoryCdnAndDnsInput) (*models.EndpointsListCDNAndDNSAssetsOutput, error) { + path := "/context/asset-inventory/cdn-and-dns" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.Cursor != nil { - query.Set("cursor", string(*in.Cursor)) + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) } - if in.Search != nil { - query.Set("search", string(*in.Search)) + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) } - if in.Ecosystem != nil { - query.Set("ecosystem", string(*in.Ecosystem)) + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) } - if in.Name != nil { - query.Set("name", string(*in.Name)) + if in.Region != nil { + query.Set("region", string(*in.Region)) } - if in.Direct != nil { - query.Set("direct", strconv.FormatBool(*in.Direct)) + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) } - if in.ProjectID != nil { - query.Set("projectId", string(*in.ProjectID)) + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) } - if in.Range != nil { - query.Set("range", string(*in.Range)) + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } in.RequestScope.AddTo(query) @@ -1284,54 +1564,32 @@ func (c *Client) ListContextDepsActive(ctx context.Context, in ListContextDepsAc if err != nil { return nil, err } - var out models.EndpointsGetActiveDepsOutput + var out models.EndpointsListCDNAndDNSAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsActiveSummaryInput is the input for ListContextDepsActiveSummary — Tenant Wide Active Dependency Summary. -type ListContextDepsActiveSummaryInput struct { - Direct *bool `url:"direct,omitempty" json:"-"` - Ecosystem *string `url:"ecosystem,omitempty" json:"-"` - Name *string `url:"name,omitempty" json:"-"` - ProjectID *string `url:"projectId,omitempty" json:"-"` - Range *string `url:"range,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` - Search *string `url:"search,omitempty" json:"-"` +// GetContextAssetInventoryCdnAndDnsIdInput is the input for GetContextAssetInventoryCdnAndDnsId — Get CDN and DNS Asset. +type GetContextAssetInventoryCdnAndDnsIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextDepsActiveSummary - Tenant Wide Active Dependency Summary -// GET /context/deps/active/summary -func (c *Client) ListContextDepsActiveSummary(ctx context.Context, in ListContextDepsActiveSummaryInput) (*models.EndpointsGetActiveDepsSummaryOutput, error) { - path := "/context/deps/active/summary" +// GetContextAssetInventoryCdnAndDnsId - Get CDN and DNS Asset +// GET /context/asset-inventory/cdn-and-dns/{id} +func (c *Client) GetContextAssetInventoryCdnAndDnsId(ctx context.Context, in GetContextAssetInventoryCdnAndDnsIdInput) (*models.EndpointsGetCDNAndDNSAssetOutput, error) { + path := "/context/asset-inventory/cdn-and-dns/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Search != nil { - query.Set("search", string(*in.Search)) - } - if in.Ecosystem != nil { - query.Set("ecosystem", string(*in.Ecosystem)) - } - if in.Name != nil { - query.Set("name", string(*in.Name)) - } - if in.Direct != nil { - query.Set("direct", strconv.FormatBool(*in.Direct)) - } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) - } - if in.ProjectID != nil { - query.Set("projectId", string(*in.ProjectID)) - } - if in.Range != nil { - query.Set("range", string(*in.Range)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1344,36 +1602,66 @@ func (c *Client) ListContextDepsActiveSummary(ctx context.Context, in ListContex if err != nil { return nil, err } - var out models.EndpointsGetActiveDepsSummaryOutput + var out models.EndpointsGetCDNAndDNSAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsByRefBomRefInput is the input for ListContextDepsByRefBomRef — Get Dependencies by Bom Ref. -type ListContextDepsByRefBomRefInput struct { - BomRef string `path:"bomRef" json:"-"` - Cursor *string `url:"cursor,omitempty" json:"-"` - PageSize *int32 `url:"pageSize,omitempty" json:"-"` +// ListContextAssetInventoryCiCdInput is the input for ListContextAssetInventoryCiCd — List CI/CD Assets. +type ListContextAssetInventoryCiCdInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextDepsByRefBomRef - Get Dependencies by Bom Ref -// GET /context/deps/by-ref/{bomRef} -func (c *Client) ListContextDepsByRefBomRef(ctx context.Context, in ListContextDepsByRefBomRefInput) (*models.EndpointsGetDepsByBomRefOutput, error) { - path := "/context/deps/by-ref/{bomRef}" - path = strings.Replace(path, "{bomRef}", url.PathEscape(in.BomRef), 1) +// ListContextAssetInventoryCiCd - List CI/CD Assets +// GET /context/asset-inventory/ci-cd +func (c *Client) ListContextAssetInventoryCiCd(ctx context.Context, in ListContextAssetInventoryCiCdInput) (*models.EndpointsListCiCdAssetsOutput, error) { + path := "/context/asset-inventory/ci-cd" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.Cursor != nil { - query.Set("cursor", string(*in.Cursor)) + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } in.RequestScope.AddTo(query) @@ -1386,36 +1674,32 @@ func (c *Client) ListContextDepsByRefBomRef(ctx context.Context, in ListContextD if err != nil { return nil, err } - var out models.EndpointsGetDepsByBomRefOutput + var out models.EndpointsListCiCdAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsDependentsBomRefInput is the input for ListContextDepsDependentsBomRef — List Dependents of a Bom Ref. -type ListContextDepsDependentsBomRefInput struct { - BomRef string `path:"bomRef" json:"-"` - Cursor *string `url:"cursor,omitempty" json:"-"` - PageSize *int32 `url:"pageSize,omitempty" json:"-"` +// GetContextAssetInventoryCiCdIdInput is the input for GetContextAssetInventoryCiCdId — Get CI/CD Asset. +type GetContextAssetInventoryCiCdIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextDepsDependentsBomRef - List Dependents of a Bom Ref -// GET /context/deps/dependents/{bomRef} -func (c *Client) ListContextDepsDependentsBomRef(ctx context.Context, in ListContextDepsDependentsBomRefInput) (*models.EndpointsGetDepsDependentsOutput, error) { - path := "/context/deps/dependents/{bomRef}" - path = strings.Replace(path, "{bomRef}", url.PathEscape(in.BomRef), 1) +// GetContextAssetInventoryCiCdId - Get CI/CD Asset +// GET /context/asset-inventory/ci-cd/{id} +func (c *Client) GetContextAssetInventoryCiCdId(ctx context.Context, in GetContextAssetInventoryCiCdIdInput) (*models.EndpointsGetCiCdAssetOutput, error) { + path := "/context/asset-inventory/ci-cd/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) - } - if in.Cursor != nil { - query.Set("cursor", string(*in.Cursor)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1428,38 +1712,66 @@ func (c *Client) ListContextDepsDependentsBomRef(ctx context.Context, in ListCon if err != nil { return nil, err } - var out models.EndpointsGetDepsDependentsOutput + var out models.EndpointsGetCiCdAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsExposureInput is the input for ListContextDepsExposure — Global package exposure by version filter (semver or hash). -type ListContextDepsExposureInput struct { - Ecosystem *string `url:"ecosystem,omitempty" json:"-"` - Name *string `url:"name,omitempty" json:"-"` - Range *string `url:"range,omitempty" json:"-"` +// ListContextAssetInventoryClusterInput is the input for ListContextAssetInventoryCluster — List Cluster Assets. +type ListContextAssetInventoryClusterInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextDepsExposure - Global package exposure by version filter (semver or hash) -// GET /context/deps/exposure -func (c *Client) ListContextDepsExposure(ctx context.Context, in ListContextDepsExposureInput) (*models.EndpointsGetExposureOutput, error) { - path := "/context/deps/exposure" +// ListContextAssetInventoryCluster - List Cluster Assets +// GET /context/asset-inventory/cluster +func (c *Client) ListContextAssetInventoryCluster(ctx context.Context, in ListContextAssetInventoryClusterInput) (*models.EndpointsListClusterAssetsOutput, error) { + path := "/context/asset-inventory/cluster" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Ecosystem != nil { - query.Set("ecosystem", string(*in.Ecosystem)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.Name != nil { - query.Set("name", string(*in.Name)) + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) } - if in.Range != nil { - query.Set("range", string(*in.Range)) + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } in.RequestScope.AddTo(query) @@ -1472,42 +1784,32 @@ func (c *Client) ListContextDepsExposure(ctx context.Context, in ListContextDeps if err != nil { return nil, err } - var out models.EndpointsGetExposureOutput + var out models.EndpointsListClusterAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdActive — List Active Dependencies. -type ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - Direct *bool `url:"direct,omitempty" json:"-"` - Ecosystem *string `url:"ecosystem,omitempty" json:"-"` - Search *string `url:"search,omitempty" json:"-"` +// GetContextAssetInventoryClusterIdInput is the input for GetContextAssetInventoryClusterId — Get Cluster Asset. +type GetContextAssetInventoryClusterIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdActive - List Active Dependencies -// GET /context/deps/repository/{repositoryId}/project/{projectId}/active -func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdActive(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput) (*models.EndpointsGetProjectActiveDepsOutput, error) { - path := "/context/deps/repository/{repositoryId}/project/{projectId}/active" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// GetContextAssetInventoryClusterId - Get Cluster Asset +// GET /context/asset-inventory/cluster/{id} +func (c *Client) GetContextAssetInventoryClusterId(ctx context.Context, in GetContextAssetInventoryClusterIdInput) (*models.EndpointsGetClusterAssetOutput, error) { + path := "/context/asset-inventory/cluster/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Search != nil { - query.Set("search", string(*in.Search)) - } - if in.Ecosystem != nil { - query.Set("ecosystem", string(*in.Ecosystem)) - } - if in.Direct != nil { - query.Set("direct", strconv.FormatBool(*in.Direct)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1520,33 +1822,67 @@ func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdActive(ctx if err != nil { return nil, err } - var out models.EndpointsGetProjectActiveDepsOutput + var out models.EndpointsGetClusterAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit — Dependencies at commit. -type ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - Commit string `path:"commit" json:"-"` +// ListContextAssetInventoryComputeInput is the input for ListContextAssetInventoryCompute — List Compute Assets. +type ListContextAssetInventoryComputeInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit - Dependencies at commit -// GET /context/deps/repository/{repositoryId}/project/{projectId}/at/{commit} -func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput) (*models.EndpointsGetDepsAtCommitOutput, error) { - path := "/context/deps/repository/{repositoryId}/project/{projectId}/at/{commit}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) - path = strings.Replace(path, "{commit}", url.PathEscape(in.Commit), 1) +// ListContextAssetInventoryCompute - List Compute Assets +// GET /context/asset-inventory/compute +func (c *Client) ListContextAssetInventoryCompute(ctx context.Context, in ListContextAssetInventoryComputeInput) (*models.EndpointsListComputeAssetsOutput, error) { + path := "/context/asset-inventory/compute" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1558,38 +1894,32 @@ func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit(c if err != nil { return nil, err } - var out models.EndpointsGetDepsAtCommitOutput + var out models.EndpointsListComputeAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff — Dependency diff between two commits. -type ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - FromCommit *string `url:"fromCommit,omitempty" json:"-"` - ToCommit *string `url:"toCommit,omitempty" json:"-"` +// GetContextAssetInventoryComputeIdInput is the input for GetContextAssetInventoryComputeId — Get Compute Asset. +type GetContextAssetInventoryComputeIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff - Dependency diff between two commits -// GET /context/deps/repository/{repositoryId}/project/{projectId}/diff -func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput) (*models.EndpointsGetDepsDiffOutput, error) { - path := "/context/deps/repository/{repositoryId}/project/{projectId}/diff" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// GetContextAssetInventoryComputeId - Get Compute Asset +// GET /context/asset-inventory/compute/{id} +func (c *Client) GetContextAssetInventoryComputeId(ctx context.Context, in GetContextAssetInventoryComputeIdInput) (*models.EndpointsGetComputeAssetOutput, error) { + path := "/context/asset-inventory/compute/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.FromCommit != nil { - query.Set("fromCommit", string(*in.FromCommit)) - } - if in.ToCommit != nil { - query.Set("toCommit", string(*in.ToCommit)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1602,47 +1932,71 @@ func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff(ctx c if err != nil { return nil, err } - var out models.EndpointsGetDepsDiffOutput + var out models.EndpointsGetComputeAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure — Project package exposure by version filter (semver or hash). -type ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - Ecosystem *string `url:"ecosystem,omitempty" json:"-"` - Name *string `url:"name,omitempty" json:"-"` - Range *string `url:"range,omitempty" json:"-"` +// ListContextAssetInventoryConnectivityInput is the input for ListContextAssetInventoryConnectivity — List Connectivity Assets. +type ListContextAssetInventoryConnectivityInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure - Project package exposure by version filter (semver or hash) -// GET /context/deps/repository/{repositoryId}/project/{projectId}/exposure -func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput) (*models.EndpointsGetProjectExposureOutput, error) { - path := "/context/deps/repository/{repositoryId}/project/{projectId}/exposure" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// ListContextAssetInventoryConnectivity - List Connectivity Assets +// GET /context/asset-inventory/connectivity +func (c *Client) ListContextAssetInventoryConnectivity(ctx context.Context, in ListContextAssetInventoryConnectivityInput) (*models.EndpointsListConnectivityAssetsOutput, error) { + path := "/context/asset-inventory/connectivity" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Ecosystem != nil { - query.Set("ecosystem", string(*in.Ecosystem)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.Name != nil { - query.Set("name", string(*in.Name)) + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) } - if in.Range != nil { - query.Set("range", string(*in.Range)) + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { fullURL += "?" + query.Encode() } @@ -1650,38 +2004,32 @@ func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure(c if err != nil { return nil, err } - var out models.EndpointsGetProjectExposureOutput + var out models.EndpointsListConnectivityAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory — Package exposure history (windows). -type ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - Ecosystem *string `url:"ecosystem,omitempty" json:"-"` - Name *string `url:"name,omitempty" json:"-"` +// GetContextAssetInventoryConnectivityIdInput is the input for GetContextAssetInventoryConnectivityId — Get Connectivity Asset. +type GetContextAssetInventoryConnectivityIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory - Package exposure history (windows) -// GET /context/deps/repository/{repositoryId}/project/{projectId}/history -func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput) (*models.EndpointsGetDepsHistoryOut, error) { - path := "/context/deps/repository/{repositoryId}/project/{projectId}/history" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// GetContextAssetInventoryConnectivityId - Get Connectivity Asset +// GET /context/asset-inventory/connectivity/{id} +func (c *Client) GetContextAssetInventoryConnectivityId(ctx context.Context, in GetContextAssetInventoryConnectivityIdInput) (*models.EndpointsGetConnectivityAssetOutput, error) { + path := "/context/asset-inventory/connectivity/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Ecosystem != nil { - query.Set("ecosystem", string(*in.Ecosystem)) - } - if in.Name != nil { - query.Set("name", string(*in.Name)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1694,30 +2042,66 @@ func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory(ct if err != nil { return nil, err } - var out models.EndpointsGetDepsHistoryOut + var out models.EndpointsGetConnectivityAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextDepsWithoutLockfileInput is the input for ListContextDepsWithoutLockfile — List projects/repos without lockfiles. -type ListContextDepsWithoutLockfileInput struct { - Level *string `url:"level,omitempty" json:"-"` +// ListContextAssetInventoryContainerInput is the input for ListContextAssetInventoryContainer — List Container Assets. +type ListContextAssetInventoryContainerInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextDepsWithoutLockfile - List projects/repos without lockfiles -// GET /context/deps/without-lockfile -func (c *Client) ListContextDepsWithoutLockfile(ctx context.Context, in ListContextDepsWithoutLockfileInput) (*models.EndpointsGetDepsWithoutLockfileOutput, error) { - path := "/context/deps/without-lockfile" +// ListContextAssetInventoryContainer - List Container Assets +// GET /context/asset-inventory/container +func (c *Client) ListContextAssetInventoryContainer(ctx context.Context, in ListContextAssetInventoryContainerInput) (*models.EndpointsListContainerAssetsOutput, error) { + path := "/context/asset-inventory/container" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Level != nil { - query.Set("level", string(*in.Level)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } in.RequestScope.AddTo(query) @@ -1730,50 +2114,32 @@ func (c *Client) ListContextDepsWithoutLockfile(ctx context.Context, in ListCont if err != nil { return nil, err } - var out models.EndpointsGetDepsWithoutLockfileOutput + var out models.EndpointsListContainerAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextEntrypointsInput is the input for ListContextEntrypoints — List Entrypoints. -type ListContextEntrypointsInput struct { - IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` - Kind *string `url:"kind,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - ProjectID *string `url:"projectId,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` +// GetContextAssetInventoryContainerIdInput is the input for GetContextAssetInventoryContainerId — Get Container Asset. +type GetContextAssetInventoryContainerIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextEntrypoints - List Entrypoints -// GET /context/entrypoints -func (c *Client) ListContextEntrypoints(ctx context.Context, in ListContextEntrypointsInput) (*models.EndpointsListEntrypointsOutput, error) { - path := "/context/entrypoints" +// GetContextAssetInventoryContainerId - Get Container Asset +// GET /context/asset-inventory/container/{id} +func (c *Client) GetContextAssetInventoryContainerId(ctx context.Context, in GetContextAssetInventoryContainerIdInput) (*models.EndpointsGetContainerAssetOutput, error) { + path := "/context/asset-inventory/container/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) - } - if in.ProjectID != nil { - query.Set("projectId", string(*in.ProjectID)) - } - if in.Kind != nil { - query.Set("kind", string(*in.Kind)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) - } - if in.IncludeDeleted != nil { - query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1786,29 +2152,67 @@ func (c *Client) ListContextEntrypoints(ctx context.Context, in ListContextEntry if err != nil { return nil, err } - var out models.EndpointsListEntrypointsOutput + var out models.EndpointsGetContainerAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextEntrypointsEntrypointIdInput is the input for DeleteContextEntrypointsEntrypointId — Delete Entrypoint. -type DeleteContextEntrypointsEntrypointIdInput struct { - EntrypointID string `path:"entrypointId" json:"-"` +// ListContextAssetInventoryDataPipelineInput is the input for ListContextAssetInventoryDataPipeline — List Data Pipeline Assets. +type ListContextAssetInventoryDataPipelineInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// DeleteContextEntrypointsEntrypointId - Delete Entrypoint -// DELETE /context/entrypoints/{entrypointId} -func (c *Client) DeleteContextEntrypointsEntrypointId(ctx context.Context, in DeleteContextEntrypointsEntrypointIdInput) (*models.EndpointsDeleteEntrypointOutput, error) { - path := "/context/entrypoints/{entrypointId}" - path = strings.Replace(path, "{entrypointId}", url.PathEscape(in.EntrypointID), 1) +// ListContextAssetInventoryDataPipeline - List Data Pipeline Assets +// GET /context/asset-inventory/data-pipeline +func (c *Client) ListContextAssetInventoryDataPipeline(ctx context.Context, in ListContextAssetInventoryDataPipelineInput) (*models.EndpointsListDataPipelineAssetsOutput, error) { + path := "/context/asset-inventory/data-pipeline" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1816,33 +2220,37 @@ func (c *Client) DeleteContextEntrypointsEntrypointId(ctx context.Context, in De fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteEntrypointOutput + var out models.EndpointsListDataPipelineAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextEntrypointsEntrypointIdInput is the input for GetContextEntrypointsEntrypointId — Get Entrypoint. -type GetContextEntrypointsEntrypointIdInput struct { - EntrypointID string `path:"entrypointId" json:"-"` +// GetContextAssetInventoryDataPipelineIdInput is the input for GetContextAssetInventoryDataPipelineId — Get Data Pipeline Asset. +type GetContextAssetInventoryDataPipelineIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetContextEntrypointsEntrypointId - Get Entrypoint -// GET /context/entrypoints/{entrypointId} -func (c *Client) GetContextEntrypointsEntrypointId(ctx context.Context, in GetContextEntrypointsEntrypointIdInput) (*models.EndpointsGetEntrypointOutput, error) { - path := "/context/entrypoints/{entrypointId}" - path = strings.Replace(path, "{entrypointId}", url.PathEscape(in.EntrypointID), 1) +// GetContextAssetInventoryDataPipelineId - Get Data Pipeline Asset +// GET /context/asset-inventory/data-pipeline/{id} +func (c *Client) GetContextAssetInventoryDataPipelineId(ctx context.Context, in GetContextAssetInventoryDataPipelineIdInput) (*models.EndpointsGetDataPipelineAssetOutput, error) { + path := "/context/asset-inventory/data-pipeline/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1854,55 +2262,67 @@ func (c *Client) GetContextEntrypointsEntrypointId(ctx context.Context, in GetCo if err != nil { return nil, err } - var out models.EndpointsGetEntrypointOutput + var out models.EndpointsGetDataPipelineAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextMemoriesInput is the input for ListContextMemories — Get Memories. -type ListContextMemoriesInput struct { - IsLatest *bool `url:"isLatest,omitempty" json:"-"` +// ListContextAssetInventoryDatabaseInput is the input for ListContextAssetInventoryDatabase — List Database Assets. +type ListContextAssetInventoryDatabaseInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` - MemoryType *string `url:"memoryType,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` - Priority *string `url:"priority,omitempty" json:"-"` - ResourceID *string `url:"resourceId,omitempty" json:"-"` - ResourceType *string `url:"resourceType,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextMemories - Get Memories -// GET /context/memories -func (c *Client) ListContextMemories(ctx context.Context, in ListContextMemoriesInput) (*models.EndpointsGetMemoriesOutput, error) { - path := "/context/memories" +// ListContextAssetInventoryDatabase - List Database Assets +// GET /context/asset-inventory/database +func (c *Client) ListContextAssetInventoryDatabase(ctx context.Context, in ListContextAssetInventoryDatabaseInput) (*models.EndpointsListDatabaseAssetsOutput, error) { + path := "/context/asset-inventory/database" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.ResourceID != nil { - query.Set("resourceId", string(*in.ResourceID)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.ResourceType != nil { - query.Set("resourceType", string(*in.ResourceType)) + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) } - if in.MemoryType != nil { - query.Set("memoryType", string(*in.MemoryType)) + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) } - if in.Priority != nil { - query.Set("priority", string(*in.Priority)) + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) } - if in.IsLatest != nil { - query.Set("isLatest", strconv.FormatBool(*in.IsLatest)) + if in.Region != nil { + query.Set("region", string(*in.Region)) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) } if in.NextToken != nil { query.Set("nextToken", string(*in.NextToken)) } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1914,41 +2334,33 @@ func (c *Client) ListContextMemories(ctx context.Context, in ListContextMemories if err != nil { return nil, err } - var out models.EndpointsGetMemoriesOutput + var out models.EndpointsListDatabaseAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextMemoriesInput is the input for CreateContextMemories — Create Memory. -type CreateContextMemoriesInput struct { - Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` - Confidence *float64 `json:"confidence,omitempty"` - Content string `json:"content"` - CreatedBy *string `json:"createdBy,omitempty"` - CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` - IsUserCreated *bool `json:"isUserCreated,omitempty"` - MemoryType models.ModelsMemoryMemoryType `json:"memoryType"` - Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` - ParentNoteID *string `json:"parentNoteId,omitempty"` - Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` - ResourceID *string `json:"resourceId,omitempty"` - ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` - Tags []string `json:"tags,omitempty"` - Title *string `json:"title,omitempty"` +// GetContextAssetInventoryDatabaseIdInput is the input for GetContextAssetInventoryDatabaseId — Get Database Asset. +type GetContextAssetInventoryDatabaseIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateContextMemories - Create Memory -// POST /context/memories -func (c *Client) CreateContextMemories(ctx context.Context, in CreateContextMemoriesInput) (*models.EndpointsPostMemoryOutput, error) { - path := "/context/memories" +// GetContextAssetInventoryDatabaseId - Get Database Asset +// GET /context/asset-inventory/database/{id} +func (c *Client) GetContextAssetInventoryDatabaseId(ctx context.Context, in GetContextAssetInventoryDatabaseIdInput) (*models.EndpointsGetDatabaseAssetOutput, error) { + path := "/context/asset-inventory/database/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1956,81 +2368,67 @@ func (c *Client) CreateContextMemories(ctx context.Context, in CreateContextMemo fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` - Confidence *float64 `json:"confidence,omitempty"` - Content string `json:"content"` - CreatedBy *string `json:"createdBy,omitempty"` - CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` - IsUserCreated *bool `json:"isUserCreated,omitempty"` - MemoryType models.ModelsMemoryMemoryType `json:"memoryType"` - Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` - ParentNoteID *string `json:"parentNoteId,omitempty"` - Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` - ResourceID *string `json:"resourceId,omitempty"` - ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` - Tags []string `json:"tags,omitempty"` - Title *string `json:"title,omitempty"` - }{ - Citations: in.Citations, - Confidence: in.Confidence, - Content: in.Content, - CreatedBy: in.CreatedBy, - CrossReferences: in.CrossReferences, - IsUserCreated: in.IsUserCreated, - MemoryType: in.MemoryType, - Metadata: in.Metadata, - ParentNoteID: in.ParentNoteID, - Priority: in.Priority, - ResourceID: in.ResourceID, - ResourceType: in.ResourceType, - Tags: in.Tags, - Title: in.Title, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostMemoryOutput + var out models.EndpointsGetDatabaseAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextMemoriesTypeInput is the input for ListContextMemoriesType — Get Memories By Type. -type ListContextMemoriesTypeInput struct { - IsLatest *bool `url:"isLatest,omitempty" json:"-"` +// ListContextAssetInventoryEndpointsInput is the input for ListContextAssetInventoryEndpoints — List Asset Inventory Endpoints. +type ListContextAssetInventoryEndpointsInput struct { + Active *bool `url:"active,omitempty" json:"-"` + AwsService *string `url:"awsService,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + HostCategory *string `url:"hostCategory,omitempty" json:"-"` + HostID *string `url:"hostId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` - MemoryType *string `url:"memoryType,omitempty" json:"-"` - PaginationToken *string `url:"paginationToken,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Q *string `url:"q,omitempty" json:"-"` + SourceType *string `url:"sourceType,omitempty" json:"-"` models.RequestScope } -// ListContextMemoriesType - Get Memories By Type -// GET /context/memories/type -func (c *Client) ListContextMemoriesType(ctx context.Context, in ListContextMemoriesTypeInput) (*models.EndpointsGetMemoriesByTypeOutput, error) { - path := "/context/memories/type" +// ListContextAssetInventoryEndpoints - List Asset Inventory Endpoints +// GET /context/asset-inventory/endpoints +func (c *Client) ListContextAssetInventoryEndpoints(ctx context.Context, in ListContextAssetInventoryEndpointsInput) (*models.EndpointsListEndpointsAssetsOutput, error) { + path := "/context/asset-inventory/endpoints" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.MemoryType != nil { - query.Set("memoryType", string(*in.MemoryType)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.IsLatest != nil { - query.Set("isLatest", strconv.FormatBool(*in.IsLatest)) + if in.HostCategory != nil { + query.Set("hostCategory", string(*in.HostCategory)) + } + if in.HostID != nil { + query.Set("hostId", string(*in.HostID)) + } + if in.AwsService != nil { + query.Set("awsService", string(*in.AwsService)) + } + if in.SourceType != nil { + query.Set("sourceType", string(*in.SourceType)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.Q != nil { + query.Set("q", string(*in.Q)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } - if in.PaginationToken != nil { - query.Set("paginationToken", string(*in.PaginationToken)) - } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2042,29 +2440,33 @@ func (c *Client) ListContextMemoriesType(ctx context.Context, in ListContextMemo if err != nil { return nil, err } - var out models.EndpointsGetMemoriesByTypeOutput + var out models.EndpointsListEndpointsAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextMemoriesMemoryIdInput is the input for DeleteContextMemoriesMemoryId — Delete Memory. -type DeleteContextMemoriesMemoryIdInput struct { - MemoryID string `path:"memoryId" json:"-"` +// GetContextAssetInventoryEndpointsIdInput is the input for GetContextAssetInventoryEndpointsId — Get Asset Inventory Endpoint. +type GetContextAssetInventoryEndpointsIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteContextMemoriesMemoryId - Delete Memory -// DELETE /context/memories/{memoryId} -func (c *Client) DeleteContextMemoriesMemoryId(ctx context.Context, in DeleteContextMemoriesMemoryIdInput) (*models.EndpointsDeleteMemoryOutput, error) { - path := "/context/memories/{memoryId}" - path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) +// GetContextAssetInventoryEndpointsId - Get Asset Inventory Endpoint +// GET /context/asset-inventory/endpoints/{id} +func (c *Client) GetContextAssetInventoryEndpointsId(ctx context.Context, in GetContextAssetInventoryEndpointsIdInput) (*models.EndpointsGetEndpointsAssetOutput, error) { + path := "/context/asset-inventory/endpoints/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2072,36 +2474,70 @@ func (c *Client) DeleteContextMemoriesMemoryId(ctx context.Context, in DeleteCon fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteMemoryOutput + var out models.EndpointsGetEndpointsAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextMemoriesMemoryIdInput is the input for GetContextMemoriesMemoryId — Get Memory. -type GetContextMemoriesMemoryIdInput struct { - MemoryID string `path:"memoryId" json:"-"` - Version *string `url:"version,omitempty" json:"-"` +// ListContextAssetInventoryIdentityInput is the input for ListContextAssetInventoryIdentity — List Identity Assets. +type ListContextAssetInventoryIdentityInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// GetContextMemoriesMemoryId - Get Memory -// GET /context/memories/{memoryId} -func (c *Client) GetContextMemoriesMemoryId(ctx context.Context, in GetContextMemoriesMemoryIdInput) (*models.EndpointsGetMemoryOutput, error) { - path := "/context/memories/{memoryId}" - path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) +// ListContextAssetInventoryIdentity - List Identity Assets +// GET /context/asset-inventory/identity +func (c *Client) ListContextAssetInventoryIdentity(ctx context.Context, in ListContextAssetInventoryIdentityInput) (*models.EndpointsListIdentityAssetsOutput, error) { + path := "/context/asset-inventory/identity" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Version != nil { - query.Set("version", string(*in.Version)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } in.RequestScope.AddTo(query) @@ -2114,39 +2550,33 @@ func (c *Client) GetContextMemoriesMemoryId(ctx context.Context, in GetContextMe if err != nil { return nil, err } - var out models.EndpointsGetMemoryOutput + var out models.EndpointsListIdentityAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchContextMemoriesMemoryIdInput is the input for PatchContextMemoriesMemoryId — Update Memory. -type PatchContextMemoriesMemoryIdInput struct { - MemoryID string `path:"memoryId" json:"-"` - Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` - Confidence *float64 `json:"confidence,omitempty"` - Content *string `json:"content,omitempty"` - CreateNewVersion *bool `json:"createNewVersion,omitempty"` - CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` - Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` - ParentNoteID *string `json:"parentNoteId,omitempty"` - Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` - Tags []string `json:"tags,omitempty"` - Title *string `json:"title,omitempty"` +// GetContextAssetInventoryIdentityIdInput is the input for GetContextAssetInventoryIdentityId — Get Identity Asset. +type GetContextAssetInventoryIdentityIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// PatchContextMemoriesMemoryId - Update Memory -// PATCH /context/memories/{memoryId} -func (c *Client) PatchContextMemoriesMemoryId(ctx context.Context, in PatchContextMemoriesMemoryIdInput) (*models.EndpointsPatchMemoryOutput, error) { - path := "/context/memories/{memoryId}" - path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) +// GetContextAssetInventoryIdentityId - Get Identity Asset +// GET /context/asset-inventory/identity/{id} +func (c *Client) GetContextAssetInventoryIdentityId(ctx context.Context, in GetContextAssetInventoryIdentityIdInput) (*models.EndpointsGetIdentityAssetOutput, error) { + path := "/context/asset-inventory/identity/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2154,60 +2584,68 @@ func (c *Client) PatchContextMemoriesMemoryId(ctx context.Context, in PatchConte fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` - Confidence *float64 `json:"confidence,omitempty"` - Content *string `json:"content,omitempty"` - CreateNewVersion *bool `json:"createNewVersion,omitempty"` - CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` - Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` - ParentNoteID *string `json:"parentNoteId,omitempty"` - Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` - Tags []string `json:"tags,omitempty"` - Title *string `json:"title,omitempty"` - }{ - Citations: in.Citations, - Confidence: in.Confidence, - Content: in.Content, - CreateNewVersion: in.CreateNewVersion, - CrossReferences: in.CrossReferences, - Metadata: in.Metadata, - ParentNoteID: in.ParentNoteID, - Priority: in.Priority, - Tags: in.Tags, - Title: in.Title, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPatchMemoryOutput + var out models.EndpointsGetIdentityAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextMemoriesMemoryIdVersionsInput is the input for ListContextMemoriesMemoryIdVersions — Get Memory Versions. -type ListContextMemoriesMemoryIdVersionsInput struct { - MemoryID string `path:"memoryId" json:"-"` - Limit *int32 `url:"limit,omitempty" json:"-"` +// ListContextAssetInventoryLoadBalancerInput is the input for ListContextAssetInventoryLoadBalancer — List Load Balancer Assets. +type ListContextAssetInventoryLoadBalancerInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// ListContextMemoriesMemoryIdVersions - Get Memory Versions -// GET /context/memories/{memoryId}/versions -func (c *Client) ListContextMemoriesMemoryIdVersions(ctx context.Context, in ListContextMemoriesMemoryIdVersionsInput) (*models.EndpointsGetMemoryVersionsOutput, error) { - path := "/context/memories/{memoryId}/versions" - path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) +// ListContextAssetInventoryLoadBalancer - List Load Balancer Assets +// GET /context/asset-inventory/load-balancer +func (c *Client) ListContextAssetInventoryLoadBalancer(ctx context.Context, in ListContextAssetInventoryLoadBalancerInput) (*models.EndpointsListLoadBalancerAssetsOutput, error) { + path := "/context/asset-inventory/load-balancer" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } @@ -2222,27 +2660,33 @@ func (c *Client) ListContextMemoriesMemoryIdVersions(ctx context.Context, in Lis if err != nil { return nil, err } - var out models.EndpointsGetMemoryVersionsOutput + var out models.EndpointsListLoadBalancerAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextOrganizationInput is the input for ListContextOrganization — Get Organization Context. -type ListContextOrganizationInput struct { +// GetContextAssetInventoryLoadBalancerIdInput is the input for GetContextAssetInventoryLoadBalancerId — Get Load Balancer Asset. +type GetContextAssetInventoryLoadBalancerIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextOrganization - Get Organization Context -// GET /context/organization -func (c *Client) ListContextOrganization(ctx context.Context, in ListContextOrganizationInput) (*models.EndpointsGetOrganizationOutput, error) { - path := "/context/organization" +// GetContextAssetInventoryLoadBalancerId - Get Load Balancer Asset +// GET /context/asset-inventory/load-balancer/{id} +func (c *Client) GetContextAssetInventoryLoadBalancerId(ctx context.Context, in GetContextAssetInventoryLoadBalancerIdInput) (*models.EndpointsGetLoadBalancerAssetOutput, error) { + path := "/context/asset-inventory/load-balancer/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2254,29 +2698,67 @@ func (c *Client) ListContextOrganization(ctx context.Context, in ListContextOrga if err != nil { return nil, err } - var out models.EndpointsGetOrganizationOutput + var out models.EndpointsGetLoadBalancerAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchContextOrganizationInput is the input for PatchContextOrganization — Update Classification of the Organization. -type PatchContextOrganizationInput struct { - Name *string `json:"name,omitempty"` - Notes *string `json:"notes,omitempty"` +// ListContextAssetInventoryMessagingInput is the input for ListContextAssetInventoryMessaging — List Messaging Assets. +type ListContextAssetInventoryMessagingInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// PatchContextOrganization - Update Classification of the Organization -// PATCH /context/organization -func (c *Client) PatchContextOrganization(ctx context.Context, in PatchContextOrganizationInput) ([]byte, error) { - path := "/context/organization" +// ListContextAssetInventoryMessaging - List Messaging Assets +// GET /context/asset-inventory/messaging +func (c *Client) ListContextAssetInventoryMessaging(ctx context.Context, in ListContextAssetInventoryMessagingInput) (*models.EndpointsListMessagingAssetsOutput, error) { + path := "/context/asset-inventory/messaging" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2284,35 +2766,37 @@ func (c *Client) PatchContextOrganization(ctx context.Context, in PatchContextOr fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Name *string `json:"name,omitempty"` - Notes *string `json:"notes,omitempty"` - }{ - Name: in.Name, - Notes: in.Notes, - }) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) + return nil, err } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) - return data, err + var out models.EndpointsListMessagingAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } -// UpdateContextOrganizationInput is the input for UpdateContextOrganization — Upsert Classification of the Organization. -type UpdateContextOrganizationInput struct { - Organization *models.ModelsOrgContext `json:"organization,omitempty"` +// GetContextAssetInventoryMessagingIdInput is the input for GetContextAssetInventoryMessagingId — Get Messaging Asset. +type GetContextAssetInventoryMessagingIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// UpdateContextOrganization - Upsert Classification of the Organization -// PUT /context/organization -func (c *Client) UpdateContextOrganization(ctx context.Context, in UpdateContextOrganizationInput) (*models.EndpointsCreateOrganizationOutput, error) { - path := "/context/organization" +// GetContextAssetInventoryMessagingId - Get Messaging Asset +// GET /context/asset-inventory/messaging/{id} +func (c *Client) GetContextAssetInventoryMessagingId(ctx context.Context, in GetContextAssetInventoryMessagingIdInput) (*models.EndpointsGetMessagingAssetOutput, error) { + path := "/context/asset-inventory/messaging/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2320,39 +2804,71 @@ func (c *Client) UpdateContextOrganization(ctx context.Context, in UpdateContext fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Organization *models.ModelsOrgContext `json:"organization,omitempty"` - }{ - Organization: in.Organization, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsCreateOrganizationOutput + var out models.EndpointsGetMessagingAssetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextRagResyncInput is the input for CreateContextRagResync — Resync RAG Vector Store. -type CreateContextRagResyncInput struct { +// ListContextAssetInventoryNetworkInput is the input for ListContextAssetInventoryNetwork — List Network Assets. +type ListContextAssetInventoryNetworkInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` models.RequestScope } -// CreateContextRagResync - Resync RAG Vector Store -// POST /context/rag/resync -func (c *Client) CreateContextRagResync(ctx context.Context, in CreateContextRagResyncInput) (*models.EndpointsPostRAGResyncOutput, error) { - path := "/context/rag/resync" +// ListContextAssetInventoryNetwork - List Network Assets +// GET /context/asset-inventory/network +func (c *Client) ListContextAssetInventoryNetwork(ctx context.Context, in ListContextAssetInventoryNetworkInput) (*models.EndpointsListNetworkAssetsOutput, error) { + path := "/context/asset-inventory/network" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2360,50 +2876,5621 @@ func (c *Client) CreateContextRagResync(ctx context.Context, in CreateContextRag fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostRAGResyncOutput + var out models.EndpointsListNetworkAssetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextRepoScansInput is the input for ListContextRepoScans — List Repo Context Scans. -type ListContextRepoScansInput struct { - CommitSha *string `url:"commitSha,omitempty" json:"-"` - Page *int `url:"page,omitempty" json:"-"` +// GetContextAssetInventoryNetworkIdInput is the input for GetContextAssetInventoryNetworkId — Get Network Asset. +type GetContextAssetInventoryNetworkIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventoryNetworkId - Get Network Asset +// GET /context/asset-inventory/network/{id} +func (c *Client) GetContextAssetInventoryNetworkId(ctx context.Context, in GetContextAssetInventoryNetworkIdInput) (*models.EndpointsGetNetworkAssetOutput, error) { + path := "/context/asset-inventory/network/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetNetworkAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventoryObservabilityInput is the input for ListContextAssetInventoryObservability — List Observability Assets. +type ListContextAssetInventoryObservabilityInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventoryObservability - List Observability Assets +// GET /context/asset-inventory/observability +func (c *Client) ListContextAssetInventoryObservability(ctx context.Context, in ListContextAssetInventoryObservabilityInput) (*models.EndpointsListObservabilityAssetsOutput, error) { + path := "/context/asset-inventory/observability" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListObservabilityAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextAssetInventoryObservabilityIdInput is the input for GetContextAssetInventoryObservabilityId — Get Observability Asset. +type GetContextAssetInventoryObservabilityIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventoryObservabilityId - Get Observability Asset +// GET /context/asset-inventory/observability/{id} +func (c *Client) GetContextAssetInventoryObservabilityId(ctx context.Context, in GetContextAssetInventoryObservabilityIdInput) (*models.EndpointsGetObservabilityAssetOutput, error) { + path := "/context/asset-inventory/observability/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetObservabilityAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventoryPipelinesInput is the input for ListContextAssetInventoryPipelines — List Pipelines Assets. +type ListContextAssetInventoryPipelinesInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + RepoID *string `url:"repoId,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventoryPipelines - List Pipelines Assets +// GET /context/asset-inventory/pipelines +func (c *Client) ListContextAssetInventoryPipelines(ctx context.Context, in ListContextAssetInventoryPipelinesInput) (*models.EndpointsListPipelinesAssetsOutput, error) { + path := "/context/asset-inventory/pipelines" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.RepoID != nil { + query.Set("repoId", string(*in.RepoID)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListPipelinesAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextAssetInventoryPipelinesIdInput is the input for GetContextAssetInventoryPipelinesId — Get Pipelines Asset. +type GetContextAssetInventoryPipelinesIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventoryPipelinesId - Get Pipelines Asset +// GET /context/asset-inventory/pipelines/{id} +func (c *Client) GetContextAssetInventoryPipelinesId(ctx context.Context, in GetContextAssetInventoryPipelinesIdInput) (*models.EndpointsGetPipelinesAssetOutput, error) { + path := "/context/asset-inventory/pipelines/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPipelinesAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventoryProjectsInput is the input for ListContextAssetInventoryProjects — List Projects Assets. +type ListContextAssetInventoryProjectsInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + RepoID *string `url:"repoId,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventoryProjects - List Projects Assets +// GET /context/asset-inventory/projects +func (c *Client) ListContextAssetInventoryProjects(ctx context.Context, in ListContextAssetInventoryProjectsInput) (*models.EndpointsListProjectsAssetsOutput, error) { + path := "/context/asset-inventory/projects" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.RepoID != nil { + query.Set("repoId", string(*in.RepoID)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListProjectsAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextAssetInventoryProjectsIdInput is the input for GetContextAssetInventoryProjectsId — Get Projects Asset. +type GetContextAssetInventoryProjectsIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventoryProjectsId - Get Projects Asset +// GET /context/asset-inventory/projects/{id} +func (c *Client) GetContextAssetInventoryProjectsId(ctx context.Context, in GetContextAssetInventoryProjectsIdInput) (*models.EndpointsGetProjectsAssetOutput, error) { + path := "/context/asset-inventory/projects/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectsAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventoryPublicInput is the input for ListContextAssetInventoryPublic — List Public Asset Inventory. +type ListContextAssetInventoryPublicInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Category *string `url:"category,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Policy *string `url:"policy,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventoryPublic - List Public Asset Inventory +// GET /context/asset-inventory/public +func (c *Client) ListContextAssetInventoryPublic(ctx context.Context, in ListContextAssetInventoryPublicInput) (*models.EndpointsListAssetInventoryOutput, error) { + path := "/context/asset-inventory/public" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Category != nil { + query.Set("category", string(*in.Category)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Policy != nil { + query.Set("policy", string(*in.Policy)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListAssetInventoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventoryReposInput is the input for ListContextAssetInventoryRepos — List Repos Assets. +type ListContextAssetInventoryReposInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventoryRepos - List Repos Assets +// GET /context/asset-inventory/repos +func (c *Client) ListContextAssetInventoryRepos(ctx context.Context, in ListContextAssetInventoryReposInput) (*models.EndpointsListReposAssetsOutput, error) { + path := "/context/asset-inventory/repos" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListReposAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextAssetInventoryReposIdInput is the input for GetContextAssetInventoryReposId — Get Repos Asset. +type GetContextAssetInventoryReposIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventoryReposId - Get Repos Asset +// GET /context/asset-inventory/repos/{id} +func (c *Client) GetContextAssetInventoryReposId(ctx context.Context, in GetContextAssetInventoryReposIdInput) (*models.EndpointsGetReposAssetOutput, error) { + path := "/context/asset-inventory/repos/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetReposAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventorySecurityInput is the input for ListContextAssetInventorySecurity — List Security Assets. +type ListContextAssetInventorySecurityInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventorySecurity - List Security Assets +// GET /context/asset-inventory/security +func (c *Client) ListContextAssetInventorySecurity(ctx context.Context, in ListContextAssetInventorySecurityInput) (*models.EndpointsListSecurityAssetsOutput, error) { + path := "/context/asset-inventory/security" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListSecurityAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextAssetInventorySecurityIdInput is the input for GetContextAssetInventorySecurityId — Get Security Asset. +type GetContextAssetInventorySecurityIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventorySecurityId - Get Security Asset +// GET /context/asset-inventory/security/{id} +func (c *Client) GetContextAssetInventorySecurityId(ctx context.Context, in GetContextAssetInventorySecurityIdInput) (*models.EndpointsGetSecurityAssetOutput, error) { + path := "/context/asset-inventory/security/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSecurityAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventoryServerlessInput is the input for ListContextAssetInventoryServerless — List Serverless Assets. +type ListContextAssetInventoryServerlessInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventoryServerless - List Serverless Assets +// GET /context/asset-inventory/serverless +func (c *Client) ListContextAssetInventoryServerless(ctx context.Context, in ListContextAssetInventoryServerlessInput) (*models.EndpointsListServerlessAssetsOutput, error) { + path := "/context/asset-inventory/serverless" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListServerlessAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextAssetInventoryServerlessIdInput is the input for GetContextAssetInventoryServerlessId — Get Serverless Asset. +type GetContextAssetInventoryServerlessIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventoryServerlessId - Get Serverless Asset +// GET /context/asset-inventory/serverless/{id} +func (c *Client) GetContextAssetInventoryServerlessId(ctx context.Context, in GetContextAssetInventoryServerlessIdInput) (*models.EndpointsGetServerlessAssetOutput, error) { + path := "/context/asset-inventory/serverless/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetServerlessAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextAssetInventoryStorageAndBackupInput is the input for ListContextAssetInventoryStorageAndBackup — List Storage and Backup Assets. +type ListContextAssetInventoryStorageAndBackupInput struct { + AccountID *string `url:"accountId,omitempty" json:"-"` + Active *bool `url:"active,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InternetReachable *bool `url:"internetReachable,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + PublicFacing *bool `url:"publicFacing,omitempty" json:"-"` + Region *string `url:"region,omitempty" json:"-"` + SubType *string `url:"subType,omitempty" json:"-"` + models.RequestScope +} + +// ListContextAssetInventoryStorageAndBackup - List Storage and Backup Assets +// GET /context/asset-inventory/storage-and-backup +func (c *Client) ListContextAssetInventoryStorageAndBackup(ctx context.Context, in ListContextAssetInventoryStorageAndBackupInput) (*models.EndpointsListStorageAndBackupAssetsOutput, error) { + path := "/context/asset-inventory/storage-and-backup" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.SubType != nil { + query.Set("subType", string(*in.SubType)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + if in.AccountID != nil { + query.Set("accountId", string(*in.AccountID)) + } + if in.Region != nil { + query.Set("region", string(*in.Region)) + } + if in.Active != nil { + query.Set("active", strconv.FormatBool(*in.Active)) + } + if in.PublicFacing != nil { + query.Set("publicFacing", strconv.FormatBool(*in.PublicFacing)) + } + if in.InternetReachable != nil { + query.Set("internetReachable", strconv.FormatBool(*in.InternetReachable)) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListStorageAndBackupAssetsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextAssetInventoryStorageAndBackupIdInput is the input for GetContextAssetInventoryStorageAndBackupId — Get Storage and Backup Asset. +type GetContextAssetInventoryStorageAndBackupIdInput struct { + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextAssetInventoryStorageAndBackupId - Get Storage and Backup Asset +// GET /context/asset-inventory/storage-and-backup/{id} +func (c *Client) GetContextAssetInventoryStorageAndBackupId(ctx context.Context, in GetContextAssetInventoryStorageAndBackupIdInput) (*models.EndpointsGetStorageAndBackupAssetOutput, error) { + path := "/context/asset-inventory/storage-and-backup/{id}" + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetStorageAndBackupAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextAssetInventoryCategoryIdInput is the input for DeleteContextAssetInventoryCategoryId — Delete Asset. +type DeleteContextAssetInventoryCategoryIdInput struct { + Category string `path:"category" json:"-"` + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteContextAssetInventoryCategoryId - Delete Asset +// DELETE /context/asset-inventory/{category}/{id} +func (c *Client) DeleteContextAssetInventoryCategoryId(ctx context.Context, in DeleteContextAssetInventoryCategoryIdInput) (*models.EndpointsDeleteAssetOutput, error) { + path := "/context/asset-inventory/{category}/{id}" + path = strings.Replace(path, "{category}", url.PathEscape(in.Category), 1) + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteAssetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchContextAssetInventoryCategoryIdFlagsInput is the input for PatchContextAssetInventoryCategoryIdFlags — Patch Asset Flags. +type PatchContextAssetInventoryCategoryIdFlagsInput struct { + Category string `path:"category" json:"-"` + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + models.RequestScope +} + +// PatchContextAssetInventoryCategoryIdFlags - Patch Asset Flags +// PATCH /context/asset-inventory/{category}/{id}/flags +func (c *Client) PatchContextAssetInventoryCategoryIdFlags(ctx context.Context, in PatchContextAssetInventoryCategoryIdFlagsInput) (*models.EndpointsPatchAssetFlagsOutput, error) { + path := "/context/asset-inventory/{category}/{id}/flags" + path = strings.Replace(path, "{category}", url.PathEscape(in.Category), 1) + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + }{ + IsInternetReachable: in.IsInternetReachable, + IsPublicFacing: in.IsPublicFacing, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchAssetFlagsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchContextAssetInventoryCategoryIdTagsInput is the input for PatchContextAssetInventoryCategoryIdTags — Patch Asset Tags. +type PatchContextAssetInventoryCategoryIdTagsInput struct { + Category string `path:"category" json:"-"` + ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Tags map[string]string `json:"tags,omitempty"` + models.RequestScope +} + +// PatchContextAssetInventoryCategoryIdTags - Patch Asset Tags +// PATCH /context/asset-inventory/{category}/{id}/tags +func (c *Client) PatchContextAssetInventoryCategoryIdTags(ctx context.Context, in PatchContextAssetInventoryCategoryIdTagsInput) (*models.EndpointsPatchAssetTagsOutput, error) { + path := "/context/asset-inventory/{category}/{id}/tags" + path = strings.Replace(path, "{category}", url.PathEscape(in.Category), 1) + path = strings.Replace(path, "{id}", url.PathEscape(in.ID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Tags map[string]string `json:"tags,omitempty"` + }{ + Tags: in.Tags, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchAssetTagsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCicdPipelinesInput is the input for ListContextCicdPipelines — List CI/CD Pipelines. +type ListContextCicdPipelinesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Platform *string `url:"platform,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCicdPipelines - List CI/CD Pipelines +// GET /context/cicd-pipelines +func (c *Client) ListContextCicdPipelines(ctx context.Context, in ListContextCicdPipelinesInput) (*models.EndpointsListPipelinesOutput, error) { + path := "/context/cicd-pipelines" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.Platform != nil { + query.Set("platform", string(*in.Platform)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.IncludeDeleted != nil { + query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListPipelinesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextCicdPipelinesPipelineIdInput is the input for DeleteContextCicdPipelinesPipelineId — Delete CI/CD Pipeline. +type DeleteContextCicdPipelinesPipelineIdInput struct { + PipelineID string `path:"pipelineId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteContextCicdPipelinesPipelineId - Delete CI/CD Pipeline +// DELETE /context/cicd-pipelines/{pipelineId} +func (c *Client) DeleteContextCicdPipelinesPipelineId(ctx context.Context, in DeleteContextCicdPipelinesPipelineIdInput) (*models.EndpointsDeletePipelineOutput, error) { + path := "/context/cicd-pipelines/{pipelineId}" + path = strings.Replace(path, "{pipelineId}", url.PathEscape(in.PipelineID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeletePipelineOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextCicdPipelinesPipelineIdInput is the input for GetContextCicdPipelinesPipelineId — Get CI/CD Pipeline. +type GetContextCicdPipelinesPipelineIdInput struct { + PipelineID string `path:"pipelineId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextCicdPipelinesPipelineId - Get CI/CD Pipeline +// GET /context/cicd-pipelines/{pipelineId} +func (c *Client) GetContextCicdPipelinesPipelineId(ctx context.Context, in GetContextCicdPipelinesPipelineIdInput) (*models.EndpointsGetPipelineOutput, error) { + path := "/context/cicd-pipelines/{pipelineId}" + path = strings.Replace(path, "{pipelineId}", url.PathEscape(in.PipelineID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPipelineOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextCloudConnectorPrRunsInput is the input for CreateContextCloudConnectorPrRuns — Start Cloud Connector PR Run. +type CreateContextCloudConnectorPrRunsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Digest *string `json:"digest,omitempty"` + ExpectedRunID *string `json:"expectedRunId,omitempty"` + models.RequestScope +} + +// CreateContextCloudConnectorPrRuns - Start Cloud Connector PR Run +// POST /context/cloud-connector-pr/runs +func (c *Client) CreateContextCloudConnectorPrRuns(ctx context.Context, in CreateContextCloudConnectorPrRunsInput) (*models.EndpointsContextStartCloudConnectorPRRunOutput, error) { + path := "/context/cloud-connector-pr/runs" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Digest *string `json:"digest,omitempty"` + ExpectedRunID *string `json:"expectedRunId,omitempty"` + }{ + Digest: in.Digest, + ExpectedRunID: in.ExpectedRunID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsContextStartCloudConnectorPRRunOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextCloudConnectorPrRunsRunIdInput is the input for GetContextCloudConnectorPrRunsRunId — Get Cloud Connector PR Run. +type GetContextCloudConnectorPrRunsRunIdInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextCloudConnectorPrRunsRunId - Get Cloud Connector PR Run +// GET /context/cloud-connector-pr/runs/{runId} +func (c *Client) GetContextCloudConnectorPrRunsRunId(ctx context.Context, in GetContextCloudConnectorPrRunsRunIdInput) (*models.EndpointsContextGetCloudConnectorPRRunOutput, error) { + path := "/context/cloud-connector-pr/runs/{runId}" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsContextGetCloudConnectorPRRunOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextCloudConnectorPrRunsRunIdApproveInput is the input for CreateContextCloudConnectorPrRunsRunIdApprove — Create approved AWS connector draft PR. +type CreateContextCloudConnectorPrRunsRunIdApproveInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Digest string `json:"digest"` + models.RequestScope +} + +// CreateContextCloudConnectorPrRunsRunIdApprove - Create approved AWS connector draft PR +// POST /context/cloud-connector-pr/runs/{runId}/approve +func (c *Client) CreateContextCloudConnectorPrRunsRunIdApprove(ctx context.Context, in CreateContextCloudConnectorPrRunsRunIdApproveInput) (*models.EndpointsContextApproveCloudConnectorProposalOutput, error) { + path := "/context/cloud-connector-pr/runs/{runId}/approve" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Digest string `json:"digest"` + }{ + Digest: in.Digest, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsContextApproveCloudConnectorProposalOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudConnectorPrRunsRunIdProposalInput is the input for ListContextCloudConnectorPrRunsRunIdProposal — Review AWS connector proposal. +type ListContextCloudConnectorPrRunsRunIdProposalInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudConnectorPrRunsRunIdProposal - Review AWS connector proposal +// GET /context/cloud-connector-pr/runs/{runId}/proposal +func (c *Client) ListContextCloudConnectorPrRunsRunIdProposal(ctx context.Context, in ListContextCloudConnectorPrRunsRunIdProposalInput) (*models.EndpointsContextGetCloudConnectorProposalOutput, error) { + path := "/context/cloud-connector-pr/runs/{runId}/proposal" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsContextGetCloudConnectorProposalOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextCloudConnectorPrRunsRunIdRecoverInput is the input for CreateContextCloudConnectorPrRunsRunIdRecover — Recover unresolved connector publication. +type CreateContextCloudConnectorPrRunsRunIdRecoverInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmNoPullRequest bool `json:"confirmNoPullRequest"` + Digest string `json:"digest"` + models.RequestScope +} + +// CreateContextCloudConnectorPrRunsRunIdRecover - Recover unresolved connector publication +// POST /context/cloud-connector-pr/runs/{runId}/recover +func (c *Client) CreateContextCloudConnectorPrRunsRunIdRecover(ctx context.Context, in CreateContextCloudConnectorPrRunsRunIdRecoverInput) (*models.EndpointsContextRecoverCloudConnectorProposalOutput, error) { + path := "/context/cloud-connector-pr/runs/{runId}/recover" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ConfirmNoPullRequest bool `json:"confirmNoPullRequest"` + Digest string `json:"digest"` + }{ + ConfirmNoPullRequest: in.ConfirmNoPullRequest, + Digest: in.Digest, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsContextRecoverCloudConnectorProposalOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudConnectorPrStatusInput is the input for ListContextCloudConnectorPrStatus — Get Cloud Connector PR Status. +type ListContextCloudConnectorPrStatusInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudConnectorPrStatus - Get Cloud Connector PR Status +// GET /context/cloud-connector-pr/status +func (c *Client) ListContextCloudConnectorPrStatus(ctx context.Context, in ListContextCloudConnectorPrStatusInput) (*models.EndpointsContextGetCloudConnectorPRStatusOutput, error) { + path := "/context/cloud-connector-pr/status" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsContextGetCloudConnectorPRStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdCrossAccountRelationshipsInput is the input for ListContextCloudReconAccountsAccountIdCrossAccountRelationships — Get Cloud Recon Cross-Account Relationships. +type ListContextCloudReconAccountsAccountIdCrossAccountRelationshipsInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdCrossAccountRelationships - Get Cloud Recon Cross-Account Relationships +// GET /context/cloud-recon/accounts/{accountId}/cross-account-relationships +func (c *Client) ListContextCloudReconAccountsAccountIdCrossAccountRelationships(ctx context.Context, in ListContextCloudReconAccountsAccountIdCrossAccountRelationshipsInput) (*models.EndpointsGetCloudReconCrossAccountRelationshipsOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/cross-account-relationships" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconCrossAccountRelationshipsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdDiscoveredNodesInput is the input for ListContextCloudReconAccountsAccountIdDiscoveredNodes — Get Cloud Recon Discovered Nodes. +type ListContextCloudReconAccountsAccountIdDiscoveredNodesInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + ObjectType *string `url:"objectType,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Source *string `url:"source,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdDiscoveredNodes - Get Cloud Recon Discovered Nodes +// GET /context/cloud-recon/accounts/{accountId}/discovered-nodes +func (c *Client) ListContextCloudReconAccountsAccountIdDiscoveredNodes(ctx context.Context, in ListContextCloudReconAccountsAccountIdDiscoveredNodesInput) (*models.EndpointsGetCloudReconDiscoveredNodesOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/discovered-nodes" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.ObjectType != nil { + query.Set("objectType", string(*in.ObjectType)) + } + if in.Source != nil { + query.Set("source", string(*in.Source)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconDiscoveredNodesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdGraphGapsInput is the input for ListContextCloudReconAccountsAccountIdGraphGaps — Get Cloud Recon Graph Gaps. +type ListContextCloudReconAccountsAccountIdGraphGapsInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdGraphGaps - Get Cloud Recon Graph Gaps +// GET /context/cloud-recon/accounts/{accountId}/graph-gaps +func (c *Client) ListContextCloudReconAccountsAccountIdGraphGaps(ctx context.Context, in ListContextCloudReconAccountsAccountIdGraphGapsInput) (*models.EndpointsGetCloudReconGraphGapsOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/graph-gaps" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconGraphGapsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdHotspotsInput is the input for ListContextCloudReconAccountsAccountIdHotspots — Get Cloud Recon Hotspots. +type ListContextCloudReconAccountsAccountIdHotspotsInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Severity *string `url:"severity,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdHotspots - Get Cloud Recon Hotspots +// GET /context/cloud-recon/accounts/{accountId}/hotspots +func (c *Client) ListContextCloudReconAccountsAccountIdHotspots(ctx context.Context, in ListContextCloudReconAccountsAccountIdHotspotsInput) (*models.EndpointsGetCloudReconHotspotsOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/hotspots" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Severity != nil { + query.Set("severity", string(*in.Severity)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconHotspotsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdIamPostureInput is the input for ListContextCloudReconAccountsAccountIdIamPosture — Get Cloud Recon IAM Posture. +type ListContextCloudReconAccountsAccountIdIamPostureInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdIamPosture - Get Cloud Recon IAM Posture +// GET /context/cloud-recon/accounts/{accountId}/iam-posture +func (c *Client) ListContextCloudReconAccountsAccountIdIamPosture(ctx context.Context, in ListContextCloudReconAccountsAccountIdIamPostureInput) (*models.EndpointsGetCloudReconIamPostureOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/iam-posture" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconIamPostureOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdNetworkExposuresInput is the input for ListContextCloudReconAccountsAccountIdNetworkExposures — Get Cloud Recon Network Exposures. +type ListContextCloudReconAccountsAccountIdNetworkExposuresInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdNetworkExposures - Get Cloud Recon Network Exposures +// GET /context/cloud-recon/accounts/{accountId}/network-exposures +func (c *Client) ListContextCloudReconAccountsAccountIdNetworkExposures(ctx context.Context, in ListContextCloudReconAccountsAccountIdNetworkExposuresInput) (*models.EndpointsGetCloudReconNetworkExposuresOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/network-exposures" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconNetworkExposuresOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdOverviewInput is the input for ListContextCloudReconAccountsAccountIdOverview — Get Cloud Recon Account Overview. +type ListContextCloudReconAccountsAccountIdOverviewInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdOverview - Get Cloud Recon Account Overview +// GET /context/cloud-recon/accounts/{accountId}/overview +func (c *Client) ListContextCloudReconAccountsAccountIdOverview(ctx context.Context, in ListContextCloudReconAccountsAccountIdOverviewInput) (*models.EndpointsGetCloudReconAccountOverviewOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/overview" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconAccountOverviewOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdScansLatestInput is the input for ListContextCloudReconAccountsAccountIdScansLatest — Get Latest Cloud Recon Scan. +type ListContextCloudReconAccountsAccountIdScansLatestInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ScanID *string `url:"scanId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdScansLatest - Get Latest Cloud Recon Scan +// GET /context/cloud-recon/accounts/{accountId}/scans/latest +func (c *Client) ListContextCloudReconAccountsAccountIdScansLatest(ctx context.Context, in ListContextCloudReconAccountsAccountIdScansLatestInput) (*models.EndpointsGetLatestCloudReconScanOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/scans/latest" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.ScanID != nil { + query.Set("scanId", string(*in.ScanID)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetLatestCloudReconScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdSecurityBoundariesInput is the input for ListContextCloudReconAccountsAccountIdSecurityBoundaries — Get Cloud Recon Security Boundaries. +type ListContextCloudReconAccountsAccountIdSecurityBoundariesInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdSecurityBoundaries - Get Cloud Recon Security Boundaries +// GET /context/cloud-recon/accounts/{accountId}/security-boundaries +func (c *Client) ListContextCloudReconAccountsAccountIdSecurityBoundaries(ctx context.Context, in ListContextCloudReconAccountsAccountIdSecurityBoundariesInput) (*models.EndpointsGetCloudReconSecurityBoundariesOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/security-boundaries" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconSecurityBoundariesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdSynthesisLatestInput is the input for ListContextCloudReconAccountsAccountIdSynthesisLatest — Get Latest Cloud Recon Account Synthesis. +type ListContextCloudReconAccountsAccountIdSynthesisLatestInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ScanID *string `url:"scanId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdSynthesisLatest - Get Latest Cloud Recon Account Synthesis +// GET /context/cloud-recon/accounts/{accountId}/synthesis/latest +func (c *Client) ListContextCloudReconAccountsAccountIdSynthesisLatest(ctx context.Context, in ListContextCloudReconAccountsAccountIdSynthesisLatestInput) (*models.EndpointsGetCloudReconAccountSynthesisOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/synthesis/latest" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.ScanID != nil { + query.Set("scanId", string(*in.ScanID)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconAccountSynthesisOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdTopologyInput is the input for ListContextCloudReconAccountsAccountIdTopology — Get Cloud Recon Topology. +type ListContextCloudReconAccountsAccountIdTopologyInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdTopology - Get Cloud Recon Topology +// GET /context/cloud-recon/accounts/{accountId}/topology +func (c *Client) ListContextCloudReconAccountsAccountIdTopology(ctx context.Context, in ListContextCloudReconAccountsAccountIdTopologyInput) (*models.EndpointsGetCloudReconTopologyOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/topology" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconTopologyOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdTrafficFlowsInput is the input for ListContextCloudReconAccountsAccountIdTrafficFlows — Get Cloud Recon Traffic Flows. +type ListContextCloudReconAccountsAccountIdTrafficFlowsInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdTrafficFlows - Get Cloud Recon Traffic Flows +// GET /context/cloud-recon/accounts/{accountId}/traffic-flows +func (c *Client) ListContextCloudReconAccountsAccountIdTrafficFlows(ctx context.Context, in ListContextCloudReconAccountsAccountIdTrafficFlowsInput) (*models.EndpointsGetCloudReconTrafficFlowsOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/traffic-flows" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconTrafficFlowsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconAccountsAccountIdTrustedServicesInput is the input for ListContextCloudReconAccountsAccountIdTrustedServices — Get Cloud Recon Trusted Services. +type ListContextCloudReconAccountsAccountIdTrustedServicesInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconAccountsAccountIdTrustedServices - Get Cloud Recon Trusted Services +// GET /context/cloud-recon/accounts/{accountId}/trusted-services +func (c *Client) ListContextCloudReconAccountsAccountIdTrustedServices(ctx context.Context, in ListContextCloudReconAccountsAccountIdTrustedServicesInput) (*models.EndpointsGetCloudReconTrustedServicesOutput, error) { + path := "/context/cloud-recon/accounts/{accountId}/trusted-services" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconTrustedServicesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconOrganizationSynthesisLatestInput is the input for ListContextCloudReconOrganizationSynthesisLatest — Get Latest Cloud Recon Org Synthesis. +type ListContextCloudReconOrganizationSynthesisLatestInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ScanRunID *string `url:"scanRunId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconOrganizationSynthesisLatest - Get Latest Cloud Recon Org Synthesis +// GET /context/cloud-recon/organization/synthesis/latest +func (c *Client) ListContextCloudReconOrganizationSynthesisLatest(ctx context.Context, in ListContextCloudReconOrganizationSynthesisLatestInput) (*models.EndpointsGetCloudReconOrgSynthesisOutput, error) { + path := "/context/cloud-recon/organization/synthesis/latest" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.ScanRunID != nil { + query.Set("scanRunId", string(*in.ScanRunID)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconOrgSynthesisOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextCloudReconScansInput is the input for CreateContextCloudReconScans — Persist Cloud Recon Scan. +type CreateContextCloudReconScansInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AccountID string `json:"accountId"` + CompletedAt *string `json:"completedAt,omitempty"` + ModelName *string `json:"modelName,omitempty"` + Payload string `json:"payload"` + Provider string `json:"provider"` + ScanID *string `json:"scanId,omitempty"` + SchemaVersion string `json:"schemaVersion"` + StartedAt string `json:"startedAt"` + models.RequestScope +} + +// CreateContextCloudReconScans - Persist Cloud Recon Scan +// POST /context/cloud-recon/scans +func (c *Client) CreateContextCloudReconScans(ctx context.Context, in CreateContextCloudReconScansInput) (*models.EndpointsPostCloudReconScanOutput, error) { + path := "/context/cloud-recon/scans" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AccountID string `json:"accountId"` + CompletedAt *string `json:"completedAt,omitempty"` + ModelName *string `json:"modelName,omitempty"` + Payload string `json:"payload"` + Provider string `json:"provider"` + ScanID *string `json:"scanId,omitempty"` + SchemaVersion string `json:"schemaVersion"` + StartedAt string `json:"startedAt"` + }{ + AccountID: in.AccountID, + CompletedAt: in.CompletedAt, + ModelName: in.ModelName, + Payload: in.Payload, + Provider: in.Provider, + ScanID: in.ScanID, + SchemaVersion: in.SchemaVersion, + StartedAt: in.StartedAt, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostCloudReconScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudReconTenantsCrossAccountTrustsInput is the input for ListContextCloudReconTenantsCrossAccountTrusts — Get Tenant Cloud Recon Cross-Account Trusts. +type ListContextCloudReconTenantsCrossAccountTrustsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudReconTenantsCrossAccountTrusts - Get Tenant Cloud Recon Cross-Account Trusts +// GET /context/cloud-recon/tenants/cross-account-trusts +func (c *Client) ListContextCloudReconTenantsCrossAccountTrusts(ctx context.Context, in ListContextCloudReconTenantsCrossAccountTrustsInput) (*models.EndpointsGetCloudReconTenantTrustsOutput, error) { + path := "/context/cloud-recon/tenants/cross-account-trusts" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCloudReconTenantTrustsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextCloudScanStartInput is the input for CreateContextCloudScanStart — Start Cloud Scan. +type CreateContextCloudScanStartInput struct { + AccountIds []string `url:"accountIds,omitempty" json:"-"` + ClusterIds []string `url:"clusterIds,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Provider *string `url:"provider,omitempty" json:"-"` + RebuildInfraGraph *bool `url:"rebuildInfraGraph,omitempty" json:"-"` + models.RequestScope +} + +// CreateContextCloudScanStart - Start Cloud Scan +// POST /context/cloud-scan/start +func (c *Client) CreateContextCloudScanStart(ctx context.Context, in CreateContextCloudScanStartInput) (*models.EndpointsContextStartCloudScanOutput, error) { + path := "/context/cloud-scan/start" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Provider != nil { + query.Set("provider", string(*in.Provider)) + } + for _, v := range in.ClusterIds { + query.Add("clusterIds", string(v)) + } + for _, v := range in.AccountIds { + query.Add("accountIds", string(v)) + } + if in.RebuildInfraGraph != nil { + query.Set("rebuildInfraGraph", strconv.FormatBool(*in.RebuildInfraGraph)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsContextStartCloudScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextCloudScanScanIdStatusInput is the input for ListContextCloudScanScanIdStatus — Get Cloud Scan Status. +type ListContextCloudScanScanIdStatusInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextCloudScanScanIdStatus - Get Cloud Scan Status +// GET /context/cloud-scan/{scanId}/status +func (c *Client) ListContextCloudScanScanIdStatus(ctx context.Context, in ListContextCloudScanScanIdStatusInput) (*models.EndpointsContextGetCloudScanStatusOutput, error) { + path := "/context/cloud-scan/{scanId}/status" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsContextGetCloudScanStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextDepsInput is the input for DeleteContextDeps — Delete dependency data. +type DeleteContextDepsInput struct { + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Global *bool `url:"global,omitempty" json:"-"` + IntroducedAt *string `url:"introducedAt,omitempty" json:"-"` + Name *string `url:"name,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + Version *string `url:"version,omitempty" json:"-"` + models.RequestScope +} + +// DeleteContextDeps - Delete dependency data +// DELETE /context/deps +func (c *Client) DeleteContextDeps(ctx context.Context, in DeleteContextDepsInput) (*models.EndpointsDeleteDepsOutput, error) { + path := "/context/deps" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Name != nil { + query.Set("name", string(*in.Name)) + } + if in.Version != nil { + query.Set("version", string(*in.Version)) + } + if in.IntroducedAt != nil { + query.Set("introducedAt", string(*in.IntroducedAt)) + } + if in.Global != nil { + query.Set("global", strconv.FormatBool(*in.Global)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteDepsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsInput is the input for ListContextDeps — List Tenant Wide Dependencies (Historical). +type ListContextDepsInput struct { + Cursor *string `url:"cursor,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PageSize *int32 `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDeps - List Tenant Wide Dependencies (Historical) +// GET /context/deps +func (c *Client) ListContextDeps(ctx context.Context, in ListContextDepsInput) (*models.EndpointsGetDepsOutput, error) { + path := "/context/deps" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDepsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsActiveInput is the input for ListContextDepsActive — List Tenant Wide Active Dependencies. +type ListContextDepsActiveInput struct { + Cursor *string `url:"cursor,omitempty" json:"-"` + Direct *bool `url:"direct,omitempty" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name *string `url:"name,omitempty" json:"-"` + PageSize *int32 `url:"pageSize,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + Range *string `url:"range,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsActive - List Tenant Wide Active Dependencies +// GET /context/deps/active +func (c *Client) ListContextDepsActive(ctx context.Context, in ListContextDepsActiveInput) (*models.EndpointsGetActiveDepsOutput, error) { + path := "/context/deps/active" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Name != nil { + query.Set("name", string(*in.Name)) + } + if in.Direct != nil { + query.Set("direct", strconv.FormatBool(*in.Direct)) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.Range != nil { + query.Set("range", string(*in.Range)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetActiveDepsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsActiveSummaryInput is the input for ListContextDepsActiveSummary — Tenant Wide Active Dependency Summary. +type ListContextDepsActiveSummaryInput struct { + Direct *bool `url:"direct,omitempty" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name *string `url:"name,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + Range *string `url:"range,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsActiveSummary - Tenant Wide Active Dependency Summary +// GET /context/deps/active/summary +func (c *Client) ListContextDepsActiveSummary(ctx context.Context, in ListContextDepsActiveSummaryInput) (*models.EndpointsGetActiveDepsSummaryOutput, error) { + path := "/context/deps/active/summary" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Name != nil { + query.Set("name", string(*in.Name)) + } + if in.Direct != nil { + query.Set("direct", strconv.FormatBool(*in.Direct)) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.Range != nil { + query.Set("range", string(*in.Range)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetActiveDepsSummaryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsByRefBomRefInput is the input for ListContextDepsByRefBomRef — Get Dependencies by Bom Ref. +type ListContextDepsByRefBomRefInput struct { + BomRef string `path:"bomRef" json:"-"` + Cursor *string `url:"cursor,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PageSize *int32 `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsByRefBomRef - Get Dependencies by Bom Ref +// GET /context/deps/by-ref/{bomRef} +func (c *Client) ListContextDepsByRefBomRef(ctx context.Context, in ListContextDepsByRefBomRefInput) (*models.EndpointsGetDepsByBomRefOutput, error) { + path := "/context/deps/by-ref/{bomRef}" + path = strings.Replace(path, "{bomRef}", url.PathEscape(in.BomRef), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDepsByBomRefOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsDependentsBomRefInput is the input for ListContextDepsDependentsBomRef — List Dependents of a Bom Ref. +type ListContextDepsDependentsBomRefInput struct { + BomRef string `path:"bomRef" json:"-"` + Cursor *string `url:"cursor,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PageSize *int32 `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsDependentsBomRef - List Dependents of a Bom Ref +// GET /context/deps/dependents/{bomRef} +func (c *Client) ListContextDepsDependentsBomRef(ctx context.Context, in ListContextDepsDependentsBomRefInput) (*models.EndpointsGetDepsDependentsOutput, error) { + path := "/context/deps/dependents/{bomRef}" + path = strings.Replace(path, "{bomRef}", url.PathEscape(in.BomRef), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDepsDependentsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsExposureInput is the input for ListContextDepsExposure — Global package exposure by version filter (semver or hash). +type ListContextDepsExposureInput struct { + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name *string `url:"name,omitempty" json:"-"` + Range *string `url:"range,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsExposure - Global package exposure by version filter (semver or hash) +// GET /context/deps/exposure +func (c *Client) ListContextDepsExposure(ctx context.Context, in ListContextDepsExposureInput) (*models.EndpointsGetExposureOutput, error) { + path := "/context/deps/exposure" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Name != nil { + query.Set("name", string(*in.Name)) + } + if in.Range != nil { + query.Set("range", string(*in.Range)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetExposureOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdActive — List Active Dependencies. +type ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + Direct *bool `url:"direct,omitempty" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdActive - List Active Dependencies +// GET /context/deps/repository/{repositoryId}/project/{projectId}/active +func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdActive(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput) (*models.EndpointsGetProjectActiveDepsOutput, error) { + path := "/context/deps/repository/{repositoryId}/project/{projectId}/active" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Direct != nil { + query.Set("direct", strconv.FormatBool(*in.Direct)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectActiveDepsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit — Dependencies at commit. +type ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + Commit string `path:"commit" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit - Dependencies at commit +// GET /context/deps/repository/{repositoryId}/project/{projectId}/at/{commit} +func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput) (*models.EndpointsGetDepsAtCommitOutput, error) { + path := "/context/deps/repository/{repositoryId}/project/{projectId}/at/{commit}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + path = strings.Replace(path, "{commit}", url.PathEscape(in.Commit), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDepsAtCommitOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff — Dependency diff between two commits. +type ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + FromCommit *string `url:"fromCommit,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ToCommit *string `url:"toCommit,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff - Dependency diff between two commits +// GET /context/deps/repository/{repositoryId}/project/{projectId}/diff +func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput) (*models.EndpointsGetDepsDiffOutput, error) { + path := "/context/deps/repository/{repositoryId}/project/{projectId}/diff" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.FromCommit != nil { + query.Set("fromCommit", string(*in.FromCommit)) + } + if in.ToCommit != nil { + query.Set("toCommit", string(*in.ToCommit)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDepsDiffOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure — Project package exposure by version filter (semver or hash). +type ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name *string `url:"name,omitempty" json:"-"` + Range *string `url:"range,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure - Project package exposure by version filter (semver or hash) +// GET /context/deps/repository/{repositoryId}/project/{projectId}/exposure +func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput) (*models.EndpointsGetProjectExposureOutput, error) { + path := "/context/deps/repository/{repositoryId}/project/{projectId}/exposure" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Name != nil { + query.Set("name", string(*in.Name)) + } + if in.Range != nil { + query.Set("range", string(*in.Range)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectExposureOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput is the input for ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory — Package exposure history (windows). +type ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name *string `url:"name,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory - Package exposure history (windows) +// GET /context/deps/repository/{repositoryId}/project/{projectId}/history +func (c *Client) ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory(ctx context.Context, in ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput) (*models.EndpointsGetDepsHistoryOut, error) { + path := "/context/deps/repository/{repositoryId}/project/{projectId}/history" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Name != nil { + query.Set("name", string(*in.Name)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDepsHistoryOut + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextDepsWithoutLockfileInput is the input for ListContextDepsWithoutLockfile — List projects/repos without lockfiles. +type ListContextDepsWithoutLockfileInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Level *string `url:"level,omitempty" json:"-"` + models.RequestScope +} + +// ListContextDepsWithoutLockfile - List projects/repos without lockfiles +// GET /context/deps/without-lockfile +func (c *Client) ListContextDepsWithoutLockfile(ctx context.Context, in ListContextDepsWithoutLockfileInput) (*models.EndpointsGetDepsWithoutLockfileOutput, error) { + path := "/context/deps/without-lockfile" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Level != nil { + query.Set("level", string(*in.Level)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDepsWithoutLockfileOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextEntrypointsInput is the input for ListContextEntrypoints — List Entrypoints. +type ListContextEntrypointsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` + Kind *string `url:"kind,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextEntrypoints - List Entrypoints +// GET /context/entrypoints +func (c *Client) ListContextEntrypoints(ctx context.Context, in ListContextEntrypointsInput) (*models.EndpointsListEntrypointsOutput, error) { + path := "/context/entrypoints" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) + } + if in.Kind != nil { + query.Set("kind", string(*in.Kind)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.IncludeDeleted != nil { + query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListEntrypointsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextEntrypointsEntrypointIdInput is the input for DeleteContextEntrypointsEntrypointId — Delete Entrypoint. +type DeleteContextEntrypointsEntrypointIdInput struct { + EntrypointID string `path:"entrypointId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteContextEntrypointsEntrypointId - Delete Entrypoint +// DELETE /context/entrypoints/{entrypointId} +func (c *Client) DeleteContextEntrypointsEntrypointId(ctx context.Context, in DeleteContextEntrypointsEntrypointIdInput) (*models.EndpointsDeleteEntrypointOutput, error) { + path := "/context/entrypoints/{entrypointId}" + path = strings.Replace(path, "{entrypointId}", url.PathEscape(in.EntrypointID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteEntrypointOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextEntrypointsEntrypointIdInput is the input for GetContextEntrypointsEntrypointId — Get Entrypoint. +type GetContextEntrypointsEntrypointIdInput struct { + EntrypointID string `path:"entrypointId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextEntrypointsEntrypointId - Get Entrypoint +// GET /context/entrypoints/{entrypointId} +func (c *Client) GetContextEntrypointsEntrypointId(ctx context.Context, in GetContextEntrypointsEntrypointIdInput) (*models.EndpointsGetEntrypointOutput, error) { + path := "/context/entrypoints/{entrypointId}" + path = strings.Replace(path, "{entrypointId}", url.PathEscape(in.EntrypointID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetEntrypointOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextInfrastructureGraphsInput is the input for ListContextInfrastructureGraphs — List Infrastructure Graphs. +type ListContextInfrastructureGraphsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextInfrastructureGraphs - List Infrastructure Graphs +// GET /context/infrastructure/graphs +func (c *Client) ListContextInfrastructureGraphs(ctx context.Context, in ListContextInfrastructureGraphsInput) (*models.EndpointsListInfrastructureGraphsOutput, error) { + path := "/context/infrastructure/graphs" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListInfrastructureGraphsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextInfrastructureGraphsInfoInput is the input for ListContextInfrastructureGraphsInfo — Get Infrastructure Graph Info. +type ListContextInfrastructureGraphsInfoInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextInfrastructureGraphsInfo - Get Infrastructure Graph Info +// GET /context/infrastructure/graphs/info +func (c *Client) ListContextInfrastructureGraphsInfo(ctx context.Context, in ListContextInfrastructureGraphsInfoInput) (*models.EndpointsInfrastructureGraphInfo, error) { + path := "/context/infrastructure/graphs/info" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsInfrastructureGraphInfo + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextInfrastructureGraphsSummaryInput is the input for ListContextInfrastructureGraphsSummary — Get Infrastructure Graph Summary. +type ListContextInfrastructureGraphsSummaryInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextInfrastructureGraphsSummary - Get Infrastructure Graph Summary +// GET /context/infrastructure/graphs/summary +func (c *Client) ListContextInfrastructureGraphsSummary(ctx context.Context, in ListContextInfrastructureGraphsSummaryInput) (*models.EndpointsGetInfrastructureGraphSummaryOutput, error) { + path := "/context/infrastructure/graphs/summary" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetInfrastructureGraphSummaryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextInfrastructureGraphsAccountIdInput is the input for GetContextInfrastructureGraphsAccountId — Get Infrastructure Graph. +type GetContextInfrastructureGraphsAccountIdInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextInfrastructureGraphsAccountId - Get Infrastructure Graph +// GET /context/infrastructure/graphs/{accountId} +func (c *Client) GetContextInfrastructureGraphsAccountId(ctx context.Context, in GetContextInfrastructureGraphsAccountIdInput) (*models.EndpointsGetInfrastructureGraphOutput, error) { + path := "/context/infrastructure/graphs/{accountId}" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetInfrastructureGraphOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextInfrastructureGraphsAccountIdDownloadInput is the input for ListContextInfrastructureGraphsAccountIdDownload — Get Infrastructure Graph Download URL. +type ListContextInfrastructureGraphsAccountIdDownloadInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Version *string `url:"version,omitempty" json:"-"` + models.RequestScope +} + +// ListContextInfrastructureGraphsAccountIdDownload - Get Infrastructure Graph Download URL +// GET /context/infrastructure/graphs/{accountId}/download +func (c *Client) ListContextInfrastructureGraphsAccountIdDownload(ctx context.Context, in ListContextInfrastructureGraphsAccountIdDownloadInput) (*models.EndpointsGetInfrastructureGraphDownloadOutput, error) { + path := "/context/infrastructure/graphs/{accountId}/download" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Version != nil { + query.Set("version", string(*in.Version)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetInfrastructureGraphDownloadOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextInfrastructureGraphsAccountIdVersionsInput is the input for ListContextInfrastructureGraphsAccountIdVersions — List Infrastructure Graph Versions. +type ListContextInfrastructureGraphsAccountIdVersionsInput struct { + AccountID string `path:"accountId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextInfrastructureGraphsAccountIdVersions - List Infrastructure Graph Versions +// GET /context/infrastructure/graphs/{accountId}/versions +func (c *Client) ListContextInfrastructureGraphsAccountIdVersions(ctx context.Context, in ListContextInfrastructureGraphsAccountIdVersionsInput) (*models.EndpointsListInfrastructureGraphVersionsOutput, error) { + path := "/context/infrastructure/graphs/{accountId}/versions" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListInfrastructureGraphVersionsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextInfrastructureGraphsAccountIdVersionsVersionInput is the input for ListContextInfrastructureGraphsAccountIdVersionsVersion — Get Infrastructure Graph Version. +type ListContextInfrastructureGraphsAccountIdVersionsVersionInput struct { + AccountID string `path:"accountId" json:"-"` + Version string `path:"version" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextInfrastructureGraphsAccountIdVersionsVersion - Get Infrastructure Graph Version +// GET /context/infrastructure/graphs/{accountId}/versions/{version} +func (c *Client) ListContextInfrastructureGraphsAccountIdVersionsVersion(ctx context.Context, in ListContextInfrastructureGraphsAccountIdVersionsVersionInput) (*models.EndpointsGetInfrastructureGraphVersionOutput, error) { + path := "/context/infrastructure/graphs/{accountId}/versions/{version}" + path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) + path = strings.Replace(path, "{version}", url.PathEscape(in.Version), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetInfrastructureGraphVersionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextK8sCollectorClustersInput is the input for ListContextK8sCollectorClusters — List K8s Collector Clusters. +type ListContextK8sCollectorClustersInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextK8sCollectorClusters - List K8s Collector Clusters +// GET /context/k8s/collector-clusters +func (c *Client) ListContextK8sCollectorClusters(ctx context.Context, in ListContextK8sCollectorClustersInput) (*models.EndpointsListK8SCollectorClustersOutput, error) { + path := "/context/k8s/collector-clusters" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListK8SCollectorClustersOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextMemoriesInput is the input for ListContextMemories — Get Memories. +type ListContextMemoriesInput struct { + CreatedBy *string `url:"createdBy,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsLatest *bool `url:"isLatest,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + MemoryClass *string `url:"memoryClass,omitempty" json:"-"` + MemoryType *string `url:"memoryType,omitempty" json:"-"` + MinTrustTier *int `url:"minTrustTier,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Priority *string `url:"priority,omitempty" json:"-"` + ResourceID *string `url:"resourceId,omitempty" json:"-"` + ResourceType *string `url:"resourceType,omitempty" json:"-"` + Status *string `url:"status,omitempty" json:"-"` + models.RequestScope +} + +// ListContextMemories - Get Memories +// GET /context/memories +func (c *Client) ListContextMemories(ctx context.Context, in ListContextMemoriesInput) (*models.EndpointsGetMemoriesOutput, error) { + path := "/context/memories" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.ResourceID != nil { + query.Set("resourceId", string(*in.ResourceID)) + } + if in.ResourceType != nil { + query.Set("resourceType", string(*in.ResourceType)) + } + if in.MemoryType != nil { + query.Set("memoryType", string(*in.MemoryType)) + } + if in.Priority != nil { + query.Set("priority", string(*in.Priority)) + } + if in.IsLatest != nil { + query.Set("isLatest", strconv.FormatBool(*in.IsLatest)) + } + if in.MemoryClass != nil { + query.Set("memoryClass", string(*in.MemoryClass)) + } + if in.Status != nil { + query.Set("status", string(*in.Status)) + } + if in.MinTrustTier != nil { + query.Set("minTrustTier", strconv.Itoa(int(*in.MinTrustTier))) + } + if in.CreatedBy != nil { + query.Set("createdBy", string(*in.CreatedBy)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMemoriesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextMemoriesInput is the input for CreateContextMemories — Create Memory. +type CreateContextMemoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Anchors []string `json:"anchors,omitempty"` + Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` + CommentIds []string `json:"commentIds,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Content string `json:"content"` + CreatedBy *string `json:"createdBy,omitempty"` + CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` + EventTime *string `json:"eventTime,omitempty"` + IsUserCreated *bool `json:"isUserCreated,omitempty"` + MemoryClass *models.ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryID *string `json:"memoryId,omitempty"` + MemoryType models.ModelsMemoryMemoryType `json:"memoryType"` + Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` + ParentNoteID *string `json:"parentNoteId,omitempty"` + Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` + PromptVersion *string `json:"promptVersion,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *models.ModelsMemoryScope `json:"scope,omitempty"` + SourceEvent *string `json:"sourceEvent,omitempty"` + SupersedesMemoryID *string `json:"supersedesMemoryId,omitempty"` + Tags []string `json:"tags,omitempty"` + Title *string `json:"title,omitempty"` + TrustTier *int `json:"trustTier,omitempty"` + models.RequestScope +} + +// CreateContextMemories - Create Memory +// POST /context/memories +func (c *Client) CreateContextMemories(ctx context.Context, in CreateContextMemoriesInput) (*models.EndpointsPostMemoryOutput, error) { + path := "/context/memories" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Anchors []string `json:"anchors,omitempty"` + Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` + CommentIds []string `json:"commentIds,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Content string `json:"content"` + CreatedBy *string `json:"createdBy,omitempty"` + CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` + EventTime *string `json:"eventTime,omitempty"` + IsUserCreated *bool `json:"isUserCreated,omitempty"` + MemoryClass *models.ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryID *string `json:"memoryId,omitempty"` + MemoryType models.ModelsMemoryMemoryType `json:"memoryType"` + Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` + ParentNoteID *string `json:"parentNoteId,omitempty"` + Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` + PromptVersion *string `json:"promptVersion,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *models.ModelsMemoryScope `json:"scope,omitempty"` + SourceEvent *string `json:"sourceEvent,omitempty"` + SupersedesMemoryID *string `json:"supersedesMemoryId,omitempty"` + Tags []string `json:"tags,omitempty"` + Title *string `json:"title,omitempty"` + TrustTier *int `json:"trustTier,omitempty"` + }{ + Anchors: in.Anchors, + Citations: in.Citations, + CommentIds: in.CommentIds, + Confidence: in.Confidence, + Content: in.Content, + CreatedBy: in.CreatedBy, + CrossReferences: in.CrossReferences, + EventTime: in.EventTime, + IsUserCreated: in.IsUserCreated, + MemoryClass: in.MemoryClass, + MemoryID: in.MemoryID, + MemoryType: in.MemoryType, + Metadata: in.Metadata, + ParentNoteID: in.ParentNoteID, + Priority: in.Priority, + PromptVersion: in.PromptVersion, + ResourceID: in.ResourceID, + ResourceType: in.ResourceType, + Scope: in.Scope, + SourceEvent: in.SourceEvent, + SupersedesMemoryID: in.SupersedesMemoryID, + Tags: in.Tags, + Title: in.Title, + TrustTier: in.TrustTier, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostMemoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextMemoriesDocumentDocumentIdInput is the input for GetContextMemoriesDocumentDocumentId — Get Memories By Document. +type GetContextMemoriesDocumentDocumentIdInput struct { + DocumentID string `path:"documentId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + PaginationToken *string `url:"paginationToken,omitempty" json:"-"` + models.RequestScope +} + +// GetContextMemoriesDocumentDocumentId - Get Memories By Document +// GET /context/memories/document/{documentId} +func (c *Client) GetContextMemoriesDocumentDocumentId(ctx context.Context, in GetContextMemoriesDocumentDocumentIdInput) (*models.EndpointsGetMemoriesByDocumentOutput, error) { + path := "/context/memories/document/{documentId}" + path = strings.Replace(path, "{documentId}", url.PathEscape(in.DocumentID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.PaginationToken != nil { + query.Set("paginationToken", string(*in.PaginationToken)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMemoriesByDocumentOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextMemoriesDocumentDocumentIdTypeInput is the input for ListContextMemoriesDocumentDocumentIdType — Get Memories By Document And Type. +type ListContextMemoriesDocumentDocumentIdTypeInput struct { + DocumentID string `path:"documentId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + MemoryType *string `url:"memoryType,omitempty" json:"-"` + PaginationToken *string `url:"paginationToken,omitempty" json:"-"` + models.RequestScope +} + +// ListContextMemoriesDocumentDocumentIdType - Get Memories By Document And Type +// GET /context/memories/document/{documentId}/type +func (c *Client) ListContextMemoriesDocumentDocumentIdType(ctx context.Context, in ListContextMemoriesDocumentDocumentIdTypeInput) (*models.EndpointsGetMemoriesByDocumentAndTypeOutput, error) { + path := "/context/memories/document/{documentId}/type" + path = strings.Replace(path, "{documentId}", url.PathEscape(in.DocumentID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.MemoryType != nil { + query.Set("memoryType", string(*in.MemoryType)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.PaginationToken != nil { + query.Set("paginationToken", string(*in.PaginationToken)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMemoriesByDocumentAndTypeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextMemoriesGrepInput is the input for CreateContextMemoriesGrep — Grep Memories. +type CreateContextMemoriesGrepInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `json:"limit,omitempty"` + MemoryClass *models.ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryTypes []models.ModelsMemoryMemoryType `json:"memoryTypes,omitempty"` + MinTrustTier *int `json:"minTrustTier,omitempty"` + Pattern string `json:"pattern"` + ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *models.ModelsMemoryScope `json:"scope,omitempty"` + models.RequestScope +} + +// CreateContextMemoriesGrep - Grep Memories +// POST /context/memories/grep +func (c *Client) CreateContextMemoriesGrep(ctx context.Context, in CreateContextMemoriesGrepInput) (*models.EndpointsGrepMemoriesOutput, error) { + path := "/context/memories/grep" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Limit *int `json:"limit,omitempty"` + MemoryClass *models.ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryTypes []models.ModelsMemoryMemoryType `json:"memoryTypes,omitempty"` + MinTrustTier *int `json:"minTrustTier,omitempty"` + Pattern string `json:"pattern"` + ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *models.ModelsMemoryScope `json:"scope,omitempty"` + }{ + Limit: in.Limit, + MemoryClass: in.MemoryClass, + MemoryTypes: in.MemoryTypes, + MinTrustTier: in.MinTrustTier, + Pattern: in.Pattern, + ResourceType: in.ResourceType, + Scope: in.Scope, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsGrepMemoriesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextMemoriesSearchInput is the input for CreateContextMemoriesSearch — Search Memories. +type CreateContextMemoriesSearchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Anchors []string `json:"anchors,omitempty"` + IncludeOrgWide *bool `json:"includeOrgWide,omitempty"` + Limit *int `json:"limit,omitempty"` + MemoryClass *models.ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryTypes []models.ModelsMemoryMemoryType `json:"memoryTypes,omitempty"` + MinTrustTier *int `json:"minTrustTier,omitempty"` + Query string `json:"query"` + ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *models.ModelsMemoryScope `json:"scope,omitempty"` + models.RequestScope +} + +// CreateContextMemoriesSearch - Search Memories +// POST /context/memories/search +func (c *Client) CreateContextMemoriesSearch(ctx context.Context, in CreateContextMemoriesSearchInput) (*models.EndpointsSearchMemoriesOutput, error) { + path := "/context/memories/search" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Anchors []string `json:"anchors,omitempty"` + IncludeOrgWide *bool `json:"includeOrgWide,omitempty"` + Limit *int `json:"limit,omitempty"` + MemoryClass *models.ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryTypes []models.ModelsMemoryMemoryType `json:"memoryTypes,omitempty"` + MinTrustTier *int `json:"minTrustTier,omitempty"` + Query string `json:"query"` + ResourceType *models.ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *models.ModelsMemoryScope `json:"scope,omitempty"` + }{ + Anchors: in.Anchors, + IncludeOrgWide: in.IncludeOrgWide, + Limit: in.Limit, + MemoryClass: in.MemoryClass, + MemoryTypes: in.MemoryTypes, + MinTrustTier: in.MinTrustTier, + Query: in.Query, + ResourceType: in.ResourceType, + Scope: in.Scope, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsSearchMemoriesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextMemoriesTypeInput is the input for ListContextMemoriesType — Get Memories By Type. +type ListContextMemoriesTypeInput struct { + CreatedBy *string `url:"createdBy,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsLatest *bool `url:"isLatest,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + MemoryType *string `url:"memoryType,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + PaginationToken *string `url:"paginationToken,omitempty" json:"-"` + ResourceID *string `url:"resourceId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextMemoriesType - Get Memories By Type +// GET /context/memories/type +func (c *Client) ListContextMemoriesType(ctx context.Context, in ListContextMemoriesTypeInput) (*models.EndpointsGetMemoriesByTypeOutput, error) { + path := "/context/memories/type" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.MemoryType != nil { + query.Set("memoryType", string(*in.MemoryType)) + } + if in.CreatedBy != nil { + query.Set("createdBy", string(*in.CreatedBy)) + } + if in.ResourceID != nil { + query.Set("resourceId", string(*in.ResourceID)) + } + if in.IsLatest != nil { + query.Set("isLatest", strconv.FormatBool(*in.IsLatest)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.PaginationToken != nil { + query.Set("paginationToken", string(*in.PaginationToken)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMemoriesByTypeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextMemoriesMemoryIdInput is the input for DeleteContextMemoriesMemoryId — Delete Memory. +type DeleteContextMemoriesMemoryIdInput struct { + MemoryID string `path:"memoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Reason *string `url:"reason,omitempty" json:"-"` + models.RequestScope +} + +// DeleteContextMemoriesMemoryId - Delete Memory +// DELETE /context/memories/{memoryId} +func (c *Client) DeleteContextMemoriesMemoryId(ctx context.Context, in DeleteContextMemoriesMemoryIdInput) (*models.EndpointsDeleteMemoryOutput, error) { + path := "/context/memories/{memoryId}" + path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Reason != nil { + query.Set("reason", string(*in.Reason)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteMemoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextMemoriesMemoryIdInput is the input for GetContextMemoriesMemoryId — Get Memory. +type GetContextMemoriesMemoryIdInput struct { + MemoryID string `path:"memoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Version *string `url:"version,omitempty" json:"-"` + models.RequestScope +} + +// GetContextMemoriesMemoryId - Get Memory +// GET /context/memories/{memoryId} +func (c *Client) GetContextMemoriesMemoryId(ctx context.Context, in GetContextMemoriesMemoryIdInput) (*models.EndpointsGetMemoryOutput, error) { + path := "/context/memories/{memoryId}" + path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Version != nil { + query.Set("version", string(*in.Version)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMemoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchContextMemoriesMemoryIdInput is the input for PatchContextMemoriesMemoryId — Update Memory. +type PatchContextMemoriesMemoryIdInput struct { + MemoryID string `path:"memoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Content *string `json:"content,omitempty"` + CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` + Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` + ParentNoteID *string `json:"parentNoteId,omitempty"` + Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` + SupersedesMemoryID *string `json:"supersedesMemoryId,omitempty"` + Tags []string `json:"tags,omitempty"` + Title *string `json:"title,omitempty"` + models.RequestScope +} + +// PatchContextMemoriesMemoryId - Update Memory +// PATCH /context/memories/{memoryId} +func (c *Client) PatchContextMemoriesMemoryId(ctx context.Context, in PatchContextMemoriesMemoryIdInput) (*models.EndpointsPatchMemoryOutput, error) { + path := "/context/memories/{memoryId}" + path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Citations []models.ModelsMemoryCitationsElem `json:"citations,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Content *string `json:"content,omitempty"` + CrossReferences []models.ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` + Metadata *models.ModelsMemoryMetadata `json:"metadata,omitempty"` + ParentNoteID *string `json:"parentNoteId,omitempty"` + Priority *models.ModelsMemoryPriority `json:"priority,omitempty"` + SupersedesMemoryID *string `json:"supersedesMemoryId,omitempty"` + Tags []string `json:"tags,omitempty"` + Title *string `json:"title,omitempty"` + }{ + Citations: in.Citations, + Confidence: in.Confidence, + Content: in.Content, + CrossReferences: in.CrossReferences, + Metadata: in.Metadata, + ParentNoteID: in.ParentNoteID, + Priority: in.Priority, + SupersedesMemoryID: in.SupersedesMemoryID, + Tags: in.Tags, + Title: in.Title, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchMemoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextMemoriesMemoryIdFindingsInput is the input for ListContextMemoriesMemoryIdFindings — Get Memory Findings. +type ListContextMemoriesMemoryIdFindingsInput struct { + MemoryID string `path:"memoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + models.RequestScope +} + +// ListContextMemoriesMemoryIdFindings - Get Memory Findings +// GET /context/memories/{memoryId}/findings +func (c *Client) ListContextMemoriesMemoryIdFindings(ctx context.Context, in ListContextMemoriesMemoryIdFindingsInput) (*models.EndpointsGetMemoryFindingsOutput, error) { + path := "/context/memories/{memoryId}/findings" + path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMemoryFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextMemoriesMemoryIdRetractInput is the input for CreateContextMemoriesMemoryIdRetract — Retract Memory. +type CreateContextMemoriesMemoryIdRetractInput struct { + MemoryID string `path:"memoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Reason string `json:"reason"` + RetractedBy *string `json:"retractedBy,omitempty"` + models.RequestScope +} + +// CreateContextMemoriesMemoryIdRetract - Retract Memory +// POST /context/memories/{memoryId}/retract +func (c *Client) CreateContextMemoriesMemoryIdRetract(ctx context.Context, in CreateContextMemoriesMemoryIdRetractInput) (*models.EndpointsRetractMemoryOutput, error) { + path := "/context/memories/{memoryId}/retract" + path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Reason string `json:"reason"` + RetractedBy *string `json:"retractedBy,omitempty"` + }{ + Reason: in.Reason, + RetractedBy: in.RetractedBy, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsRetractMemoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextMemoriesMemoryIdVersionsInput is the input for ListContextMemoriesMemoryIdVersions — Get Memory Versions. +type ListContextMemoriesMemoryIdVersionsInput struct { + MemoryID string `path:"memoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + models.RequestScope +} + +// ListContextMemoriesMemoryIdVersions - Get Memory Versions +// GET /context/memories/{memoryId}/versions +func (c *Client) ListContextMemoriesMemoryIdVersions(ctx context.Context, in ListContextMemoriesMemoryIdVersionsInput) (*models.EndpointsGetMemoryVersionsOutput, error) { + path := "/context/memories/{memoryId}/versions" + path = strings.Replace(path, "{memoryId}", url.PathEscape(in.MemoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMemoryVersionsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextOrganizationInput is the input for ListContextOrganization — Get Organization Context. +type ListContextOrganizationInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextOrganization - Get Organization Context +// GET /context/organization +func (c *Client) ListContextOrganization(ctx context.Context, in ListContextOrganizationInput) (*models.EndpointsGetOrganizationOutput, error) { + path := "/context/organization" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetOrganizationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchContextOrganizationInput is the input for PatchContextOrganization — Update Classification of the Organization. +type PatchContextOrganizationInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + models.RequestScope +} + +// PatchContextOrganization - Update Classification of the Organization +// PATCH /context/organization +func (c *Client) PatchContextOrganization(ctx context.Context, in PatchContextOrganizationInput) ([]byte, error) { + path := "/context/organization" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + }{ + Name: in.Name, + Notes: in.Notes, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + return data, err +} + +// UpdateContextOrganizationInput is the input for UpdateContextOrganization — Upsert Classification of the Organization. +type UpdateContextOrganizationInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Organization *models.ModelsOrgContext `json:"organization,omitempty"` + models.RequestScope +} + +// UpdateContextOrganization - Upsert Classification of the Organization +// PUT /context/organization +func (c *Client) UpdateContextOrganization(ctx context.Context, in UpdateContextOrganizationInput) (*models.EndpointsCreateOrganizationOutput, error) { + path := "/context/organization" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Organization *models.ModelsOrgContext `json:"organization,omitempty"` + }{ + Organization: in.Organization, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsCreateOrganizationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextOrganizationRunsRunIdInput is the input for GetContextOrganizationRunsRunId — Get Organization Context Run. +type GetContextOrganizationRunsRunIdInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeResult *bool `url:"includeResult,omitempty" json:"-"` + models.RequestScope +} + +// GetContextOrganizationRunsRunId - Get Organization Context Run +// GET /context/organization/runs/{runId} +func (c *Client) GetContextOrganizationRunsRunId(ctx context.Context, in GetContextOrganizationRunsRunIdInput) (*models.EndpointsGetOrgContextRunOutput, error) { + path := "/context/organization/runs/{runId}" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.IncludeResult != nil { + query.Set("includeResult", strconv.FormatBool(*in.IncludeResult)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetOrgContextRunOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextRagResyncInput is the input for CreateContextRagResync — Resync RAG Vector Store. +type CreateContextRagResyncInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfluenceOnly *bool `json:"confluenceOnly,omitempty"` + models.RequestScope +} + +// CreateContextRagResync - Resync RAG Vector Store +// POST /context/rag/resync +func (c *Client) CreateContextRagResync(ctx context.Context, in CreateContextRagResyncInput) (*models.EndpointsPostRAGResyncOutput, error) { + path := "/context/rag/resync" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ConfluenceOnly *bool `json:"confluenceOnly,omitempty"` + }{ + ConfluenceOnly: in.ConfluenceOnly, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostRAGResyncOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepoScansInput is the input for ListContextRepoScans — List Repo Context Scans. +type ListContextRepoScansInput struct { + CommitSha *string `url:"commitSha,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` PageSize *int `url:"pageSize,omitempty" json:"-"` RepositoryID *string `url:"repositoryId,omitempty" json:"-"` - Status *string `url:"status,omitempty" json:"-"` + Status *string `url:"status,omitempty" json:"-"` + VersionsOnly *bool `url:"versionsOnly,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepoScans - List Repo Context Scans +// GET /context/repo-scans +func (c *Client) ListContextRepoScans(ctx context.Context, in ListContextRepoScansInput) (*models.EndpointsListRepoScansOutput, error) { + path := "/context/repo-scans" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.CommitSha != nil { + query.Set("commitSha", string(*in.CommitSha)) + } + if in.Status != nil { + query.Set("status", string(*in.Status)) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.VersionsOnly != nil { + query.Set("versionsOnly", strconv.FormatBool(*in.VersionsOnly)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListRepoScansOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextRepoScansInput is the input for CreateContextRepoScans — Create Repo Context Scan. +type CreateContextRepoScansInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` + RepositoryID string `json:"repositoryId"` + SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` + Status *string `json:"status,omitempty"` + SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` + models.RequestScope +} + +// CreateContextRepoScans - Create Repo Context Scan +// POST /context/repo-scans +func (c *Client) CreateContextRepoScans(ctx context.Context, in CreateContextRepoScansInput) (*models.EndpointsCreateRepoScanOutput, error) { + path := "/context/repo-scans" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` + RepositoryID string `json:"repositoryId"` + SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` + Status *string `json:"status,omitempty"` + SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` + }{ + Branch: in.Branch, + CommitSha: in.CommitSha, + ProjectsTouched: in.ProjectsTouched, + RepositoryID: in.RepositoryID, + SbomsGenerated: in.SbomsGenerated, + Status: in.Status, + SubagentsRun: in.SubagentsRun, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsCreateRepoScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextRepoScansScanIdInput is the input for GetContextRepoScansScanId — Get Repo Context Scan. +type GetContextRepoScansScanIdInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextRepoScansScanId - Get Repo Context Scan +// GET /context/repo-scans/{scanId} +func (c *Client) GetContextRepoScansScanId(ctx context.Context, in GetContextRepoScansScanIdInput) (*models.EndpointsGetRepoScanOutput, error) { + path := "/context/repo-scans/{scanId}" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRepoScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchContextRepoScansScanIdInput is the input for PatchContextRepoScansScanId — Update Repo Context Scan. +type PatchContextRepoScansScanIdInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CompletedAt *string `json:"completedAt,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` + SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` + Status *string `json:"status,omitempty"` + SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` + models.RequestScope +} + +// PatchContextRepoScansScanId - Update Repo Context Scan +// PATCH /context/repo-scans/{scanId} +func (c *Client) PatchContextRepoScansScanId(ctx context.Context, in PatchContextRepoScansScanIdInput) (*models.EndpointsPatchRepoScanOutput, error) { + path := "/context/repo-scans/{scanId}" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CompletedAt *string `json:"completedAt,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` + SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` + Status *string `json:"status,omitempty"` + SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` + }{ + CompletedAt: in.CompletedAt, + ErrorMessage: in.ErrorMessage, + ProjectsTouched: in.ProjectsTouched, + SbomsGenerated: in.SbomsGenerated, + Status: in.Status, + SubagentsRun: in.SubagentsRun, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchRepoScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextRepoScopeScansInput is the input for CreateContextRepoScopeScans — Start Repo-Scope Scan. +type CreateContextRepoScopeScansInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeArchived *bool `url:"includeArchived,omitempty" json:"-"` + IncludeArchivedBody *bool `json:"includeArchived,omitempty"` + models.RequestScope +} + +// CreateContextRepoScopeScans - Start Repo-Scope Scan +// POST /context/repo-scope/scans +func (c *Client) CreateContextRepoScopeScans(ctx context.Context, in CreateContextRepoScopeScansInput) (*models.EndpointsContextStartRepoScopeScanOutput, error) { + path := "/context/repo-scope/scans" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.IncludeArchived != nil { + query.Set("includeArchived", strconv.FormatBool(*in.IncludeArchived)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + IncludeArchived *bool `json:"includeArchived,omitempty"` + }{ + IncludeArchived: in.IncludeArchivedBody, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsContextStartRepoScopeScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextRepoScopeScansScanIdInput is the input for GetContextRepoScopeScansScanId — Get Repo-Scope Scan. +type GetContextRepoScopeScansScanIdInput struct { + ScanID string `path:"scanId" json:"-"` + ExecutionArn *string `url:"executionArn,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextRepoScopeScansScanId - Get Repo-Scope Scan +// GET /context/repo-scope/scans/{scanId} +func (c *Client) GetContextRepoScopeScansScanId(ctx context.Context, in GetContextRepoScopeScansScanIdInput) (*models.EndpointsGetRepoScopeScanOutput, error) { + path := "/context/repo-scope/scans/{scanId}" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.ExecutionArn != nil { + query.Set("executionArn", string(*in.ExecutionArn)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRepoScopeScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextReportsInput is the input for CreateContextReports — Create Report Generation Job. +type CreateContextReportsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Packages []models.EndpointsPackageFilter `json:"packages,omitempty"` + Repositories []string `json:"repositories,omitempty"` + models.RequestScope +} + +// CreateContextReports - Create Report Generation Job +// POST /context/reports +func (c *Client) CreateContextReports(ctx context.Context, in CreateContextReportsInput) (*models.EndpointsPostReportOutput, error) { + path := "/context/reports" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Packages []models.EndpointsPackageFilter `json:"packages,omitempty"` + Repositories []string `json:"repositories,omitempty"` + }{ + Packages: in.Packages, + Repositories: in.Repositories, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostReportOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextReportsJobIdInput is the input for GetContextReportsJobId — Get Report Status. +type GetContextReportsJobIdInput struct { + JobID string `path:"jobId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextReportsJobId - Get Report Status +// GET /context/reports/{jobId} +func (c *Client) GetContextReportsJobId(ctx context.Context, in GetContextReportsJobIdInput) (*models.EndpointsGetReportStatusOutput, error) { + path := "/context/reports/{jobId}" + path = strings.Replace(path, "{jobId}", url.PathEscape(in.JobID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetReportStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesInput is the input for ListContextRepositories — Get Contexts of Repositories. +type ListContextRepositoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` + SortBy *string `url:"sortBy,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositories - Get Contexts of Repositories +// GET /context/repositories +func (c *Client) ListContextRepositories(ctx context.Context, in ListContextRepositoriesInput) (*models.EndpointsGetRepositoriesOutput, error) { + path := "/context/repositories" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.SortBy != nil { + query.Set("sortBy", string(*in.SortBy)) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRepositoriesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextRepositoriesRepositoryIdInput is the input for DeleteContextRepositoriesRepositoryId — Delete Repository. +type DeleteContextRepositoriesRepositoryIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteContextRepositoriesRepositoryId - Delete Repository +// DELETE /context/repositories/{repositoryId} +func (c *Client) DeleteContextRepositoriesRepositoryId(ctx context.Context, in DeleteContextRepositoriesRepositoryIdInput) (*models.EndpointsDeleteRepositoryOutput, error) { + path := "/context/repositories/{repositoryId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteRepositoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextRepositoriesRepositoryIdInput is the input for GetContextRepositoriesRepositoryId — Get Repository. +type GetContextRepositoriesRepositoryIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + PreferURL *bool `url:"preferUrl,omitempty" json:"-"` + models.RequestScope +} + +// GetContextRepositoriesRepositoryId - Get Repository +// GET /context/repositories/{repositoryId} +func (c *Client) GetContextRepositoriesRepositoryId(ctx context.Context, in GetContextRepositoriesRepositoryIdInput) (*models.EndpointsGetRepositoryOutput, error) { + path := "/context/repositories/{repositoryId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.PreferURL != nil { + query.Set("preferUrl", strconv.FormatBool(*in.PreferURL)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRepositoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchContextRepositoriesRepositoryIdInput is the input for PatchContextRepositoriesRepositoryId — Update Repository. +type PatchContextRepositoriesRepositoryIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Name *string `json:"name,omitempty"` + models.RequestScope +} + +// PatchContextRepositoriesRepositoryId - Update Repository +// PATCH /context/repositories/{repositoryId} +func (c *Client) PatchContextRepositoriesRepositoryId(ctx context.Context, in PatchContextRepositoriesRepositoryIdInput) ([]byte, error) { + path := "/context/repositories/{repositoryId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Name *string `json:"name,omitempty"` + }{ + Name: in.Name, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + return data, err +} + +// CreateContextRepositoriesRepositoryIdExecutionRecipesDiscoverInput is the input for CreateContextRepositoriesRepositoryIdExecutionRecipesDiscover — Start Repository Execution Recipe Discovery. +type CreateContextRepositoriesRepositoryIdExecutionRecipesDiscoverInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Branch *string `json:"branch,omitempty"` + ProjectIds []string `json:"projectIds,omitempty"` + models.RequestScope +} + +// CreateContextRepositoriesRepositoryIdExecutionRecipesDiscover - Start Repository Execution Recipe Discovery +// POST /context/repositories/{repositoryId}/execution-recipes/discover +func (c *Client) CreateContextRepositoriesRepositoryIdExecutionRecipesDiscover(ctx context.Context, in CreateContextRepositoriesRepositoryIdExecutionRecipesDiscoverInput) (*models.EndpointsStartRepositoryExecutionRecipeDiscoveryOutput, error) { + path := "/context/repositories/{repositoryId}/execution-recipes/discover" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Branch *string `json:"branch,omitempty"` + ProjectIds []string `json:"projectIds,omitempty"` + }{ + Branch: in.Branch, + ProjectIds: in.ProjectIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsStartRepositoryExecutionRecipeDiscoveryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesRepositoryIdProjectsInput is the input for ListContextRepositoriesRepositoryIdProjects — List Projects. +type ListContextRepositoriesRepositoryIdProjectsInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositoriesRepositoryIdProjects - List Projects +// GET /context/repositories/{repositoryId}/projects +func (c *Client) ListContextRepositoriesRepositoryIdProjects(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsInput) (*models.EndpointsListRepositoryProjectsOutput, error) { + path := "/context/repositories/{repositoryId}/projects" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.IncludeDeleted != nil { + query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListRepositoryProjectsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput is the input for DeleteContextRepositoriesRepositoryIdProjectsProjectId — Delete Project. +type DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteContextRepositoriesRepositoryIdProjectsProjectId - Delete Project +// DELETE /context/repositories/{repositoryId}/projects/{projectId} +func (c *Client) DeleteContextRepositoriesRepositoryIdProjectsProjectId(ctx context.Context, in DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput) (*models.EndpointsDeleteProjectOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteProjectOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetContextRepositoriesRepositoryIdProjectsProjectIdInput is the input for GetContextRepositoriesRepositoryIdProjectsProjectId — Get Project. +type GetContextRepositoriesRepositoryIdProjectsProjectIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetContextRepositoriesRepositoryIdProjectsProjectId - Get Project +// GET /context/repositories/{repositoryId}/projects/{projectId} +func (c *Client) GetContextRepositoriesRepositoryIdProjectsProjectId(ctx context.Context, in GetContextRepositoriesRepositoryIdProjectsProjectIdInput) (*models.EndpointsGetProjectOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchContextRepositoriesRepositoryIdProjectsProjectIdInput is the input for PatchContextRepositoriesRepositoryIdProjectsProjectId — Update Project. +type PatchContextRepositoriesRepositoryIdProjectsProjectIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DeletedAt *string `json:"deletedAt,omitempty"` + Description *string `json:"description,omitempty"` + IsDeleted *bool `json:"isDeleted,omitempty"` + Metadata map[string]json.RawMessage `json:"metadata,omitempty"` + Tags []string `json:"tags,omitempty"` + models.RequestScope +} + +// PatchContextRepositoriesRepositoryIdProjectsProjectId - Update Project +// PATCH /context/repositories/{repositoryId}/projects/{projectId} +func (c *Client) PatchContextRepositoriesRepositoryIdProjectsProjectId(ctx context.Context, in PatchContextRepositoriesRepositoryIdProjectsProjectIdInput) (*models.EndpointsUpdateProjectOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DeletedAt *string `json:"deletedAt,omitempty"` + Description *string `json:"description,omitempty"` + IsDeleted *bool `json:"isDeleted,omitempty"` + Metadata map[string]json.RawMessage `json:"metadata,omitempty"` + Tags []string `json:"tags,omitempty"` + }{ + DeletedAt: in.DeletedAt, + Description: in.Description, + IsDeleted: in.IsDeleted, + Metadata: in.Metadata, + Tags: in.Tags, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsUpdateProjectOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipe — Get Project Execution Recipe. +type ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + AllowEdits *bool `url:"allowEdits,omitempty" json:"-"` + Capabilities *string `url:"capabilities,omitempty" json:"-"` + CommitSha *string `url:"commitSha,omitempty" json:"-"` + Docker *bool `url:"docker,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InputHash *string `url:"inputHash,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipe - Get Project Execution Recipe +// GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe +func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipe(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeInput) (*models.EndpointsGetProjectExecutionRecipeOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/execution-recipe" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.CommitSha != nil { + query.Set("commitSha", string(*in.CommitSha)) + } + if in.InputHash != nil { + query.Set("inputHash", string(*in.InputHash)) + } + if in.Docker != nil { + query.Set("docker", strconv.FormatBool(*in.Docker)) + } + if in.Capabilities != nil { + query.Set("capabilities", string(*in.Capabilities)) + } + if in.AllowEdits != nil { + query.Set("allowEdits", strconv.FormatBool(*in.AllowEdits)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectExecutionRecipeOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidationsInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidations — List Project Execution Recipe Validations. +type ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidationsInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidations - List Project Execution Recipe Validations +// GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/validations +func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidations(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidationsInput) (*models.EndpointsListProjectExecutionRecipeValidationsOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/validations" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListProjectExecutionRecipeValidationsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersionsInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersions — List Project Execution Recipe Versions. +type ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersionsInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersions - List Project Execution Recipe Versions +// GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/versions +func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersions(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersionsInput) (*models.EndpointsListProjectExecutionRecipeVersionsOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/versions" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListProjectExecutionRecipeVersionsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdSchema — Get Project Schema. +type ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdSchema - Get Project Schema +// GET /context/repositories/{repositoryId}/projects/{projectId}/schema +func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchema(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput) (*models.EndpointsGetProjectSchemaOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/schema" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectSchemaOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput is the input for CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema — Upload Project Schema. +type CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Content string `json:"content"` + Format models.ModelsSchemaFormat `json:"format"` + Type models.ModelsSchemaType `json:"type"` + models.RequestScope +} + +// CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema - Upload Project Schema +// POST /context/repositories/{repositoryId}/projects/{projectId}/schema +func (c *Client) CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema(ctx context.Context, in CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput) (*models.EndpointsPostProjectSchemaOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/schema" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Content string `json:"content"` + Format models.ModelsSchemaFormat `json:"format"` + Type models.ModelsSchemaType `json:"type"` + }{ + Content: in.Content, + Format: in.Format, + Type: in.Type, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostProjectSchemaOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata — Get Project Schema Metadata. +type ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata - Get Project Schema Metadata +// GET /context/repositories/{repositoryId}/projects/{projectId}/schema/metadata +func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput) (*models.EndpointsGetProjectSchemaMetadataOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/schema/metadata" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectSchemaMetadataOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw — Get Project Schema Raw File. +type ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw - Get Project Schema Raw File +// GET /context/repositories/{repositoryId}/projects/{projectId}/schema/raw +func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput) (*models.EndpointsGetProjectSchemaRawOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/schema/raw" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetProjectSchemaRawOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTriggerInput is the input for CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTrigger — Trigger Project Schema Reversing. +type CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTriggerInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Branch *string `json:"branch,omitempty"` + models.RequestScope +} + +// CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTrigger - Trigger Project Schema Reversing +// POST /context/repositories/{repositoryId}/projects/{projectId}/schema/trigger +func (c *Client) CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTrigger(ctx context.Context, in CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTriggerInput) (*models.EndpointsTriggerProjectSchemaOutput, error) { + path := "/context/repositories/{repositoryId}/projects/{projectId}/schema/trigger" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Branch *string `json:"branch,omitempty"` + }{ + Branch: in.Branch, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsTriggerProjectSchemaOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextRepositoriesRepositoryIdRepoContextTriggerInput is the input for CreateContextRepositoriesRepositoryIdRepoContextTrigger — Trigger Repository Context. +type CreateContextRepositoriesRepositoryIdRepoContextTriggerInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Branch *string `json:"branch,omitempty"` + Force *bool `json:"force,omitempty"` + PathPrefixes []string `json:"pathPrefixes,omitempty"` + Subagents []string `json:"subagents,omitempty"` + models.RequestScope +} + +// CreateContextRepositoriesRepositoryIdRepoContextTrigger - Trigger Repository Context +// POST /context/repositories/{repositoryId}/repo-context/trigger +func (c *Client) CreateContextRepositoriesRepositoryIdRepoContextTrigger(ctx context.Context, in CreateContextRepositoriesRepositoryIdRepoContextTriggerInput) (*models.EndpointsTriggerRepoContextOutput, error) { + path := "/context/repositories/{repositoryId}/repo-context/trigger" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Branch *string `json:"branch,omitempty"` + Force *bool `json:"force,omitempty"` + PathPrefixes []string `json:"pathPrefixes,omitempty"` + Subagents []string `json:"subagents,omitempty"` + }{ + Branch: in.Branch, + Force: in.Force, + PathPrefixes: in.PathPrefixes, + Subagents: in.Subagents, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsTriggerRepoContextOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextSbomingestorReplayInput is the input for CreateContextSbomingestorReplay — Compute Dependencies Repository/Project SBOM Ingest Replay. +type CreateContextSbomingestorReplayInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + GlobalReplay *bool `json:"globalReplay,omitempty"` + ProjectID *string `json:"projectID,omitempty"` + RepositoryID *string `json:"repositoryID,omitempty"` + models.RequestScope +} + +// CreateContextSbomingestorReplay - Compute Dependencies Repository/Project SBOM Ingest Replay +// POST /context/sbomingestor/replay +func (c *Client) CreateContextSbomingestorReplay(ctx context.Context, in CreateContextSbomingestorReplayInput) (*models.EndpointsSBOMIngestReplayOutput, error) { + path := "/context/sbomingestor/replay" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + GlobalReplay *bool `json:"globalReplay,omitempty"` + ProjectID *string `json:"projectID,omitempty"` + RepositoryID *string `json:"repositoryID,omitempty"` + }{ + GlobalReplay: in.GlobalReplay, + ProjectID: in.ProjectID, + RepositoryID: in.RepositoryID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsSBOMIngestReplayOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteContextSbomsInput is the input for DeleteContextSboms — Delete SBOMs for tenant. +type DeleteContextSbomsInput struct { + DryRun *bool `url:"dryRun,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + InvalidOnly *bool `url:"invalidOnly,omitempty" json:"-"` + ProjectID *string `url:"projectId,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` models.RequestScope } -// ListContextRepoScans - List Repo Context Scans -// GET /context/repo-scans -func (c *Client) ListContextRepoScans(ctx context.Context, in ListContextRepoScansInput) (*models.EndpointsListRepoScansOutput, error) { - path := "/context/repo-scans" +// DeleteContextSboms - Delete SBOMs for tenant +// DELETE /context/sboms +func (c *Client) DeleteContextSboms(ctx context.Context, in DeleteContextSbomsInput) (*models.EndpointsDeleteSBOMOutput, error) { + path := "/context/sboms" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } if in.RepositoryID != nil { query.Set("repositoryId", string(*in.RepositoryID)) } - if in.CommitSha != nil { - query.Set("commitSha", string(*in.CommitSha)) - } - if in.Status != nil { - query.Set("status", string(*in.Status)) + if in.ProjectID != nil { + query.Set("projectId", string(*in.ProjectID)) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) + if in.InvalidOnly != nil { + query.Set("invalidOnly", strconv.FormatBool(*in.InvalidOnly)) } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.DryRun != nil { + query.Set("dryRun", strconv.FormatBool(*in.DryRun)) } in.RequestScope.AddTo(query) @@ -2412,38 +8499,39 @@ func (c *Client) ListContextRepoScans(ctx context.Context, in ListContextRepoSca fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsListRepoScansOutput + var out models.EndpointsDeleteSBOMOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextRepoScansInput is the input for CreateContextRepoScans — Create Repo Context Scan. -type CreateContextRepoScansInput struct { - Branch *string `json:"branch,omitempty"` - CommitSha string `json:"commitSha"` - ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` +// CreateContextSbomsGenerateInput is the input for CreateContextSbomsGenerate — Generate SBOM. +type CreateContextSbomsGenerateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CloneURL *string `json:"cloneUrl,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + DefaultBranch *string `json:"defaultBranch,omitempty"` RepositoryID string `json:"repositoryId"` - SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` - Status *string `json:"status,omitempty"` - SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` models.RequestScope } -// CreateContextRepoScans - Create Repo Context Scan -// POST /context/repo-scans -func (c *Client) CreateContextRepoScans(ctx context.Context, in CreateContextRepoScansInput) (*models.EndpointsCreateRepoScanOutput, error) { - path := "/context/repo-scans" +// CreateContextSbomsGenerate - Generate SBOM +// POST /context/sboms/generate +func (c *Client) CreateContextSbomsGenerate(ctx context.Context, in CreateContextSbomsGenerateInput) (*models.EndpointsPostSBOMGenerateOutput, error) { + path := "/context/sboms/generate" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2452,21 +8540,15 @@ func (c *Client) CreateContextRepoScans(ctx context.Context, in CreateContextRep } bodyBytes, err := json.Marshal(struct { - Branch *string `json:"branch,omitempty"` - CommitSha string `json:"commitSha"` - ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` + CloneURL *string `json:"cloneUrl,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + DefaultBranch *string `json:"defaultBranch,omitempty"` RepositoryID string `json:"repositoryId"` - SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` - Status *string `json:"status,omitempty"` - SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` }{ - Branch: in.Branch, + CloneURL: in.CloneURL, CommitSha: in.CommitSha, - ProjectsTouched: in.ProjectsTouched, + DefaultBranch: in.DefaultBranch, RepositoryID: in.RepositoryID, - SbomsGenerated: in.SbomsGenerated, - Status: in.Status, - SubagentsRun: in.SubagentsRun, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2475,29 +8557,33 @@ func (c *Client) CreateContextRepoScans(ctx context.Context, in CreateContextRep if err != nil { return nil, err } - var out models.EndpointsCreateRepoScanOutput + var out models.EndpointsPostSBOMGenerateOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextRepoScansScanIdInput is the input for GetContextRepoScansScanId — Get Repo Context Scan. -type GetContextRepoScansScanIdInput struct { - ScanID string `path:"scanId" json:"-"` +// ListContextSbomsRepositoryRepositoryIdLatestInput is the input for ListContextSbomsRepositoryRepositoryIdLatest — Get Latest SBOMs for Repository. +type ListContextSbomsRepositoryRepositoryIdLatestInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetContextRepoScansScanId - Get Repo Context Scan -// GET /context/repo-scans/{scanId} -func (c *Client) GetContextRepoScansScanId(ctx context.Context, in GetContextRepoScansScanIdInput) (*models.EndpointsGetRepoScanOutput, error) { - path := "/context/repo-scans/{scanId}" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// ListContextSbomsRepositoryRepositoryIdLatest - Get Latest SBOMs for Repository +// GET /context/sboms/repository/{repositoryId}/latest +func (c *Client) ListContextSbomsRepositoryRepositoryIdLatest(ctx context.Context, in ListContextSbomsRepositoryRepositoryIdLatestInput) (*models.EndpointsGetLatestSBOMsOutput, error) { + path := "/context/sboms/repository/{repositoryId}/latest" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2509,35 +8595,109 @@ func (c *Client) GetContextRepoScansScanId(ctx context.Context, in GetContextRep if err != nil { return nil, err } - var out models.EndpointsGetRepoScanOutput + var out models.EndpointsGetLatestSBOMsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchContextRepoScansScanIdInput is the input for PatchContextRepoScansScanId — Update Repo Context Scan. -type PatchContextRepoScansScanIdInput struct { - ScanID string `path:"scanId" json:"-"` - CompletedAt *string `json:"completedAt,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` - SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` - Status *string `json:"status,omitempty"` - SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` +// GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput is the input for GetContextSbomsRepositoryRepositoryIdProjectProjectId — Get Repository/Project SBOMs. +type GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + ProjectID string `path:"projectId" json:"-"` + FromCommit *string `url:"fromCommit,omitempty" json:"-"` + FromTime *string `url:"fromTime,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + UntilCommit *string `url:"untilCommit,omitempty" json:"-"` + UntilTime *string `url:"untilTime,omitempty" json:"-"` models.RequestScope } -// PatchContextRepoScansScanId - Update Repo Context Scan -// PATCH /context/repo-scans/{scanId} -func (c *Client) PatchContextRepoScansScanId(ctx context.Context, in PatchContextRepoScansScanIdInput) (*models.EndpointsPatchRepoScanOutput, error) { - path := "/context/repo-scans/{scanId}" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// GetContextSbomsRepositoryRepositoryIdProjectProjectId - Get Repository/Project SBOMs +// GET /context/sboms/repository/{repositoryId}/project/{projectId} +func (c *Client) GetContextSbomsRepositoryRepositoryIdProjectProjectId(ctx context.Context, in GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput) (*models.EndpointsGetSBOMSOutput, error) { + path := "/context/sboms/repository/{repositoryId}/project/{projectId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.FromCommit != nil { + query.Set("fromCommit", string(*in.FromCommit)) + } + if in.UntilCommit != nil { + query.Set("untilCommit", string(*in.UntilCommit)) + } + if in.FromTime != nil { + query.Set("fromTime", string(*in.FromTime)) + } + if in.UntilTime != nil { + query.Set("untilTime", string(*in.UntilTime)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSBOMSOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateContextSbomsResolveInput is the input for CreateContextSbomsResolve — Get or generate SBOM. +type CreateContextSbomsResolveInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + BaselineOnly *bool `json:"baselineOnly,omitempty"` + Branch *string `json:"branch,omitempty"` + CdxgenMajor *int `json:"cdxgenMajor,omitempty"` + CloneURL *string `json:"cloneURL,omitempty"` + CommitSHA *string `json:"commitSHA,omitempty"` + IsDefaultBranchPush *bool `json:"isDefaultBranchPush,omitempty"` + LockfileSetHash *string `json:"lockfileSetHash,omitempty"` + ManifestOnly *bool `json:"manifestOnly,omitempty"` + OwnerProvider *models.ModelsOwnerProvider `json:"ownerProvider,omitempty"` + RepositoryID *string `json:"repositoryID,omitempty"` + RepositoryProvider *models.ModelsGitRepositoryProvider `json:"repositoryProvider,omitempty"` + ScannerVersion *string `json:"scannerVersion,omitempty"` + TenantID *string `json:"tenantID,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + models.RequestScope +} + +// CreateContextSbomsResolve - Get or generate SBOM +// POST /context/sboms/resolve +func (c *Client) CreateContextSbomsResolve(ctx context.Context, in CreateContextSbomsResolveInput) (*models.EndpointsPostSBOMResolveOutput, error) { + path := "/context/sboms/resolve" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2546,50 +8706,71 @@ func (c *Client) PatchContextRepoScansScanId(ctx context.Context, in PatchContex } bodyBytes, err := json.Marshal(struct { - CompletedAt *string `json:"completedAt,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProjectsTouched []models.EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` - SbomsGenerated []models.EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` - Status *string `json:"status,omitempty"` - SubagentsRun map[string]models.EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` + BaselineOnly *bool `json:"baselineOnly,omitempty"` + Branch *string `json:"branch,omitempty"` + CdxgenMajor *int `json:"cdxgenMajor,omitempty"` + CloneURL *string `json:"cloneURL,omitempty"` + CommitSHA *string `json:"commitSHA,omitempty"` + IsDefaultBranchPush *bool `json:"isDefaultBranchPush,omitempty"` + LockfileSetHash *string `json:"lockfileSetHash,omitempty"` + ManifestOnly *bool `json:"manifestOnly,omitempty"` + OwnerProvider *models.ModelsOwnerProvider `json:"ownerProvider,omitempty"` + RepositoryID *string `json:"repositoryID,omitempty"` + RepositoryProvider *models.ModelsGitRepositoryProvider `json:"repositoryProvider,omitempty"` + ScannerVersion *string `json:"scannerVersion,omitempty"` + TenantID *string `json:"tenantID,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` }{ - CompletedAt: in.CompletedAt, - ErrorMessage: in.ErrorMessage, - ProjectsTouched: in.ProjectsTouched, - SbomsGenerated: in.SbomsGenerated, - Status: in.Status, - SubagentsRun: in.SubagentsRun, + BaselineOnly: in.BaselineOnly, + Branch: in.Branch, + CdxgenMajor: in.CdxgenMajor, + CloneURL: in.CloneURL, + CommitSHA: in.CommitSHA, + IsDefaultBranchPush: in.IsDefaultBranchPush, + LockfileSetHash: in.LockfileSetHash, + ManifestOnly: in.ManifestOnly, + OwnerProvider: in.OwnerProvider, + RepositoryID: in.RepositoryID, + RepositoryProvider: in.RepositoryProvider, + ScannerVersion: in.ScannerVersion, + TenantID: in.TenantID, + Timestamp: in.Timestamp, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchRepoScanOutput + var out models.EndpointsPostSBOMResolveOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextReportsInput is the input for CreateContextReports — Create Report Generation Job. -type CreateContextReportsInput struct { - Packages []models.EndpointsPackageFilter `json:"packages,omitempty"` - Repositories []string `json:"repositories,omitempty"` +// CreateContextSbomsRunsInput is the input for CreateContextSbomsRuns — Start SBOM Run. +type CreateContextSbomsRunsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + RepositoryID string `json:"repositoryId"` models.RequestScope } -// CreateContextReports - Create Report Generation Job -// POST /context/reports -func (c *Client) CreateContextReports(ctx context.Context, in CreateContextReportsInput) (*models.EndpointsPostReportOutput, error) { - path := "/context/reports" +// CreateContextSbomsRuns - Start SBOM Run +// POST /context/sboms/runs +func (c *Client) CreateContextSbomsRuns(ctx context.Context, in CreateContextSbomsRunsInput) (*models.EndpointsPostSBOMRunOutput, error) { + path := "/context/sboms/runs" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2598,11 +8779,13 @@ func (c *Client) CreateContextReports(ctx context.Context, in CreateContextRepor } bodyBytes, err := json.Marshal(struct { - Packages []models.EndpointsPackageFilter `json:"packages,omitempty"` - Repositories []string `json:"repositories,omitempty"` + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + RepositoryID string `json:"repositoryId"` }{ - Packages: in.Packages, - Repositories: in.Repositories, + Branch: in.Branch, + CommitSha: in.CommitSha, + RepositoryID: in.RepositoryID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -2611,29 +8794,35 @@ func (c *Client) CreateContextReports(ctx context.Context, in CreateContextRepor if err != nil { return nil, err } - var out models.EndpointsPostReportOutput + var out models.EndpointsPostSBOMRunOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextReportsJobIdInput is the input for GetContextReportsJobId — Get Report Status. -type GetContextReportsJobIdInput struct { - JobID string `path:"jobId" json:"-"` +// CreateContextSbomsScanInput is the input for CreateContextSbomsScan — Scan SBOM (get-or-generate). +type CreateContextSbomsScanInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CommitSha string `json:"commitSha"` + ForceRegenerate *bool `json:"forceRegenerate,omitempty"` + ProjectID string `json:"projectId"` + RepositoryID string `json:"repositoryId"` models.RequestScope } -// GetContextReportsJobId - Get Report Status -// GET /context/reports/{jobId} -func (c *Client) GetContextReportsJobId(ctx context.Context, in GetContextReportsJobIdInput) (*models.EndpointsGetReportStatusOutput, error) { - path := "/context/reports/{jobId}" - path = strings.Replace(path, "{jobId}", url.PathEscape(in.JobID), 1) +// CreateContextSbomsScan - Scan SBOM (get-or-generate) +// POST /context/sboms/scan +func (c *Client) CreateContextSbomsScan(ctx context.Context, in CreateContextSbomsScanInput) (*models.EndpointsPostSBOMScanOutput, error) { + path := "/context/sboms/scan" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2641,46 +8830,52 @@ func (c *Client) GetContextReportsJobId(ctx context.Context, in GetContextReport fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + CommitSha string `json:"commitSha"` + ForceRegenerate *bool `json:"forceRegenerate,omitempty"` + ProjectID string `json:"projectId"` + RepositoryID string `json:"repositoryId"` + }{ + CommitSha: in.CommitSha, + ForceRegenerate: in.ForceRegenerate, + ProjectID: in.ProjectID, + RepositoryID: in.RepositoryID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetReportStatusOutput + var out models.EndpointsPostSBOMScanOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextRepositoriesInput is the input for ListContextRepositories — Get Contexts of Repositories. -type ListContextRepositoriesInput struct { - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - Sort *string `url:"sort,omitempty" json:"-"` - SortBy *string `url:"sortBy,omitempty" json:"-"` +// ListContextSbomsTreeInput is the input for ListContextSbomsTree — Get SBOM key tree for tenant. +type ListContextSbomsTreeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Verbose *bool `url:"verbose,omitempty" json:"-"` models.RequestScope } -// ListContextRepositories - Get Contexts of Repositories -// GET /context/repositories -func (c *Client) ListContextRepositories(ctx context.Context, in ListContextRepositoriesInput) (*models.EndpointsGetRepositoriesOutput, error) { - path := "/context/repositories" +// ListContextSbomsTree - Get SBOM key tree for tenant +// GET /context/sboms/tree +func (c *Client) ListContextSbomsTree(ctx context.Context, in ListContextSbomsTreeInput) (*models.EndpointsGetSBOMTreeOutput, error) { + path := "/context/sboms/tree" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.SortBy != nil { - query.Set("sortBy", string(*in.SortBy)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.Sort != nil { - query.Set("sort", string(*in.Sort)) + if in.Verbose != nil { + query.Set("verbose", strconv.FormatBool(*in.Verbose)) } in.RequestScope.AddTo(query) @@ -2693,29 +8888,31 @@ func (c *Client) ListContextRepositories(ctx context.Context, in ListContextRepo if err != nil { return nil, err } - var out models.EndpointsGetRepositoriesOutput + var out models.EndpointsGetSBOMTreeOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextRepositoriesRepositoryIdInput is the input for DeleteContextRepositoriesRepositoryId — Delete Repository. -type DeleteContextRepositoriesRepositoryIdInput struct { - RepositoryID string `path:"repositoryId" json:"-"` +// ListContextSchemasInput is the input for ListContextSchemas — List Schemas. +type ListContextSchemasInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteContextRepositoriesRepositoryId - Delete Repository -// DELETE /context/repositories/{repositoryId} -func (c *Client) DeleteContextRepositoriesRepositoryId(ctx context.Context, in DeleteContextRepositoriesRepositoryIdInput) (*models.EndpointsDeleteRepositoryOutput, error) { - path := "/context/repositories/{repositoryId}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) +// ListContextSchemas - List Schemas +// GET /context/schemas +func (c *Client) ListContextSchemas(ctx context.Context, in ListContextSchemasInput) (*models.EndpointsListSchemasOutput, error) { + path := "/context/schemas" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2723,33 +8920,35 @@ func (c *Client) DeleteContextRepositoriesRepositoryId(ctx context.Context, in D fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteRepositoryOutput + var out models.EndpointsListSchemasOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextRepositoriesRepositoryIdInput is the input for GetContextRepositoriesRepositoryId — Get Repository. -type GetContextRepositoriesRepositoryIdInput struct { - RepositoryID string `path:"repositoryId" json:"-"` +// ListContextSetupRecommendationsPentestAssessmentsInput is the input for ListContextSetupRecommendationsPentestAssessments — List assessment setup proposals. +type ListContextSetupRecommendationsPentestAssessmentsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetContextRepositoriesRepositoryId - Get Repository -// GET /context/repositories/{repositoryId} -func (c *Client) GetContextRepositoriesRepositoryId(ctx context.Context, in GetContextRepositoriesRepositoryIdInput) (*models.EndpointsGetRepositoryOutput, error) { - path := "/context/repositories/{repositoryId}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) +// ListContextSetupRecommendationsPentestAssessments - List assessment setup proposals +// GET /context/setup-recommendations/pentest-assessments +func (c *Client) ListContextSetupRecommendationsPentestAssessments(ctx context.Context, in ListContextSetupRecommendationsPentestAssessmentsInput) (*models.EndpointsSetupPentestAssessmentRecommendationsOutput, error) { + path := "/context/setup-recommendations/pentest-assessments" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2761,76 +8960,30 @@ func (c *Client) GetContextRepositoriesRepositoryId(ctx context.Context, in GetC if err != nil { return nil, err } - var out models.EndpointsGetRepositoryOutput + var out models.EndpointsSetupPentestAssessmentRecommendationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchContextRepositoriesRepositoryIdInput is the input for PatchContextRepositoriesRepositoryId — Update Repository. -type PatchContextRepositoriesRepositoryIdInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - Name *string `json:"name,omitempty"` - models.RequestScope -} - -// PatchContextRepositoriesRepositoryId - Update Repository -// PATCH /context/repositories/{repositoryId} -func (c *Client) PatchContextRepositoriesRepositoryId(ctx context.Context, in PatchContextRepositoriesRepositoryIdInput) ([]byte, error) { - path := "/context/repositories/{repositoryId}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - bodyBytes, err := json.Marshal(struct { - Name *string `json:"name,omitempty"` - }{ - Name: in.Name, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) - return data, err -} - -// ListContextRepositoriesRepositoryIdProjectsInput is the input for ListContextRepositoriesRepositoryIdProjects — List Projects. -type ListContextRepositoriesRepositoryIdProjectsInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - IncludeDeleted *bool `url:"includeDeleted,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` +// CreateContextSetupRecommendationsPentestAssessmentsRefreshInput is the input for CreateContextSetupRecommendationsPentestAssessmentsRefresh — Refresh assessment setup proposals. +type CreateContextSetupRecommendationsPentestAssessmentsRefreshInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextRepositoriesRepositoryIdProjects - List Projects -// GET /context/repositories/{repositoryId}/projects -func (c *Client) ListContextRepositoriesRepositoryIdProjects(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsInput) (*models.EndpointsListRepositoryProjectsOutput, error) { - path := "/context/repositories/{repositoryId}/projects" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) +// CreateContextSetupRecommendationsPentestAssessmentsRefresh - Refresh assessment setup proposals +// POST /context/setup-recommendations/pentest-assessments/refresh +func (c *Client) CreateContextSetupRecommendationsPentestAssessmentsRefresh(ctx context.Context, in CreateContextSetupRecommendationsPentestAssessmentsRefreshInput) (*models.EndpointsSetupPentestAssessmentRecommendationsOutput, error) { + path := "/context/setup-recommendations/pentest-assessments/refresh" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) - } - if in.IncludeDeleted != nil { - query.Set("includeDeleted", strconv.FormatBool(*in.IncludeDeleted)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2839,35 +8992,38 @@ func (c *Client) ListContextRepositoriesRepositoryIdProjects(ctx context.Context fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsListRepositoryProjectsOutput + var out models.EndpointsSetupPentestAssessmentRecommendationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput is the input for DeleteContextRepositoriesRepositoryIdProjectsProjectId — Delete Project. -type DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` +// CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAcceptInput is the input for CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAccept — Accept assessment setup proposal. +type CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAcceptInput struct { + RecommendationID string `path:"recommendationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApplicationID string `json:"applicationId"` models.RequestScope } -// DeleteContextRepositoriesRepositoryIdProjectsProjectId - Delete Project -// DELETE /context/repositories/{repositoryId}/projects/{projectId} -func (c *Client) DeleteContextRepositoriesRepositoryIdProjectsProjectId(ctx context.Context, in DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput) (*models.EndpointsDeleteProjectOutput, error) { - path := "/context/repositories/{repositoryId}/projects/{projectId}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAccept - Accept assessment setup proposal +// POST /context/setup-recommendations/pentest-assessments/{recommendationId}/accept +func (c *Client) CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAccept(ctx context.Context, in CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAcceptInput) (*models.EndpointsDecideSetupPentestAssessmentRecommendationOutput, error) { + path := "/context/setup-recommendations/pentest-assessments/{recommendationId}/accept" + path = strings.Replace(path, "{recommendationId}", url.PathEscape(in.RecommendationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2875,35 +9031,45 @@ func (c *Client) DeleteContextRepositoriesRepositoryIdProjectsProjectId(ctx cont fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ApplicationID string `json:"applicationId"` + }{ + ApplicationID: in.ApplicationID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsDeleteProjectOutput + var out models.EndpointsDecideSetupPentestAssessmentRecommendationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextRepositoriesRepositoryIdProjectsProjectIdInput is the input for GetContextRepositoriesRepositoryIdProjectsProjectId — Get Project. -type GetContextRepositoriesRepositoryIdProjectsProjectIdInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` +// CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismissInput is the input for CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismiss — Dismiss assessment setup proposal. +type CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismissInput struct { + RecommendationID string `path:"recommendationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetContextRepositoriesRepositoryIdProjectsProjectId - Get Project -// GET /context/repositories/{repositoryId}/projects/{projectId} -func (c *Client) GetContextRepositoriesRepositoryIdProjectsProjectId(ctx context.Context, in GetContextRepositoriesRepositoryIdProjectsProjectIdInput) (*models.EndpointsGetProjectOutput, error) { - path := "/context/repositories/{repositoryId}/projects/{projectId}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismiss - Dismiss assessment setup proposal +// POST /context/setup-recommendations/pentest-assessments/{recommendationId}/dismiss +func (c *Client) CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismiss(ctx context.Context, in CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismissInput) (*models.EndpointsDecideSetupPentestAssessmentRecommendationOutput, error) { + path := "/context/setup-recommendations/pentest-assessments/{recommendationId}/dismiss" + path = strings.Replace(path, "{recommendationId}", url.PathEscape(in.RecommendationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2911,92 +9077,71 @@ func (c *Client) GetContextRepositoriesRepositoryIdProjectsProjectId(ctx context fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetProjectOutput + var out models.EndpointsDecideSetupPentestAssessmentRecommendationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchContextRepositoriesRepositoryIdProjectsProjectIdInput is the input for PatchContextRepositoriesRepositoryIdProjectsProjectId — Update Project. -type PatchContextRepositoriesRepositoryIdProjectsProjectIdInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - DeletedAt *string `json:"deletedAt,omitempty"` - Description *string `json:"description,omitempty"` - IsDeleted *bool `json:"isDeleted,omitempty"` - Metadata map[string]json.RawMessage `json:"metadata,omitempty"` - Tags []string `json:"tags,omitempty"` +// ListContextSetupRecommendationsPentestTargetsInput is the input for ListContextSetupRecommendationsPentestTargets — List pentest target recommendations. +type ListContextSetupRecommendationsPentestTargetsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// PatchContextRepositoriesRepositoryIdProjectsProjectId - Update Project -// PATCH /context/repositories/{repositoryId}/projects/{projectId} -func (c *Client) PatchContextRepositoriesRepositoryIdProjectsProjectId(ctx context.Context, in PatchContextRepositoriesRepositoryIdProjectsProjectIdInput) (*models.EndpointsUpdateProjectOutput, error) { - path := "/context/repositories/{repositoryId}/projects/{projectId}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - bodyBytes, err := json.Marshal(struct { - DeletedAt *string `json:"deletedAt,omitempty"` - Description *string `json:"description,omitempty"` - IsDeleted *bool `json:"isDeleted,omitempty"` - Metadata map[string]json.RawMessage `json:"metadata,omitempty"` - Tags []string `json:"tags,omitempty"` - }{ - DeletedAt: in.DeletedAt, - Description: in.Description, - IsDeleted: in.IsDeleted, - Metadata: in.Metadata, - Tags: in.Tags, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) +// ListContextSetupRecommendationsPentestTargets - List pentest target recommendations +// GET /context/setup-recommendations/pentest-targets +func (c *Client) ListContextSetupRecommendationsPentestTargets(ctx context.Context, in ListContextSetupRecommendationsPentestTargetsInput) (*models.EndpointsSetupPentestTargetRecommendationsOutput, error) { + path := "/context/setup-recommendations/pentest-targets" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsUpdateProjectOutput + var out models.EndpointsSetupPentestTargetRecommendationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdSchema — Get Project Schema. -type ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` +// CreateContextSetupRecommendationsPentestTargetsRefreshInput is the input for CreateContextSetupRecommendationsPentestTargetsRefresh — Refresh pentest target recommendations. +type CreateContextSetupRecommendationsPentestTargetsRefreshInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextRepositoriesRepositoryIdProjectsProjectIdSchema - Get Project Schema -// GET /context/repositories/{repositoryId}/projects/{projectId}/schema -func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchema(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput) (*models.EndpointsGetProjectSchemaOutput, error) { - path := "/context/repositories/{repositoryId}/projects/{projectId}/schema" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// CreateContextSetupRecommendationsPentestTargetsRefresh - Refresh pentest target recommendations +// POST /context/setup-recommendations/pentest-targets/refresh +func (c *Client) CreateContextSetupRecommendationsPentestTargetsRefresh(ctx context.Context, in CreateContextSetupRecommendationsPentestTargetsRefreshInput) (*models.EndpointsSetupPentestTargetRecommendationsOutput, error) { + path := "/context/setup-recommendations/pentest-targets/refresh" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3004,38 +9149,38 @@ func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchema(ctx fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetProjectSchemaOutput + var out models.EndpointsSetupPentestTargetRecommendationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput is the input for CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema — Upload Project Schema. -type CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - Content string `json:"content"` - Format models.ModelsSchemaFormat `json:"format"` - Type models.ModelsSchemaType `json:"type"` +// CreateContextSetupRecommendationsPentestTargetsRecommendationIdAcceptInput is the input for CreateContextSetupRecommendationsPentestTargetsRecommendationIdAccept — Accept pentest target recommendation. +type CreateContextSetupRecommendationsPentestTargetsRecommendationIdAcceptInput struct { + RecommendationID string `path:"recommendationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TargetID string `json:"targetId"` models.RequestScope } -// CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema - Upload Project Schema -// POST /context/repositories/{repositoryId}/projects/{projectId}/schema -func (c *Client) CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema(ctx context.Context, in CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput) (*models.EndpointsPostProjectSchemaOutput, error) { - path := "/context/repositories/{repositoryId}/projects/{projectId}/schema" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// CreateContextSetupRecommendationsPentestTargetsRecommendationIdAccept - Accept pentest target recommendation +// POST /context/setup-recommendations/pentest-targets/{recommendationId}/accept +func (c *Client) CreateContextSetupRecommendationsPentestTargetsRecommendationIdAccept(ctx context.Context, in CreateContextSetupRecommendationsPentestTargetsRecommendationIdAcceptInput) (*models.EndpointsDecideSetupPentestTargetRecommendationOutput, error) { + path := "/context/setup-recommendations/pentest-targets/{recommendationId}/accept" + path = strings.Replace(path, "{recommendationId}", url.PathEscape(in.RecommendationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3044,13 +9189,9 @@ func (c *Client) CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema(ct } bodyBytes, err := json.Marshal(struct { - Content string `json:"content"` - Format models.ModelsSchemaFormat `json:"format"` - Type models.ModelsSchemaType `json:"type"` + TargetID string `json:"targetId"` }{ - Content: in.Content, - Format: in.Format, - Type: in.Type, + TargetID: in.TargetID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3059,31 +9200,33 @@ func (c *Client) CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema(ct if err != nil { return nil, err } - var out models.EndpointsPostProjectSchemaOutput + var out models.EndpointsDecideSetupPentestTargetRecommendationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata — Get Project Schema Metadata. -type ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` +// CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismissInput is the input for CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismiss — Dismiss pentest target recommendation. +type CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismissInput struct { + RecommendationID string `path:"recommendationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata - Get Project Schema Metadata -// GET /context/repositories/{repositoryId}/projects/{projectId}/schema/metadata -func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput) (*models.EndpointsGetProjectSchemaMetadataOutput, error) { - path := "/context/repositories/{repositoryId}/projects/{projectId}/schema/metadata" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismiss - Dismiss pentest target recommendation +// POST /context/setup-recommendations/pentest-targets/{recommendationId}/dismiss +func (c *Client) CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismiss(ctx context.Context, in CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismissInput) (*models.EndpointsDecideSetupPentestTargetRecommendationOutput, error) { + path := "/context/setup-recommendations/pentest-targets/{recommendationId}/dismiss" + path = strings.Replace(path, "{recommendationId}", url.PathEscape(in.RecommendationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3091,35 +9234,53 @@ func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetad fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetProjectSchemaMetadataOutput + var out models.EndpointsDecideSetupPentestTargetRecommendationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput is the input for ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw — Get Project Schema Raw File. -type ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` +// ListContextVaultDocumentDocumentIdTextInput is the input for ListContextVaultDocumentDocumentIdText — Get Vault Document Text. +type ListContextVaultDocumentDocumentIdTextInput struct { + DocumentID string `path:"documentId" json:"-"` + EndPage *int `url:"endPage,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + MaxChars *int `url:"maxChars,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + StartPage *int `url:"startPage,omitempty" json:"-"` models.RequestScope } -// ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw - Get Project Schema Raw File -// GET /context/repositories/{repositoryId}/projects/{projectId}/schema/raw -func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw(ctx context.Context, in ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput) (*models.EndpointsGetProjectSchemaRawOutput, error) { - path := "/context/repositories/{repositoryId}/projects/{projectId}/schema/raw" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// ListContextVaultDocumentDocumentIdText - Get Vault Document Text +// GET /context/vault/document/{documentId}/text +func (c *Client) ListContextVaultDocumentDocumentIdText(ctx context.Context, in ListContextVaultDocumentDocumentIdTextInput) (*models.EndpointsGetVaultDocumentTextOutput, error) { + path := "/context/vault/document/{documentId}/text" + path = strings.Replace(path, "{documentId}", url.PathEscape(in.DocumentID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.StartPage != nil { + query.Set("startPage", strconv.Itoa(int(*in.StartPage))) + } + if in.EndPage != nil { + query.Set("endPage", strconv.Itoa(int(*in.EndPage))) + } + if in.MaxChars != nil { + query.Set("maxChars", strconv.Itoa(int(*in.MaxChars))) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3131,30 +9292,34 @@ func (c *Client) ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw(c if err != nil { return nil, err } - var out models.EndpointsGetProjectSchemaRawOutput + var out models.EndpointsGetVaultDocumentTextOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextSbomingestorReplayInput is the input for CreateContextSbomingestorReplay — Compute Dependencies Repository/Project SBOM Ingest Replay. -type CreateContextSbomingestorReplayInput struct { - GlobalReplay *bool `json:"globalReplay,omitempty"` - ProjectID *string `json:"projectID,omitempty"` - RepositoryID *string `json:"repositoryID,omitempty"` +// CreateContextVaultFileInput is the input for CreateContextVaultFile — Post Vault File. +type CreateContextVaultFileInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Description *string `json:"description,omitempty"` + FileName string `json:"fileName"` + Size *int64 `json:"size,omitempty"` models.RequestScope } -// CreateContextSbomingestorReplay - Compute Dependencies Repository/Project SBOM Ingest Replay -// POST /context/sbomingestor/replay -func (c *Client) CreateContextSbomingestorReplay(ctx context.Context, in CreateContextSbomingestorReplayInput) (*models.EndpointsSBOMIngestReplayOutput, error) { - path := "/context/sbomingestor/replay" +// CreateContextVaultFile - Post Vault File +// POST /context/vault/file +func (c *Client) CreateContextVaultFile(ctx context.Context, in CreateContextVaultFileInput) (*models.EndpointsPostVaultFileOutput, error) { + path := "/context/vault/file" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3163,13 +9328,13 @@ func (c *Client) CreateContextSbomingestorReplay(ctx context.Context, in CreateC } bodyBytes, err := json.Marshal(struct { - GlobalReplay *bool `json:"globalReplay,omitempty"` - ProjectID *string `json:"projectID,omitempty"` - RepositoryID *string `json:"repositoryID,omitempty"` + Description *string `json:"description,omitempty"` + FileName string `json:"fileName"` + Size *int64 `json:"size,omitempty"` }{ - GlobalReplay: in.GlobalReplay, - ProjectID: in.ProjectID, - RepositoryID: in.RepositoryID, + Description: in.Description, + FileName: in.FileName, + Size: in.Size, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3178,42 +9343,32 @@ func (c *Client) CreateContextSbomingestorReplay(ctx context.Context, in CreateC if err != nil { return nil, err } - var out models.EndpointsSBOMIngestReplayOutput + var out models.EndpointsPostVaultFileOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextSbomsInput is the input for DeleteContextSboms — Delete SBOMs for tenant. -type DeleteContextSbomsInput struct { - DryRun *bool `url:"dryRun,omitempty" json:"-"` - InvalidOnly *bool `url:"invalidOnly,omitempty" json:"-"` - ProjectID *string `url:"projectId,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` +// DeleteContextVaultFileFileIdInput is the input for DeleteContextVaultFileFileId — Delete Vault File. +type DeleteContextVaultFileFileIdInput struct { + FileID string `path:"fileId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteContextSboms - Delete SBOMs for tenant -// DELETE /context/sboms -func (c *Client) DeleteContextSboms(ctx context.Context, in DeleteContextSbomsInput) (*models.EndpointsDeleteSBOMOutput, error) { - path := "/context/sboms" +// DeleteContextVaultFileFileId - Delete Vault File +// DELETE /context/vault/file/{fileId} +func (c *Client) DeleteContextVaultFileFileId(ctx context.Context, in DeleteContextVaultFileFileIdInput) ([]byte, error) { + path := "/context/vault/file/{fileId}" + path = strings.Replace(path, "{fileId}", url.PathEscape(in.FileID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) - } - if in.ProjectID != nil { - query.Set("projectId", string(*in.ProjectID)) - } - if in.InvalidOnly != nil { - query.Set("invalidOnly", strconv.FormatBool(*in.InvalidOnly)) - } - if in.DryRun != nil { - query.Set("dryRun", strconv.FormatBool(*in.DryRun)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -3223,34 +9378,29 @@ func (c *Client) DeleteContextSboms(ctx context.Context, in DeleteContextSbomsIn } data, err := c.do(ctx, "DELETE", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsDeleteSBOMOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil + return data, err } -// CreateContextSbomsGenerateInput is the input for CreateContextSbomsGenerate — Generate SBOM. -type CreateContextSbomsGenerateInput struct { - CloneURL *string `json:"cloneUrl,omitempty"` - CommitSha *string `json:"commitSha,omitempty"` - DefaultBranch *string `json:"defaultBranch,omitempty"` - RepositoryID string `json:"repositoryId"` +// GetContextVaultFileFileIdInput is the input for GetContextVaultFileFileId — Get Vault File. +type GetContextVaultFileFileIdInput struct { + FileID string `path:"fileId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateContextSbomsGenerate - Generate SBOM -// POST /context/sboms/generate -func (c *Client) CreateContextSbomsGenerate(ctx context.Context, in CreateContextSbomsGenerateInput) (*models.EndpointsPostSBOMGenerateOutput, error) { - path := "/context/sboms/generate" +// GetContextVaultFileFileId - Get Vault File +// GET /context/vault/file/{fileId} +func (c *Client) GetContextVaultFileFileId(ctx context.Context, in GetContextVaultFileFileIdInput) (*models.EndpointsGetVaultFileOutput, error) { + path := "/context/vault/file/{fileId}" + path = strings.Replace(path, "{fileId}", url.PathEscape(in.FileID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3258,47 +9408,40 @@ func (c *Client) CreateContextSbomsGenerate(ctx context.Context, in CreateContex fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - CloneURL *string `json:"cloneUrl,omitempty"` - CommitSha *string `json:"commitSha,omitempty"` - DefaultBranch *string `json:"defaultBranch,omitempty"` - RepositoryID string `json:"repositoryId"` - }{ - CloneURL: in.CloneURL, - CommitSha: in.CommitSha, - DefaultBranch: in.DefaultBranch, - RepositoryID: in.RepositoryID, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostSBOMGenerateOutput + var out models.EndpointsGetVaultFileOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextSbomsRepositoryRepositoryIdLatestInput is the input for ListContextSbomsRepositoryRepositoryIdLatest — Get Latest SBOMs for Repository. -type ListContextSbomsRepositoryRepositoryIdLatestInput struct { - RepositoryID string `path:"repositoryId" json:"-"` +// PatchContextVaultFileFileNameInput is the input for PatchContextVaultFileFileName — Patch Vault File. +type PatchContextVaultFileFileNameInput struct { + FileName string `path:"fileName" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DocumentID *string `json:"documentId,omitempty"` + Metadata map[string]json.RawMessage `json:"metadata,omitempty"` + ProcessedAt *string `json:"processedAt,omitempty"` models.RequestScope } -// ListContextSbomsRepositoryRepositoryIdLatest - Get Latest SBOMs for Repository -// GET /context/sboms/repository/{repositoryId}/latest -func (c *Client) ListContextSbomsRepositoryRepositoryIdLatest(ctx context.Context, in ListContextSbomsRepositoryRepositoryIdLatestInput) (*models.EndpointsGetLatestSBOMsOutput, error) { - path := "/context/sboms/repository/{repositoryId}/latest" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) +// PatchContextVaultFileFileName - Patch Vault File +// PATCH /context/vault/file/{fileName} +func (c *Client) PatchContextVaultFileFileName(ctx context.Context, in PatchContextVaultFileFileNameInput) (*models.EndpointsPatchVaultFileOutput, error) { + path := "/context/vault/file/{fileName}" + path = strings.Replace(path, "{fileName}", url.PathEscape(in.FileName), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3306,58 +9449,58 @@ func (c *Client) ListContextSbomsRepositoryRepositoryIdLatest(ctx context.Contex fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + DocumentID *string `json:"documentId,omitempty"` + Metadata map[string]json.RawMessage `json:"metadata,omitempty"` + ProcessedAt *string `json:"processedAt,omitempty"` + }{ + DocumentID: in.DocumentID, + Metadata: in.Metadata, + ProcessedAt: in.ProcessedAt, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetLatestSBOMsOutput + var out models.EndpointsPatchVaultFileOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput is the input for GetContextSbomsRepositoryRepositoryIdProjectProjectId — Get Repository/Project SBOMs. -type GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput struct { - RepositoryID string `path:"repositoryId" json:"-"` - ProjectID string `path:"projectId" json:"-"` - FromCommit *string `url:"fromCommit,omitempty" json:"-"` - FromTime *string `url:"fromTime,omitempty" json:"-"` - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` - UntilCommit *string `url:"untilCommit,omitempty" json:"-"` - UntilTime *string `url:"untilTime,omitempty" json:"-"` +// ListContextVaultFilesInput is the input for ListContextVaultFiles — Get Vault Files. +type ListContextVaultFilesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` models.RequestScope } -// GetContextSbomsRepositoryRepositoryIdProjectProjectId - Get Repository/Project SBOMs -// GET /context/sboms/repository/{repositoryId}/project/{projectId} -func (c *Client) GetContextSbomsRepositoryRepositoryIdProjectProjectId(ctx context.Context, in GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput) (*models.EndpointsGetSBOMSOutput, error) { - path := "/context/sboms/repository/{repositoryId}/project/{projectId}" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) - path = strings.Replace(path, "{projectId}", url.PathEscape(in.ProjectID), 1) +// ListContextVaultFiles - Get Vault Files +// GET /context/vault/files +func (c *Client) ListContextVaultFiles(ctx context.Context, in ListContextVaultFilesInput) (*models.EndpointsGetVaultFilesOutput, error) { + path := "/context/vault/files" query := url.Values{} for k, v := range c.DefaultParams { - query.Set(k, v) - } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + query.Set(k, v) } - if in.FromCommit != nil { - query.Set("fromCommit", string(*in.FromCommit)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.UntilCommit != nil { - query.Set("untilCommit", string(*in.UntilCommit)) + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) } - if in.FromTime != nil { - query.Set("fromTime", string(*in.FromTime)) + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) } - if in.UntilTime != nil { - query.Set("untilTime", string(*in.UntilTime)) + if in.Search != nil { + query.Set("search", string(*in.Search)) } in.RequestScope.AddTo(query) @@ -3370,39 +9513,31 @@ func (c *Client) GetContextSbomsRepositoryRepositoryIdProjectProjectId(ctx conte if err != nil { return nil, err } - var out models.EndpointsGetSBOMSOutput + var out models.EndpointsGetVaultFilesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextSbomsResolveInput is the input for CreateContextSbomsResolve — Get or generate SBOM. -type CreateContextSbomsResolveInput struct { - Branch *string `json:"branch,omitempty"` - CdxgenMajor *int `json:"cdxgenMajor,omitempty"` - CloneURL *string `json:"cloneURL,omitempty"` - CommitSHA *string `json:"commitSHA,omitempty"` - IsDefaultBranchPush *bool `json:"isDefaultBranchPush,omitempty"` - LockfileSetHash *string `json:"lockfileSetHash,omitempty"` - OwnerProvider *models.ModelsOwnerProvider `json:"ownerProvider,omitempty"` - RepositoryID *string `json:"repositoryID,omitempty"` - RepositoryProvider *models.ModelsGitRepositoryProvider `json:"repositoryProvider,omitempty"` - ScannerVersion *string `json:"scannerVersion,omitempty"` - TenantID *string `json:"tenantID,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` +// ListContextVaultFilesListInput is the input for ListContextVaultFilesList — Get Vault Files List. +type ListContextVaultFilesListInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateContextSbomsResolve - Get or generate SBOM -// POST /context/sboms/resolve -func (c *Client) CreateContextSbomsResolve(ctx context.Context, in CreateContextSbomsResolveInput) (*models.EndpointsPostSBOMResolveOutput, error) { - path := "/context/sboms/resolve" +// ListContextVaultFilesList - Get Vault Files List +// GET /context/vault/files/list +func (c *Client) ListContextVaultFilesList(ctx context.Context, in ListContextVaultFilesListInput) (*models.EndpointsGetVaultFilesListOutput, error) { + path := "/context/vault/files/list" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3410,65 +9545,36 @@ func (c *Client) CreateContextSbomsResolve(ctx context.Context, in CreateContext fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Branch *string `json:"branch,omitempty"` - CdxgenMajor *int `json:"cdxgenMajor,omitempty"` - CloneURL *string `json:"cloneURL,omitempty"` - CommitSHA *string `json:"commitSHA,omitempty"` - IsDefaultBranchPush *bool `json:"isDefaultBranchPush,omitempty"` - LockfileSetHash *string `json:"lockfileSetHash,omitempty"` - OwnerProvider *models.ModelsOwnerProvider `json:"ownerProvider,omitempty"` - RepositoryID *string `json:"repositoryID,omitempty"` - RepositoryProvider *models.ModelsGitRepositoryProvider `json:"repositoryProvider,omitempty"` - ScannerVersion *string `json:"scannerVersion,omitempty"` - TenantID *string `json:"tenantID,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - }{ - Branch: in.Branch, - CdxgenMajor: in.CdxgenMajor, - CloneURL: in.CloneURL, - CommitSHA: in.CommitSHA, - IsDefaultBranchPush: in.IsDefaultBranchPush, - LockfileSetHash: in.LockfileSetHash, - OwnerProvider: in.OwnerProvider, - RepositoryID: in.RepositoryID, - RepositoryProvider: in.RepositoryProvider, - ScannerVersion: in.ScannerVersion, - TenantID: in.TenantID, - Timestamp: in.Timestamp, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostSBOMResolveOutput + var out models.EndpointsGetVaultFilesListOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextSbomsScanInput is the input for CreateContextSbomsScan — Scan SBOM (get-or-generate). -type CreateContextSbomsScanInput struct { - CommitSha string `json:"commitSha"` - ForceRegenerate *bool `json:"forceRegenerate,omitempty"` - ProjectID string `json:"projectId"` - RepositoryID string `json:"repositoryId"` +// CreateContextVaultIndexInput is the input for CreateContextVaultIndex — Index Vault Files. +type CreateContextVaultIndexInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + FileIDs []string `json:"fileIDs,omitempty"` models.RequestScope } -// CreateContextSbomsScan - Scan SBOM (get-or-generate) -// POST /context/sboms/scan -func (c *Client) CreateContextSbomsScan(ctx context.Context, in CreateContextSbomsScanInput) (*models.EndpointsPostSBOMScanOutput, error) { - path := "/context/sboms/scan" +// CreateContextVaultIndex - Index Vault Files +// POST /context/vault/index +func (c *Client) CreateContextVaultIndex(ctx context.Context, in CreateContextVaultIndexInput) (*models.EndpointsPostVaultIndexOutput, error) { + path := "/context/vault/index" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3477,15 +9583,9 @@ func (c *Client) CreateContextSbomsScan(ctx context.Context, in CreateContextSbo } bodyBytes, err := json.Marshal(struct { - CommitSha string `json:"commitSha"` - ForceRegenerate *bool `json:"forceRegenerate,omitempty"` - ProjectID string `json:"projectId"` - RepositoryID string `json:"repositoryId"` + FileIDs []string `json:"fileIDs,omitempty"` }{ - CommitSha: in.CommitSha, - ForceRegenerate: in.ForceRegenerate, - ProjectID: in.ProjectID, - RepositoryID: in.RepositoryID, + FileIDs: in.FileIDs, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3494,30 +9594,32 @@ func (c *Client) CreateContextSbomsScan(ctx context.Context, in CreateContextSbo if err != nil { return nil, err } - var out models.EndpointsPostSBOMScanOutput + var out models.EndpointsPostVaultIndexOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextSbomsTreeInput is the input for ListContextSbomsTree — Get SBOM key tree for tenant. -type ListContextSbomsTreeInput struct { - Verbose *bool `url:"verbose,omitempty" json:"-"` +// CreateContextVaultOnboardInput is the input for CreateContextVaultOnboard — Trigger Vault Onboarding. +type CreateContextVaultOnboardInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + FileIDs []string `json:"fileIDs,omitempty"` + RunID *string `json:"runId,omitempty"` models.RequestScope } -// ListContextSbomsTree - Get SBOM key tree for tenant -// GET /context/sboms/tree -func (c *Client) ListContextSbomsTree(ctx context.Context, in ListContextSbomsTreeInput) (*models.EndpointsGetSBOMTreeOutput, error) { - path := "/context/sboms/tree" +// CreateContextVaultOnboard - Trigger Vault Onboarding +// POST /context/vault/onboard +func (c *Client) CreateContextVaultOnboard(ctx context.Context, in CreateContextVaultOnboardInput) (*models.EndpointsPostVaultOnboardOutput, error) { + path := "/context/vault/onboard" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Verbose != nil { - query.Set("verbose", strconv.FormatBool(*in.Verbose)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -3526,31 +9628,49 @@ func (c *Client) ListContextSbomsTree(ctx context.Context, in ListContextSbomsTr fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + FileIDs []string `json:"fileIDs,omitempty"` + RunID *string `json:"runId,omitempty"` + }{ + FileIDs: in.FileIDs, + RunID: in.RunID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetSBOMTreeOutput + var out models.EndpointsPostVaultOnboardOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextSchemasInput is the input for ListContextSchemas — List Schemas. -type ListContextSchemasInput struct { +// CreateContextVaultSearchInput is the input for CreateContextVaultSearch — Search Vault Documents. +type CreateContextVaultSearchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DocTypes []string `json:"docTypes,omitempty"` + DocumentIds []string `json:"documentIds,omitempty"` + Limit *int `json:"limit,omitempty"` + Query string `json:"query"` models.RequestScope } -// ListContextSchemas - List Schemas -// GET /context/schemas -func (c *Client) ListContextSchemas(ctx context.Context, in ListContextSchemasInput) (*models.EndpointsListSchemasOutput, error) { - path := "/context/schemas" +// CreateContextVaultSearch - Search Vault Documents +// POST /context/vault/search +func (c *Client) CreateContextVaultSearch(ctx context.Context, in CreateContextVaultSearchInput) (*models.EndpointsSearchVaultOutput, error) { + path := "/context/vault/search" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3558,33 +9678,51 @@ func (c *Client) ListContextSchemas(ctx context.Context, in ListContextSchemasIn fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + DocTypes []string `json:"docTypes,omitempty"` + DocumentIds []string `json:"documentIds,omitempty"` + Limit *int `json:"limit,omitempty"` + Query string `json:"query"` + }{ + DocTypes: in.DocTypes, + DocumentIds: in.DocumentIds, + Limit: in.Limit, + Query: in.Query, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsListSchemasOutput + var out models.EndpointsSearchVaultOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextVaultFileInput is the input for CreateContextVaultFile — Post Vault File. -type CreateContextVaultFileInput struct { - Description *string `json:"description,omitempty"` - FileName string `json:"fileName"` +// CreateContextWafAllowlistPrRunsInput is the input for CreateContextWafAllowlistPrRuns — Start WAF Allowlist PR Run. +type CreateContextWafAllowlistPrRunsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Digest *string `json:"digest,omitempty"` + ExpectedRunID *string `json:"expectedRunId,omitempty"` models.RequestScope } -// CreateContextVaultFile - Post Vault File -// POST /context/vault/file -func (c *Client) CreateContextVaultFile(ctx context.Context, in CreateContextVaultFileInput) (*models.EndpointsPostVaultFileOutput, error) { - path := "/context/vault/file" +// CreateContextWafAllowlistPrRuns - Start WAF Allowlist PR Run +// POST /context/waf-allowlist-pr/runs +func (c *Client) CreateContextWafAllowlistPrRuns(ctx context.Context, in CreateContextWafAllowlistPrRunsInput) (*models.EndpointsContextStartCloudConnectorPRRunOutput, error) { + path := "/context/waf-allowlist-pr/runs" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3593,11 +9731,11 @@ func (c *Client) CreateContextVaultFile(ctx context.Context, in CreateContextVau } bodyBytes, err := json.Marshal(struct { - Description *string `json:"description,omitempty"` - FileName string `json:"fileName"` + Digest *string `json:"digest,omitempty"` + ExpectedRunID *string `json:"expectedRunId,omitempty"` }{ - Description: in.Description, - FileName: in.FileName, + Digest: in.Digest, + ExpectedRunID: in.ExpectedRunID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -3606,55 +9744,32 @@ func (c *Client) CreateContextVaultFile(ctx context.Context, in CreateContextVau if err != nil { return nil, err } - var out models.EndpointsPostVaultFileOutput + var out models.EndpointsContextStartCloudConnectorPRRunOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteContextVaultFileFileIdInput is the input for DeleteContextVaultFileFileId — Delete Vault File. -type DeleteContextVaultFileFileIdInput struct { - FileID string `path:"fileId" json:"-"` +// GetContextWafAllowlistPrRunsRunIdInput is the input for GetContextWafAllowlistPrRunsRunId — Get WAF Allowlist PR Run. +type GetContextWafAllowlistPrRunsRunIdInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteContextVaultFileFileId - Delete Vault File -// DELETE /context/vault/file/{fileId} -func (c *Client) DeleteContextVaultFileFileId(ctx context.Context, in DeleteContextVaultFileFileIdInput) ([]byte, error) { - path := "/context/vault/file/{fileId}" - path = strings.Replace(path, "{fileId}", url.PathEscape(in.FileID), 1) +// GetContextWafAllowlistPrRunsRunId - Get WAF Allowlist PR Run +// GET /context/waf-allowlist-pr/runs/{runId} +func (c *Client) GetContextWafAllowlistPrRunsRunId(ctx context.Context, in GetContextWafAllowlistPrRunsRunIdInput) (*models.EndpointsContextGetCloudConnectorPRRunOutput, error) { + path := "/context/waf-allowlist-pr/runs/{runId}" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "DELETE", fullURL, nil) - return data, err -} - -// GetContextVaultFileFileIdInput is the input for GetContextVaultFileFileId — Get Vault File. -type GetContextVaultFileFileIdInput struct { - FileID string `path:"fileId" json:"-"` - models.RequestScope -} - -// GetContextVaultFileFileId - Get Vault File -// GET /context/vault/file/{fileId} -func (c *Client) GetContextVaultFileFileId(ctx context.Context, in GetContextVaultFileFileIdInput) (*models.EndpointsGetVaultFileOutput, error) { - path := "/context/vault/file/{fileId}" - path = strings.Replace(path, "{fileId}", url.PathEscape(in.FileID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -3667,32 +9782,34 @@ func (c *Client) GetContextVaultFileFileId(ctx context.Context, in GetContextVau if err != nil { return nil, err } - var out models.EndpointsGetVaultFileOutput + var out models.EndpointsContextGetCloudConnectorPRRunOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchContextVaultFileFileNameInput is the input for PatchContextVaultFileFileName — Patch Vault File. -type PatchContextVaultFileFileNameInput struct { - FileName string `path:"fileName" json:"-"` - DocumentID *string `json:"documentId,omitempty"` - Metadata map[string]json.RawMessage `json:"metadata,omitempty"` - ProcessedAt *string `json:"processedAt,omitempty"` +// CreateContextWafAllowlistPrRunsRunIdApproveInput is the input for CreateContextWafAllowlistPrRunsRunIdApprove — Create approved WAF allowlist draft PR. +type CreateContextWafAllowlistPrRunsRunIdApproveInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Digest string `json:"digest"` models.RequestScope } -// PatchContextVaultFileFileName - Patch Vault File -// PATCH /context/vault/file/{fileName} -func (c *Client) PatchContextVaultFileFileName(ctx context.Context, in PatchContextVaultFileFileNameInput) (*models.EndpointsPatchVaultFileOutput, error) { - path := "/context/vault/file/{fileName}" - path = strings.Replace(path, "{fileName}", url.PathEscape(in.FileName), 1) +// CreateContextWafAllowlistPrRunsRunIdApprove - Create approved WAF allowlist draft PR +// POST /context/waf-allowlist-pr/runs/{runId}/approve +func (c *Client) CreateContextWafAllowlistPrRunsRunIdApprove(ctx context.Context, in CreateContextWafAllowlistPrRunsRunIdApproveInput) (*models.EndpointsContextApproveCloudConnectorProposalOutput, error) { + path := "/context/waf-allowlist-pr/runs/{runId}/approve" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3701,42 +9818,44 @@ func (c *Client) PatchContextVaultFileFileName(ctx context.Context, in PatchCont } bodyBytes, err := json.Marshal(struct { - DocumentID *string `json:"documentId,omitempty"` - Metadata map[string]json.RawMessage `json:"metadata,omitempty"` - ProcessedAt *string `json:"processedAt,omitempty"` + Digest string `json:"digest"` }{ - DocumentID: in.DocumentID, - Metadata: in.Metadata, - ProcessedAt: in.ProcessedAt, + Digest: in.Digest, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchVaultFileOutput + var out models.EndpointsContextApproveCloudConnectorProposalOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextVaultFilesInput is the input for ListContextVaultFiles — Get Vault Files. -type ListContextVaultFilesInput struct { +// ListContextWafAllowlistPrRunsRunIdProposalInput is the input for ListContextWafAllowlistPrRunsRunIdProposal — Review WAF allowlist proposal. +type ListContextWafAllowlistPrRunsRunIdProposalInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListContextVaultFiles - Get Vault Files -// GET /context/vault/files -func (c *Client) ListContextVaultFiles(ctx context.Context, in ListContextVaultFilesInput) (*models.EndpointsGetVaultFilesOutput, error) { - path := "/context/vault/files" +// ListContextWafAllowlistPrRunsRunIdProposal - Review WAF allowlist proposal +// GET /context/waf-allowlist-pr/runs/{runId}/proposal +func (c *Client) ListContextWafAllowlistPrRunsRunIdProposal(ctx context.Context, in ListContextWafAllowlistPrRunsRunIdProposalInput) (*models.EndpointsContextGetCloudConnectorProposalOutput, error) { + path := "/context/waf-allowlist-pr/runs/{runId}/proposal" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3748,27 +9867,35 @@ func (c *Client) ListContextVaultFiles(ctx context.Context, in ListContextVaultF if err != nil { return nil, err } - var out models.EndpointsGetVaultFilesOutput + var out models.EndpointsContextGetCloudConnectorProposalOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListContextVaultFilesListInput is the input for ListContextVaultFilesList — Get Vault Files List. -type ListContextVaultFilesListInput struct { +// CreateContextWafAllowlistPrRunsRunIdRecoverInput is the input for CreateContextWafAllowlistPrRunsRunIdRecover — Recover unresolved WAF allowlist publication. +type CreateContextWafAllowlistPrRunsRunIdRecoverInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ConfirmNoPullRequest bool `json:"confirmNoPullRequest"` + Digest string `json:"digest"` models.RequestScope } -// ListContextVaultFilesList - Get Vault Files List -// GET /context/vault/files/list -func (c *Client) ListContextVaultFilesList(ctx context.Context, in ListContextVaultFilesListInput) (*models.EndpointsGetVaultFilesListOutput, error) { - path := "/context/vault/files/list" +// CreateContextWafAllowlistPrRunsRunIdRecover - Recover unresolved WAF allowlist publication +// POST /context/waf-allowlist-pr/runs/{runId}/recover +func (c *Client) CreateContextWafAllowlistPrRunsRunIdRecover(ctx context.Context, in CreateContextWafAllowlistPrRunsRunIdRecoverInput) (*models.EndpointsContextRecoverCloudConnectorProposalOutput, error) { + path := "/context/waf-allowlist-pr/runs/{runId}/recover" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3776,32 +9903,45 @@ func (c *Client) ListContextVaultFilesList(ctx context.Context, in ListContextVa fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ConfirmNoPullRequest bool `json:"confirmNoPullRequest"` + Digest string `json:"digest"` + }{ + ConfirmNoPullRequest: in.ConfirmNoPullRequest, + Digest: in.Digest, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetVaultFilesListOutput + var out models.EndpointsContextRecoverCloudConnectorProposalOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateContextVaultOnboardInput is the input for CreateContextVaultOnboard — Trigger Vault Onboarding. -type CreateContextVaultOnboardInput struct { - FileIDs []string `json:"fileIDs,omitempty"` +// ListContextWafAllowlistPrStatusInput is the input for ListContextWafAllowlistPrStatus — Get WAF Allowlist PR Status. +type ListContextWafAllowlistPrStatusInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateContextVaultOnboard - Trigger Vault Onboarding -// POST /context/vault/onboard -func (c *Client) CreateContextVaultOnboard(ctx context.Context, in CreateContextVaultOnboardInput) (*models.EndpointsPostVaultOnboardOutput, error) { - path := "/context/vault/onboard" +// ListContextWafAllowlistPrStatus - Get WAF Allowlist PR Status +// GET /context/waf-allowlist-pr/status +func (c *Client) ListContextWafAllowlistPrStatus(ctx context.Context, in ListContextWafAllowlistPrStatusInput) (*models.EndpointsContextGetCloudConnectorPRStatusOutput, error) { + path := "/context/waf-allowlist-pr/status" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -3809,19 +9949,11 @@ func (c *Client) CreateContextVaultOnboard(ctx context.Context, in CreateContext fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - FileIDs []string `json:"fileIDs,omitempty"` - }{ - FileIDs: in.FileIDs, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostVaultOnboardOutput + var out models.EndpointsContextGetCloudConnectorPRStatusOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } diff --git a/internal/api/cspm.go b/internal/api/cspm.go index 501e2b1..70ea053 100644 --- a/internal/api/cspm.go +++ b/internal/api/cspm.go @@ -24,11 +24,20 @@ var _ = models.RequestScope{} // ListCspmFindingsInput is the input for ListCspmFindings — Get CSPM Findings. type ListCspmFindingsInput struct { AccountID *string `url:"accountId,omitempty" json:"-"` + Category *string `url:"category,omitempty" json:"-"` + CloudProvider *string `url:"cloudProvider,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` + IsArchived *bool `url:"isArchived,omitempty" json:"-"` + IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` Region *string `url:"region,omitempty" json:"-"` ResourceType *string `url:"resourceType,omitempty" json:"-"` + RuleID *string `url:"ruleId,omitempty" json:"-"` ScanID *string `url:"scanId,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` Severity *string `url:"severity,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` @@ -45,12 +54,18 @@ func (c *Client) ListCspmFindings(ctx context.Context, in ListCspmFindingsInput) for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } if in.NextToken != nil { query.Set("nextToken", string(*in.NextToken)) } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } if in.Sort != nil { query.Set("sort", string(*in.Sort)) } @@ -75,6 +90,27 @@ func (c *Client) ListCspmFindings(ctx context.Context, in ListCspmFindingsInput) if in.ScanID != nil { query.Set("scanId", string(*in.ScanID)) } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.CloudProvider != nil { + query.Set("cloudProvider", string(*in.CloudProvider)) + } + if in.RuleID != nil { + query.Set("ruleId", string(*in.RuleID)) + } + if in.Category != nil { + query.Set("category", string(*in.Category)) + } + if in.IsArchived != nil { + query.Set("isArchived", strconv.FormatBool(*in.IsArchived)) + } + if in.IsAllowlisted != nil { + query.Set("isAllowlisted", strconv.FormatBool(*in.IsAllowlisted)) + } + if in.IsFalsePositive != nil { + query.Set("isFalsePositive", strconv.FormatBool(*in.IsFalsePositive)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -96,9 +132,13 @@ func (c *Client) ListCspmFindings(ctx context.Context, in ListCspmFindingsInput) // GetCspmFindingsFindingIdInput is the input for GetCspmFindingsFindingId — Get CSPM Finding. type GetCspmFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetCspmFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetCspmFindingsFindingId - Get CSPM Finding // GET /cspm/findings/{findingId} func (c *Client) GetCspmFindingsFindingId(ctx context.Context, in GetCspmFindingsFindingIdInput) (*models.EndpointsGetCSPMFindingOutput, error) { @@ -109,6 +149,9 @@ func (c *Client) GetCspmFindingsFindingId(ctx context.Context, in GetCspmFinding for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -127,29 +170,93 @@ func (c *Client) GetCspmFindingsFindingId(ctx context.Context, in GetCspmFinding return &out, nil } -// ListCspmFindingsFindingIdAutofixActivityInput is the input for ListCspmFindingsFindingIdAutofixActivity — Get CSPM Finding Autofix Activity. -type ListCspmFindingsFindingIdAutofixActivityInput struct { +// PatchCspmFindingsFindingIdInput is the input for PatchCspmFindingsFindingId — Update CSPM Finding. +type PatchCspmFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` - Limit *int32 `url:"limit,omitempty" json:"-"` - SinceID *string `url:"since_id,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ClearPriorityOverride *bool `json:"clearPriorityOverride,omitempty"` + ClearSeverityOverride *bool `json:"clearSeverityOverride,omitempty"` + PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` + SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` + UserNotes *string `json:"userNotes,omitempty"` models.RequestScope } -// ListCspmFindingsFindingIdAutofixActivity - Get CSPM Finding Autofix Activity -// GET /cspm/findings/{findingId}/autofix/activity -func (c *Client) ListCspmFindingsFindingIdAutofixActivity(ctx context.Context, in ListCspmFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { - path := "/cspm/findings/{findingId}/autofix/activity" +// SetFindingID sets the finding that the request targets. +func (in *PatchCspmFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + +// PatchCspmFindingsFindingId - Update CSPM Finding +// PATCH /cspm/findings/{findingId} +func (c *Client) PatchCspmFindingsFindingId(ctx context.Context, in PatchCspmFindingsFindingIdInput) (*models.EndpointsPatchCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.SinceID != nil { - query.Set("since_id", string(*in.SinceID)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ClearPriorityOverride *bool `json:"clearPriorityOverride,omitempty"` + ClearSeverityOverride *bool `json:"clearSeverityOverride,omitempty"` + PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` + SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` + UserNotes *string `json:"userNotes,omitempty"` + }{ + ClearPriorityOverride: in.ClearPriorityOverride, + ClearSeverityOverride: in.ClearSeverityOverride, + PriorityOverride: in.PriorityOverride, + SeverityOverride: in.SeverityOverride, + UserNotes: in.UserNotes, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchCSPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateCspmFindingsFindingIdAllowlistInput is the input for CreateCspmFindingsFindingIdAllowlist — Allowlist CSPM Finding. +type CreateCspmFindingsFindingIdAllowlistInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AllowlistReason string `json:"allowlistReason"` + AllowlistType *models.ModelsAllowlistType `json:"allowlistType,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + +// CreateCspmFindingsFindingIdAllowlist - Allowlist CSPM Finding +// POST /cspm/findings/{findingId}/allowlist +func (c *Client) CreateCspmFindingsFindingIdAllowlist(ctx context.Context, in CreateCspmFindingsFindingIdAllowlistInput) (*models.EndpointsPostAllowlistCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}/allowlist" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -158,33 +265,110 @@ func (c *Client) ListCspmFindingsFindingIdAutofixActivity(ctx context.Context, i fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + AllowlistReason string `json:"allowlistReason"` + AllowlistType *models.ModelsAllowlistType `json:"allowlistType,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + }{ + AllowlistReason: in.AllowlistReason, + AllowlistType: in.AllowlistType, + UserCanonicalID: in.UserCanonicalID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetAutofixActivityLogOutput + var out models.EndpointsPostAllowlistCSPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateCspmFindingsFindingIdArchiveInput is the input for CreateCspmFindingsFindingIdArchive — Archive CSPM Finding. +type CreateCspmFindingsFindingIdArchiveInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdArchiveInput) SetFindingID(id string) { in.FindingID = id } + +// CreateCspmFindingsFindingIdArchive - Archive CSPM Finding +// POST /cspm/findings/{findingId}/archive +func (c *Client) CreateCspmFindingsFindingIdArchive(ctx context.Context, in CreateCspmFindingsFindingIdArchiveInput) (*models.EndpointsPostArchiveCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}/archive" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + }{ + UserCanonicalID: in.UserCanonicalID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostArchiveCSPMFindingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListCspmFindingsFindingIdAutofixCacheDiffInput is the input for ListCspmFindingsFindingIdAutofixCacheDiff — Get CSPM Finding Autofix Diff. -type ListCspmFindingsFindingIdAutofixCacheDiffInput struct { +// ListCspmFindingsFindingIdAutofixActivityInput is the input for ListCspmFindingsFindingIdAutofixActivity — Get CSPM Finding Autofix Activity. +type ListCspmFindingsFindingIdAutofixActivityInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + SinceID *string `url:"since_id,omitempty" json:"-"` models.RequestScope } -// ListCspmFindingsFindingIdAutofixCacheDiff - Get CSPM Finding Autofix Diff -// GET /cspm/findings/{findingId}/autofix/cache/diff -func (c *Client) ListCspmFindingsFindingIdAutofixCacheDiff(ctx context.Context, in ListCspmFindingsFindingIdAutofixCacheDiffInput) (*models.EndpointsGetCSPMFindingAutofixDiffOutput, error) { - path := "/cspm/findings/{findingId}/autofix/cache/diff" +// SetFindingID sets the finding that the request targets. +func (in *ListCspmFindingsFindingIdAutofixActivityInput) SetFindingID(id string) { in.FindingID = id } + +// ListCspmFindingsFindingIdAutofixActivity - Get CSPM Finding Autofix Activity +// GET /cspm/findings/{findingId}/autofix/activity +func (c *Client) ListCspmFindingsFindingIdAutofixActivity(ctx context.Context, in ListCspmFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { + path := "/cspm/findings/{findingId}/autofix/activity" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.SinceID != nil { + query.Set("since_id", string(*in.SinceID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -196,7 +380,7 @@ func (c *Client) ListCspmFindingsFindingIdAutofixCacheDiff(ctx context.Context, if err != nil { return nil, err } - var out models.EndpointsGetCSPMFindingAutofixDiffOutput + var out models.EndpointsGetAutofixActivityLogOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } @@ -206,12 +390,18 @@ func (c *Client) ListCspmFindingsFindingIdAutofixCacheDiff(ctx context.Context, // CreateCspmFindingsFindingIdAutofixFixInput is the input for CreateCspmFindingsFindingIdAutofixFix — Post CSPM Finding Autofix. type CreateCspmFindingsFindingIdAutofixFixInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Force *bool `json:"force,omitempty"` + GitRepositoryProvider *models.ModelsGitRepositoryProvider `json:"gitRepositoryProvider,omitempty"` Message *string `json:"message,omitempty"` OriginCampaignID *string `json:"originCampaignId,omitempty"` + UseCachedFix *bool `json:"useCachedFix,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdAutofixFixInput) SetFindingID(id string) { in.FindingID = id } + // CreateCspmFindingsFindingIdAutofixFix - Post CSPM Finding Autofix // POST /cspm/findings/{findingId}/autofix/fix func (c *Client) CreateCspmFindingsFindingIdAutofixFix(ctx context.Context, in CreateCspmFindingsFindingIdAutofixFixInput) (*models.EndpointsPostCSPMFindingAutofixOutput, error) { @@ -222,6 +412,9 @@ func (c *Client) CreateCspmFindingsFindingIdAutofixFix(ctx context.Context, in C for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -231,12 +424,16 @@ func (c *Client) CreateCspmFindingsFindingIdAutofixFix(ctx context.Context, in C bodyBytes, err := json.Marshal(struct { Force *bool `json:"force,omitempty"` + GitRepositoryProvider *models.ModelsGitRepositoryProvider `json:"gitRepositoryProvider,omitempty"` Message *string `json:"message,omitempty"` OriginCampaignID *string `json:"originCampaignId,omitempty"` + UseCachedFix *bool `json:"useCachedFix,omitempty"` }{ Force: in.Force, + GitRepositoryProvider: in.GitRepositoryProvider, Message: in.Message, OriginCampaignID: in.OriginCampaignID, + UseCachedFix: in.UseCachedFix, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -255,9 +452,13 @@ func (c *Client) CreateCspmFindingsFindingIdAutofixFix(ctx context.Context, in C // ListCspmFindingsFindingIdAutofixStateInput is the input for ListCspmFindingsFindingIdAutofixState — Get CSPM Finding Autofix State. type ListCspmFindingsFindingIdAutofixStateInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListCspmFindingsFindingIdAutofixStateInput) SetFindingID(id string) { in.FindingID = id } + // ListCspmFindingsFindingIdAutofixState - Get CSPM Finding Autofix State // GET /cspm/findings/{findingId}/autofix/state func (c *Client) ListCspmFindingsFindingIdAutofixState(ctx context.Context, in ListCspmFindingsFindingIdAutofixStateInput) (*models.EndpointsGetCSPMFindingAutofixStateOutput, error) { @@ -268,6 +469,9 @@ func (c *Client) ListCspmFindingsFindingIdAutofixState(ctx context.Context, in L for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -289,9 +493,13 @@ func (c *Client) ListCspmFindingsFindingIdAutofixState(ctx context.Context, in L // ListCspmFindingsFindingIdAutofixStatusInput is the input for ListCspmFindingsFindingIdAutofixStatus — Get CSPM Finding Autofix Status. type ListCspmFindingsFindingIdAutofixStatusInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListCspmFindingsFindingIdAutofixStatusInput) SetFindingID(id string) { in.FindingID = id } + // ListCspmFindingsFindingIdAutofixStatus - Get CSPM Finding Autofix Status // GET /cspm/findings/{findingId}/autofix/status func (c *Client) ListCspmFindingsFindingIdAutofixStatus(ctx context.Context, in ListCspmFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetCSPMFindingAutofixStatusOutput, error) { @@ -302,6 +510,9 @@ func (c *Client) ListCspmFindingsFindingIdAutofixStatus(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -320,9 +531,104 @@ func (c *Client) ListCspmFindingsFindingIdAutofixStatus(ctx context.Context, in return &out, nil } +// CreateCspmFindingsFindingIdMarkFalsePositiveInput is the input for CreateCspmFindingsFindingIdMarkFalsePositive — Mark CSPM Finding as False Positive. +type CreateCspmFindingsFindingIdMarkFalsePositiveInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + FalsePositiveReason string `json:"falsePositiveReason"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdMarkFalsePositiveInput) SetFindingID(id string) { in.FindingID = id } + +// CreateCspmFindingsFindingIdMarkFalsePositive - Mark CSPM Finding as False Positive +// POST /cspm/findings/{findingId}/mark-false-positive +func (c *Client) CreateCspmFindingsFindingIdMarkFalsePositive(ctx context.Context, in CreateCspmFindingsFindingIdMarkFalsePositiveInput) (*models.EndpointsPostMarkFalsePositiveCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}/mark-false-positive" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + FalsePositiveReason string `json:"falsePositiveReason"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + }{ + FalsePositiveReason: in.FalsePositiveReason, + UserCanonicalID: in.UserCanonicalID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostMarkFalsePositiveCSPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteCspmFindingsFindingIdTicketInput is the input for DeleteCspmFindingsFindingIdTicket — Delete Ticket for CSPM Finding. +type DeleteCspmFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteCspmFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteCspmFindingsFindingIdTicket - Delete Ticket for CSPM Finding +// DELETE /cspm/findings/{findingId}/ticket +func (c *Client) DeleteCspmFindingsFindingIdTicket(ctx context.Context, in DeleteCspmFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketCSPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateCspmFindingsFindingIdTicketInput is the input for CreateCspmFindingsFindingIdTicket — Create Ticket for CSPM Finding. type CreateCspmFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` CampaignTitle *string `json:"campaignTitle,omitempty"` @@ -332,6 +638,9 @@ type CreateCspmFindingsFindingIdTicketInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + // CreateCspmFindingsFindingIdTicket - Create Ticket for CSPM Finding // POST /cspm/findings/{findingId}/ticket func (c *Client) CreateCspmFindingsFindingIdTicket(ctx context.Context, in CreateCspmFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketCSPMFindingOutput, error) { @@ -342,6 +651,9 @@ func (c *Client) CreateCspmFindingsFindingIdTicket(ctx context.Context, in Creat for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -378,13 +690,210 @@ func (c *Client) CreateCspmFindingsFindingIdTicket(ctx context.Context, in Creat return &out, nil } +// ListCspmFindingsFindingIdTriageInput is the input for ListCspmFindingsFindingIdTriage — Get CSPM Finding Triage. +type ListCspmFindingsFindingIdTriageInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListCspmFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + +// ListCspmFindingsFindingIdTriage - Get CSPM Finding Triage +// GET /cspm/findings/{findingId}/triage +func (c *Client) ListCspmFindingsFindingIdTriage(ctx context.Context, in ListCspmFindingsFindingIdTriageInput) (*models.EndpointsGetCSPMFindingTriageOutput, error) { + path := "/cspm/findings/{findingId}/triage" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCSPMFindingTriageOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateCspmFindingsFindingIdUnallowlistInput is the input for CreateCspmFindingsFindingIdUnallowlist — Unallowlist CSPM Finding. +type CreateCspmFindingsFindingIdUnallowlistInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UnallowlistReason *string `json:"unallowlistReason,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + +// CreateCspmFindingsFindingIdUnallowlist - Unallowlist CSPM Finding +// POST /cspm/findings/{findingId}/unallowlist +func (c *Client) CreateCspmFindingsFindingIdUnallowlist(ctx context.Context, in CreateCspmFindingsFindingIdUnallowlistInput) (*models.EndpointsPostUnallowlistCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}/unallowlist" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + UnallowlistReason *string `json:"unallowlistReason,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + }{ + UnallowlistReason: in.UnallowlistReason, + UserCanonicalID: in.UserCanonicalID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostUnallowlistCSPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateCspmFindingsFindingIdUnarchiveInput is the input for CreateCspmFindingsFindingIdUnarchive — Unarchive CSPM Finding. +type CreateCspmFindingsFindingIdUnarchiveInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdUnarchiveInput) SetFindingID(id string) { in.FindingID = id } + +// CreateCspmFindingsFindingIdUnarchive - Unarchive CSPM Finding +// POST /cspm/findings/{findingId}/unarchive +func (c *Client) CreateCspmFindingsFindingIdUnarchive(ctx context.Context, in CreateCspmFindingsFindingIdUnarchiveInput) (*models.EndpointsPostUnarchiveCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}/unarchive" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + }{ + UserCanonicalID: in.UserCanonicalID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostUnarchiveCSPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateCspmFindingsFindingIdUnmarkFalsePositiveInput is the input for CreateCspmFindingsFindingIdUnmarkFalsePositive — Unmark CSPM Finding as False Positive. +type CreateCspmFindingsFindingIdUnmarkFalsePositiveInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateCspmFindingsFindingIdUnmarkFalsePositiveInput) SetFindingID(id string) { in.FindingID = id } + +// CreateCspmFindingsFindingIdUnmarkFalsePositive - Unmark CSPM Finding as False Positive +// POST /cspm/findings/{findingId}/unmark-false-positive +func (c *Client) CreateCspmFindingsFindingIdUnmarkFalsePositive(ctx context.Context, in CreateCspmFindingsFindingIdUnmarkFalsePositiveInput) (*models.EndpointsPostUnmarkFalsePositiveCSPMFindingOutput, error) { + path := "/cspm/findings/{findingId}/unmark-false-positive" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + }{ + UserCanonicalID: in.UserCanonicalID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostUnmarkFalsePositiveCSPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // ListCspmScansInput is the input for ListCspmScans — Get CSPM Scans. type ListCspmScansInput struct { AccountID *string `url:"accountId,omitempty" json:"-"` + CloudProvider *string `url:"cloudProvider,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsArchived *bool `url:"isArchived,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` - Region *string `url:"region,omitempty" json:"-"` - ScanType *string `url:"scanType,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` Status *string `url:"status,omitempty" json:"-"` models.RequestScope } @@ -398,23 +907,32 @@ func (c *Client) ListCspmScans(ctx context.Context, in ListCspmScansInput) (*mod for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } if in.NextToken != nil { query.Set("nextToken", string(*in.NextToken)) } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } if in.Status != nil { query.Set("status", string(*in.Status)) } if in.AccountID != nil { query.Set("accountId", string(*in.AccountID)) } - if in.Region != nil { - query.Set("region", string(*in.Region)) + if in.CloudProvider != nil { + query.Set("cloudProvider", string(*in.CloudProvider)) + } + if in.IsArchived != nil { + query.Set("isArchived", strconv.FormatBool(*in.IsArchived)) } - if in.ScanType != nil { - query.Set("scanType", string(*in.ScanType)) + if in.Search != nil { + query.Set("search", string(*in.Search)) } in.RequestScope.AddTo(query) @@ -434,9 +952,46 @@ func (c *Client) ListCspmScans(ctx context.Context, in ListCspmScansInput) (*mod return &out, nil } +// CreateCspmScansStartInput is the input for CreateCspmScansStart — Start CSPM Scan. +type CreateCspmScansStartInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateCspmScansStart - Start CSPM Scan +// POST /cspm/scans/start +func (c *Client) CreateCspmScansStart(ctx context.Context, in CreateCspmScansStartInput) (*models.EndpointsStartCSPMScanOutput, error) { + path := "/cspm/scans/start" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsStartCSPMScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // GetCspmScansScanIdInput is the input for GetCspmScansScanId — Get CSPM Scan. type GetCspmScansScanIdInput struct { ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -450,6 +1005,9 @@ func (c *Client) GetCspmScansScanId(ctx context.Context, in GetCspmScansScanIdIn for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) diff --git a/internal/api/dast.go b/internal/api/dast.go index 7d6ca6a..cefbf4c 100644 --- a/internal/api/dast.go +++ b/internal/api/dast.go @@ -21,20 +21,32 @@ var _ = fmt.Sprintf var _ = url.PathEscape var _ = models.RequestScope{} -// ListDastBughuntConfigInput is the input for ListDastBughuntConfig — Get BugHunt Config. -type ListDastBughuntConfigInput struct { +// ListDastApplicationsInput is the input for ListDastApplications — List Applications. +type ListDastApplicationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// ListDastBughuntConfig - Get BugHunt Config -// GET /dast/bughunt/config -func (c *Client) ListDastBughuntConfig(ctx context.Context, in ListDastBughuntConfigInput) (*models.EndpointsGetBugHuntConfigOutput, error) { - path := "/dast/bughunt/config" +// ListDastApplications - List Applications +// GET /dast/applications +func (c *Client) ListDastApplications(ctx context.Context, in ListDastApplicationsInput) (*models.EndpointsGetDASTApplicationsOutput, error) { + path := "/dast/applications" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -46,28 +58,36 @@ func (c *Client) ListDastBughuntConfig(ctx context.Context, in ListDastBughuntCo if err != nil { return nil, err } - var out models.EndpointsGetBugHuntConfigOutput + var out models.EndpointsGetDASTApplicationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// UpdateDastBughuntConfigInput is the input for UpdateDastBughuntConfig — Put BugHunt Config. -type UpdateDastBughuntConfigInput struct { - Config models.EndpointsBugHuntConfigInput `json:"config"` +// CreateDastApplicationsInput is the input for CreateDastApplications — Create Application. +type CreateDastApplicationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ContextApplicationID *string `json:"contextApplicationId,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ScopeExcludePatterns []string `json:"scopeExcludePatterns,omitempty"` + WebServiceIds []string `json:"webServiceIds,omitempty"` models.RequestScope } -// UpdateDastBughuntConfig - Put BugHunt Config -// PUT /dast/bughunt/config -func (c *Client) UpdateDastBughuntConfig(ctx context.Context, in UpdateDastBughuntConfigInput) (*models.EndpointsPutBugHuntConfigOutput, error) { - path := "/dast/bughunt/config" +// CreateDastApplications - Create Application +// POST /dast/applications +func (c *Client) CreateDastApplications(ctx context.Context, in CreateDastApplicationsInput) (*models.EndpointsPostDASTApplicationOutput, error) { + path := "/dast/applications" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -76,39 +96,53 @@ func (c *Client) UpdateDastBughuntConfig(ctx context.Context, in UpdateDastBughu } bodyBytes, err := json.Marshal(struct { - Config models.EndpointsBugHuntConfigInput `json:"config"` + ContextApplicationID *string `json:"contextApplicationId,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ScopeExcludePatterns []string `json:"scopeExcludePatterns,omitempty"` + WebServiceIds []string `json:"webServiceIds,omitempty"` }{ - Config: in.Config, + ContextApplicationID: in.ContextApplicationID, + Description: in.Description, + Name: in.Name, + ScopeExcludePatterns: in.ScopeExcludePatterns, + WebServiceIds: in.WebServiceIds, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPutBugHuntConfigOutput + var out models.EndpointsPostDASTApplicationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastBughuntConfigValidateInput is the input for CreateDastBughuntConfigValidate — Validate BugHunt Config. -type CreateDastBughuntConfigValidateInput struct { - Config models.EndpointsBugHuntConfigInput `json:"config"` +// CreateDastApplicationsFromContextInput is the input for CreateDastApplicationsFromContext — Create Assessment Setup From Context Application. +type CreateDastApplicationsFromContextInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ContextApplicationID string `json:"contextApplicationId"` + Name *string `json:"name,omitempty"` + WebServices []models.EndpointsDASTAssessmentWebService `json:"webServices,omitempty"` models.RequestScope } -// CreateDastBughuntConfigValidate - Validate BugHunt Config -// POST /dast/bughunt/config/validate -func (c *Client) CreateDastBughuntConfigValidate(ctx context.Context, in CreateDastBughuntConfigValidateInput) (*models.EndpointsValidateBugHuntConfigOutput, error) { - path := "/dast/bughunt/config/validate" +// CreateDastApplicationsFromContext - Create Assessment Setup From Context Application +// POST /dast/applications/from-context +func (c *Client) CreateDastApplicationsFromContext(ctx context.Context, in CreateDastApplicationsFromContextInput) (*models.EndpointsCreateDASTApplicationFromContextOutput, error) { + path := "/dast/applications/from-context" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -117,9 +151,13 @@ func (c *Client) CreateDastBughuntConfigValidate(ctx context.Context, in CreateD } bodyBytes, err := json.Marshal(struct { - Config models.EndpointsBugHuntConfigInput `json:"config"` + ContextApplicationID string `json:"contextApplicationId"` + Name *string `json:"name,omitempty"` + WebServices []models.EndpointsDASTAssessmentWebService `json:"webServices,omitempty"` }{ - Config: in.Config, + ContextApplicationID: in.ContextApplicationID, + Name: in.Name, + WebServices: in.WebServices, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -128,27 +166,32 @@ func (c *Client) CreateDastBughuntConfigValidate(ctx context.Context, in CreateD if err != nil { return nil, err } - var out models.EndpointsValidateBugHuntConfigOutput + var out models.EndpointsCreateDASTApplicationFromContextOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastBughuntFindingsInput is the input for ListDastBughuntFindings — Get BugHunt Findings. -type ListDastBughuntFindingsInput struct { +// CreateDastApplicationsReadinessInput is the input for CreateDastApplicationsReadiness — Get Application Assessment Readiness. +type CreateDastApplicationsReadinessInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApplicationIds []string `json:"applicationIds,omitempty"` models.RequestScope } -// ListDastBughuntFindings - Get BugHunt Findings -// GET /dast/bughunt/findings -func (c *Client) ListDastBughuntFindings(ctx context.Context, in ListDastBughuntFindingsInput) (*models.EndpointsGetBugHuntFindingsOutput, error) { - path := "/dast/bughunt/findings" +// CreateDastApplicationsReadiness - Get Application Assessment Readiness +// POST /dast/applications/readiness +func (c *Client) CreateDastApplicationsReadiness(ctx context.Context, in CreateDastApplicationsReadinessInput) (*models.EndpointsGetDASTApplicationReadinessOutput, error) { + path := "/dast/applications/readiness" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -156,33 +199,45 @@ func (c *Client) ListDastBughuntFindings(ctx context.Context, in ListDastBughunt fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ApplicationIds []string `json:"applicationIds,omitempty"` + }{ + ApplicationIds: in.ApplicationIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetBugHuntFindingsOutput + var out models.EndpointsGetDASTApplicationReadinessOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetDastBughuntFindingsFindingIdInput is the input for GetDastBughuntFindingsFindingId — Get BugHunt Finding. -type GetDastBughuntFindingsFindingIdInput struct { - FindingID string `path:"findingId" json:"-"` +// DeleteDastApplicationsApplicationIdInput is the input for DeleteDastApplicationsApplicationId — Delete Application. +type DeleteDastApplicationsApplicationIdInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetDastBughuntFindingsFindingId - Get BugHunt Finding -// GET /dast/bughunt/findings/{findingId} -func (c *Client) GetDastBughuntFindingsFindingId(ctx context.Context, in GetDastBughuntFindingsFindingIdInput) (*models.EndpointsGetBugHuntFindingOutput, error) { - path := "/dast/bughunt/findings/{findingId}" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// DeleteDastApplicationsApplicationId - Delete Application +// DELETE /dast/applications/{applicationId} +func (c *Client) DeleteDastApplicationsApplicationId(ctx context.Context, in DeleteDastApplicationsApplicationIdInput) (*models.EndpointsDeleteDASTApplicationOutput, error) { + path := "/dast/applications/{applicationId}" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -190,35 +245,37 @@ func (c *Client) GetDastBughuntFindingsFindingId(ctx context.Context, in GetDast fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetBugHuntFindingOutput + var out models.EndpointsDeleteDASTApplicationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchDastBughuntFindingsFindingIdAllowlistInput is the input for PatchDastBughuntFindingsFindingIdAllowlist — Allowlist BugHunt Finding. -type PatchDastBughuntFindingsFindingIdAllowlistInput struct { - FindingID string `path:"findingId" json:"-"` - Allow bool `json:"allow"` - Reason string `json:"reason"` +// GetDastApplicationsApplicationIdInput is the input for GetDastApplicationsApplicationId — Get Application. +type GetDastApplicationsApplicationIdInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// PatchDastBughuntFindingsFindingIdAllowlist - Allowlist BugHunt Finding -// PATCH /dast/bughunt/findings/{findingId}/allowlist -func (c *Client) PatchDastBughuntFindingsFindingIdAllowlist(ctx context.Context, in PatchDastBughuntFindingsFindingIdAllowlistInput) (*models.EndpointsPatchBugHuntFindingAllowlistOutput, error) { - path := "/dast/bughunt/findings/{findingId}/allowlist" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// GetDastApplicationsApplicationId - Get Application +// GET /dast/applications/{applicationId} +func (c *Client) GetDastApplicationsApplicationId(ctx context.Context, in GetDastApplicationsApplicationIdInput) (*models.EndpointsGetDASTApplicationOutput, error) { + path := "/dast/applications/{applicationId}" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -226,43 +283,41 @@ func (c *Client) PatchDastBughuntFindingsFindingIdAllowlist(ctx context.Context, fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Allow bool `json:"allow"` - Reason string `json:"reason"` - }{ - Allow: in.Allow, - Reason: in.Reason, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPatchBugHuntFindingAllowlistOutput + var out models.EndpointsGetDASTApplicationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastBughuntFindingsFindingIdEventsInput is the input for ListDastBughuntFindingsFindingIdEvents — Get BugHunt Finding Events. -type ListDastBughuntFindingsFindingIdEventsInput struct { - FindingID string `path:"findingId" json:"-"` +// UpdateDastApplicationsApplicationIdInput is the input for UpdateDastApplicationsApplicationId — Update Application. +type UpdateDastApplicationsApplicationIdInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ScopeExcludePatterns []string `json:"scopeExcludePatterns,omitempty"` + WebServiceIds []string `json:"webServiceIds,omitempty"` models.RequestScope } -// ListDastBughuntFindingsFindingIdEvents - Get BugHunt Finding Events -// GET /dast/bughunt/findings/{findingId}/events -func (c *Client) ListDastBughuntFindingsFindingIdEvents(ctx context.Context, in ListDastBughuntFindingsFindingIdEventsInput) (*models.EndpointsGetBugHuntFindingEventsOutput, error) { - path := "/dast/bughunt/findings/{findingId}/events" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// UpdateDastApplicationsApplicationId - Update Application +// PUT /dast/applications/{applicationId} +func (c *Client) UpdateDastApplicationsApplicationId(ctx context.Context, in UpdateDastApplicationsApplicationIdInput) (*models.EndpointsPutDASTApplicationOutput, error) { + path := "/dast/applications/{applicationId}" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -270,33 +325,49 @@ func (c *Client) ListDastBughuntFindingsFindingIdEvents(ctx context.Context, in fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ScopeExcludePatterns []string `json:"scopeExcludePatterns,omitempty"` + WebServiceIds []string `json:"webServiceIds,omitempty"` + }{ + Description: in.Description, + Name: in.Name, + ScopeExcludePatterns: in.ScopeExcludePatterns, + WebServiceIds: in.WebServiceIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetBugHuntFindingEventsOutput + var out models.EndpointsPutDASTApplicationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastBughuntFindingsFindingIdTriageInput is the input for ListDastBughuntFindingsFindingIdTriage — Create Interactor []. -type ListDastBughuntFindingsFindingIdTriageInput struct { - FindingID string `path:"findingId" json:"-"` +// ListDastBughuntConfigInput is the input for ListDastBughuntConfig — Get BugHunt Config. +type ListDastBughuntConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastBughuntFindingsFindingIdTriage - Create Interactor [] -// GET /dast/bughunt/findings/{findingId}/triage -func (c *Client) ListDastBughuntFindingsFindingIdTriage(ctx context.Context, in ListDastBughuntFindingsFindingIdTriageInput) (*models.EndpointsGetBugHuntFindingTriageOutput, error) { - path := "/dast/bughunt/findings/{findingId}/triage" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListDastBughuntConfig - Get BugHunt Config +// GET /dast/bughunt/config +func (c *Client) ListDastBughuntConfig(ctx context.Context, in ListDastBughuntConfigInput) (*models.EndpointsGetBugHuntConfigOutput, error) { + path := "/dast/bughunt/config" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -308,27 +379,32 @@ func (c *Client) ListDastBughuntFindingsFindingIdTriage(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsGetBugHuntFindingTriageOutput + var out models.EndpointsGetBugHuntConfigOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastBughuntScansInput is the input for ListDastBughuntScans — Get BugHunt Scans. -type ListDastBughuntScansInput struct { +// UpdateDastBughuntConfigInput is the input for UpdateDastBughuntConfig — Put BugHunt Config. +type UpdateDastBughuntConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Config models.EndpointsBugHuntConfigInput `json:"config"` models.RequestScope } -// ListDastBughuntScans - Get BugHunt Scans -// GET /dast/bughunt/scans -func (c *Client) ListDastBughuntScans(ctx context.Context, in ListDastBughuntScansInput) (*models.EndpointsGetBugHuntScansOutput, error) { - path := "/dast/bughunt/scans" +// UpdateDastBughuntConfig - Put BugHunt Config +// PUT /dast/bughunt/config +func (c *Client) UpdateDastBughuntConfig(ctx context.Context, in UpdateDastBughuntConfigInput) (*models.EndpointsPutBugHuntConfigOutput, error) { + path := "/dast/bughunt/config" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -336,33 +412,44 @@ func (c *Client) ListDastBughuntScans(ctx context.Context, in ListDastBughuntSca fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Config models.EndpointsBugHuntConfigInput `json:"config"` + }{ + Config: in.Config, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetBugHuntScansOutput + var out models.EndpointsPutBugHuntConfigOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastBughuntScansInput is the input for CreateDastBughuntScans — Start BugHunt Scan. -type CreateDastBughuntScansInput struct { - Intensity models.ModelsBugHuntScanIntensity `json:"intensity"` - Scope models.ModelsScopePolicy `json:"scope"` +// CreateDastBughuntConfigValidateInput is the input for CreateDastBughuntConfigValidate — Validate BugHunt Config. +type CreateDastBughuntConfigValidateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Config models.EndpointsBugHuntConfigInput `json:"config"` models.RequestScope } -// CreateDastBughuntScans - Start BugHunt Scan -// POST /dast/bughunt/scans -func (c *Client) CreateDastBughuntScans(ctx context.Context, in CreateDastBughuntScansInput) (*models.EndpointsPostBugHuntScanOutput, error) { - path := "/dast/bughunt/scans" +// CreateDastBughuntConfigValidate - Validate BugHunt Config +// POST /dast/bughunt/config/validate +func (c *Client) CreateDastBughuntConfigValidate(ctx context.Context, in CreateDastBughuntConfigValidateInput) (*models.EndpointsValidateBugHuntConfigOutput, error) { + path := "/dast/bughunt/config/validate" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -371,11 +458,9 @@ func (c *Client) CreateDastBughuntScans(ctx context.Context, in CreateDastBughun } bodyBytes, err := json.Marshal(struct { - Intensity models.ModelsBugHuntScanIntensity `json:"intensity"` - Scope models.ModelsScopePolicy `json:"scope"` + Config models.EndpointsBugHuntConfigInput `json:"config"` }{ - Intensity: in.Intensity, - Scope: in.Scope, + Config: in.Config, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -384,29 +469,31 @@ func (c *Client) CreateDastBughuntScans(ctx context.Context, in CreateDastBughun if err != nil { return nil, err } - var out models.EndpointsPostBugHuntScanOutput + var out models.EndpointsValidateBugHuntConfigOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetDastBughuntScansScanIdInput is the input for GetDastBughuntScansScanId — Get BugHunt Scan. -type GetDastBughuntScansScanIdInput struct { - ScanID string `path:"scanId" json:"-"` +// ListDastBughuntFindingsInput is the input for ListDastBughuntFindings — Get BugHunt Findings. +type ListDastBughuntFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetDastBughuntScansScanId - Get BugHunt Scan -// GET /dast/bughunt/scans/{scanId} -func (c *Client) GetDastBughuntScansScanId(ctx context.Context, in GetDastBughuntScansScanIdInput) (*models.EndpointsGetBugHuntScanOutput, error) { - path := "/dast/bughunt/scans/{scanId}" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// ListDastBughuntFindings - Get BugHunt Findings +// GET /dast/bughunt/findings +func (c *Client) ListDastBughuntFindings(ctx context.Context, in ListDastBughuntFindingsInput) (*models.EndpointsGetBugHuntFindingsOutput, error) { + path := "/dast/bughunt/findings" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -418,32 +505,35 @@ func (c *Client) GetDastBughuntScansScanId(ctx context.Context, in GetDastBughun if err != nil { return nil, err } - var out models.EndpointsGetBugHuntScanOutput + var out models.EndpointsGetBugHuntFindingsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastBughuntScansScanIdDiffInput is the input for ListDastBughuntScansScanIdDiff — Get BugHunt Scan Diff. -type ListDastBughuntScansScanIdDiffInput struct { - ScanID string `path:"scanId" json:"-"` - Against *string `url:"against,omitempty" json:"-"` +// GetDastBughuntFindingsFindingIdInput is the input for GetDastBughuntFindingsFindingId — Get BugHunt Finding. +type GetDastBughuntFindingsFindingIdInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastBughuntScansScanIdDiff - Get BugHunt Scan Diff -// GET /dast/bughunt/scans/{scanId}/diff -func (c *Client) ListDastBughuntScansScanIdDiff(ctx context.Context, in ListDastBughuntScansScanIdDiffInput) (*models.EndpointsGetBugHuntScanDiffOutput, error) { - path := "/dast/bughunt/scans/{scanId}/diff" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// SetFindingID sets the finding that the request targets. +func (in *GetDastBughuntFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + +// GetDastBughuntFindingsFindingId - Get BugHunt Finding +// GET /dast/bughunt/findings/{findingId} +func (c *Client) GetDastBughuntFindingsFindingId(ctx context.Context, in GetDastBughuntFindingsFindingIdInput) (*models.EndpointsGetBugHuntFindingOutput, error) { + path := "/dast/bughunt/findings/{findingId}" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Against != nil { - query.Set("against", string(*in.Against)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -456,29 +546,38 @@ func (c *Client) ListDastBughuntScansScanIdDiff(ctx context.Context, in ListDast if err != nil { return nil, err } - var out models.EndpointsGetBugHuntScanDiffOutput + var out models.EndpointsGetBugHuntFindingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastBughuntScansScanIdFindingsInput is the input for ListDastBughuntScansScanIdFindings — Get BugHunt Scan Findings. -type ListDastBughuntScansScanIdFindingsInput struct { - ScanID string `path:"scanId" json:"-"` +// PatchDastBughuntFindingsFindingIdAllowlistInput is the input for PatchDastBughuntFindingsFindingIdAllowlist — Allowlist BugHunt Finding. +type PatchDastBughuntFindingsFindingIdAllowlistInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Allow bool `json:"allow"` + Reason string `json:"reason"` models.RequestScope } -// ListDastBughuntScansScanIdFindings - Get BugHunt Scan Findings -// GET /dast/bughunt/scans/{scanId}/findings -func (c *Client) ListDastBughuntScansScanIdFindings(ctx context.Context, in ListDastBughuntScansScanIdFindingsInput) (*models.EndpointsGetBugHuntScanFindingsOutput, error) { - path := "/dast/bughunt/scans/{scanId}/findings" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// SetFindingID sets the finding that the request targets. +func (in *PatchDastBughuntFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + +// PatchDastBughuntFindingsFindingIdAllowlist - Allowlist BugHunt Finding +// PATCH /dast/bughunt/findings/{findingId}/allowlist +func (c *Client) PatchDastBughuntFindingsFindingIdAllowlist(ctx context.Context, in PatchDastBughuntFindingsFindingIdAllowlistInput) (*models.EndpointsPatchBugHuntFindingAllowlistOutput, error) { + path := "/dast/bughunt/findings/{findingId}/allowlist" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -486,67 +585,50 @@ func (c *Client) ListDastBughuntScansScanIdFindings(ctx context.Context, in List fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Allow bool `json:"allow"` + Reason string `json:"reason"` + }{ + Allow: in.Allow, + Reason: in.Reason, + }) if err != nil { - return nil, err - } - var out models.EndpointsGetBugHuntScanFindingsOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListDastBughuntScansScanIdLogsInput is the input for ListDastBughuntScansScanIdLogs — Get BugHunt Sub-Agent Network Log. -type ListDastBughuntScansScanIdLogsInput struct { - ScanID string `path:"scanId" json:"-"` - models.RequestScope -} - -// ListDastBughuntScansScanIdLogs - Get BugHunt Sub-Agent Network Log -// GET /dast/bughunt/scans/{scanId}/logs -func (c *Client) ListDastBughuntScansScanIdLogs(ctx context.Context, in ListDastBughuntScansScanIdLogsInput) (*models.EndpointsGetSubAgentNetworkLogOutput, error) { - path := "/dast/bughunt/scans/{scanId}/logs" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() + return nil, fmt.Errorf("marshal body: %w", err) } - - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetSubAgentNetworkLogOutput + var out models.EndpointsPatchBugHuntFindingAllowlistOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastBughuntScansScanIdStopInput is the input for CreateDastBughuntScansScanIdStop — Stop BugHunt Scan. -type CreateDastBughuntScansScanIdStopInput struct { - ScanID string `path:"scanId" json:"-"` +// ListDastBughuntFindingsFindingIdEventsInput is the input for ListDastBughuntFindingsFindingIdEvents — Get BugHunt Finding Events. +type ListDastBughuntFindingsFindingIdEventsInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateDastBughuntScansScanIdStop - Stop BugHunt Scan -// POST /dast/bughunt/scans/{scanId}/stop -func (c *Client) CreateDastBughuntScansScanIdStop(ctx context.Context, in CreateDastBughuntScansScanIdStopInput) (*models.EndpointsStopBugHuntScanOutput, error) { - path := "/dast/bughunt/scans/{scanId}/stop" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// SetFindingID sets the finding that the request targets. +func (in *ListDastBughuntFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastBughuntFindingsFindingIdEvents - Get BugHunt Finding Events +// GET /dast/bughunt/findings/{findingId}/events +func (c *Client) ListDastBughuntFindingsFindingIdEvents(ctx context.Context, in ListDastBughuntFindingsFindingIdEventsInput) (*models.EndpointsGetBugHuntFindingEventsOutput, error) { + path := "/dast/bughunt/findings/{findingId}/events" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -554,31 +636,40 @@ func (c *Client) CreateDastBughuntScansScanIdStop(ctx context.Context, in Create fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsStopBugHuntScanOutput + var out models.EndpointsGetBugHuntFindingEventsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastBughuntSuiteRunsInput is the input for ListDastBughuntSuiteRuns — Get BugHunt Suite Runs. -type ListDastBughuntSuiteRunsInput struct { +// DeleteDastBughuntFindingsFindingIdTicketInput is the input for DeleteDastBughuntFindingsFindingIdTicket — Delete Ticket for BugHunt Finding. +type DeleteDastBughuntFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastBughuntSuiteRuns - Get BugHunt Suite Runs -// GET /dast/bughunt/suite-runs -func (c *Client) ListDastBughuntSuiteRuns(ctx context.Context, in ListDastBughuntSuiteRunsInput) (*models.EndpointsGetBugHuntSuiteRunsOutput, error) { - path := "/dast/bughunt/suite-runs" +// SetFindingID sets the finding that the request targets. +func (in *DeleteDastBughuntFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteDastBughuntFindingsFindingIdTicket - Delete Ticket for BugHunt Finding +// DELETE /dast/bughunt/findings/{findingId}/ticket +func (c *Client) DeleteDastBughuntFindingsFindingIdTicket(ctx context.Context, in DeleteDastBughuntFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketBugHuntFindingOutput, error) { + path := "/dast/bughunt/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -586,34 +677,43 @@ func (c *Client) ListDastBughuntSuiteRuns(ctx context.Context, in ListDastBughun fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetBugHuntSuiteRunsOutput + var out models.EndpointsDeleteTicketBugHuntFindingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastBughuntSuitesSuiteRunNowInput is the input for CreateDastBughuntSuitesSuiteRunNow — Run BugHunt Suite Now. -type CreateDastBughuntSuitesSuiteRunNowInput struct { - Suite string `path:"suite" json:"-"` - Intensity *models.ModelsBugHuntScanIntensity `json:"intensity,omitempty"` +// CreateDastBughuntFindingsFindingIdTicketInput is the input for CreateDastBughuntFindingsFindingIdTicket — Create Ticket for BugHunt Finding. +type CreateDastBughuntFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Assignees []models.ModelsUser `json:"assignees,omitempty"` + Message *string `json:"message,omitempty"` + Project *string `json:"project,omitempty"` models.RequestScope } -// CreateDastBughuntSuitesSuiteRunNow - Run BugHunt Suite Now -// POST /dast/bughunt/suites/{suite}/run-now -func (c *Client) CreateDastBughuntSuitesSuiteRunNow(ctx context.Context, in CreateDastBughuntSuitesSuiteRunNowInput) (*models.EndpointsPostBugHuntSuiteRunNowOutput, error) { - path := "/dast/bughunt/suites/{suite}/run-now" - path = strings.Replace(path, "{suite}", url.PathEscape(in.Suite), 1) +// SetFindingID sets the finding that the request targets. +func (in *CreateDastBughuntFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// CreateDastBughuntFindingsFindingIdTicket - Create Ticket for BugHunt Finding +// POST /dast/bughunt/findings/{findingId}/ticket +func (c *Client) CreateDastBughuntFindingsFindingIdTicket(ctx context.Context, in CreateDastBughuntFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketBugHuntFindingOutput, error) { + path := "/dast/bughunt/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -622,9 +722,13 @@ func (c *Client) CreateDastBughuntSuitesSuiteRunNow(ctx context.Context, in Crea } bodyBytes, err := json.Marshal(struct { - Intensity *models.ModelsBugHuntScanIntensity `json:"intensity,omitempty"` + Assignees []models.ModelsUser `json:"assignees,omitempty"` + Message *string `json:"message,omitempty"` + Project *string `json:"project,omitempty"` }{ - Intensity: in.Intensity, + Assignees: in.Assignees, + Message: in.Message, + Project: in.Project, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -633,27 +737,36 @@ func (c *Client) CreateDastBughuntSuitesSuiteRunNow(ctx context.Context, in Crea if err != nil { return nil, err } - var out models.EndpointsPostBugHuntSuiteRunNowOutput + var out models.EndpointsPostCreateTicketBugHuntFindingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastCredentialsInput is the input for ListDastCredentials — Get All Credentials. -type ListDastCredentialsInput struct { +// ListDastBughuntFindingsFindingIdTriageInput is the input for ListDastBughuntFindingsFindingIdTriage — Create Interactor []. +type ListDastBughuntFindingsFindingIdTriageInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastCredentials - Get All Credentials -// GET /dast/credentials -func (c *Client) ListDastCredentials(ctx context.Context, in ListDastCredentialsInput) (*models.EndpointsGetCredentialsOutput, error) { - path := "/dast/credentials" +// SetFindingID sets the finding that the request targets. +func (in *ListDastBughuntFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastBughuntFindingsFindingIdTriage - Create Interactor [] +// GET /dast/bughunt/findings/{findingId}/triage +func (c *Client) ListDastBughuntFindingsFindingIdTriage(ctx context.Context, in ListDastBughuntFindingsFindingIdTriageInput) (*models.EndpointsGetBugHuntFindingTriageOutput, error) { + path := "/dast/bughunt/findings/{findingId}/triage" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -665,31 +778,33 @@ func (c *Client) ListDastCredentials(ctx context.Context, in ListDastCredentials if err != nil { return nil, err } - var out models.EndpointsGetCredentialsOutput + var out models.EndpointsGetBugHuntFindingTriageOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastCredentialsInput is the input for CreateDastCredentials — Create Credential. -type CreateDastCredentialsInput struct { - Config models.ModelsCredentialConfig `json:"config"` - Description string `json:"description"` - Name string `json:"name"` - Type models.ModelsCredentialType `json:"type"` +// CreateDastBughuntProgramImportInput is the input for CreateDastBughuntProgramImport — Preview BugHunt Program Import. +type CreateDastBughuntProgramImportInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ProgramType string `json:"programType"` + ProgramURL string `json:"programUrl"` models.RequestScope } -// CreateDastCredentials - Create Credential -// POST /dast/credentials -func (c *Client) CreateDastCredentials(ctx context.Context, in CreateDastCredentialsInput) (*models.EndpointsPostCredentialOutput, error) { - path := "/dast/credentials" +// CreateDastBughuntProgramImport - Preview BugHunt Program Import +// POST /dast/bughunt/program/import +func (c *Client) CreateDastBughuntProgramImport(ctx context.Context, in CreateDastBughuntProgramImportInput) (*models.EndpointsPostBugHuntProgramImportOutput, error) { + path := "/dast/bughunt/program/import" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -698,15 +813,11 @@ func (c *Client) CreateDastCredentials(ctx context.Context, in CreateDastCredent } bodyBytes, err := json.Marshal(struct { - Config models.ModelsCredentialConfig `json:"config"` - Description string `json:"description"` - Name string `json:"name"` - Type models.ModelsCredentialType `json:"type"` + ProgramType string `json:"programType"` + ProgramURL string `json:"programUrl"` }{ - Config: in.Config, - Description: in.Description, - Name: in.Name, - Type: in.Type, + ProgramType: in.ProgramType, + ProgramURL: in.ProgramURL, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -715,29 +826,47 @@ func (c *Client) CreateDastCredentials(ctx context.Context, in CreateDastCredent if err != nil { return nil, err } - var out models.EndpointsPostCredentialOutput + var out models.EndpointsPostBugHuntProgramImportOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteDastCredentialsCredentialIdInput is the input for DeleteDastCredentialsCredentialId — Delete Credential. -type DeleteDastCredentialsCredentialIdInput struct { - CredentialID string `path:"credentialId" json:"-"` +// ListDastBughuntScansInput is the input for ListDastBughuntScans — Get BugHunt Scans. +type ListDastBughuntScansInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` models.RequestScope } -// DeleteDastCredentialsCredentialId - Delete Credential -// DELETE /dast/credentials/{credentialId} -func (c *Client) DeleteDastCredentialsCredentialId(ctx context.Context, in DeleteDastCredentialsCredentialIdInput) (*models.EndpointsDeleteCredentialOutput, error) { - path := "/dast/credentials/{credentialId}" - path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) +// ListDastBughuntScans - Get BugHunt Scans +// GET /dast/bughunt/scans +func (c *Client) ListDastBughuntScans(ctx context.Context, in ListDastBughuntScansInput) (*models.EndpointsGetBugHuntScansOutput, error) { + path := "/dast/bughunt/scans" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -745,33 +874,37 @@ func (c *Client) DeleteDastCredentialsCredentialId(ctx context.Context, in Delet fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteCredentialOutput + var out models.EndpointsGetBugHuntScansOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetDastCredentialsCredentialIdInput is the input for GetDastCredentialsCredentialId — Get Credential. -type GetDastCredentialsCredentialIdInput struct { - CredentialID string `path:"credentialId" json:"-"` +// CreateDastBughuntScansInput is the input for CreateDastBughuntScans — Start BugHunt Scan. +type CreateDastBughuntScansInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Intensity models.ModelsBugHuntScanIntensity `json:"intensity"` + Scope models.ModelsScopePolicy `json:"scope"` models.RequestScope } -// GetDastCredentialsCredentialId - Get Credential -// GET /dast/credentials/{credentialId} -func (c *Client) GetDastCredentialsCredentialId(ctx context.Context, in GetDastCredentialsCredentialIdInput) (*models.EndpointsGetCredentialOutput, error) { - path := "/dast/credentials/{credentialId}" - path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) +// CreateDastBughuntScans - Start BugHunt Scan +// POST /dast/bughunt/scans +func (c *Client) CreateDastBughuntScans(ctx context.Context, in CreateDastBughuntScansInput) (*models.EndpointsPostBugHuntScanOutput, error) { + path := "/dast/bughunt/scans" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -779,37 +912,47 @@ func (c *Client) GetDastCredentialsCredentialId(ctx context.Context, in GetDastC fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Intensity models.ModelsBugHuntScanIntensity `json:"intensity"` + Scope models.ModelsScopePolicy `json:"scope"` + }{ + Intensity: in.Intensity, + Scope: in.Scope, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetCredentialOutput + var out models.EndpointsPostBugHuntScanOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// UpdateDastCredentialsCredentialIdInput is the input for UpdateDastCredentialsCredentialId — Update Credential. -type UpdateDastCredentialsCredentialIdInput struct { - CredentialID string `path:"credentialId" json:"-"` - Config models.ModelsCredentialConfig `json:"config"` - Description string `json:"description"` - Name string `json:"name"` - Type models.ModelsCredentialType `json:"type"` +// GetDastBughuntScansScanIdInput is the input for GetDastBughuntScansScanId — Get BugHunt Scan. +type GetDastBughuntScansScanIdInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// UpdateDastCredentialsCredentialId - Update Credential -// PUT /dast/credentials/{credentialId} -func (c *Client) UpdateDastCredentialsCredentialId(ctx context.Context, in UpdateDastCredentialsCredentialIdInput) (*models.EndpointsPutCredentialOutput, error) { - path := "/dast/credentials/{credentialId}" - path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) +// GetDastBughuntScansScanId - Get BugHunt Scan +// GET /dast/bughunt/scans/{scanId} +func (c *Client) GetDastBughuntScansScanId(ctx context.Context, in GetDastBughuntScansScanIdInput) (*models.EndpointsGetBugHuntScanOutput, error) { + path := "/dast/bughunt/scans/{scanId}" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -817,47 +960,45 @@ func (c *Client) UpdateDastCredentialsCredentialId(ctx context.Context, in Updat fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Config models.ModelsCredentialConfig `json:"config"` - Description string `json:"description"` - Name string `json:"name"` - Type models.ModelsCredentialType `json:"type"` - }{ - Config: in.Config, - Description: in.Description, - Name: in.Name, - Type: in.Type, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPutCredentialOutput + var out models.EndpointsGetBugHuntScanOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastCredentialsCredentialIdValidateInput is the input for CreateDastCredentialsCredentialIdValidate — Validate Credential. -type CreateDastCredentialsCredentialIdValidateInput struct { - CredentialID string `path:"credentialId" json:"-"` +// ListDastBughuntScansScanIdActivityInput is the input for ListDastBughuntScansScanIdActivity — Get BugHunt Scan Activity. +type ListDastBughuntScansScanIdActivityInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + SinceID *string `url:"since_id,omitempty" json:"-"` models.RequestScope } -// CreateDastCredentialsCredentialIdValidate - Validate Credential -// POST /dast/credentials/{credentialId}/validate -func (c *Client) CreateDastCredentialsCredentialIdValidate(ctx context.Context, in CreateDastCredentialsCredentialIdValidateInput) (*models.EndpointsValidateCredentialOutput, error) { - path := "/dast/credentials/{credentialId}/validate" - path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) +// ListDastBughuntScansScanIdActivity - Get BugHunt Scan Activity +// GET /dast/bughunt/scans/{scanId}/activity +func (c *Client) ListDastBughuntScansScanIdActivity(ctx context.Context, in ListDastBughuntScansScanIdActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { + path := "/dast/bughunt/scans/{scanId}/activity" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.SinceID != nil { + query.Set("since_id", string(*in.SinceID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -865,38 +1006,2935 @@ func (c *Client) CreateDastCredentialsCredentialIdValidate(ctx context.Context, fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsValidateCredentialOutput + var out models.EndpointsGetAutofixActivityLogOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestApplicationsInput is the input for ListDastPentestApplications — Get Pentest App Configs. +// ListDastBughuntScansScanIdDiffInput is the input for ListDastBughuntScansScanIdDiff — Get BugHunt Scan Diff. +type ListDastBughuntScansScanIdDiffInput struct { + ScanID string `path:"scanId" json:"-"` + Against *string `url:"against,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastBughuntScansScanIdDiff - Get BugHunt Scan Diff +// GET /dast/bughunt/scans/{scanId}/diff +func (c *Client) ListDastBughuntScansScanIdDiff(ctx context.Context, in ListDastBughuntScansScanIdDiffInput) (*models.EndpointsGetBugHuntScanDiffOutput, error) { + path := "/dast/bughunt/scans/{scanId}/diff" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Against != nil { + query.Set("against", string(*in.Against)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetBugHuntScanDiffOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastBughuntScansScanIdFindingsInput is the input for ListDastBughuntScansScanIdFindings — Get BugHunt Scan Findings. +type ListDastBughuntScansScanIdFindingsInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + models.RequestScope +} + +// ListDastBughuntScansScanIdFindings - Get BugHunt Scan Findings +// GET /dast/bughunt/scans/{scanId}/findings +func (c *Client) ListDastBughuntScansScanIdFindings(ctx context.Context, in ListDastBughuntScansScanIdFindingsInput) (*models.EndpointsGetBugHuntScanFindingsOutput, error) { + path := "/dast/bughunt/scans/{scanId}/findings" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetBugHuntScanFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastBughuntScansScanIdLogsInput is the input for ListDastBughuntScansScanIdLogs — Get BugHunt Sub-Agent Network Log. +type ListDastBughuntScansScanIdLogsInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastBughuntScansScanIdLogs - Get BugHunt Sub-Agent Network Log +// GET /dast/bughunt/scans/{scanId}/logs +func (c *Client) ListDastBughuntScansScanIdLogs(ctx context.Context, in ListDastBughuntScansScanIdLogsInput) (*models.EndpointsGetSubAgentNetworkLogOutput, error) { + path := "/dast/bughunt/scans/{scanId}/logs" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSubAgentNetworkLogOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastBughuntScansScanIdStatusInput is the input for ListDastBughuntScansScanIdStatus — Get BugHunt Scan Status. +type ListDastBughuntScansScanIdStatusInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastBughuntScansScanIdStatus - Get BugHunt Scan Status +// GET /dast/bughunt/scans/{scanId}/status +func (c *Client) ListDastBughuntScansScanIdStatus(ctx context.Context, in ListDastBughuntScansScanIdStatusInput) (*models.EndpointsBugHuntScanStatusOutput, error) { + path := "/dast/bughunt/scans/{scanId}/status" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsBugHuntScanStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastBughuntScansScanIdStopInput is the input for CreateDastBughuntScansScanIdStop — Stop BugHunt Scan. +type CreateDastBughuntScansScanIdStopInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateDastBughuntScansScanIdStop - Stop BugHunt Scan +// POST /dast/bughunt/scans/{scanId}/stop +func (c *Client) CreateDastBughuntScansScanIdStop(ctx context.Context, in CreateDastBughuntScansScanIdStopInput) (*models.EndpointsStopBugHuntScanOutput, error) { + path := "/dast/bughunt/scans/{scanId}/stop" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsStopBugHuntScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastBughuntSuiteRunsInput is the input for ListDastBughuntSuiteRuns — Get BugHunt Suite Runs. +type ListDastBughuntSuiteRunsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastBughuntSuiteRuns - Get BugHunt Suite Runs +// GET /dast/bughunt/suite-runs +func (c *Client) ListDastBughuntSuiteRuns(ctx context.Context, in ListDastBughuntSuiteRunsInput) (*models.EndpointsGetBugHuntSuiteRunsOutput, error) { + path := "/dast/bughunt/suite-runs" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetBugHuntSuiteRunsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastBughuntSuitesSuiteRunNowInput is the input for CreateDastBughuntSuitesSuiteRunNow — Run BugHunt Suite Now. +type CreateDastBughuntSuitesSuiteRunNowInput struct { + Suite string `path:"suite" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Intensity *models.ModelsBugHuntScanIntensity `json:"intensity,omitempty"` + models.RequestScope +} + +// CreateDastBughuntSuitesSuiteRunNow - Run BugHunt Suite Now +// POST /dast/bughunt/suites/{suite}/run-now +func (c *Client) CreateDastBughuntSuitesSuiteRunNow(ctx context.Context, in CreateDastBughuntSuitesSuiteRunNowInput) (*models.EndpointsPostBugHuntSuiteRunNowOutput, error) { + path := "/dast/bughunt/suites/{suite}/run-now" + path = strings.Replace(path, "{suite}", url.PathEscape(in.Suite), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Intensity *models.ModelsBugHuntScanIntensity `json:"intensity,omitempty"` + }{ + Intensity: in.Intensity, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostBugHuntSuiteRunNowOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastCredentialsInput is the input for ListDastCredentials — Get All Credentials. +type ListDastCredentialsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + models.RequestScope +} + +// ListDastCredentials - Get All Credentials +// GET /dast/credentials +func (c *Client) ListDastCredentials(ctx context.Context, in ListDastCredentialsInput) (*models.EndpointsGetCredentialsOutput, error) { + path := "/dast/credentials" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCredentialsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastCredentialsInput is the input for CreateDastCredentials — Create Credential. +type CreateDastCredentialsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Config models.ModelsCredentialConfig `json:"config"` + Description string `json:"description"` + Name string `json:"name"` + Type models.ModelsCredentialType `json:"type"` + models.RequestScope +} + +// CreateDastCredentials - Create Credential +// POST /dast/credentials +func (c *Client) CreateDastCredentials(ctx context.Context, in CreateDastCredentialsInput) (*models.EndpointsPostCredentialOutput, error) { + path := "/dast/credentials" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Config models.ModelsCredentialConfig `json:"config"` + Description string `json:"description"` + Name string `json:"name"` + Type models.ModelsCredentialType `json:"type"` + }{ + Config: in.Config, + Description: in.Description, + Name: in.Name, + Type: in.Type, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostCredentialOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastCredentialsValidateInput is the input for CreateDastCredentialsValidate — Validate Credentials. +type CreateDastCredentialsValidateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CredentialIds []string `json:"credentialIds,omitempty"` + TestURL *string `json:"testUrl,omitempty"` + models.RequestScope +} + +// CreateDastCredentialsValidate - Validate Credentials +// POST /dast/credentials/validate +func (c *Client) CreateDastCredentialsValidate(ctx context.Context, in CreateDastCredentialsValidateInput) (*models.EndpointsValidateCredentialsOutput, error) { + path := "/dast/credentials/validate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CredentialIds []string `json:"credentialIds,omitempty"` + TestURL *string `json:"testUrl,omitempty"` + }{ + CredentialIds: in.CredentialIds, + TestURL: in.TestURL, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsValidateCredentialsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteDastCredentialsCredentialIdInput is the input for DeleteDastCredentialsCredentialId — Delete Credential. +type DeleteDastCredentialsCredentialIdInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteDastCredentialsCredentialId - Delete Credential +// DELETE /dast/credentials/{credentialId} +func (c *Client) DeleteDastCredentialsCredentialId(ctx context.Context, in DeleteDastCredentialsCredentialIdInput) (*models.EndpointsDeleteCredentialOutput, error) { + path := "/dast/credentials/{credentialId}" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteCredentialOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetDastCredentialsCredentialIdInput is the input for GetDastCredentialsCredentialId — Get Credential. +type GetDastCredentialsCredentialIdInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetDastCredentialsCredentialId - Get Credential +// GET /dast/credentials/{credentialId} +func (c *Client) GetDastCredentialsCredentialId(ctx context.Context, in GetDastCredentialsCredentialIdInput) (*models.EndpointsGetCredentialOutput, error) { + path := "/dast/credentials/{credentialId}" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCredentialOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateDastCredentialsCredentialIdInput is the input for UpdateDastCredentialsCredentialId — Update Credential. +type UpdateDastCredentialsCredentialIdInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Config models.ModelsCredentialConfig `json:"config"` + Description string `json:"description"` + Name string `json:"name"` + Type models.ModelsCredentialType `json:"type"` + models.RequestScope +} + +// UpdateDastCredentialsCredentialId - Update Credential +// PUT /dast/credentials/{credentialId} +func (c *Client) UpdateDastCredentialsCredentialId(ctx context.Context, in UpdateDastCredentialsCredentialIdInput) (*models.EndpointsPutCredentialOutput, error) { + path := "/dast/credentials/{credentialId}" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Config models.ModelsCredentialConfig `json:"config"` + Description string `json:"description"` + Name string `json:"name"` + Type models.ModelsCredentialType `json:"type"` + }{ + Config: in.Config, + Description: in.Description, + Name: in.Name, + Type: in.Type, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutCredentialOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateDastCredentialsCredentialIdActiveInput is the input for UpdateDastCredentialsCredentialIdActive — Switch Credential On or Off. +type UpdateDastCredentialsCredentialIdActiveInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsActive bool `json:"isActive"` + models.RequestScope +} + +// UpdateDastCredentialsCredentialIdActive - Switch Credential On or Off +// PUT /dast/credentials/{credentialId}/active +func (c *Client) UpdateDastCredentialsCredentialIdActive(ctx context.Context, in UpdateDastCredentialsCredentialIdActiveInput) (*models.EndpointsPutCredentialActiveOutput, error) { + path := "/dast/credentials/{credentialId}/active" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + IsActive bool `json:"isActive"` + }{ + IsActive: in.IsActive, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutCredentialActiveOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastCredentialsCredentialIdValidateInput is the input for CreateDastCredentialsCredentialIdValidate — Validate Credential. +type CreateDastCredentialsCredentialIdValidateInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TestURL *string `json:"testUrl,omitempty"` + models.RequestScope +} + +// CreateDastCredentialsCredentialIdValidate - Validate Credential +// POST /dast/credentials/{credentialId}/validate +func (c *Client) CreateDastCredentialsCredentialIdValidate(ctx context.Context, in CreateDastCredentialsCredentialIdValidateInput) (*models.EndpointsValidateCredentialOutput, error) { + path := "/dast/credentials/{credentialId}/validate" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + TestURL *string `json:"testUrl,omitempty"` + }{ + TestURL: in.TestURL, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsValidateCredentialOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastCredentialsCredentialIdValidationsInput is the input for ListDastCredentialsCredentialIdValidations — Credential Validation History. +type ListDastCredentialsCredentialIdValidationsInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + models.RequestScope +} + +// ListDastCredentialsCredentialIdValidations - Credential Validation History +// GET /dast/credentials/{credentialId}/validations +func (c *Client) ListDastCredentialsCredentialIdValidations(ctx context.Context, in ListDastCredentialsCredentialIdValidationsInput) (*models.EndpointsPaginatedValidations, error) { + path := "/dast/credentials/{credentialId}/validations" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsPaginatedValidations + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastCredentialsCredentialIdValidationsInput is the input for CreateDastCredentialsCredentialIdValidations — Start Credential Validation. +type CreateDastCredentialsCredentialIdValidationsInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TestURL *string `json:"testUrl,omitempty"` + models.RequestScope +} + +// CreateDastCredentialsCredentialIdValidations - Start Credential Validation +// POST /dast/credentials/{credentialId}/validations +func (c *Client) CreateDastCredentialsCredentialIdValidations(ctx context.Context, in CreateDastCredentialsCredentialIdValidationsInput) (*models.EndpointsDASTCredentialValidationRun, error) { + path := "/dast/credentials/{credentialId}/validations" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + TestURL *string `json:"testUrl,omitempty"` + }{ + TestURL: in.TestURL, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsDASTCredentialValidationRun + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastCredentialsCredentialIdValidationsStatusInput is the input for ListDastCredentialsCredentialIdValidationsStatus — Credential Validation Status. +type ListDastCredentialsCredentialIdValidationsStatusInput struct { + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastCredentialsCredentialIdValidationsStatus - Credential Validation Status +// GET /dast/credentials/{credentialId}/validations/status +func (c *Client) ListDastCredentialsCredentialIdValidationsStatus(ctx context.Context, in ListDastCredentialsCredentialIdValidationsStatusInput) (*models.EndpointsDASTCredentialValidationRun, error) { + path := "/dast/credentials/{credentialId}/validations/status" + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDASTCredentialValidationRun + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastExploitValidationAttemptsInput is the input for ListDastExploitValidationAttempts — List Exploit Validation Attempts. +type ListDastExploitValidationAttemptsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + models.RequestScope +} + +// ListDastExploitValidationAttempts - List Exploit Validation Attempts +// GET /dast/exploit-validation/attempts +func (c *Client) ListDastExploitValidationAttempts(ctx context.Context, in ListDastExploitValidationAttemptsInput) (*models.EndpointsListExploitValidationAttemptsOutput, error) { + path := "/dast/exploit-validation/attempts" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListExploitValidationAttemptsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetDastExploitValidationFindingsFindingIdEvidenceEvidenceIdInput is the input for GetDastExploitValidationFindingsFindingIdEvidenceEvidenceId — Get an Exploit Validation Evidence File. +type GetDastExploitValidationFindingsFindingIdEvidenceEvidenceIdInput struct { + FindingID string `path:"findingId" json:"-"` + EvidenceID string `path:"evidenceId" json:"-"` + FindingType *string `url:"findingType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *GetDastExploitValidationFindingsFindingIdEvidenceEvidenceIdInput) SetFindingID(id string) { in.FindingID = id } + +// GetDastExploitValidationFindingsFindingIdEvidenceEvidenceId - Get an Exploit Validation Evidence File +// GET /dast/exploit-validation/findings/{findingId}/evidence/{evidenceId} +func (c *Client) GetDastExploitValidationFindingsFindingIdEvidenceEvidenceId(ctx context.Context, in GetDastExploitValidationFindingsFindingIdEvidenceEvidenceIdInput) (*models.EndpointsGetExploitEvidenceOutput, error) { + path := "/dast/exploit-validation/findings/{findingId}/evidence/{evidenceId}" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + path = strings.Replace(path, "{evidenceId}", url.PathEscape(in.EvidenceID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.FindingType != nil { + query.Set("findingType", string(*in.FindingType)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetExploitEvidenceOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastExploitValidationFindingsFindingIdValidateInput is the input for CreateDastExploitValidationFindingsFindingIdValidate — Start Exploit Validation for a Finding. +type CreateDastExploitValidationFindingsFindingIdValidateInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateDastExploitValidationFindingsFindingIdValidateInput) SetFindingID(id string) { in.FindingID = id } + +// CreateDastExploitValidationFindingsFindingIdValidate - Start Exploit Validation for a Finding +// POST /dast/exploit-validation/findings/{findingId}/validate +func (c *Client) CreateDastExploitValidationFindingsFindingIdValidate(ctx context.Context, in CreateDastExploitValidationFindingsFindingIdValidateInput) (*models.EndpointsStartExploitValidationOutput, error) { + path := "/dast/exploit-validation/findings/{findingId}/validate" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsStartExploitValidationOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastExploitValidationPoliciesInput is the input for ListDastExploitValidationPolicies — List Exploit Validation Policies. +type ListDastExploitValidationPoliciesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastExploitValidationPolicies - List Exploit Validation Policies +// GET /dast/exploit-validation/policies +func (c *Client) ListDastExploitValidationPolicies(ctx context.Context, in ListDastExploitValidationPoliciesInput) (*models.EndpointsGetDASTExploitValidationPoliciesOutput, error) { + path := "/dast/exploit-validation/policies" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDASTExploitValidationPoliciesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastExploitValidationPoliciesInput is the input for CreateDastExploitValidationPolicies — Create Exploit Validation Policy. +type CreateDastExploitValidationPoliciesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DaysOfWeek []int `json:"daysOfWeek,omitempty"` + Enabled bool `json:"enabled"` + EndTime string `json:"endTime"` + FindingTypes []models.ModelsDASTExploitValidationFindingType `json:"findingTypes,omitempty"` + MinimumExploitability string `json:"minimumExploitability"` + MinimumSeverity string `json:"minimumSeverity"` + Name string `json:"name"` + RevalidationCooldownDays int `json:"revalidationCooldownDays"` + StartTime string `json:"startTime"` + Timezone string `json:"timezone"` + WebServiceIds []string `json:"webServiceIds,omitempty"` + models.RequestScope +} + +// CreateDastExploitValidationPolicies - Create Exploit Validation Policy +// POST /dast/exploit-validation/policies +func (c *Client) CreateDastExploitValidationPolicies(ctx context.Context, in CreateDastExploitValidationPoliciesInput) (*models.EndpointsPostDASTExploitValidationPolicyOutput, error) { + path := "/dast/exploit-validation/policies" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DaysOfWeek []int `json:"daysOfWeek,omitempty"` + Enabled bool `json:"enabled"` + EndTime string `json:"endTime"` + FindingTypes []models.ModelsDASTExploitValidationFindingType `json:"findingTypes,omitempty"` + MinimumExploitability string `json:"minimumExploitability"` + MinimumSeverity string `json:"minimumSeverity"` + Name string `json:"name"` + RevalidationCooldownDays int `json:"revalidationCooldownDays"` + StartTime string `json:"startTime"` + Timezone string `json:"timezone"` + WebServiceIds []string `json:"webServiceIds,omitempty"` + }{ + DaysOfWeek: in.DaysOfWeek, + Enabled: in.Enabled, + EndTime: in.EndTime, + FindingTypes: in.FindingTypes, + MinimumExploitability: in.MinimumExploitability, + MinimumSeverity: in.MinimumSeverity, + Name: in.Name, + RevalidationCooldownDays: in.RevalidationCooldownDays, + StartTime: in.StartTime, + Timezone: in.Timezone, + WebServiceIds: in.WebServiceIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostDASTExploitValidationPolicyOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteDastExploitValidationPoliciesPolicyIdInput is the input for DeleteDastExploitValidationPoliciesPolicyId — Delete Exploit Validation Policy. +type DeleteDastExploitValidationPoliciesPolicyIdInput struct { + PolicyID string `path:"policyId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteDastExploitValidationPoliciesPolicyId - Delete Exploit Validation Policy +// DELETE /dast/exploit-validation/policies/{policyId} +func (c *Client) DeleteDastExploitValidationPoliciesPolicyId(ctx context.Context, in DeleteDastExploitValidationPoliciesPolicyIdInput) (*models.EndpointsDeleteDASTExploitValidationPolicyOutput, error) { + path := "/dast/exploit-validation/policies/{policyId}" + path = strings.Replace(path, "{policyId}", url.PathEscape(in.PolicyID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteDASTExploitValidationPolicyOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateDastExploitValidationPoliciesPolicyIdInput is the input for UpdateDastExploitValidationPoliciesPolicyId — Update Exploit Validation Policy. +type UpdateDastExploitValidationPoliciesPolicyIdInput struct { + PolicyID string `path:"policyId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DaysOfWeek []int `json:"daysOfWeek,omitempty"` + Enabled bool `json:"enabled"` + EndTime string `json:"endTime"` + FindingTypes []models.ModelsDASTExploitValidationFindingType `json:"findingTypes,omitempty"` + MinimumExploitability string `json:"minimumExploitability"` + MinimumSeverity string `json:"minimumSeverity"` + Name string `json:"name"` + RevalidationCooldownDays int `json:"revalidationCooldownDays"` + StartTime string `json:"startTime"` + Timezone string `json:"timezone"` + WebServiceIds []string `json:"webServiceIds,omitempty"` + models.RequestScope +} + +// UpdateDastExploitValidationPoliciesPolicyId - Update Exploit Validation Policy +// PUT /dast/exploit-validation/policies/{policyId} +func (c *Client) UpdateDastExploitValidationPoliciesPolicyId(ctx context.Context, in UpdateDastExploitValidationPoliciesPolicyIdInput) (*models.EndpointsPutDASTExploitValidationPolicyOutput, error) { + path := "/dast/exploit-validation/policies/{policyId}" + path = strings.Replace(path, "{policyId}", url.PathEscape(in.PolicyID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DaysOfWeek []int `json:"daysOfWeek,omitempty"` + Enabled bool `json:"enabled"` + EndTime string `json:"endTime"` + FindingTypes []models.ModelsDASTExploitValidationFindingType `json:"findingTypes,omitempty"` + MinimumExploitability string `json:"minimumExploitability"` + MinimumSeverity string `json:"minimumSeverity"` + Name string `json:"name"` + RevalidationCooldownDays int `json:"revalidationCooldownDays"` + StartTime string `json:"startTime"` + Timezone string `json:"timezone"` + WebServiceIds []string `json:"webServiceIds,omitempty"` + }{ + DaysOfWeek: in.DaysOfWeek, + Enabled: in.Enabled, + EndTime: in.EndTime, + FindingTypes: in.FindingTypes, + MinimumExploitability: in.MinimumExploitability, + MinimumSeverity: in.MinimumSeverity, + Name: in.Name, + RevalidationCooldownDays: in.RevalidationCooldownDays, + StartTime: in.StartTime, + Timezone: in.Timezone, + WebServiceIds: in.WebServiceIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutDASTExploitValidationPolicyOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastExploitValidationPoliciesPolicyIdArmInput is the input for CreateDastExploitValidationPoliciesPolicyIdArm — Arm an Exploit Validation Policy. +type CreateDastExploitValidationPoliciesPolicyIdArmInput struct { + PolicyID string `path:"policyId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Capabilities []models.ModelsDASTExploitValidationCapability `json:"capabilities,omitempty"` + ExpectedUpdatedAt string `json:"expectedUpdatedAt"` + SafetyContractVersion int `json:"safetyContractVersion"` + models.RequestScope +} + +// CreateDastExploitValidationPoliciesPolicyIdArm - Arm an Exploit Validation Policy +// POST /dast/exploit-validation/policies/{policyId}/arm +func (c *Client) CreateDastExploitValidationPoliciesPolicyIdArm(ctx context.Context, in CreateDastExploitValidationPoliciesPolicyIdArmInput) (*models.EndpointsPostDASTExploitValidationPolicyArmOutput, error) { + path := "/dast/exploit-validation/policies/{policyId}/arm" + path = strings.Replace(path, "{policyId}", url.PathEscape(in.PolicyID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Capabilities []models.ModelsDASTExploitValidationCapability `json:"capabilities,omitempty"` + ExpectedUpdatedAt string `json:"expectedUpdatedAt"` + SafetyContractVersion int `json:"safetyContractVersion"` + }{ + Capabilities: in.Capabilities, + ExpectedUpdatedAt: in.ExpectedUpdatedAt, + SafetyContractVersion: in.SafetyContractVersion, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostDASTExploitValidationPolicyArmOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastExploitValidationPoliciesPolicyIdDisarmInput is the input for CreateDastExploitValidationPoliciesPolicyIdDisarm — Disarm an Exploit Validation Policy. +type CreateDastExploitValidationPoliciesPolicyIdDisarmInput struct { + PolicyID string `path:"policyId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateDastExploitValidationPoliciesPolicyIdDisarm - Disarm an Exploit Validation Policy +// POST /dast/exploit-validation/policies/{policyId}/disarm +func (c *Client) CreateDastExploitValidationPoliciesPolicyIdDisarm(ctx context.Context, in CreateDastExploitValidationPoliciesPolicyIdDisarmInput) (*models.EndpointsPostDASTExploitValidationPolicyDisarmOutput, error) { + path := "/dast/exploit-validation/policies/{policyId}/disarm" + path = strings.Replace(path, "{policyId}", url.PathEscape(in.PolicyID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsPostDASTExploitValidationPolicyDisarmOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetDastExploitValidationRunsRunIdInput is the input for GetDastExploitValidationRunsRunId — Get Exploit Validation Run. +type GetDastExploitValidationRunsRunIdInput struct { + RunID string `path:"runId" json:"-"` + ExecutionArn *string `url:"executionArn,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetDastExploitValidationRunsRunId - Get Exploit Validation Run +// GET /dast/exploit-validation/runs/{runId} +func (c *Client) GetDastExploitValidationRunsRunId(ctx context.Context, in GetDastExploitValidationRunsRunIdInput) (*models.EndpointsGetExploitValidationRunOutput, error) { + path := "/dast/exploit-validation/runs/{runId}" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.ExecutionArn != nil { + query.Set("executionArn", string(*in.ExecutionArn)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetExploitValidationRunOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestApplicationsInput is the input for ListDastPentestApplications — Get Pentest App Configs. type ListDastPentestApplicationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestApplications - Get Pentest App Configs +// GET /dast/pentest/applications +func (c *Client) ListDastPentestApplications(ctx context.Context, in ListDastPentestApplicationsInput) (*models.EndpointsGetPentestAppConfigsOutput, error) { + path := "/dast/pentest/applications" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestAppConfigsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastPentestApplicationsInput is the input for CreateDastPentestApplications — Create Application. +type CreateDastPentestApplicationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CredentialIds []string `json:"credentialIds,omitempty"` + ID *string `json:"id,omitempty"` + Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` + models.RequestScope +} + +// CreateDastPentestApplications - Create Application +// POST /dast/pentest/applications +func (c *Client) CreateDastPentestApplications(ctx context.Context, in CreateDastPentestApplicationsInput) (*models.EndpointsPostPentestAppConfigOutput, error) { + path := "/dast/pentest/applications" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CredentialIds []string `json:"credentialIds,omitempty"` + ID *string `json:"id,omitempty"` + Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` + }{ + CredentialIds: in.CredentialIds, + ID: in.ID, + Targets: in.Targets, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostPentestAppConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteDastPentestApplicationsApplicationIdInput is the input for DeleteDastPentestApplicationsApplicationId — Delete Pentest App Config. +type DeleteDastPentestApplicationsApplicationIdInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteDastPentestApplicationsApplicationId - Delete Pentest App Config +// DELETE /dast/pentest/applications/{applicationId} +func (c *Client) DeleteDastPentestApplicationsApplicationId(ctx context.Context, in DeleteDastPentestApplicationsApplicationIdInput) (*models.EndpointsDeletePentestAppConfigOutput, error) { + path := "/dast/pentest/applications/{applicationId}" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeletePentestAppConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetDastPentestApplicationsApplicationIdInput is the input for GetDastPentestApplicationsApplicationId — Get Pentest App Config. +type GetDastPentestApplicationsApplicationIdInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetDastPentestApplicationsApplicationId - Get Pentest App Config +// GET /dast/pentest/applications/{applicationId} +func (c *Client) GetDastPentestApplicationsApplicationId(ctx context.Context, in GetDastPentestApplicationsApplicationIdInput) (*models.EndpointsGetPentestAppConfigOutput, error) { + path := "/dast/pentest/applications/{applicationId}" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestAppConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchDastPentestApplicationsApplicationIdInput is the input for PatchDastPentestApplicationsApplicationId — Partially Update Application. +type PatchDastPentestApplicationsApplicationIdInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CredentialIds []string `json:"credentialIds,omitempty"` + Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` + models.RequestScope +} + +// PatchDastPentestApplicationsApplicationId - Partially Update Application +// PATCH /dast/pentest/applications/{applicationId} +func (c *Client) PatchDastPentestApplicationsApplicationId(ctx context.Context, in PatchDastPentestApplicationsApplicationIdInput) (*models.EndpointsPatchPentestAppConfigOutput, error) { + path := "/dast/pentest/applications/{applicationId}" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CredentialIds []string `json:"credentialIds,omitempty"` + Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` + }{ + CredentialIds: in.CredentialIds, + Targets: in.Targets, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchPentestAppConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateDastPentestApplicationsApplicationIdInput is the input for UpdateDastPentestApplicationsApplicationId — Update Application. +type UpdateDastPentestApplicationsApplicationIdInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CredentialIds []string `json:"credentialIds,omitempty"` + Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` + models.RequestScope +} + +// UpdateDastPentestApplicationsApplicationId - Update Application +// PUT /dast/pentest/applications/{applicationId} +func (c *Client) UpdateDastPentestApplicationsApplicationId(ctx context.Context, in UpdateDastPentestApplicationsApplicationIdInput) (*models.EndpointsPutPentestAppConfigOutput, error) { + path := "/dast/pentest/applications/{applicationId}" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CredentialIds []string `json:"credentialIds,omitempty"` + Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` + }{ + CredentialIds: in.CredentialIds, + Targets: in.Targets, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutPentestAppConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestApplicationsApplicationIdEstimateInput is the input for ListDastPentestApplicationsApplicationIdEstimate — Get Pentest Cost Estimate. +type ListDastPentestApplicationsApplicationIdEstimateInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestApplicationsApplicationIdEstimate - Get Pentest Cost Estimate +// GET /dast/pentest/applications/{applicationId}/estimate +func (c *Client) ListDastPentestApplicationsApplicationIdEstimate(ctx context.Context, in ListDastPentestApplicationsApplicationIdEstimateInput) (*models.EndpointsGetPentestEstimateOutput, error) { + path := "/dast/pentest/applications/{applicationId}/estimate" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestEstimateOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateDastPentestApplicationsApplicationIdMutationConsentInput is the input for UpdateDastPentestApplicationsApplicationIdMutationConsent — Create Interactor []. +type UpdateDastPentestApplicationsApplicationIdMutationConsentInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Enabled bool `json:"enabled"` + WarningVersion *string `json:"warningVersion,omitempty"` + models.RequestScope +} + +// UpdateDastPentestApplicationsApplicationIdMutationConsent - Create Interactor [] +// PUT /dast/pentest/applications/{applicationId}/mutation-consent +func (c *Client) UpdateDastPentestApplicationsApplicationIdMutationConsent(ctx context.Context, in UpdateDastPentestApplicationsApplicationIdMutationConsentInput) ([]byte, error) { + path := "/dast/pentest/applications/{applicationId}/mutation-consent" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Enabled bool `json:"enabled"` + WarningVersion *string `json:"warningVersion,omitempty"` + }{ + Enabled: in.Enabled, + WarningVersion: in.WarningVersion, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + return data, err +} + +// CreateDastPentestApplicationsApplicationIdPreflightInput is the input for CreateDastPentestApplicationsApplicationIdPreflight — Start Pentest Preflight. +type CreateDastPentestApplicationsApplicationIdPreflightInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Deployment *models.ModelsPentestDeployment `json:"deployment,omitempty"` + TriggeredByScan *bool `json:"triggeredByScan,omitempty"` + models.RequestScope +} + +// CreateDastPentestApplicationsApplicationIdPreflight - Start Pentest Preflight +// POST /dast/pentest/applications/{applicationId}/preflight +func (c *Client) CreateDastPentestApplicationsApplicationIdPreflight(ctx context.Context, in CreateDastPentestApplicationsApplicationIdPreflightInput) (*models.EndpointsStartPentestPreflightOutput, error) { + path := "/dast/pentest/applications/{applicationId}/preflight" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Deployment *models.ModelsPentestDeployment `json:"deployment,omitempty"` + TriggeredByScan *bool `json:"triggeredByScan,omitempty"` + }{ + Deployment: in.Deployment, + TriggeredByScan: in.TriggeredByScan, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsStartPentestPreflightOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestApplicationsApplicationIdPreflightLatestInput is the input for ListDastPentestApplicationsApplicationIdPreflightLatest — Get Latest Pentest Preflight for Application. +type ListDastPentestApplicationsApplicationIdPreflightLatestInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TargetID *string `url:"targetId,omitempty" json:"-"` + WebServiceID *string `url:"webServiceId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestApplicationsApplicationIdPreflightLatest - Get Latest Pentest Preflight for Application +// GET /dast/pentest/applications/{applicationId}/preflight/latest +func (c *Client) ListDastPentestApplicationsApplicationIdPreflightLatest(ctx context.Context, in ListDastPentestApplicationsApplicationIdPreflightLatestInput) (*models.EndpointsGetLatestPentestPreflightOutput, error) { + path := "/dast/pentest/applications/{applicationId}/preflight/latest" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.WebServiceID != nil { + query.Set("webServiceId", string(*in.WebServiceID)) + } + if in.TargetID != nil { + query.Set("targetId", string(*in.TargetID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetLatestPentestPreflightOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestApplicationsApplicationIdPreflightQuotaInput is the input for ListDastPentestApplicationsApplicationIdPreflightQuota — Get Pentest Preflight Quota. +type ListDastPentestApplicationsApplicationIdPreflightQuotaInput struct { + ApplicationID string `path:"applicationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestApplicationsApplicationIdPreflightQuota - Get Pentest Preflight Quota +// GET /dast/pentest/applications/{applicationId}/preflight/quota +func (c *Client) ListDastPentestApplicationsApplicationIdPreflightQuota(ctx context.Context, in ListDastPentestApplicationsApplicationIdPreflightQuotaInput) (*models.EndpointsGetPentestPreflightQuotaOutput, error) { + path := "/dast/pentest/applications/{applicationId}/preflight/quota" + path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestPreflightQuotaOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestBudgetInput is the input for ListDastPentestBudget — Get Pentest Budget. +type ListDastPentestBudgetInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestBudget - Get Pentest Budget +// GET /dast/pentest/budget +func (c *Client) ListDastPentestBudget(ctx context.Context, in ListDastPentestBudgetInput) (*models.EndpointsGetPentestBudgetOutput, error) { + path := "/dast/pentest/budget" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestBudgetOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestFindingsInput is the input for ListDastPentestFindings — Get Pentest Findings. +type ListDastPentestFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` + IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` + IsLatest *bool `url:"isLatest,omitempty" json:"-"` + IsResolved *bool `url:"isResolved,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + PriorityLabel *string `url:"priorityLabel,omitempty" json:"-"` + ScanID *string `url:"scanId,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` + SortBy *string `url:"sortBy,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestFindings - Get Pentest Findings +// GET /dast/pentest/findings +func (c *Client) ListDastPentestFindings(ctx context.Context, in ListDastPentestFindingsInput) (*models.EndpointsGetPentestFindingsOutput, error) { + path := "/dast/pentest/findings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.ScanID != nil { + query.Set("scanId", string(*in.ScanID)) + } + if in.PriorityLabel != nil { + query.Set("priorityLabel", string(*in.PriorityLabel)) + } + if in.IsFalsePositive != nil { + query.Set("isFalsePositive", strconv.FormatBool(*in.IsFalsePositive)) + } + if in.IsLatest != nil { + query.Set("isLatest", strconv.FormatBool(*in.IsLatest)) + } + if in.IsAllowlisted != nil { + query.Set("isAllowlisted", strconv.FormatBool(*in.IsAllowlisted)) + } + if in.IsResolved != nil { + query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) + } + if in.SortBy != nil { + query.Set("sortBy", string(*in.SortBy)) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetDastPentestFindingsFindingIdInput is the input for GetDastPentestFindingsFindingId — Get Pentest Finding. +type GetDastPentestFindingsFindingIdInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *GetDastPentestFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + +// GetDastPentestFindingsFindingId - Get Pentest Finding +// GET /dast/pentest/findings/{findingId} +func (c *Client) GetDastPentestFindingsFindingId(ctx context.Context, in GetDastPentestFindingsFindingIdInput) (*models.EndpointsGetPentestFindingOutput, error) { + path := "/dast/pentest/findings/{findingId}" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastPentestFindingsFindingIdAllowlistInput is the input for CreateDastPentestFindingsFindingIdAllowlist — Allowlist Pentest Finding. +type CreateDastPentestFindingsFindingIdAllowlistInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AllowlistReason string `json:"allowlistReason"` + AllowlistType models.ModelsAllowlistType `json:"allowlistType"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateDastPentestFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + +// CreateDastPentestFindingsFindingIdAllowlist - Allowlist Pentest Finding +// POST /dast/pentest/findings/{findingId}/allowlist +func (c *Client) CreateDastPentestFindingsFindingIdAllowlist(ctx context.Context, in CreateDastPentestFindingsFindingIdAllowlistInput) ([]byte, error) { + path := "/dast/pentest/findings/{findingId}/allowlist" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + AllowlistReason string `json:"allowlistReason"` + AllowlistType models.ModelsAllowlistType `json:"allowlistType"` + }{ + AllowlistReason: in.AllowlistReason, + AllowlistType: in.AllowlistType, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + return data, err +} + +// ListDastPentestFindingsFindingIdAutofixActivityInput is the input for ListDastPentestFindingsFindingIdAutofixActivity — Get DAST Pentest Finding Autofix Activity. +type ListDastPentestFindingsFindingIdAutofixActivityInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + SinceID *string `url:"since_id,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListDastPentestFindingsFindingIdAutofixActivityInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastPentestFindingsFindingIdAutofixActivity - Get DAST Pentest Finding Autofix Activity +// GET /dast/pentest/findings/{findingId}/autofix/activity +func (c *Client) ListDastPentestFindingsFindingIdAutofixActivity(ctx context.Context, in ListDastPentestFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { + path := "/dast/pentest/findings/{findingId}/autofix/activity" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.SinceID != nil { + query.Set("since_id", string(*in.SinceID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetAutofixActivityLogOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastPentestFindingsFindingIdAutofixFixInput is the input for CreateDastPentestFindingsFindingIdAutofixFix — Post DAST Pentest Finding AutoFix. +type CreateDastPentestFindingsFindingIdAutofixFixInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Assignees []models.ModelsUser `json:"assignees,omitempty"` + Force *bool `json:"force,omitempty"` + Message *string `json:"message,omitempty"` + OriginCampaignID *string `json:"originCampaignId,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateDastPentestFindingsFindingIdAutofixFixInput) SetFindingID(id string) { in.FindingID = id } + +// CreateDastPentestFindingsFindingIdAutofixFix - Post DAST Pentest Finding AutoFix +// POST /dast/pentest/findings/{findingId}/autofix/fix +func (c *Client) CreateDastPentestFindingsFindingIdAutofixFix(ctx context.Context, in CreateDastPentestFindingsFindingIdAutofixFixInput) (*models.EndpointsPostAutofixDASTPentestFindingOutput, error) { + path := "/dast/pentest/findings/{findingId}/autofix/fix" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Assignees []models.ModelsUser `json:"assignees,omitempty"` + Force *bool `json:"force,omitempty"` + Message *string `json:"message,omitempty"` + OriginCampaignID *string `json:"originCampaignId,omitempty"` + }{ + Assignees: in.Assignees, + Force: in.Force, + Message: in.Message, + OriginCampaignID: in.OriginCampaignID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostAutofixDASTPentestFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestFindingsFindingIdAutofixStateInput is the input for ListDastPentestFindingsFindingIdAutofixState — Get DAST Pentest Finding Autofix State. +type ListDastPentestFindingsFindingIdAutofixStateInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListDastPentestFindingsFindingIdAutofixStateInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastPentestFindingsFindingIdAutofixState - Get DAST Pentest Finding Autofix State +// GET /dast/pentest/findings/{findingId}/autofix/state +func (c *Client) ListDastPentestFindingsFindingIdAutofixState(ctx context.Context, in ListDastPentestFindingsFindingIdAutofixStateInput) (*models.EndpointsGetDASTFindingAutofixStateOutput, error) { + path := "/dast/pentest/findings/{findingId}/autofix/state" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDASTFindingAutofixStateOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestFindingsFindingIdAutofixStatusInput is the input for ListDastPentestFindingsFindingIdAutofixStatus — Get DAST Pentest Finding Autofix Status. +type ListDastPentestFindingsFindingIdAutofixStatusInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListDastPentestFindingsFindingIdAutofixStatusInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastPentestFindingsFindingIdAutofixStatus - Get DAST Pentest Finding Autofix Status +// GET /dast/pentest/findings/{findingId}/autofix/status +func (c *Client) ListDastPentestFindingsFindingIdAutofixStatus(ctx context.Context, in ListDastPentestFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetDASTFindingAutofixStatusOutput, error) { + path := "/dast/pentest/findings/{findingId}/autofix/status" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDASTFindingAutofixStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestFindingsFindingIdEventsInput is the input for ListDastPentestFindingsFindingIdEvents — Get Pentest Finding Events. +type ListDastPentestFindingsFindingIdEventsInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListDastPentestFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastPentestFindingsFindingIdEvents - Get Pentest Finding Events +// GET /dast/pentest/findings/{findingId}/events +func (c *Client) ListDastPentestFindingsFindingIdEvents(ctx context.Context, in ListDastPentestFindingsFindingIdEventsInput) (*models.EndpointsGetPentestFindingEventsOutput, error) { + path := "/dast/pentest/findings/{findingId}/events" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestFindingEventsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestFindingsFindingIdFullInput is the input for ListDastPentestFindingsFindingIdFull — Get Pentest Finding Full. +type ListDastPentestFindingsFindingIdFullInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListDastPentestFindingsFindingIdFullInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastPentestFindingsFindingIdFull - Get Pentest Finding Full +// GET /dast/pentest/findings/{findingId}/full +func (c *Client) ListDastPentestFindingsFindingIdFull(ctx context.Context, in ListDastPentestFindingsFindingIdFullInput) (*models.EndpointsGetPentestFindingFullOutput, error) { + path := "/dast/pentest/findings/{findingId}/full" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestFindingFullOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteDastPentestFindingsFindingIdTicketInput is the input for DeleteDastPentestFindingsFindingIdTicket — Delete Ticket for Pentest Finding. +type DeleteDastPentestFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteDastPentestFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteDastPentestFindingsFindingIdTicket - Delete Ticket for Pentest Finding +// DELETE /dast/pentest/findings/{findingId}/ticket +func (c *Client) DeleteDastPentestFindingsFindingIdTicket(ctx context.Context, in DeleteDastPentestFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketPentestFindingOutput, error) { + path := "/dast/pentest/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketPentestFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastPentestFindingsFindingIdTicketInput is the input for CreateDastPentestFindingsFindingIdTicket — Create Ticket for Pentest Finding. +type CreateDastPentestFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Assignees []models.ModelsUser `json:"assignees,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + CampaignTitle *string `json:"campaignTitle,omitempty"` + Message *string `json:"message,omitempty"` + Project *string `json:"project,omitempty"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateDastPentestFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// CreateDastPentestFindingsFindingIdTicket - Create Ticket for Pentest Finding +// POST /dast/pentest/findings/{findingId}/ticket +func (c *Client) CreateDastPentestFindingsFindingIdTicket(ctx context.Context, in CreateDastPentestFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketPentestFindingOutput, error) { + path := "/dast/pentest/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Assignees []models.ModelsUser `json:"assignees,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + CampaignTitle *string `json:"campaignTitle,omitempty"` + Message *string `json:"message,omitempty"` + Project *string `json:"project,omitempty"` + }{ + Assignees: in.Assignees, + CampaignID: in.CampaignID, + CampaignTitle: in.CampaignTitle, + Message: in.Message, + Project: in.Project, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostCreateTicketPentestFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestFindingsFindingIdTriageInput is the input for ListDastPentestFindingsFindingIdTriage — Get Pentest Finding Full. +type ListDastPentestFindingsFindingIdTriageInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListDastPentestFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + +// ListDastPentestFindingsFindingIdTriage - Get Pentest Finding Full +// GET /dast/pentest/findings/{findingId}/triage +func (c *Client) ListDastPentestFindingsFindingIdTriage(ctx context.Context, in ListDastPentestFindingsFindingIdTriageInput) (*models.EndpointsGetPentestFindingFullOutput, error) { + path := "/dast/pentest/findings/{findingId}/triage" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestFindingFullOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateDastPentestFindingsFindingIdUnallowlistInput is the input for CreateDastPentestFindingsFindingIdUnallowlist — Unallowlist Pentest Finding. +type CreateDastPentestFindingsFindingIdUnallowlistInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UnallowlistReason string `json:"unallowlistReason"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateDastPentestFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + +// CreateDastPentestFindingsFindingIdUnallowlist - Unallowlist Pentest Finding +// POST /dast/pentest/findings/{findingId}/unallowlist +func (c *Client) CreateDastPentestFindingsFindingIdUnallowlist(ctx context.Context, in CreateDastPentestFindingsFindingIdUnallowlistInput) ([]byte, error) { + path := "/dast/pentest/findings/{findingId}/unallowlist" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + UnallowlistReason string `json:"unallowlistReason"` + }{ + UnallowlistReason: in.UnallowlistReason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + return data, err +} + +// ListDastPentestMutationWarningInput is the input for ListDastPentestMutationWarning — Create Interactor []. +type ListDastPentestMutationWarningInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestMutationWarning - Create Interactor [] +// GET /dast/pentest/mutation-warning +func (c *Client) ListDastPentestMutationWarning(ctx context.Context, in ListDastPentestMutationWarningInput) (*models.EndpointsGetMutationWarningOutput, error) { + path := "/dast/pentest/mutation-warning" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetMutationWarningOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetDastPentestPreflightsPreflightIdInput is the input for GetDastPentestPreflightsPreflightId — Get Pentest Preflight. +type GetDastPentestPreflightsPreflightIdInput struct { + PreflightID string `path:"preflightId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetDastPentestPreflightsPreflightId - Get Pentest Preflight +// GET /dast/pentest/preflights/{preflightId} +func (c *Client) GetDastPentestPreflightsPreflightId(ctx context.Context, in GetDastPentestPreflightsPreflightIdInput) (*models.EndpointsGetPentestPreflightOutput, error) { + path := "/dast/pentest/preflights/{preflightId}" + path = strings.Replace(path, "{preflightId}", url.PathEscape(in.PreflightID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestPreflightOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestPreflightsPreflightIdEventsInput is the input for ListDastPentestPreflightsPreflightIdEvents — Get Pentest Preflight Events. +type ListDastPentestPreflightsPreflightIdEventsInput struct { + PreflightID string `path:"preflightId" json:"-"` + AfterSeq *int64 `url:"afterSeq,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestPreflightsPreflightIdEvents - Get Pentest Preflight Events +// GET /dast/pentest/preflights/{preflightId}/events +func (c *Client) ListDastPentestPreflightsPreflightIdEvents(ctx context.Context, in ListDastPentestPreflightsPreflightIdEventsInput) (*models.EndpointsGetPentestPreflightEventsOutput, error) { + path := "/dast/pentest/preflights/{preflightId}/events" + path = strings.Replace(path, "{preflightId}", url.PathEscape(in.PreflightID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.AfterSeq != nil { + query.Set("afterSeq", strconv.FormatInt(*in.AfterSeq, 10)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestPreflightEventsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestScansInput is the input for ListDastPentestScans — Get Pentest Scans. +type ListDastPentestScansInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestScans - Get Pentest Scans +// GET /dast/pentest/scans +func (c *Client) ListDastPentestScans(ctx context.Context, in ListDastPentestScansInput) (*models.EndpointsGetPentestScansOutput, error) { + path := "/dast/pentest/scans" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestScansOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetDastPentestScansScanIdInput is the input for GetDastPentestScansScanId — Get Pentest Scan. +type GetDastPentestScansScanIdInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetDastPentestScansScanId - Get Pentest Scan +// GET /dast/pentest/scans/{scanId} +func (c *Client) GetDastPentestScansScanId(ctx context.Context, in GetDastPentestScansScanIdInput) (*models.EndpointsGetPentestScanOutput, error) { + path := "/dast/pentest/scans/{scanId}" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestScansScanIdActivityInput is the input for ListDastPentestScansScanIdActivity — Get Pentest Scan Activity. +type ListDastPentestScansScanIdActivityInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + SinceID *string `url:"since_id,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestScansScanIdActivity - Get Pentest Scan Activity +// GET /dast/pentest/scans/{scanId}/activity +func (c *Client) ListDastPentestScansScanIdActivity(ctx context.Context, in ListDastPentestScansScanIdActivityInput) (*models.EndpointsGetPentestScanActivityOutput, error) { + path := "/dast/pentest/scans/{scanId}/activity" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.SinceID != nil { + query.Set("since_id", string(*in.SinceID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestScanActivityOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestScansScanIdAuthMatrixCasesInput is the input for ListDastPentestScansScanIdAuthMatrixCases — List pentest auth-matrix cases. +type ListDastPentestScansScanIdAuthMatrixCasesInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + HideNotRun *bool `url:"hideNotRun,omitempty" json:"-"` + Identity *string `url:"identity,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Outcome *string `url:"outcome,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestScansScanIdAuthMatrixCases - List pentest auth-matrix cases +// GET /dast/pentest/scans/{scanId}/auth-matrix/cases +func (c *Client) ListDastPentestScansScanIdAuthMatrixCases(ctx context.Context, in ListDastPentestScansScanIdAuthMatrixCasesInput) (*models.EndpointsGetPentestAuthMatrixCasesOutput, error) { + path := "/dast/pentest/scans/{scanId}/auth-matrix/cases" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Outcome != nil { + query.Set("outcome", string(*in.Outcome)) + } + if in.Identity != nil { + query.Set("identity", string(*in.Identity)) + } + if in.HideNotRun != nil { + query.Set("hideNotRun", strconv.FormatBool(*in.HideNotRun)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestAuthMatrixCasesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestScansScanIdAuthMatrixEvidenceInput is the input for ListDastPentestScansScanIdAuthMatrixEvidence — Get retained pentest attempt evidence. +type ListDastPentestScansScanIdAuthMatrixEvidenceInput struct { + ScanID string `path:"scanId" json:"-"` + AttemptID *string `url:"attemptId,omitempty" json:"-"` + Cursor *string `url:"cursor,omitempty" json:"-"` + EvidenceRef *string `url:"evidenceRef,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IdentityID *string `url:"identityId,omitempty" json:"-"` + Method *string `url:"method,omitempty" json:"-"` + Path *string `url:"path,omitempty" json:"-"` + Since *string `url:"since,omitempty" json:"-"` + Stage *string `url:"stage,omitempty" json:"-"` + Until *string `url:"until,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestScansScanIdAuthMatrixEvidence - Get retained pentest attempt evidence +// GET /dast/pentest/scans/{scanId}/auth-matrix/evidence +func (c *Client) ListDastPentestScansScanIdAuthMatrixEvidence(ctx context.Context, in ListDastPentestScansScanIdAuthMatrixEvidenceInput) (*models.EndpointsGetPentestAuthMatrixEvidenceOutput, error) { + path := "/dast/pentest/scans/{scanId}/auth-matrix/evidence" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Stage != nil { + query.Set("stage", string(*in.Stage)) + } + if in.Since != nil { + query.Set("since", string(*in.Since)) + } + if in.Until != nil { + query.Set("until", string(*in.Until)) + } + if in.IdentityID != nil { + query.Set("identityId", string(*in.IdentityID)) + } + if in.Method != nil { + query.Set("method", string(*in.Method)) + } + if in.Path != nil { + query.Set("path", string(*in.Path)) + } + if in.EvidenceRef != nil { + query.Set("evidenceRef", string(*in.EvidenceRef)) + } + if in.AttemptID != nil { + query.Set("attemptId", string(*in.AttemptID)) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestAuthMatrixEvidenceOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestScansScanIdEventsInput is the input for ListDastPentestScansScanIdEvents — Get Pentest Scan Events. +type ListDastPentestScansScanIdEventsInput struct { + ScanID string `path:"scanId" json:"-"` + AfterSeq *int64 `url:"afterSeq,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestScansScanIdEvents - Get Pentest Scan Events +// GET /dast/pentest/scans/{scanId}/events +func (c *Client) ListDastPentestScansScanIdEvents(ctx context.Context, in ListDastPentestScansScanIdEventsInput) (*models.EndpointsGetPentestScanEventsOutput, error) { + path := "/dast/pentest/scans/{scanId}/events" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.AfterSeq != nil { + query.Set("afterSeq", strconv.FormatInt(*in.AfterSeq, 10)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestScanEventsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestScansScanIdFindingsInput is the input for ListDastPentestScansScanIdFindings — Get Pentest Scan Findings. +type ListDastPentestScansScanIdFindingsInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListDastPentestScansScanIdFindings - Get Pentest Scan Findings +// GET /dast/pentest/scans/{scanId}/findings +func (c *Client) ListDastPentestScansScanIdFindings(ctx context.Context, in ListDastPentestScansScanIdFindingsInput) (*models.EndpointsGetPentestScanFindingsOutput, error) { + path := "/dast/pentest/scans/{scanId}/findings" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetPentestScanFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListDastPentestScansScanIdFindingsLinksInput is the input for ListDastPentestScansScanIdFindingsLinks — Get Pentest Scan Finding Links. +type ListDastPentestScansScanIdFindingsLinksInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestApplications - Get Pentest App Configs -// GET /dast/pentest/applications -func (c *Client) ListDastPentestApplications(ctx context.Context, in ListDastPentestApplicationsInput) (*models.EndpointsGetPentestAppConfigsOutput, error) { - path := "/dast/pentest/applications" +// ListDastPentestScansScanIdFindingsLinks - Get Pentest Scan Finding Links +// GET /dast/pentest/scans/{scanId}/findings/links +func (c *Client) ListDastPentestScansScanIdFindingsLinks(ctx context.Context, in ListDastPentestScansScanIdFindingsLinksInput) (*models.EndpointsGetPentestScanFindingLinksOutput, error) { + path := "/dast/pentest/scans/{scanId}/findings/links" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -909,30 +3947,33 @@ func (c *Client) ListDastPentestApplications(ctx context.Context, in ListDastPen if err != nil { return nil, err } - var out models.EndpointsGetPentestAppConfigsOutput + var out models.EndpointsGetPentestScanFindingLinksOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestApplicationsInput is the input for CreateDastPentestApplications — Create Application. -type CreateDastPentestApplicationsInput struct { - CredentialIds []string `json:"credentialIds,omitempty"` - ID *string `json:"id,omitempty"` - Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` +// ListDastPentestScansScanIdHypothesesInput is the input for ListDastPentestScansScanIdHypotheses — Get Auth Matrix Hypotheses. +type ListDastPentestScansScanIdHypothesesInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateDastPentestApplications - Create Application -// POST /dast/pentest/applications -func (c *Client) CreateDastPentestApplications(ctx context.Context, in CreateDastPentestApplicationsInput) (*models.EndpointsPostPentestAppConfigOutput, error) { - path := "/dast/pentest/applications" +// ListDastPentestScansScanIdHypotheses - Get Auth Matrix Hypotheses +// GET /dast/pentest/scans/{scanId}/hypotheses +func (c *Client) ListDastPentestScansScanIdHypotheses(ctx context.Context, in ListDastPentestScansScanIdHypothesesInput) (*models.EndpointsGetAuthMatrixHypothesesOutput, error) { + path := "/dast/pentest/scans/{scanId}/hypotheses" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -940,45 +3981,37 @@ func (c *Client) CreateDastPentestApplications(ctx context.Context, in CreateDas fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - CredentialIds []string `json:"credentialIds,omitempty"` - ID *string `json:"id,omitempty"` - Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` - }{ - CredentialIds: in.CredentialIds, - ID: in.ID, - Targets: in.Targets, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostPentestAppConfigOutput + var out models.EndpointsGetAuthMatrixHypothesesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteDastPentestApplicationsApplicationIdInput is the input for DeleteDastPentestApplicationsApplicationId — Delete Pentest App Config. -type DeleteDastPentestApplicationsApplicationIdInput struct { - ApplicationID string `path:"applicationId" json:"-"` +// ListDastPentestScansScanIdLogsInput is the input for ListDastPentestScansScanIdLogs — Get Sub-Agent Network Log. +type ListDastPentestScansScanIdLogsInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteDastPentestApplicationsApplicationId - Delete Pentest App Config -// DELETE /dast/pentest/applications/{applicationId} -func (c *Client) DeleteDastPentestApplicationsApplicationId(ctx context.Context, in DeleteDastPentestApplicationsApplicationIdInput) (*models.EndpointsDeletePentestAppConfigOutput, error) { - path := "/dast/pentest/applications/{applicationId}" - path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) +// ListDastPentestScansScanIdLogs - Get Sub-Agent Network Log +// GET /dast/pentest/scans/{scanId}/logs +func (c *Client) ListDastPentestScansScanIdLogs(ctx context.Context, in ListDastPentestScansScanIdLogsInput) (*models.EndpointsGetSubAgentNetworkLogOutput, error) { + path := "/dast/pentest/scans/{scanId}/logs" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -986,33 +4019,69 @@ func (c *Client) DeleteDastPentestApplicationsApplicationId(ctx context.Context, fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeletePentestAppConfigOutput + var out models.EndpointsGetSubAgentNetworkLogOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetDastPentestApplicationsApplicationIdInput is the input for GetDastPentestApplicationsApplicationId — Get Pentest App Config. -type GetDastPentestApplicationsApplicationIdInput struct { - ApplicationID string `path:"applicationId" json:"-"` +// ListDastPentestScansScanIdLogsTransactionsInput is the input for ListDastPentestScansScanIdLogsTransactions — Get filtered pentest capture transactions. +type ListDastPentestScansScanIdLogsTransactionsInput struct { + ScanID string `path:"scanId" json:"-"` + Cursor *string `url:"cursor,omitempty" json:"-"` + EvidenceRef *string `url:"evidenceRef,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IdentityID *string `url:"identityId,omitempty" json:"-"` + Method *string `url:"method,omitempty" json:"-"` + Path *string `url:"path,omitempty" json:"-"` + Since *string `url:"since,omitempty" json:"-"` + Stage *string `url:"stage,omitempty" json:"-"` + Until *string `url:"until,omitempty" json:"-"` models.RequestScope } -// GetDastPentestApplicationsApplicationId - Get Pentest App Config -// GET /dast/pentest/applications/{applicationId} -func (c *Client) GetDastPentestApplicationsApplicationId(ctx context.Context, in GetDastPentestApplicationsApplicationIdInput) (*models.EndpointsGetPentestAppConfigOutput, error) { - path := "/dast/pentest/applications/{applicationId}" - path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) +// ListDastPentestScansScanIdLogsTransactions - Get filtered pentest capture transactions +// GET /dast/pentest/scans/{scanId}/logs/transactions +func (c *Client) ListDastPentestScansScanIdLogsTransactions(ctx context.Context, in ListDastPentestScansScanIdLogsTransactionsInput) (*models.EndpointsGetPentestScanNetworkTransactionsOutput, error) { + path := "/dast/pentest/scans/{scanId}/logs/transactions" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Stage != nil { + query.Set("stage", string(*in.Stage)) + } + if in.Since != nil { + query.Set("since", string(*in.Since)) + } + if in.Until != nil { + query.Set("until", string(*in.Until)) + } + if in.Method != nil { + query.Set("method", string(*in.Method)) + } + if in.Path != nil { + query.Set("path", string(*in.Path)) + } + if in.IdentityID != nil { + query.Set("identityId", string(*in.IdentityID)) + } + if in.EvidenceRef != nil { + query.Set("evidenceRef", string(*in.EvidenceRef)) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1024,31 +4093,37 @@ func (c *Client) GetDastPentestApplicationsApplicationId(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsGetPentestAppConfigOutput + var out models.EndpointsGetPentestScanNetworkTransactionsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// UpdateDastPentestApplicationsApplicationIdInput is the input for UpdateDastPentestApplicationsApplicationId — Update Application. -type UpdateDastPentestApplicationsApplicationIdInput struct { - ApplicationID string `path:"applicationId" json:"-"` - CredentialIds []string `json:"credentialIds,omitempty"` - Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` +// ListDastPentestScansScanIdReportInput is the input for ListDastPentestScansScanIdReport — Get Pentest Scan Report. +type ListDastPentestScansScanIdReportInput struct { + ScanID string `path:"scanId" json:"-"` + Exclude []string `url:"exclude,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// UpdateDastPentestApplicationsApplicationId - Update Application -// PUT /dast/pentest/applications/{applicationId} -func (c *Client) UpdateDastPentestApplicationsApplicationId(ctx context.Context, in UpdateDastPentestApplicationsApplicationIdInput) (*models.EndpointsPutPentestAppConfigOutput, error) { - path := "/dast/pentest/applications/{applicationId}" - path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) +// ListDastPentestScansScanIdReport - Get Pentest Scan Report +// GET /dast/pentest/scans/{scanId}/report +func (c *Client) ListDastPentestScansScanIdReport(ctx context.Context, in ListDastPentestScansScanIdReportInput) (*models.EndpointsGetPentestScanReportOutput, error) { + path := "/dast/pentest/scans/{scanId}/report" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + for _, v := range in.Exclude { + query.Add("exclude", string(v)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1056,44 +4131,37 @@ func (c *Client) UpdateDastPentestApplicationsApplicationId(ctx context.Context, fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - CredentialIds []string `json:"credentialIds,omitempty"` - Targets []models.ModelsApplicationPentestTarget `json:"targets,omitempty"` - }{ - CredentialIds: in.CredentialIds, - Targets: in.Targets, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPutPentestAppConfigOutput + var out models.EndpointsGetPentestScanReportOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestApplicationsApplicationIdPreflightInput is the input for CreateDastPentestApplicationsApplicationIdPreflight — Start Pentest Preflight. -type CreateDastPentestApplicationsApplicationIdPreflightInput struct { - ApplicationID string `path:"applicationId" json:"-"` - TriggeredByScan *bool `json:"triggeredByScan,omitempty"` +// ListDastPentestScansScanIdReportDownloadInput is the input for ListDastPentestScansScanIdReportDownload — Get Pentest Scan Report Download URL. +type ListDastPentestScansScanIdReportDownloadInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateDastPentestApplicationsApplicationIdPreflight - Start Pentest Preflight -// POST /dast/pentest/applications/{applicationId}/preflight -func (c *Client) CreateDastPentestApplicationsApplicationIdPreflight(ctx context.Context, in CreateDastPentestApplicationsApplicationIdPreflightInput) (*models.EndpointsStartPentestPreflightOutput, error) { - path := "/dast/pentest/applications/{applicationId}/preflight" - path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) +// ListDastPentestScansScanIdReportDownload - Get Pentest Scan Report Download URL +// GET /dast/pentest/scans/{scanId}/report/download +func (c *Client) ListDastPentestScansScanIdReportDownload(ctx context.Context, in ListDastPentestScansScanIdReportDownloadInput) (*models.EndpointsGetPentestScanReportDownloadURLOutput, error) { + path := "/dast/pentest/scans/{scanId}/report/download" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1101,41 +4169,37 @@ func (c *Client) CreateDastPentestApplicationsApplicationIdPreflight(ctx context fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - TriggeredByScan *bool `json:"triggeredByScan,omitempty"` - }{ - TriggeredByScan: in.TriggeredByScan, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsStartPentestPreflightOutput + var out models.EndpointsGetPentestScanReportDownloadURLOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestApplicationsApplicationIdPreflightLatestInput is the input for ListDastPentestApplicationsApplicationIdPreflightLatest — Get Latest Pentest Preflight for Application. -type ListDastPentestApplicationsApplicationIdPreflightLatestInput struct { - ApplicationID string `path:"applicationId" json:"-"` +// ListDastPentestScansScanIdReportExternalPdfInput is the input for ListDastPentestScansScanIdReportExternalPdf — Get Pentest Scan External Report PDF. +type ListDastPentestScansScanIdReportExternalPdfInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestApplicationsApplicationIdPreflightLatest - Get Latest Pentest Preflight for Application -// GET /dast/pentest/applications/{applicationId}/preflight/latest -func (c *Client) ListDastPentestApplicationsApplicationIdPreflightLatest(ctx context.Context, in ListDastPentestApplicationsApplicationIdPreflightLatestInput) (*models.EndpointsGetLatestPentestPreflightOutput, error) { - path := "/dast/pentest/applications/{applicationId}/preflight/latest" - path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) +// ListDastPentestScansScanIdReportExternalPdf - Get Pentest Scan External Report PDF +// GET /dast/pentest/scans/{scanId}/report/external/pdf +func (c *Client) ListDastPentestScansScanIdReportExternalPdf(ctx context.Context, in ListDastPentestScansScanIdReportExternalPdfInput) (*models.EndpointsGetPentestScanReportExternalPDFOutput, error) { + path := "/dast/pentest/scans/{scanId}/report/external/pdf" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1147,29 +4211,33 @@ func (c *Client) ListDastPentestApplicationsApplicationIdPreflightLatest(ctx con if err != nil { return nil, err } - var out models.EndpointsGetLatestPentestPreflightOutput + var out models.EndpointsGetPentestScanReportExternalPDFOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestApplicationsApplicationIdPreflightQuotaInput is the input for ListDastPentestApplicationsApplicationIdPreflightQuota — Get Pentest Preflight Quota. -type ListDastPentestApplicationsApplicationIdPreflightQuotaInput struct { - ApplicationID string `path:"applicationId" json:"-"` +// ListDastPentestScansScanIdReportPdfInput is the input for ListDastPentestScansScanIdReportPdf — Get Pentest Scan Report PDF. +type ListDastPentestScansScanIdReportPdfInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestApplicationsApplicationIdPreflightQuota - Get Pentest Preflight Quota -// GET /dast/pentest/applications/{applicationId}/preflight/quota -func (c *Client) ListDastPentestApplicationsApplicationIdPreflightQuota(ctx context.Context, in ListDastPentestApplicationsApplicationIdPreflightQuotaInput) (*models.EndpointsGetPentestPreflightQuotaOutput, error) { - path := "/dast/pentest/applications/{applicationId}/preflight/quota" - path = strings.Replace(path, "{applicationId}", url.PathEscape(in.ApplicationID), 1) +// ListDastPentestScansScanIdReportPdf - Get Pentest Scan Report PDF +// GET /dast/pentest/scans/{scanId}/report/pdf +func (c *Client) ListDastPentestScansScanIdReportPdf(ctx context.Context, in ListDastPentestScansScanIdReportPdfInput) (*models.EndpointsGetPentestScanReportPDFOutput, error) { + path := "/dast/pentest/scans/{scanId}/report/pdf" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1181,66 +4249,70 @@ func (c *Client) ListDastPentestApplicationsApplicationIdPreflightQuota(ctx cont if err != nil { return nil, err } - var out models.EndpointsGetPentestPreflightQuotaOutput + var out models.EndpointsGetPentestScanReportPDFOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestFindingsInput is the input for ListDastPentestFindings — Get Pentest Findings. -type ListDastPentestFindingsInput struct { - IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` - IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` - IsLatest *bool `url:"isLatest,omitempty" json:"-"` - IsResolved *bool `url:"isResolved,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` - PriorityLabel *string `url:"priorityLabel,omitempty" json:"-"` - ScanID *string `url:"scanId,omitempty" json:"-"` - Sort *string `url:"sort,omitempty" json:"-"` - SortBy *string `url:"sortBy,omitempty" json:"-"` +// ListDastPentestScansScanIdStatusInput is the input for ListDastPentestScansScanIdStatus — Get Pentest Scan Progress Status. +type ListDastPentestScansScanIdStatusInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestFindings - Get Pentest Findings -// GET /dast/pentest/findings -func (c *Client) ListDastPentestFindings(ctx context.Context, in ListDastPentestFindingsInput) (*models.EndpointsGetPentestFindingsOutput, error) { - path := "/dast/pentest/findings" +// ListDastPentestScansScanIdStatus - Get Pentest Scan Progress Status +// GET /dast/pentest/scans/{scanId}/status +func (c *Client) ListDastPentestScansScanIdStatus(ctx context.Context, in ListDastPentestScansScanIdStatusInput) (*models.EndpointsGetPentestScanProgressStatusOutput, error) { + path := "/dast/pentest/scans/{scanId}/status" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.ScanID != nil { - query.Set("scanId", string(*in.ScanID)) - } - if in.PriorityLabel != nil { - query.Set("priorityLabel", string(*in.PriorityLabel)) - } - if in.IsFalsePositive != nil { - query.Set("isFalsePositive", strconv.FormatBool(*in.IsFalsePositive)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.IsLatest != nil { - query.Set("isLatest", strconv.FormatBool(*in.IsLatest)) + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() } - if in.IsAllowlisted != nil { - query.Set("isAllowlisted", strconv.FormatBool(*in.IsAllowlisted)) + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err } - if in.IsResolved != nil { - query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) + var out models.EndpointsGetPentestScanProgressStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) } - if in.SortBy != nil { - query.Set("sortBy", string(*in.SortBy)) + return &out, nil +} + +// CreateDastPentestScansScanIdStopInput is the input for CreateDastPentestScansScanIdStop — Stop Pentest Scan. +type CreateDastPentestScansScanIdStopInput struct { + ScanID string `path:"scanId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateDastPentestScansScanIdStop - Stop Pentest Scan +// POST /dast/pentest/scans/{scanId}/stop +func (c *Client) CreateDastPentestScansScanIdStop(ctx context.Context, in CreateDastPentestScansScanIdStopInput) (*models.EndpointsStopPentestScanOutput, error) { + path := "/dast/pentest/scans/{scanId}/stop" + path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) } - if in.Sort != nil { - query.Set("sort", string(*in.Sort)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1249,33 +4321,39 @@ func (c *Client) ListDastPentestFindings(ctx context.Context, in ListDastPentest fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetPentestFindingsOutput + var out models.EndpointsStopPentestScanOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetDastPentestFindingsFindingIdInput is the input for GetDastPentestFindingsFindingId — Get Pentest Finding. -type GetDastPentestFindingsFindingIdInput struct { - FindingID string `path:"findingId" json:"-"` +// CreateDastPentestStartInput is the input for CreateDastPentestStart — Request Pentest Assessment. +type CreateDastPentestStartInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApplicationID string `json:"applicationId"` + ConfigOverrides *models.ModelsApplicationPentestConfigOverrides `json:"configOverrides,omitempty"` + Deployment *models.ModelsPentestDeployment `json:"deployment,omitempty"` + OnboardingDispatch *bool `json:"onboardingDispatch,omitempty"` models.RequestScope } -// GetDastPentestFindingsFindingId - Get Pentest Finding -// GET /dast/pentest/findings/{findingId} -func (c *Client) GetDastPentestFindingsFindingId(ctx context.Context, in GetDastPentestFindingsFindingIdInput) (*models.EndpointsGetPentestFindingOutput, error) { - path := "/dast/pentest/findings/{findingId}" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// CreateDastPentestStart - Request Pentest Assessment +// POST /dast/pentest/start +func (c *Client) CreateDastPentestStart(ctx context.Context, in CreateDastPentestStartInput) (*models.EndpointsStartPentestScanFromApplicationOutput, error) { + path := "/dast/pentest/start" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1283,35 +4361,49 @@ func (c *Client) GetDastPentestFindingsFindingId(ctx context.Context, in GetDast fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ApplicationID string `json:"applicationId"` + ConfigOverrides *models.ModelsApplicationPentestConfigOverrides `json:"configOverrides,omitempty"` + Deployment *models.ModelsPentestDeployment `json:"deployment,omitempty"` + OnboardingDispatch *bool `json:"onboardingDispatch,omitempty"` + }{ + ApplicationID: in.ApplicationID, + ConfigOverrides: in.ConfigOverrides, + Deployment: in.Deployment, + OnboardingDispatch: in.OnboardingDispatch, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPentestFindingOutput + var out models.EndpointsStartPentestScanFromApplicationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestFindingsFindingIdAllowlistInput is the input for CreateDastPentestFindingsFindingIdAllowlist — Allowlist Pentest Finding. -type CreateDastPentestFindingsFindingIdAllowlistInput struct { - FindingID string `path:"findingId" json:"-"` - AllowlistReason string `json:"allowlistReason"` - AllowlistType models.ModelsAllowlistType `json:"allowlistType"` +// ListDastScansStatusLastInput is the input for ListDastScansStatusLast — Get Pentest Last Scan Status. +type ListDastScansStatusLastInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateDastPentestFindingsFindingIdAllowlist - Allowlist Pentest Finding -// POST /dast/pentest/findings/{findingId}/allowlist -func (c *Client) CreateDastPentestFindingsFindingIdAllowlist(ctx context.Context, in CreateDastPentestFindingsFindingIdAllowlistInput) ([]byte, error) { - path := "/dast/pentest/findings/{findingId}/allowlist" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListDastScansStatusLast - Get Pentest Last Scan Status +// GET /dast/scans/status/last +func (c *Client) ListDastScansStatusLast(ctx context.Context, in ListDastScansStatusLastInput) (*models.EndpointsGetDASTLastScanStatusesOutput, error) { + path := "/dast/scans/status/last" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1319,43 +4411,34 @@ func (c *Client) CreateDastPentestFindingsFindingIdAllowlist(ctx context.Context fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - AllowlistReason string `json:"allowlistReason"` - AllowlistType models.ModelsAllowlistType `json:"allowlistType"` - }{ - AllowlistReason: in.AllowlistReason, - AllowlistType: in.AllowlistType, - }) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) + return nil, err } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) - return data, err + var out models.EndpointsGetDASTLastScanStatusesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } -// ListDastPentestFindingsFindingIdAutofixActivityInput is the input for ListDastPentestFindingsFindingIdAutofixActivity — Get DAST Pentest Finding Autofix Activity. -type ListDastPentestFindingsFindingIdAutofixActivityInput struct { - FindingID string `path:"findingId" json:"-"` - Limit *int32 `url:"limit,omitempty" json:"-"` - SinceID *string `url:"since_id,omitempty" json:"-"` +// ListDastSourceipsInput is the input for ListDastSourceips — Get Source IPs. +type ListDastSourceipsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestFindingsFindingIdAutofixActivity - Get DAST Pentest Finding Autofix Activity -// GET /dast/pentest/findings/{findingId}/autofix/activity -func (c *Client) ListDastPentestFindingsFindingIdAutofixActivity(ctx context.Context, in ListDastPentestFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { - path := "/dast/pentest/findings/{findingId}/autofix/activity" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListDastSourceips - Get Source IPs +// GET /dast/sourceips +func (c *Client) ListDastSourceips(ctx context.Context, in ListDastSourceipsInput) (*models.EndpointsGetSourceIPsOutput, error) { + path := "/dast/sourceips" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.SinceID != nil { - query.Set("since_id", string(*in.SinceID)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1368,29 +4451,39 @@ func (c *Client) ListDastPentestFindingsFindingIdAutofixActivity(ctx context.Con if err != nil { return nil, err } - var out models.EndpointsGetAutofixActivityLogOutput + var out models.EndpointsGetSourceIPsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestFindingsFindingIdAutofixCacheDiffInput is the input for ListDastPentestFindingsFindingIdAutofixCacheDiff — Get Pentest Finding Autofix Diff. -type ListDastPentestFindingsFindingIdAutofixCacheDiffInput struct { - FindingID string `path:"findingId" json:"-"` +// ListDastTargetsInput is the input for ListDastTargets — List Targets. +type ListDastTargetsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// ListDastPentestFindingsFindingIdAutofixCacheDiff - Get Pentest Finding Autofix Diff -// GET /dast/pentest/findings/{findingId}/autofix/cache/diff -func (c *Client) ListDastPentestFindingsFindingIdAutofixCacheDiff(ctx context.Context, in ListDastPentestFindingsFindingIdAutofixCacheDiffInput) (*models.EndpointsGetPentestFindingAutofixDiffOutput, error) { - path := "/dast/pentest/findings/{findingId}/autofix/cache/diff" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListDastTargets - List Targets +// GET /dast/targets +func (c *Client) ListDastTargets(ctx context.Context, in ListDastTargetsInput) (*models.EndpointsGetDASTTargetsOutput, error) { + path := "/dast/targets" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1402,33 +4495,37 @@ func (c *Client) ListDastPentestFindingsFindingIdAutofixCacheDiff(ctx context.Co if err != nil { return nil, err } - var out models.EndpointsGetPentestFindingAutofixDiffOutput + var out models.EndpointsGetDASTTargetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestFindingsFindingIdAutofixFixInput is the input for CreateDastPentestFindingsFindingIdAutofixFix — Post DAST Pentest Finding AutoFix. -type CreateDastPentestFindingsFindingIdAutofixFixInput struct { - FindingID string `path:"findingId" json:"-"` - Assignees []models.ModelsUser `json:"assignees,omitempty"` - Force *bool `json:"force,omitempty"` - Message *string `json:"message,omitempty"` - OriginCampaignID *string `json:"originCampaignId,omitempty"` +// CreateDastTargetsInput is the input for CreateDastTargets — Create Target. +type CreateDastTargetsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Description *string `json:"description,omitempty"` + Hostname string `json:"hostname"` + IsProd *bool `json:"isProd,omitempty"` + Name *string `json:"name,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` models.RequestScope } -// CreateDastPentestFindingsFindingIdAutofixFix - Post DAST Pentest Finding AutoFix -// POST /dast/pentest/findings/{findingId}/autofix/fix -func (c *Client) CreateDastPentestFindingsFindingIdAutofixFix(ctx context.Context, in CreateDastPentestFindingsFindingIdAutofixFixInput) (*models.EndpointsPostAutofixDASTPentestFindingOutput, error) { - path := "/dast/pentest/findings/{findingId}/autofix/fix" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// CreateDastTargets - Create Target +// POST /dast/targets +func (c *Client) CreateDastTargets(ctx context.Context, in CreateDastTargetsInput) (*models.EndpointsPostDASTTargetOutput, error) { + path := "/dast/targets" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1437,15 +4534,19 @@ func (c *Client) CreateDastPentestFindingsFindingIdAutofixFix(ctx context.Contex } bodyBytes, err := json.Marshal(struct { - Assignees []models.ModelsUser `json:"assignees,omitempty"` - Force *bool `json:"force,omitempty"` - Message *string `json:"message,omitempty"` - OriginCampaignID *string `json:"originCampaignId,omitempty"` + Description *string `json:"description,omitempty"` + Hostname string `json:"hostname"` + IsProd *bool `json:"isProd,omitempty"` + Name *string `json:"name,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` }{ - Assignees: in.Assignees, - Force: in.Force, - Message: in.Message, - OriginCampaignID: in.OriginCampaignID, + Description: in.Description, + Hostname: in.Hostname, + IsProd: in.IsProd, + Name: in.Name, + Port: in.Port, + Protocol: in.Protocol, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -1454,29 +4555,32 @@ func (c *Client) CreateDastPentestFindingsFindingIdAutofixFix(ctx context.Contex if err != nil { return nil, err } - var out models.EndpointsPostAutofixDASTPentestFindingOutput + var out models.EndpointsPostDASTTargetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestFindingsFindingIdAutofixStateInput is the input for ListDastPentestFindingsFindingIdAutofixState — Get DAST Pentest Finding Autofix State. -type ListDastPentestFindingsFindingIdAutofixStateInput struct { - FindingID string `path:"findingId" json:"-"` +// CreateDastTargetsValidateInput is the input for CreateDastTargetsValidate — Validate Targets. +type CreateDastTargetsValidateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TargetIds []string `json:"targetIds,omitempty"` models.RequestScope } -// ListDastPentestFindingsFindingIdAutofixState - Get DAST Pentest Finding Autofix State -// GET /dast/pentest/findings/{findingId}/autofix/state -func (c *Client) ListDastPentestFindingsFindingIdAutofixState(ctx context.Context, in ListDastPentestFindingsFindingIdAutofixStateInput) (*models.EndpointsGetDASTFindingAutofixStateOutput, error) { - path := "/dast/pentest/findings/{findingId}/autofix/state" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// CreateDastTargetsValidate - Validate Targets +// POST /dast/targets/validate +func (c *Client) CreateDastTargetsValidate(ctx context.Context, in CreateDastTargetsValidateInput) (*models.EndpointsValidateTargetsOutput, error) { + path := "/dast/targets/validate" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1484,33 +4588,45 @@ func (c *Client) ListDastPentestFindingsFindingIdAutofixState(ctx context.Contex fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + TargetIds []string `json:"targetIds,omitempty"` + }{ + TargetIds: in.TargetIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetDASTFindingAutofixStateOutput + var out models.EndpointsValidateTargetsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestFindingsFindingIdAutofixStatusInput is the input for ListDastPentestFindingsFindingIdAutofixStatus — Get DAST Pentest Finding Autofix Status. -type ListDastPentestFindingsFindingIdAutofixStatusInput struct { - FindingID string `path:"findingId" json:"-"` +// DeleteDastTargetsTargetIdInput is the input for DeleteDastTargetsTargetId — Delete Target. +type DeleteDastTargetsTargetIdInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestFindingsFindingIdAutofixStatus - Get DAST Pentest Finding Autofix Status -// GET /dast/pentest/findings/{findingId}/autofix/status -func (c *Client) ListDastPentestFindingsFindingIdAutofixStatus(ctx context.Context, in ListDastPentestFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetDASTFindingAutofixStatusOutput, error) { - path := "/dast/pentest/findings/{findingId}/autofix/status" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// DeleteDastTargetsTargetId - Delete Target +// DELETE /dast/targets/{targetId} +func (c *Client) DeleteDastTargetsTargetId(ctx context.Context, in DeleteDastTargetsTargetIdInput) (*models.EndpointsDeleteDASTTargetOutput, error) { + path := "/dast/targets/{targetId}" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1518,33 +4634,37 @@ func (c *Client) ListDastPentestFindingsFindingIdAutofixStatus(ctx context.Conte fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetDASTFindingAutofixStatusOutput + var out models.EndpointsDeleteDASTTargetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestFindingsFindingIdEventsInput is the input for ListDastPentestFindingsFindingIdEvents — Get Pentest Finding Events. -type ListDastPentestFindingsFindingIdEventsInput struct { - FindingID string `path:"findingId" json:"-"` +// GetDastTargetsTargetIdInput is the input for GetDastTargetsTargetId — Get Target. +type GetDastTargetsTargetIdInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestFindingsFindingIdEvents - Get Pentest Finding Events -// GET /dast/pentest/findings/{findingId}/events -func (c *Client) ListDastPentestFindingsFindingIdEvents(ctx context.Context, in ListDastPentestFindingsFindingIdEventsInput) (*models.EndpointsGetPentestFindingEventsOutput, error) { - path := "/dast/pentest/findings/{findingId}/events" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// GetDastTargetsTargetId - Get Target +// GET /dast/targets/{targetId} +func (c *Client) GetDastTargetsTargetId(ctx context.Context, in GetDastTargetsTargetIdInput) (*models.EndpointsGetDASTTargetOutput, error) { + path := "/dast/targets/{targetId}" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1556,29 +4676,39 @@ func (c *Client) ListDastPentestFindingsFindingIdEvents(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsGetPentestFindingEventsOutput + var out models.EndpointsGetDASTTargetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestFindingsFindingIdFullInput is the input for ListDastPentestFindingsFindingIdFull — Get Pentest Finding Full. -type ListDastPentestFindingsFindingIdFullInput struct { - FindingID string `path:"findingId" json:"-"` +// UpdateDastTargetsTargetIdInput is the input for UpdateDastTargetsTargetId — Update Target. +type UpdateDastTargetsTargetIdInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Description *string `json:"description,omitempty"` + Hostname string `json:"hostname"` + IsProd *bool `json:"isProd,omitempty"` + Name *string `json:"name,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` models.RequestScope } -// ListDastPentestFindingsFindingIdFull - Get Pentest Finding Full -// GET /dast/pentest/findings/{findingId}/full -func (c *Client) ListDastPentestFindingsFindingIdFull(ctx context.Context, in ListDastPentestFindingsFindingIdFullInput) (*models.EndpointsGetPentestFindingFullOutput, error) { - path := "/dast/pentest/findings/{findingId}/full" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// UpdateDastTargetsTargetId - Update Target +// PUT /dast/targets/{targetId} +func (c *Client) UpdateDastTargetsTargetId(ctx context.Context, in UpdateDastTargetsTargetIdInput) (*models.EndpointsPutDASTTargetOutput, error) { + path := "/dast/targets/{targetId}" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1586,38 +4716,56 @@ func (c *Client) ListDastPentestFindingsFindingIdFull(ctx context.Context, in Li fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Description *string `json:"description,omitempty"` + Hostname string `json:"hostname"` + IsProd *bool `json:"isProd,omitempty"` + Name *string `json:"name,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` + }{ + Description: in.Description, + Hostname: in.Hostname, + IsProd: in.IsProd, + Name: in.Name, + Port: in.Port, + Protocol: in.Protocol, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPentestFindingFullOutput + var out models.EndpointsPutDASTTargetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestFindingsFindingIdTicketInput is the input for CreateDastPentestFindingsFindingIdTicket — Create Jira Ticket for Pentest Finding. -type CreateDastPentestFindingsFindingIdTicketInput struct { - FindingID string `path:"findingId" json:"-"` - Assignees []models.ModelsUser `json:"assignees,omitempty"` - CampaignID *string `json:"campaignId,omitempty"` - CampaignTitle *string `json:"campaignTitle,omitempty"` - Message *string `json:"message,omitempty"` - Project *string `json:"project,omitempty"` +// UpdateDastTargetsTargetIdClassificationInput is the input for UpdateDastTargetsTargetIdClassification — Create Interactor []. +type UpdateDastTargetsTargetIdClassificationInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Classification models.ModelsDASTTargetClassification `json:"classification"` models.RequestScope } -// CreateDastPentestFindingsFindingIdTicket - Create Jira Ticket for Pentest Finding -// POST /dast/pentest/findings/{findingId}/ticket -func (c *Client) CreateDastPentestFindingsFindingIdTicket(ctx context.Context, in CreateDastPentestFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketPentestFindingOutput, error) { - path := "/dast/pentest/findings/{findingId}/ticket" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// UpdateDastTargetsTargetIdClassification - Create Interactor [] +// PUT /dast/targets/{targetId}/classification +func (c *Client) UpdateDastTargetsTargetIdClassification(ctx context.Context, in UpdateDastTargetsTargetIdClassificationInput) (*models.EndpointsPutDASTTargetOutput, error) { + path := "/dast/targets/{targetId}/classification" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1626,48 +4774,44 @@ func (c *Client) CreateDastPentestFindingsFindingIdTicket(ctx context.Context, i } bodyBytes, err := json.Marshal(struct { - Assignees []models.ModelsUser `json:"assignees,omitempty"` - CampaignID *string `json:"campaignId,omitempty"` - CampaignTitle *string `json:"campaignTitle,omitempty"` - Message *string `json:"message,omitempty"` - Project *string `json:"project,omitempty"` + Classification models.ModelsDASTTargetClassification `json:"classification"` }{ - Assignees: in.Assignees, - CampaignID: in.CampaignID, - CampaignTitle: in.CampaignTitle, - Message: in.Message, - Project: in.Project, + Classification: in.Classification, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPostCreateTicketPentestFindingOutput + var out models.EndpointsPutDASTTargetOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestFindingsFindingIdTriageInput is the input for ListDastPentestFindingsFindingIdTriage — Get Pentest Finding Full. -type ListDastPentestFindingsFindingIdTriageInput struct { - FindingID string `path:"findingId" json:"-"` +// DeleteDastTargetsTargetIdExploitValidationConsentInput is the input for DeleteDastTargetsTargetIdExploitValidationConsent — Revoke Exploit Validation Write Risk. +type DeleteDastTargetsTargetIdExploitValidationConsentInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestFindingsFindingIdTriage - Get Pentest Finding Full -// GET /dast/pentest/findings/{findingId}/triage -func (c *Client) ListDastPentestFindingsFindingIdTriage(ctx context.Context, in ListDastPentestFindingsFindingIdTriageInput) (*models.EndpointsGetPentestFindingFullOutput, error) { - path := "/dast/pentest/findings/{findingId}/triage" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// DeleteDastTargetsTargetIdExploitValidationConsent - Revoke Exploit Validation Write Risk +// DELETE /dast/targets/{targetId}/exploit-validation-consent +func (c *Client) DeleteDastTargetsTargetIdExploitValidationConsent(ctx context.Context, in DeleteDastTargetsTargetIdExploitValidationConsentInput) (*models.EndpointsExploitValidationConsentOutput, error) { + path := "/dast/targets/{targetId}/exploit-validation-consent" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1675,69 +4819,79 @@ func (c *Client) ListDastPentestFindingsFindingIdTriage(ctx context.Context, in fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetPentestFindingFullOutput + var out models.EndpointsExploitValidationConsentOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestFindingsFindingIdUnallowlistInput is the input for CreateDastPentestFindingsFindingIdUnallowlist — Unallowlist Pentest Finding. -type CreateDastPentestFindingsFindingIdUnallowlistInput struct { - FindingID string `path:"findingId" json:"-"` - UnallowlistReason string `json:"unallowlistReason"` +// ListDastTargetsTargetIdExploitValidationConsentInput is the input for ListDastTargetsTargetIdExploitValidationConsent — Get Exploit Validation Consent. +type ListDastTargetsTargetIdExploitValidationConsentInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateDastPentestFindingsFindingIdUnallowlist - Unallowlist Pentest Finding -// POST /dast/pentest/findings/{findingId}/unallowlist -func (c *Client) CreateDastPentestFindingsFindingIdUnallowlist(ctx context.Context, in CreateDastPentestFindingsFindingIdUnallowlistInput) ([]byte, error) { - path := "/dast/pentest/findings/{findingId}/unallowlist" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListDastTargetsTargetIdExploitValidationConsent - Get Exploit Validation Consent +// GET /dast/targets/{targetId}/exploit-validation-consent +func (c *Client) ListDastTargetsTargetIdExploitValidationConsent(ctx context.Context, in ListDastTargetsTargetIdExploitValidationConsentInput) (*models.EndpointsExploitValidationConsentOutput, error) { + path := "/dast/targets/{targetId}/exploit-validation-consent" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - bodyBytes, err := json.Marshal(struct { - UnallowlistReason string `json:"unallowlistReason"` - }{ - UnallowlistReason: in.UnallowlistReason, - }) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) + return nil, err } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) - return data, err + var out models.EndpointsExploitValidationConsentOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } -// GetDastPentestPreflightsPreflightIdInput is the input for GetDastPentestPreflightsPreflightId — Get Pentest Preflight. -type GetDastPentestPreflightsPreflightIdInput struct { - PreflightID string `path:"preflightId" json:"-"` +// UpdateDastTargetsTargetIdExploitValidationConsentInput is the input for UpdateDastTargetsTargetIdExploitValidationConsent — Accept Exploit Validation Write Risk. +type UpdateDastTargetsTargetIdExploitValidationConsentInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Endpoint string `json:"endpoint"` + Evidence *string `json:"evidence,omitempty"` + OnBehalfOf *string `json:"onBehalfOf,omitempty"` + WarningVersion string `json:"warningVersion"` models.RequestScope } -// GetDastPentestPreflightsPreflightId - Get Pentest Preflight -// GET /dast/pentest/preflights/{preflightId} -func (c *Client) GetDastPentestPreflightsPreflightId(ctx context.Context, in GetDastPentestPreflightsPreflightIdInput) (*models.EndpointsGetPentestPreflightOutput, error) { - path := "/dast/pentest/preflights/{preflightId}" - path = strings.Replace(path, "{preflightId}", url.PathEscape(in.PreflightID), 1) +// UpdateDastTargetsTargetIdExploitValidationConsent - Accept Exploit Validation Write Risk +// PUT /dast/targets/{targetId}/exploit-validation-consent +func (c *Client) UpdateDastTargetsTargetIdExploitValidationConsent(ctx context.Context, in UpdateDastTargetsTargetIdExploitValidationConsentInput) (*models.EndpointsExploitValidationConsentOutput, error) { + path := "/dast/targets/{targetId}/exploit-validation-consent" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1745,40 +4899,50 @@ func (c *Client) GetDastPentestPreflightsPreflightId(ctx context.Context, in Get fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Endpoint string `json:"endpoint"` + Evidence *string `json:"evidence,omitempty"` + OnBehalfOf *string `json:"onBehalfOf,omitempty"` + WarningVersion string `json:"warningVersion"` + }{ + Endpoint: in.Endpoint, + Evidence: in.Evidence, + OnBehalfOf: in.OnBehalfOf, + WarningVersion: in.WarningVersion, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPentestPreflightOutput + var out models.EndpointsExploitValidationConsentOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestPreflightsPreflightIdEventsInput is the input for ListDastPentestPreflightsPreflightIdEvents — Get Pentest Preflight Events. -type ListDastPentestPreflightsPreflightIdEventsInput struct { - PreflightID string `path:"preflightId" json:"-"` - AfterSeq *int64 `url:"afterSeq,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` +// CreateDastTargetsTargetIdValidateInput is the input for CreateDastTargetsTargetIdValidate — Validate Target. +type CreateDastTargetsTargetIdValidateInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestPreflightsPreflightIdEvents - Get Pentest Preflight Events -// GET /dast/pentest/preflights/{preflightId}/events -func (c *Client) ListDastPentestPreflightsPreflightIdEvents(ctx context.Context, in ListDastPentestPreflightsPreflightIdEventsInput) (*models.EndpointsGetPentestPreflightEventsOutput, error) { - path := "/dast/pentest/preflights/{preflightId}/events" - path = strings.Replace(path, "{preflightId}", url.PathEscape(in.PreflightID), 1) +// CreateDastTargetsTargetIdValidate - Validate Target +// POST /dast/targets/{targetId}/validate +func (c *Client) CreateDastTargetsTargetIdValidate(ctx context.Context, in CreateDastTargetsTargetIdValidateInput) (*models.EndpointsPostDASTTargetValidationOutput, error) { + path := "/dast/targets/{targetId}/validate" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.AfterSeq != nil { - query.Set("afterSeq", strconv.FormatInt(*in.AfterSeq, 10)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1787,28 +4951,31 @@ func (c *Client) ListDastPentestPreflightsPreflightIdEvents(ctx context.Context, fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetPentestPreflightEventsOutput + var out models.EndpointsPostDASTTargetValidationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansInput is the input for ListDastPentestScans — Get Pentest Scans. -type ListDastPentestScansInput struct { +// ListDastTargetsTargetIdValidationsInput is the input for ListDastTargetsTargetIdValidations — Target Validation History. +type ListDastTargetsTargetIdValidationsInput struct { + TargetID string `path:"targetId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// ListDastPentestScans - Get Pentest Scans -// GET /dast/pentest/scans -func (c *Client) ListDastPentestScans(ctx context.Context, in ListDastPentestScansInput) (*models.EndpointsGetPentestScansOutput, error) { - path := "/dast/pentest/scans" +// ListDastTargetsTargetIdValidations - Target Validation History +// GET /dast/targets/{targetId}/validations +func (c *Client) ListDastTargetsTargetIdValidations(ctx context.Context, in ListDastTargetsTargetIdValidationsInput) (*models.EndpointsPaginatedValidations, error) { + path := "/dast/targets/{targetId}/validations" + path = strings.Replace(path, "{targetId}", url.PathEscape(in.TargetID), 1) query := url.Values{} for k, v := range c.DefaultParams { @@ -1820,6 +4987,9 @@ func (c *Client) ListDastPentestScans(ctx context.Context, in ListDastPentestSca if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1831,29 +5001,39 @@ func (c *Client) ListDastPentestScans(ctx context.Context, in ListDastPentestSca if err != nil { return nil, err } - var out models.EndpointsGetPentestScansOutput + var out models.EndpointsPaginatedValidations if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetDastPentestScansScanIdInput is the input for GetDastPentestScansScanId — Get Pentest Scan. -type GetDastPentestScansScanIdInput struct { - ScanID string `path:"scanId" json:"-"` +// ListDastWebServicesInput is the input for ListDastWebServices — List Web Services. +type ListDastWebServicesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// GetDastPentestScansScanId - Get Pentest Scan -// GET /dast/pentest/scans/{scanId} -func (c *Client) GetDastPentestScansScanId(ctx context.Context, in GetDastPentestScansScanIdInput) (*models.EndpointsGetPentestScanOutput, error) { - path := "/dast/pentest/scans/{scanId}" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// ListDastWebServices - List Web Services +// GET /dast/web-services +func (c *Client) ListDastWebServices(ctx context.Context, in ListDastWebServicesInput) (*models.EndpointsGetDASTWebServicesOutput, error) { + path := "/dast/web-services" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1865,29 +5045,39 @@ func (c *Client) GetDastPentestScansScanId(ctx context.Context, in GetDastPentes if err != nil { return nil, err } - var out models.EndpointsGetPentestScanOutput + var out models.EndpointsGetDASTWebServicesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansScanIdFindingsInput is the input for ListDastPentestScansScanIdFindings — Get Pentest Scan Findings. -type ListDastPentestScansScanIdFindingsInput struct { - ScanID string `path:"scanId" json:"-"` +// CreateDastWebServicesInput is the input for CreateDastWebServices — Create Web Service. +type CreateDastWebServicesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApiType *models.ModelsAPIType `json:"apiType,omitempty"` + CredentialIds []string `json:"credentialIds,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + Targets []models.ModelsDASTWebServiceTarget `json:"targets,omitempty"` models.RequestScope } -// ListDastPentestScansScanIdFindings - Get Pentest Scan Findings -// GET /dast/pentest/scans/{scanId}/findings -func (c *Client) ListDastPentestScansScanIdFindings(ctx context.Context, in ListDastPentestScansScanIdFindingsInput) (*models.EndpointsGetPentestScanFindingsOutput, error) { - path := "/dast/pentest/scans/{scanId}/findings" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// CreateDastWebServices - Create Web Service +// POST /dast/web-services +func (c *Client) CreateDastWebServices(ctx context.Context, in CreateDastWebServicesInput) (*models.EndpointsPostDASTWebServiceOutput, error) { + path := "/dast/web-services" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1895,33 +5085,59 @@ func (c *Client) ListDastPentestScansScanIdFindings(ctx context.Context, in List fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ApiType *models.ModelsAPIType `json:"apiType,omitempty"` + CredentialIds []string `json:"credentialIds,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + Targets []models.ModelsDASTWebServiceTarget `json:"targets,omitempty"` + }{ + ApiType: in.ApiType, + CredentialIds: in.CredentialIds, + Description: in.Description, + Name: in.Name, + ProjectID: in.ProjectID, + RepoPath: in.RepoPath, + RepositoryID: in.RepositoryID, + Targets: in.Targets, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPentestScanFindingsOutput + var out models.EndpointsPostDASTWebServiceOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansScanIdHypothesesInput is the input for ListDastPentestScansScanIdHypotheses — Get Auth Matrix Hypotheses. -type ListDastPentestScansScanIdHypothesesInput struct { - ScanID string `path:"scanId" json:"-"` +// DeleteDastWebServicesWebServiceIdInput is the input for DeleteDastWebServicesWebServiceId — Delete Web Service. +type DeleteDastWebServicesWebServiceIdInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestScansScanIdHypotheses - Get Auth Matrix Hypotheses -// GET /dast/pentest/scans/{scanId}/hypotheses -func (c *Client) ListDastPentestScansScanIdHypotheses(ctx context.Context, in ListDastPentestScansScanIdHypothesesInput) (*models.EndpointsGetAuthMatrixHypothesesOutput, error) { - path := "/dast/pentest/scans/{scanId}/hypotheses" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// DeleteDastWebServicesWebServiceId - Delete Web Service +// DELETE /dast/web-services/{webServiceId} +func (c *Client) DeleteDastWebServicesWebServiceId(ctx context.Context, in DeleteDastWebServicesWebServiceIdInput) (*models.EndpointsDeleteDASTWebServiceOutput, error) { + path := "/dast/web-services/{webServiceId}" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1929,33 +5145,37 @@ func (c *Client) ListDastPentestScansScanIdHypotheses(ctx context.Context, in Li fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetAuthMatrixHypothesesOutput + var out models.EndpointsDeleteDASTWebServiceOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansScanIdLogsInput is the input for ListDastPentestScansScanIdLogs — Get Sub-Agent Network Log. -type ListDastPentestScansScanIdLogsInput struct { - ScanID string `path:"scanId" json:"-"` +// GetDastWebServicesWebServiceIdInput is the input for GetDastWebServicesWebServiceId — Get Web Service. +type GetDastWebServicesWebServiceIdInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestScansScanIdLogs - Get Sub-Agent Network Log -// GET /dast/pentest/scans/{scanId}/logs -func (c *Client) ListDastPentestScansScanIdLogs(ctx context.Context, in ListDastPentestScansScanIdLogsInput) (*models.EndpointsGetSubAgentNetworkLogOutput, error) { - path := "/dast/pentest/scans/{scanId}/logs" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// GetDastWebServicesWebServiceId - Get Web Service +// GET /dast/web-services/{webServiceId} +func (c *Client) GetDastWebServicesWebServiceId(ctx context.Context, in GetDastWebServicesWebServiceIdInput) (*models.EndpointsGetDASTWebServiceOutput, error) { + path := "/dast/web-services/{webServiceId}" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1967,29 +5187,41 @@ func (c *Client) ListDastPentestScansScanIdLogs(ctx context.Context, in ListDast if err != nil { return nil, err } - var out models.EndpointsGetSubAgentNetworkLogOutput + var out models.EndpointsGetDASTWebServiceOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansScanIdReportInput is the input for ListDastPentestScansScanIdReport — Get Pentest Scan Report. -type ListDastPentestScansScanIdReportInput struct { - ScanID string `path:"scanId" json:"-"` +// UpdateDastWebServicesWebServiceIdInput is the input for UpdateDastWebServicesWebServiceId — Update Web Service. +type UpdateDastWebServicesWebServiceIdInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ApiType *models.ModelsAPIType `json:"apiType,omitempty"` + CredentialIds []string `json:"credentialIds,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + Targets []models.ModelsDASTWebServiceTarget `json:"targets,omitempty"` models.RequestScope } -// ListDastPentestScansScanIdReport - Get Pentest Scan Report -// GET /dast/pentest/scans/{scanId}/report -func (c *Client) ListDastPentestScansScanIdReport(ctx context.Context, in ListDastPentestScansScanIdReportInput) (*models.EndpointsGetPentestScanReportOutput, error) { - path := "/dast/pentest/scans/{scanId}/report" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// UpdateDastWebServicesWebServiceId - Update Web Service +// PUT /dast/web-services/{webServiceId} +func (c *Client) UpdateDastWebServicesWebServiceId(ctx context.Context, in UpdateDastWebServicesWebServiceIdInput) (*models.EndpointsPutDASTWebServiceOutput, error) { + path := "/dast/web-services/{webServiceId}" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1997,33 +5229,60 @@ func (c *Client) ListDastPentestScansScanIdReport(ctx context.Context, in ListDa fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + ApiType *models.ModelsAPIType `json:"apiType,omitempty"` + CredentialIds []string `json:"credentialIds,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + Targets []models.ModelsDASTWebServiceTarget `json:"targets,omitempty"` + }{ + ApiType: in.ApiType, + CredentialIds: in.CredentialIds, + Description: in.Description, + Name: in.Name, + ProjectID: in.ProjectID, + RepoPath: in.RepoPath, + RepositoryID: in.RepositoryID, + Targets: in.Targets, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPentestScanReportOutput + var out models.EndpointsPutDASTWebServiceOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansScanIdReportDownloadInput is the input for ListDastPentestScansScanIdReportDownload — Get Pentest Scan Report Download URL. -type ListDastPentestScansScanIdReportDownloadInput struct { - ScanID string `path:"scanId" json:"-"` +// CreateDastWebServicesWebServiceIdAccessValidationInput is the input for CreateDastWebServicesWebServiceIdAccessValidation — Validate Web Service Access. +type CreateDastWebServicesWebServiceIdAccessValidationInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CredentialID string `json:"credentialId"` models.RequestScope } -// ListDastPentestScansScanIdReportDownload - Get Pentest Scan Report Download URL -// GET /dast/pentest/scans/{scanId}/report/download -func (c *Client) ListDastPentestScansScanIdReportDownload(ctx context.Context, in ListDastPentestScansScanIdReportDownloadInput) (*models.EndpointsGetPentestScanReportDownloadURLOutput, error) { - path := "/dast/pentest/scans/{scanId}/report/download" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// CreateDastWebServicesWebServiceIdAccessValidation - Validate Web Service Access +// POST /dast/web-services/{webServiceId}/access-validation +func (c *Client) CreateDastWebServicesWebServiceIdAccessValidation(ctx context.Context, in CreateDastWebServicesWebServiceIdAccessValidationInput) (*models.EndpointsPostDASTWebServiceAccessValidationOutput, error) { + path := "/dast/web-services/{webServiceId}/access-validation" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2031,33 +5290,53 @@ func (c *Client) ListDastPentestScansScanIdReportDownload(ctx context.Context, i fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + CredentialID string `json:"credentialId"` + }{ + CredentialID: in.CredentialID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPentestScanReportDownloadURLOutput + var out models.EndpointsPostDASTWebServiceAccessValidationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansScanIdReportExternalPdfInput is the input for ListDastPentestScansScanIdReportExternalPdf — Get Pentest Scan External Report PDF. -type ListDastPentestScansScanIdReportExternalPdfInput struct { - ScanID string `path:"scanId" json:"-"` +// ListDastWebServicesWebServiceIdAccessValidationsInput is the input for ListDastWebServicesWebServiceIdAccessValidations — Web Service Access Validation History. +type ListDastWebServicesWebServiceIdAccessValidationsInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// ListDastPentestScansScanIdReportExternalPdf - Get Pentest Scan External Report PDF -// GET /dast/pentest/scans/{scanId}/report/external/pdf -func (c *Client) ListDastPentestScansScanIdReportExternalPdf(ctx context.Context, in ListDastPentestScansScanIdReportExternalPdfInput) (*models.EndpointsGetPentestScanReportPDFOutput, error) { - path := "/dast/pentest/scans/{scanId}/report/external/pdf" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// ListDastWebServicesWebServiceIdAccessValidations - Web Service Access Validation History +// GET /dast/web-services/{webServiceId}/access-validations +func (c *Client) ListDastWebServicesWebServiceIdAccessValidations(ctx context.Context, in ListDastWebServicesWebServiceIdAccessValidationsInput) (*models.EndpointsPaginatedValidations, error) { + path := "/dast/web-services/{webServiceId}/access-validations" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2069,29 +5348,33 @@ func (c *Client) ListDastPentestScansScanIdReportExternalPdf(ctx context.Context if err != nil { return nil, err } - var out models.EndpointsGetPentestScanReportPDFOutput + var out models.EndpointsPaginatedValidations if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastPentestScansScanIdReportPdfInput is the input for ListDastPentestScansScanIdReportPdf — Get Pentest Scan Report PDF. -type ListDastPentestScansScanIdReportPdfInput struct { - ScanID string `path:"scanId" json:"-"` +// ListDastWebServicesWebServiceIdCredentialsInput is the input for ListDastWebServicesWebServiceIdCredentials — List Web Service Credentials. +type ListDastWebServicesWebServiceIdCredentialsInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastPentestScansScanIdReportPdf - Get Pentest Scan Report PDF -// GET /dast/pentest/scans/{scanId}/report/pdf -func (c *Client) ListDastPentestScansScanIdReportPdf(ctx context.Context, in ListDastPentestScansScanIdReportPdfInput) (*models.EndpointsGetPentestScanReportPDFOutput, error) { - path := "/dast/pentest/scans/{scanId}/report/pdf" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// ListDastWebServicesWebServiceIdCredentials - List Web Service Credentials +// GET /dast/web-services/{webServiceId}/credentials +func (c *Client) ListDastWebServicesWebServiceIdCredentials(ctx context.Context, in ListDastWebServicesWebServiceIdCredentialsInput) (*models.EndpointsGetDASTWebServiceCredentialsOutput, error) { + path := "/dast/web-services/{webServiceId}/credentials" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2103,29 +5386,34 @@ func (c *Client) ListDastPentestScansScanIdReportPdf(ctx context.Context, in Lis if err != nil { return nil, err } - var out models.EndpointsGetPentestScanReportPDFOutput + var out models.EndpointsGetDASTWebServiceCredentialsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestScansScanIdStopInput is the input for CreateDastPentestScansScanIdStop — Stop Pentest Scan. -type CreateDastPentestScansScanIdStopInput struct { - ScanID string `path:"scanId" json:"-"` +// CreateDastWebServicesWebServiceIdCredentialsInput is the input for CreateDastWebServicesWebServiceIdCredentials — Map Credential to Web Service. +type CreateDastWebServicesWebServiceIdCredentialsInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CredentialID string `json:"credentialId"` models.RequestScope } -// CreateDastPentestScansScanIdStop - Stop Pentest Scan -// POST /dast/pentest/scans/{scanId}/stop -func (c *Client) CreateDastPentestScansScanIdStop(ctx context.Context, in CreateDastPentestScansScanIdStopInput) (*models.EndpointsStopPentestScanOutput, error) { - path := "/dast/pentest/scans/{scanId}/stop" - path = strings.Replace(path, "{scanId}", url.PathEscape(in.ScanID), 1) +// CreateDastWebServicesWebServiceIdCredentials - Map Credential to Web Service +// POST /dast/web-services/{webServiceId}/credentials +func (c *Client) CreateDastWebServicesWebServiceIdCredentials(ctx context.Context, in CreateDastWebServicesWebServiceIdCredentialsInput) (*models.EndpointsPostDASTWebServiceCredentialOutput, error) { + path := "/dast/web-services/{webServiceId}/credentials" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2133,33 +5421,47 @@ func (c *Client) CreateDastPentestScansScanIdStop(ctx context.Context, in Create fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + CredentialID string `json:"credentialId"` + }{ + CredentialID: in.CredentialID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsStopPentestScanOutput + var out models.EndpointsPostDASTWebServiceCredentialOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateDastPentestStartInput is the input for CreateDastPentestStart — Start Pentest Scan from Application. -type CreateDastPentestStartInput struct { - ApplicationID string `json:"applicationId"` - ConfigOverrides *models.ModelsApplicationPentestConfigOverrides `json:"configOverrides,omitempty"` +// DeleteDastWebServicesWebServiceIdCredentialsCredentialIdInput is the input for DeleteDastWebServicesWebServiceIdCredentialsCredentialId — Unmap Credential from Web Service. +type DeleteDastWebServicesWebServiceIdCredentialsCredentialIdInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + CredentialID string `path:"credentialId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateDastPentestStart - Start Pentest Scan from Application -// POST /dast/pentest/start -func (c *Client) CreateDastPentestStart(ctx context.Context, in CreateDastPentestStartInput) (*models.EndpointsStartPentestScanFromApplicationOutput, error) { - path := "/dast/pentest/start" +// DeleteDastWebServicesWebServiceIdCredentialsCredentialId - Unmap Credential from Web Service +// DELETE /dast/web-services/{webServiceId}/credentials/{credentialId} +func (c *Client) DeleteDastWebServicesWebServiceIdCredentialsCredentialId(ctx context.Context, in DeleteDastWebServicesWebServiceIdCredentialsCredentialIdInput) (*models.EndpointsDeleteDASTWebServiceCredentialOutput, error) { + path := "/dast/web-services/{webServiceId}/credentials/{credentialId}" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) + path = strings.Replace(path, "{credentialId}", url.PathEscape(in.CredentialID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2167,41 +5469,37 @@ func (c *Client) CreateDastPentestStart(ctx context.Context, in CreateDastPentes fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - ApplicationID string `json:"applicationId"` - ConfigOverrides *models.ModelsApplicationPentestConfigOverrides `json:"configOverrides,omitempty"` - }{ - ApplicationID: in.ApplicationID, - ConfigOverrides: in.ConfigOverrides, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsStartPentestScanFromApplicationOutput + var out models.EndpointsDeleteDASTWebServiceCredentialOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastScansStatusLastInput is the input for ListDastScansStatusLast — Get Pentest Last Scan Status. -type ListDastScansStatusLastInput struct { +// CreateDastWebServicesWebServiceIdStatusValidationInput is the input for CreateDastWebServicesWebServiceIdStatusValidation — Validate Web Service Status. +type CreateDastWebServicesWebServiceIdStatusValidationInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListDastScansStatusLast - Get Pentest Last Scan Status -// GET /dast/scans/status/last -func (c *Client) ListDastScansStatusLast(ctx context.Context, in ListDastScansStatusLastInput) (*models.EndpointsGetDASTLastScanStatusesOutput, error) { - path := "/dast/scans/status/last" +// CreateDastWebServicesWebServiceIdStatusValidation - Validate Web Service Status +// POST /dast/web-services/{webServiceId}/status-validation +func (c *Client) CreateDastWebServicesWebServiceIdStatusValidation(ctx context.Context, in CreateDastWebServicesWebServiceIdStatusValidationInput) (*models.EndpointsPostDASTWebServiceStatusValidationOutput, error) { + path := "/dast/web-services/{webServiceId}/status-validation" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2209,31 +5507,45 @@ func (c *Client) ListDastScansStatusLast(ctx context.Context, in ListDastScansSt fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetDASTLastScanStatusesOutput + var out models.EndpointsPostDASTWebServiceStatusValidationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListDastSourceipsInput is the input for ListDastSourceips — Get Source IPs. -type ListDastSourceipsInput struct { +// ListDastWebServicesWebServiceIdStatusValidationsInput is the input for ListDastWebServicesWebServiceIdStatusValidations — Web Service Status Validation History. +type ListDastWebServicesWebServiceIdStatusValidationsInput struct { + WebServiceID string `path:"webServiceId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// ListDastSourceips - Get Source IPs -// GET /dast/sourceips -func (c *Client) ListDastSourceips(ctx context.Context, in ListDastSourceipsInput) (*models.EndpointsGetSourceIPsOutput, error) { - path := "/dast/sourceips" +// ListDastWebServicesWebServiceIdStatusValidations - Web Service Status Validation History +// GET /dast/web-services/{webServiceId}/status-validations +func (c *Client) ListDastWebServicesWebServiceIdStatusValidations(ctx context.Context, in ListDastWebServicesWebServiceIdStatusValidationsInput) (*models.EndpointsPaginatedValidations, error) { + path := "/dast/web-services/{webServiceId}/status-validations" + path = strings.Replace(path, "{webServiceId}", url.PathEscape(in.WebServiceID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2245,7 +5557,7 @@ func (c *Client) ListDastSourceips(ctx context.Context, in ListDastSourceipsInpu if err != nil { return nil, err } - var out models.EndpointsGetSourceIPsOutput + var out models.EndpointsPaginatedValidations if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } diff --git a/internal/api/findings.go b/internal/api/findings.go new file mode 100644 index 0000000..9b976c7 --- /dev/null +++ b/internal/api/findings.go @@ -0,0 +1,119 @@ +// Code generated by scripts/generate/main.go. DO NOT EDIT. +package api + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/url" + "strconv" + "strings" + + "github.com/nullify-platform/cli/internal/api/models" +) + +var _ = bytes.NewReader +var _ = json.Marshal +var _ = strconv.FormatInt +var _ = strings.Replace +var _ = fmt.Sprintf +var _ = url.PathEscape +var _ = models.RequestScope{} + +// ListFindingsFindingIdFeedbackInput is the input for ListFindingsFindingIdFeedback — List feedback on a finding. +type ListFindingsFindingIdFeedbackInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListFindingsFindingIdFeedbackInput) SetFindingID(id string) { in.FindingID = id } + +// ListFindingsFindingIdFeedback - List feedback on a finding +// GET /findings/{findingId}/feedback +func (c *Client) ListFindingsFindingIdFeedback(ctx context.Context, in ListFindingsFindingIdFeedbackInput) (*models.EndpointsGetFindingFeedbackOutput, error) { + path := "/findings/{findingId}/feedback" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetFindingFeedbackOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateFindingsFindingIdFeedbackInput is the input for CreateFindingsFindingIdFeedback — Record feedback on a finding. +type CreateFindingsFindingIdFeedbackInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CommentText *string `json:"commentText,omitempty"` + FindingType *string `json:"findingType,omitempty"` + Verdict models.EndpointsFindingFeedbackVerdict `json:"verdict"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateFindingsFindingIdFeedbackInput) SetFindingID(id string) { in.FindingID = id } + +// CreateFindingsFindingIdFeedback - Record feedback on a finding +// POST /findings/{findingId}/feedback +func (c *Client) CreateFindingsFindingIdFeedback(ctx context.Context, in CreateFindingsFindingIdFeedbackInput) (*models.EndpointsPostFindingFeedbackOutput, error) { + path := "/findings/{findingId}/feedback" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CommentText *string `json:"commentText,omitempty"` + FindingType *string `json:"findingType,omitempty"` + Verdict models.EndpointsFindingFeedbackVerdict `json:"verdict"` + }{ + CommentText: in.CommentText, + FindingType: in.FindingType, + Verdict: in.Verdict, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostFindingFeedbackOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} diff --git a/internal/api/findings_raw.go b/internal/api/findings_raw.go new file mode 100644 index 0000000..4b2a004 --- /dev/null +++ b/internal/api/findings_raw.go @@ -0,0 +1,42 @@ +package api + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/url" + + "github.com/nullify-platform/cli/internal/api/models" +) + +// CreateAdminFindingsRaw sends POST /admin/findings like CreateAdminFindings, and +// returns the response body as the server sent it. A finding then keeps the fields +// that the generated models do not have, and a changed field type cannot fail a list. +func (c *Client) CreateAdminFindingsRaw(ctx context.Context, q models.ModelsUnifiedFindingsQuery) ([]byte, error) { + body, err := json.Marshal(struct { + Query models.ModelsUnifiedFindingsQuery `json:"query"` + }{Query: q}) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + + return c.do(ctx, "POST", c.defaultParamsURL("/admin/findings"), bytes.NewReader(body)) +} + +// GetRaw sends a GET and returns the response body as the server sent it. +func (c *Client) GetRaw(ctx context.Context, path string) ([]byte, error) { + return c.do(ctx, "GET", c.defaultParamsURL(path), nil) +} + +func (c *Client) defaultParamsURL(path string) string { + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + + if len(query) == 0 { + return c.BaseURL + path + } + return c.BaseURL + path + "?" + query.Encode() +} diff --git a/internal/api/infrastructure.go b/internal/api/infrastructure.go deleted file mode 100644 index 3fcc805..0000000 --- a/internal/api/infrastructure.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by scripts/generate/main.go. DO NOT EDIT. -package api - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "net/url" - "strconv" - "strings" - - "github.com/nullify-platform/cli/internal/api/models" -) - -var _ = bytes.NewReader -var _ = json.Marshal -var _ = strconv.FormatInt -var _ = strings.Replace -var _ = fmt.Sprintf -var _ = url.PathEscape -var _ = models.RequestScope{} - -// ListInfrastructureGraphsInput is the input for ListInfrastructureGraphs — List Infrastructure Graphs. -type ListInfrastructureGraphsInput struct { - models.RequestScope -} - -// ListInfrastructureGraphs - List Infrastructure Graphs -// GET /infrastructure/graphs -func (c *Client) ListInfrastructureGraphs(ctx context.Context, in ListInfrastructureGraphsInput) (*models.EndpointsListInfrastructureGraphsOutput, error) { - path := "/infrastructure/graphs" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsListInfrastructureGraphsOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListInfrastructureGraphsInfoInput is the input for ListInfrastructureGraphsInfo — Get Infrastructure Graph Info. -type ListInfrastructureGraphsInfoInput struct { - models.RequestScope -} - -// ListInfrastructureGraphsInfo - Get Infrastructure Graph Info -// GET /infrastructure/graphs/info -func (c *Client) ListInfrastructureGraphsInfo(ctx context.Context, in ListInfrastructureGraphsInfoInput) (*models.EndpointsInfrastructureGraphInfo, error) { - path := "/infrastructure/graphs/info" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsInfrastructureGraphInfo - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListInfrastructureGraphsSummaryInput is the input for ListInfrastructureGraphsSummary — Get Infrastructure Graph Summary. -type ListInfrastructureGraphsSummaryInput struct { - models.RequestScope -} - -// ListInfrastructureGraphsSummary - Get Infrastructure Graph Summary -// GET /infrastructure/graphs/summary -func (c *Client) ListInfrastructureGraphsSummary(ctx context.Context, in ListInfrastructureGraphsSummaryInput) (*models.EndpointsGetInfrastructureGraphSummaryOutput, error) { - path := "/infrastructure/graphs/summary" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetInfrastructureGraphSummaryOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// GetInfrastructureGraphsAccountIdInput is the input for GetInfrastructureGraphsAccountId — Get Infrastructure Graph. -type GetInfrastructureGraphsAccountIdInput struct { - AccountID string `path:"accountId" json:"-"` - models.RequestScope -} - -// GetInfrastructureGraphsAccountId - Get Infrastructure Graph -// GET /infrastructure/graphs/{accountId} -func (c *Client) GetInfrastructureGraphsAccountId(ctx context.Context, in GetInfrastructureGraphsAccountIdInput) (*models.EndpointsGetInfrastructureGraphOutput, error) { - path := "/infrastructure/graphs/{accountId}" - path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetInfrastructureGraphOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListInfrastructureGraphsAccountIdDownloadInput is the input for ListInfrastructureGraphsAccountIdDownload — Get Infrastructure Graph Download URL. -type ListInfrastructureGraphsAccountIdDownloadInput struct { - AccountID string `path:"accountId" json:"-"` - models.RequestScope -} - -// ListInfrastructureGraphsAccountIdDownload - Get Infrastructure Graph Download URL -// GET /infrastructure/graphs/{accountId}/download -func (c *Client) ListInfrastructureGraphsAccountIdDownload(ctx context.Context, in ListInfrastructureGraphsAccountIdDownloadInput) (*models.EndpointsGetInfrastructureGraphDownloadOutput, error) { - path := "/infrastructure/graphs/{accountId}/download" - path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetInfrastructureGraphDownloadOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListInfrastructureGraphsAccountIdVersionsInput is the input for ListInfrastructureGraphsAccountIdVersions — List Infrastructure Graph Versions. -type ListInfrastructureGraphsAccountIdVersionsInput struct { - AccountID string `path:"accountId" json:"-"` - models.RequestScope -} - -// ListInfrastructureGraphsAccountIdVersions - List Infrastructure Graph Versions -// GET /infrastructure/graphs/{accountId}/versions -func (c *Client) ListInfrastructureGraphsAccountIdVersions(ctx context.Context, in ListInfrastructureGraphsAccountIdVersionsInput) (*models.EndpointsListInfrastructureGraphVersionsOutput, error) { - path := "/infrastructure/graphs/{accountId}/versions" - path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsListInfrastructureGraphVersionsOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - -// ListInfrastructureGraphsAccountIdVersionsVersionInput is the input for ListInfrastructureGraphsAccountIdVersionsVersion — Get Infrastructure Graph Version. -type ListInfrastructureGraphsAccountIdVersionsVersionInput struct { - AccountID string `path:"accountId" json:"-"` - Version string `path:"version" json:"-"` - models.RequestScope -} - -// ListInfrastructureGraphsAccountIdVersionsVersion - Get Infrastructure Graph Version -// GET /infrastructure/graphs/{accountId}/versions/{version} -func (c *Client) ListInfrastructureGraphsAccountIdVersionsVersion(ctx context.Context, in ListInfrastructureGraphsAccountIdVersionsVersionInput) (*models.EndpointsGetInfrastructureGraphVersionOutput, error) { - path := "/infrastructure/graphs/{accountId}/versions/{version}" - path = strings.Replace(path, "{accountId}", url.PathEscape(in.AccountID), 1) - path = strings.Replace(path, "{version}", url.PathEscape(in.Version), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetInfrastructureGraphVersionOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} diff --git a/internal/api/manager.go b/internal/api/manager.go index fc41eea..0cbc61b 100644 --- a/internal/api/manager.go +++ b/internal/api/manager.go @@ -21,22 +21,66 @@ var _ = fmt.Sprintf var _ = url.PathEscape var _ = models.RequestScope{} -// ListManagerCampaignsInput is the input for ListManagerCampaigns — List Campaigns. -type ListManagerCampaignsInput struct { +// ListManagerActionItemsInput is the input for ListManagerActionItems — List Action Items. +type ListManagerActionItemsInput struct { + AnswerType *string `url:"answerType,omitempty" json:"-"` + FindingID *string `url:"findingId,omitempty" json:"-"` + FindingType *string `url:"findingType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + GroupKey *string `url:"groupKey,omitempty" json:"-"` + Kind *string `url:"kind,omitempty" json:"-"` Page *int `url:"page,omitempty" json:"-"` PageSize *int `url:"pageSize,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` + State *string `url:"state,omitempty" json:"-"` + Status *string `url:"status,omitempty" json:"-"` + TeamID *string `url:"teamId,omitempty" json:"-"` + UnassignedOnly *bool `url:"unassignedOnly,omitempty" json:"-"` models.RequestScope } -// ListManagerCampaigns - List Campaigns -// GET /manager/campaigns -func (c *Client) ListManagerCampaigns(ctx context.Context, in ListManagerCampaignsInput) (*models.EndpointsGetCampaignsOutput, error) { - path := "/manager/campaigns" +// ListManagerActionItems - List Action Items +// GET /manager/action-items +func (c *Client) ListManagerActionItems(ctx context.Context, in ListManagerActionItemsInput) (*models.EndpointsGetActionItemsOutput, error) { + path := "/manager/action-items" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Status != nil { + query.Set("status", string(*in.Status)) + } + if in.Kind != nil { + query.Set("kind", string(*in.Kind)) + } + if in.TeamID != nil { + query.Set("teamId", string(*in.TeamID)) + } + if in.UnassignedOnly != nil { + query.Set("unassignedOnly", strconv.FormatBool(*in.UnassignedOnly)) + } + if in.FindingID != nil { + query.Set("findingId", string(*in.FindingID)) + } + if in.FindingType != nil { + query.Set("findingType", string(*in.FindingType)) + } + if in.AnswerType != nil { + query.Set("answerType", string(*in.AnswerType)) + } + if in.State != nil { + query.Set("state", string(*in.State)) + } + if in.GroupKey != nil { + query.Set("groupKey", string(*in.GroupKey)) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) + } if in.Page != nil { query.Set("page", strconv.Itoa(int(*in.Page))) } @@ -54,52 +98,31 @@ func (c *Client) ListManagerCampaigns(ctx context.Context, in ListManagerCampaig if err != nil { return nil, err } - var out models.EndpointsGetCampaignsOutput + var out models.EndpointsGetActionItemsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerCampaignsInput is the input for CreateManagerCampaigns — Post Campaign. -type CreateManagerCampaignsInput struct { - CreatedAfter *string `json:"createdAfter,omitempty"` - CreatedBefore *string `json:"createdBefore,omitempty"` - Description *string `json:"description,omitempty"` - EndDate *string `json:"endDate,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - GeneratedReasoning *string `json:"generatedReasoning,omitempty"` - IsActive *bool `json:"isActive,omitempty"` - LimitPerType *int `json:"limitPerType,omitempty"` - MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` - MinPriority *float64 `json:"minPriority,omitempty"` - NoEndDate *bool `json:"noEndDate,omitempty"` - Owner *string `json:"owner,omitempty"` - PriorityLabels []string `json:"priorityLabels,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` - SortByColumns *string `json:"sortByColumns,omitempty"` - SortByDirection *string `json:"sortByDirection,omitempty"` - StartDate *string `json:"startDate,omitempty"` - Summary *string `json:"summary,omitempty"` - TeamIDs []string `json:"teamIDs,omitempty"` - TeamNames []string `json:"teamNames,omitempty"` - Title *string `json:"title,omitempty"` - Types []string `json:"types,omitempty"` - UserNames []string `json:"userNames,omitempty"` - VulnerabilityCVEIds []string `json:"vulnerabilityCVEIds,omitempty"` - VulnerabilityCWEIds []string `json:"vulnerabilityCWEIds,omitempty"` +// ListManagerActionItemsSummaryInput is the input for ListManagerActionItemsSummary — Action Items Summary. +type ListManagerActionItemsSummaryInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateManagerCampaigns - Post Campaign -// POST /manager/campaigns -func (c *Client) CreateManagerCampaigns(ctx context.Context, in CreateManagerCampaignsInput) (*models.EndpointsPostCampaignOutput, error) { - path := "/manager/campaigns" +// ListManagerActionItemsSummary - Action Items Summary +// GET /manager/action-items/summary +func (c *Client) ListManagerActionItemsSummary(ctx context.Context, in ListManagerActionItemsSummaryInput) (*models.EndpointsGetActionItemsSummaryOutput, error) { + path := "/manager/action-items/summary" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -107,87 +130,37 @@ func (c *Client) CreateManagerCampaigns(ctx context.Context, in CreateManagerCam fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - CreatedAfter *string `json:"createdAfter,omitempty"` - CreatedBefore *string `json:"createdBefore,omitempty"` - Description *string `json:"description,omitempty"` - EndDate *string `json:"endDate,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - GeneratedReasoning *string `json:"generatedReasoning,omitempty"` - IsActive *bool `json:"isActive,omitempty"` - LimitPerType *int `json:"limitPerType,omitempty"` - MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` - MinPriority *float64 `json:"minPriority,omitempty"` - NoEndDate *bool `json:"noEndDate,omitempty"` - Owner *string `json:"owner,omitempty"` - PriorityLabels []string `json:"priorityLabels,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` - SortByColumns *string `json:"sortByColumns,omitempty"` - SortByDirection *string `json:"sortByDirection,omitempty"` - StartDate *string `json:"startDate,omitempty"` - Summary *string `json:"summary,omitempty"` - TeamIDs []string `json:"teamIDs,omitempty"` - TeamNames []string `json:"teamNames,omitempty"` - Title *string `json:"title,omitempty"` - Types []string `json:"types,omitempty"` - UserNames []string `json:"userNames,omitempty"` - VulnerabilityCVEIds []string `json:"vulnerabilityCVEIds,omitempty"` - VulnerabilityCWEIds []string `json:"vulnerabilityCWEIds,omitempty"` - }{ - CreatedAfter: in.CreatedAfter, - CreatedBefore: in.CreatedBefore, - Description: in.Description, - EndDate: in.EndDate, - FindingIds: in.FindingIds, - GeneratedReasoning: in.GeneratedReasoning, - IsActive: in.IsActive, - LimitPerType: in.LimitPerType, - MaxStoryPoints: in.MaxStoryPoints, - MinPriority: in.MinPriority, - NoEndDate: in.NoEndDate, - Owner: in.Owner, - PriorityLabels: in.PriorityLabels, - RepositoryNames: in.RepositoryNames, - SortByColumns: in.SortByColumns, - SortByDirection: in.SortByDirection, - StartDate: in.StartDate, - Summary: in.Summary, - TeamIDs: in.TeamIDs, - TeamNames: in.TeamNames, - Title: in.Title, - Types: in.Types, - UserNames: in.UserNames, - VulnerabilityCVEIds: in.VulnerabilityCVEIds, - VulnerabilityCWEIds: in.VulnerabilityCWEIds, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostCampaignOutput + var out models.EndpointsGetActionItemsSummaryOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsDefaultInput is the input for ListManagerCampaignsDefault — Get Default Campaigns. -type ListManagerCampaignsDefaultInput struct { +// DeleteManagerActionItemsActionItemIdInput is the input for DeleteManagerActionItemsActionItemId — Soft-Delete Action Item. +type DeleteManagerActionItemsActionItemIdInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerCampaignsDefault - Get Default Campaigns -// GET /manager/campaigns/default -func (c *Client) ListManagerCampaignsDefault(ctx context.Context, in ListManagerCampaignsDefaultInput) (*models.EndpointsGetDefaultCampaignsOutput, error) { - path := "/manager/campaigns/default" +// DeleteManagerActionItemsActionItemId - Soft-Delete Action Item +// DELETE /manager/action-items/{actionItemId} +func (c *Client) DeleteManagerActionItemsActionItemId(ctx context.Context, in DeleteManagerActionItemsActionItemIdInput) (*models.EndpointsDeleteActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -195,38 +168,36 @@ func (c *Client) ListManagerCampaignsDefault(ctx context.Context, in ListManager fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetDefaultCampaignsOutput + var out models.EndpointsDeleteActionItemOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerCampaignsDefaultGenerateInput is the input for CreateManagerCampaignsDefaultGenerate — Generate Default Campaigns. -type CreateManagerCampaignsDefaultGenerateInput struct { - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// GetManagerActionItemsActionItemIdInput is the input for GetManagerActionItemsActionItemId — Get Action Item. +type GetManagerActionItemsActionItemIdInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateManagerCampaignsDefaultGenerate - Generate Default Campaigns -// POST /manager/campaigns/default/generate -func (c *Client) CreateManagerCampaignsDefaultGenerate(ctx context.Context, in CreateManagerCampaignsDefaultGenerateInput) (*models.EndpointsGenerateDefaultCampaignsOutput, error) { - path := "/manager/campaigns/default/generate" +// GetManagerActionItemsActionItemId - Get Action Item +// GET /manager/action-items/{actionItemId} +func (c *Client) GetManagerActionItemsActionItemId(ctx context.Context, in GetManagerActionItemsActionItemIdInput) (*models.EndpointsGetActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -235,31 +206,38 @@ func (c *Client) CreateManagerCampaignsDefaultGenerate(ctx context.Context, in C fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGenerateDefaultCampaignsOutput + var out models.EndpointsGetActionItemOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsFindingsInput is the input for ListManagerCampaignsFindings — Get All Campaigns Findings. -type ListManagerCampaignsFindingsInput struct { +// PatchManagerActionItemsActionItemIdInput is the input for PatchManagerActionItemsActionItemId — Patch Action Item Team. +type PatchManagerActionItemsActionItemIdInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TeamID *string `json:"teamId,omitempty"` models.RequestScope } -// ListManagerCampaignsFindings - Get All Campaigns Findings -// GET /manager/campaigns/findings -func (c *Client) ListManagerCampaignsFindings(ctx context.Context, in ListManagerCampaignsFindingsInput) (*models.EndpointsGetAllCampaignsFindingsOutput, error) { - path := "/manager/campaigns/findings" +// PatchManagerActionItemsActionItemId - Patch Action Item Team +// PATCH /manager/action-items/{actionItemId} +func (c *Client) PatchManagerActionItemsActionItemId(ctx context.Context, in PatchManagerActionItemsActionItemIdInput) (*models.EndpointsPatchActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -267,34 +245,45 @@ func (c *Client) ListManagerCampaignsFindings(ctx context.Context, in ListManage fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + TeamID *string `json:"teamId,omitempty"` + }{ + TeamID: in.TeamID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetAllCampaignsFindingsOutput + var out models.EndpointsPatchActionItemOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsMetricsRefreshInput is the input for ListManagerCampaignsMetricsRefresh — Refresh Campaign Metrics. -type ListManagerCampaignsMetricsRefreshInput struct { - IncludeExpired *bool `url:"includeExpired,omitempty" json:"-"` +// CreateManagerActionItemsActionItemIdAnswerInput is the input for CreateManagerActionItemsActionItemIdAnswer — Answer Action Item. +type CreateManagerActionItemsActionItemIdAnswerInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Answer models.ActionitemanswerAnswer `json:"answer"` models.RequestScope } -// ListManagerCampaignsMetricsRefresh - Refresh Campaign Metrics -// GET /manager/campaigns/metrics/refresh -func (c *Client) ListManagerCampaignsMetricsRefresh(ctx context.Context, in ListManagerCampaignsMetricsRefreshInput) (*models.EndpointsGetCampaignMetricsRefreshOutput, error) { - path := "/manager/campaigns/metrics/refresh" +// CreateManagerActionItemsActionItemIdAnswer - Answer Action Item +// POST /manager/action-items/{actionItemId}/answer +func (c *Client) CreateManagerActionItemsActionItemIdAnswer(ctx context.Context, in CreateManagerActionItemsActionItemIdAnswerInput) (*models.EndpointsAnswerActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/answer" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.IncludeExpired != nil { - query.Set("includeExpired", strconv.FormatBool(*in.IncludeExpired)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -303,38 +292,45 @@ func (c *Client) ListManagerCampaignsMetricsRefresh(ctx context.Context, in List fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Answer models.ActionitemanswerAnswer `json:"answer"` + }{ + Answer: in.Answer, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetCampaignMetricsRefreshOutput + var out models.EndpointsAnswerActionItemOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsPreviewsInput is the input for ListManagerCampaignsPreviews — Get Campaign Previews. -type ListManagerCampaignsPreviewsInput struct { - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// CreateManagerActionItemsActionItemIdAssignRepoInput is the input for CreateManagerActionItemsActionItemIdAssignRepo — Assign Repository Owner To Action Item. +type CreateManagerActionItemsActionItemIdAssignRepoInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TeamID string `json:"teamId"` models.RequestScope } -// ListManagerCampaignsPreviews - Get Campaign Previews -// GET /manager/campaigns/previews -func (c *Client) ListManagerCampaignsPreviews(ctx context.Context, in ListManagerCampaignsPreviewsInput) (*models.EndpointsGetCampaignPreviewsOutput, error) { - path := "/manager/campaigns/previews" +// CreateManagerActionItemsActionItemIdAssignRepo - Assign Repository Owner To Action Item +// POST /manager/action-items/{actionItemId}/assign-repo +func (c *Client) CreateManagerActionItemsActionItemIdAssignRepo(ctx context.Context, in CreateManagerActionItemsActionItemIdAssignRepoInput) (*models.EndpointsAssignRepoActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/assign-repo" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -343,38 +339,45 @@ func (c *Client) ListManagerCampaignsPreviews(ctx context.Context, in ListManage fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + TeamID string `json:"teamId"` + }{ + TeamID: in.TeamID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetCampaignPreviewsOutput + var out models.EndpointsAssignRepoActionItemOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsSummariesInput is the input for ListManagerCampaignsSummaries — Get Campaign Summaries. -type ListManagerCampaignsSummariesInput struct { - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// CreateManagerActionItemsActionItemIdAssignTeamInput is the input for CreateManagerActionItemsActionItemIdAssignTeam — Assign Team To Action Item. +type CreateManagerActionItemsActionItemIdAssignTeamInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + TeamID string `json:"teamId"` models.RequestScope } -// ListManagerCampaignsSummaries - Get Campaign Summaries -// GET /manager/campaigns/summaries -func (c *Client) ListManagerCampaignsSummaries(ctx context.Context, in ListManagerCampaignsSummariesInput) (*models.EndpointsGetCampaignSummariesOutput, error) { - path := "/manager/campaigns/summaries" +// CreateManagerActionItemsActionItemIdAssignTeam - Assign Team To Action Item +// POST /manager/action-items/{actionItemId}/assign-team +func (c *Client) CreateManagerActionItemsActionItemIdAssignTeam(ctx context.Context, in CreateManagerActionItemsActionItemIdAssignTeamInput) (*models.EndpointsAssignTeamActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/assign-team" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -383,33 +386,45 @@ func (c *Client) ListManagerCampaignsSummaries(ctx context.Context, in ListManag fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + TeamID string `json:"teamId"` + }{ + TeamID: in.TeamID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetCampaignSummariesOutput + var out models.EndpointsAssignTeamActionItemOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteManagerCampaignsCampaignIdInput is the input for DeleteManagerCampaignsCampaignId — Delete Campaign. -type DeleteManagerCampaignsCampaignIdInput struct { - CampaignID string `path:"campaignId" json:"-"` +// UpdateManagerActionItemsActionItemIdChatInput is the input for UpdateManagerActionItemsActionItemIdChat — Get or create action item chat. +type UpdateManagerActionItemsActionItemIdChatInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteManagerCampaignsCampaignId - Delete Campaign -// DELETE /manager/campaigns/{campaignId} -func (c *Client) DeleteManagerCampaignsCampaignId(ctx context.Context, in DeleteManagerCampaignsCampaignIdInput) ([]byte, error) { - path := "/manager/campaigns/{campaignId}" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) +// UpdateManagerActionItemsActionItemIdChat - Get or create action item chat +// PUT /manager/action-items/{actionItemId}/chat +func (c *Client) UpdateManagerActionItemsActionItemIdChat(ctx context.Context, in UpdateManagerActionItemsActionItemIdChatInput) (*models.EndpointsPutActionItemChatOutput, error) { + path := "/manager/action-items/{actionItemId}/chat" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -417,26 +432,40 @@ func (c *Client) DeleteManagerCampaignsCampaignId(ctx context.Context, in Delete fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) - return data, err + data, err := c.do(ctx, "PUT", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsPutActionItemChatOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } -// GetManagerCampaignsCampaignIdInput is the input for GetManagerCampaignsCampaignId — Get Campaign by ID. -type GetManagerCampaignsCampaignIdInput struct { - CampaignID string `path:"campaignId" json:"-"` +// CreateManagerActionItemsActionItemIdDismissInput is the input for CreateManagerActionItemsActionItemIdDismiss — Dismiss Action Item. +type CreateManagerActionItemsActionItemIdDismissInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Classify *string `json:"classify,omitempty"` + Disposition *string `json:"disposition,omitempty"` + Reason string `json:"reason"` models.RequestScope } -// GetManagerCampaignsCampaignId - Get Campaign by ID -// GET /manager/campaigns/{campaignId} -func (c *Client) GetManagerCampaignsCampaignId(ctx context.Context, in GetManagerCampaignsCampaignIdInput) (*models.EndpointsGetCampaignOutput, error) { - path := "/manager/campaigns/{campaignId}" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) +// CreateManagerActionItemsActionItemIdDismiss - Dismiss Action Item +// POST /manager/action-items/{actionItemId}/dismiss +func (c *Client) CreateManagerActionItemsActionItemIdDismiss(ctx context.Context, in CreateManagerActionItemsActionItemIdDismissInput) (*models.EndpointsDismissActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/dismiss" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -444,40 +473,345 @@ func (c *Client) GetManagerCampaignsCampaignId(ctx context.Context, in GetManage fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Classify *string `json:"classify,omitempty"` + Disposition *string `json:"disposition,omitempty"` + Reason string `json:"reason"` + }{ + Classify: in.Classify, + Disposition: in.Disposition, + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetCampaignOutput + var out models.EndpointsDismissActionItemOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchManagerCampaignsCampaignIdInput is the input for PatchManagerCampaignsCampaignId — Patch Campaign. -type PatchManagerCampaignsCampaignIdInput struct { - CampaignID string `path:"campaignId" json:"-"` - CreatedAfter *string `json:"createdAfter,omitempty"` - CreatedBefore *string `json:"createdBefore,omitempty"` - Description *string `json:"description,omitempty"` - EndDate *string `json:"endDate,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - GeneratedReasoning *string `json:"generatedReasoning,omitempty"` - IsActive *bool `json:"isActive,omitempty"` - LimitPerType *int `json:"limitPerType,omitempty"` - MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` +// CreateManagerActionItemsActionItemIdMapUserInput is the input for CreateManagerActionItemsActionItemIdMapUser — Map User For Action Item. +type CreateManagerActionItemsActionItemIdMapUserInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + MessageUserID *string `json:"messageUserId,omitempty"` + ServiceAccount *bool `json:"serviceAccount,omitempty"` + models.RequestScope +} + +// CreateManagerActionItemsActionItemIdMapUser - Map User For Action Item +// POST /manager/action-items/{actionItemId}/map-user +func (c *Client) CreateManagerActionItemsActionItemIdMapUser(ctx context.Context, in CreateManagerActionItemsActionItemIdMapUserInput) (*models.EndpointsMapUserActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/map-user" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + MessageUserID *string `json:"messageUserId,omitempty"` + ServiceAccount *bool `json:"serviceAccount,omitempty"` + }{ + MessageUserID: in.MessageUserID, + ServiceAccount: in.ServiceAccount, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsMapUserActionItemOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerActionItemsActionItemIdMessagesInput is the input for ListManagerActionItemsActionItemIdMessages — Get Action Item Messages. +type ListManagerActionItemsActionItemIdMessagesInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeReplay *bool `url:"includeReplay,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerActionItemsActionItemIdMessages - Get Action Item Messages +// GET /manager/action-items/{actionItemId}/messages +func (c *Client) ListManagerActionItemsActionItemIdMessages(ctx context.Context, in ListManagerActionItemsActionItemIdMessagesInput) (*models.EndpointsGetActionItemMessagesOutput, error) { + path := "/manager/action-items/{actionItemId}/messages" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.IncludeReplay != nil { + query.Set("includeReplay", strconv.FormatBool(*in.IncludeReplay)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetActionItemMessagesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateManagerActionItemsActionItemIdNudgeInput is the input for CreateManagerActionItemsActionItemIdNudge — Nudge Escalation Action Item. +type CreateManagerActionItemsActionItemIdNudgeInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Message *string `json:"message,omitempty"` + RecipientUserID *string `json:"recipientUserId,omitempty"` + models.RequestScope +} + +// CreateManagerActionItemsActionItemIdNudge - Nudge Escalation Action Item +// POST /manager/action-items/{actionItemId}/nudge +func (c *Client) CreateManagerActionItemsActionItemIdNudge(ctx context.Context, in CreateManagerActionItemsActionItemIdNudgeInput) (*models.EndpointsNudgeActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/nudge" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Message *string `json:"message,omitempty"` + RecipientUserID *string `json:"recipientUserId,omitempty"` + }{ + Message: in.Message, + RecipientUserID: in.RecipientUserID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsNudgeActionItemOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateManagerActionItemsActionItemIdReopenInput is the input for CreateManagerActionItemsActionItemIdReopen — Reopen Action Item. +type CreateManagerActionItemsActionItemIdReopenInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Reason string `json:"reason"` + models.RequestScope +} + +// CreateManagerActionItemsActionItemIdReopen - Reopen Action Item +// POST /manager/action-items/{actionItemId}/reopen +func (c *Client) CreateManagerActionItemsActionItemIdReopen(ctx context.Context, in CreateManagerActionItemsActionItemIdReopenInput) (*models.EndpointsReopenActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/reopen" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Reason string `json:"reason"` + }{ + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsReopenActionItemOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateManagerActionItemsActionItemIdSnoozeInput is the input for CreateManagerActionItemsActionItemIdSnooze — Snooze Action Item. +type CreateManagerActionItemsActionItemIdSnoozeInput struct { + ActionItemID string `path:"actionItemId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DurationDays int `json:"durationDays"` + Reason string `json:"reason"` + models.RequestScope +} + +// CreateManagerActionItemsActionItemIdSnooze - Snooze Action Item +// POST /manager/action-items/{actionItemId}/snooze +func (c *Client) CreateManagerActionItemsActionItemIdSnooze(ctx context.Context, in CreateManagerActionItemsActionItemIdSnoozeInput) (*models.EndpointsSnoozeActionItemOutput, error) { + path := "/manager/action-items/{actionItemId}/snooze" + path = strings.Replace(path, "{actionItemId}", url.PathEscape(in.ActionItemID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + DurationDays int `json:"durationDays"` + Reason string `json:"reason"` + }{ + DurationDays: in.DurationDays, + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsSnoozeActionItemOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsInput is the input for ListManagerCampaigns — List Campaigns. +type ListManagerCampaignsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaigns - List Campaigns +// GET /manager/campaigns +func (c *Client) ListManagerCampaigns(ctx context.Context, in ListManagerCampaignsInput) (*models.EndpointsGetCampaignsOutput, error) { + path := "/manager/campaigns" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateManagerCampaignsInput is the input for CreateManagerCampaigns — Post Campaign. +type CreateManagerCampaignsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CreatedAfter *string `json:"createdAfter,omitempty"` + CreatedBefore *string `json:"createdBefore,omitempty"` + Description *string `json:"description,omitempty"` + EndDate *string `json:"endDate,omitempty"` + ExploitValidated *bool `json:"exploitValidated,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + GeneratedReasoning *string `json:"generatedReasoning,omitempty"` + IsActive *bool `json:"isActive,omitempty"` + LimitPerType *int `json:"limitPerType,omitempty"` + MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` MinPriority *float64 `json:"minPriority,omitempty"` NoEndDate *bool `json:"noEndDate,omitempty"` Owner *string `json:"owner,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` PriorityLabels []string `json:"priorityLabels,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` SortByColumns *string `json:"sortByColumns,omitempty"` SortByDirection *string `json:"sortByDirection,omitempty"` StartDate *string `json:"startDate,omitempty"` Summary *string `json:"summary,omitempty"` TeamIDs []string `json:"teamIDs,omitempty"` - TeamNames []string `json:"teamNames,omitempty"` Title *string `json:"title,omitempty"` Types []string `json:"types,omitempty"` UserNames []string `json:"userNames,omitempty"` @@ -486,16 +820,1370 @@ type PatchManagerCampaignsCampaignIdInput struct { models.RequestScope } -// PatchManagerCampaignsCampaignId - Patch Campaign -// PATCH /manager/campaigns/{campaignId} -func (c *Client) PatchManagerCampaignsCampaignId(ctx context.Context, in PatchManagerCampaignsCampaignIdInput) (*models.EndpointsPatchCampaignOutput, error) { - path := "/manager/campaigns/{campaignId}" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) +// CreateManagerCampaigns - Post Campaign +// POST /manager/campaigns +func (c *Client) CreateManagerCampaigns(ctx context.Context, in CreateManagerCampaignsInput) (*models.EndpointsPostCampaignOutput, error) { + path := "/manager/campaigns" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CreatedAfter *string `json:"createdAfter,omitempty"` + CreatedBefore *string `json:"createdBefore,omitempty"` + Description *string `json:"description,omitempty"` + EndDate *string `json:"endDate,omitempty"` + ExploitValidated *bool `json:"exploitValidated,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + GeneratedReasoning *string `json:"generatedReasoning,omitempty"` + IsActive *bool `json:"isActive,omitempty"` + LimitPerType *int `json:"limitPerType,omitempty"` + MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` + MinPriority *float64 `json:"minPriority,omitempty"` + NoEndDate *bool `json:"noEndDate,omitempty"` + Owner *string `json:"owner,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` + PriorityLabels []string `json:"priorityLabels,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` + SortByColumns *string `json:"sortByColumns,omitempty"` + SortByDirection *string `json:"sortByDirection,omitempty"` + StartDate *string `json:"startDate,omitempty"` + Summary *string `json:"summary,omitempty"` + TeamIDs []string `json:"teamIDs,omitempty"` + Title *string `json:"title,omitempty"` + Types []string `json:"types,omitempty"` + UserNames []string `json:"userNames,omitempty"` + VulnerabilityCVEIds []string `json:"vulnerabilityCVEIds,omitempty"` + VulnerabilityCWEIds []string `json:"vulnerabilityCWEIds,omitempty"` + }{ + CreatedAfter: in.CreatedAfter, + CreatedBefore: in.CreatedBefore, + Description: in.Description, + EndDate: in.EndDate, + ExploitValidated: in.ExploitValidated, + FindingIds: in.FindingIds, + GeneratedReasoning: in.GeneratedReasoning, + IsActive: in.IsActive, + LimitPerType: in.LimitPerType, + MaxStoryPoints: in.MaxStoryPoints, + MinPriority: in.MinPriority, + NoEndDate: in.NoEndDate, + Owner: in.Owner, + PrBudgetPerWeek: in.PrBudgetPerWeek, + PriorityLabels: in.PriorityLabels, + RepositoryIds: in.RepositoryIds, + SeverityConfidence: in.SeverityConfidence, + SortByColumns: in.SortByColumns, + SortByDirection: in.SortByDirection, + StartDate: in.StartDate, + Summary: in.Summary, + TeamIDs: in.TeamIDs, + Title: in.Title, + Types: in.Types, + UserNames: in.UserNames, + VulnerabilityCVEIds: in.VulnerabilityCVEIds, + VulnerabilityCWEIds: in.VulnerabilityCWEIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostCampaignOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsDefaultInput is the input for ListManagerCampaignsDefault — Get Default Campaigns. +type ListManagerCampaignsDefaultInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsDefault - Get Default Campaigns +// GET /manager/campaigns/default +func (c *Client) ListManagerCampaignsDefault(ctx context.Context, in ListManagerCampaignsDefaultInput) (*models.EndpointsGetDefaultCampaignsOutput, error) { + path := "/manager/campaigns/default" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetDefaultCampaignsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateManagerCampaignsDefaultGenerateInput is the input for CreateManagerCampaignsDefaultGenerate — Generate Default Campaigns. +type CreateManagerCampaignsDefaultGenerateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// CreateManagerCampaignsDefaultGenerate - Generate Default Campaigns +// POST /manager/campaigns/default/generate +func (c *Client) CreateManagerCampaignsDefaultGenerate(ctx context.Context, in CreateManagerCampaignsDefaultGenerateInput) (*models.EndpointsGenerateDefaultCampaignsOutput, error) { + path := "/manager/campaigns/default/generate" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGenerateDefaultCampaignsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsFindingsInput is the input for ListManagerCampaignsFindings — Get All Campaigns Findings. +type ListManagerCampaignsFindingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsFindings - Get All Campaigns Findings +// GET /manager/campaigns/findings +func (c *Client) ListManagerCampaignsFindings(ctx context.Context, in ListManagerCampaignsFindingsInput) (*models.EndpointsGetAllCampaignsFindingsOutput, error) { + path := "/manager/campaigns/findings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetAllCampaignsFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsMetricsRefreshInput is the input for ListManagerCampaignsMetricsRefresh — Refresh Campaign Metrics. +type ListManagerCampaignsMetricsRefreshInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeExpired *bool `url:"includeExpired,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsMetricsRefresh - Refresh Campaign Metrics +// GET /manager/campaigns/metrics/refresh +func (c *Client) ListManagerCampaignsMetricsRefresh(ctx context.Context, in ListManagerCampaignsMetricsRefreshInput) (*models.EndpointsGetCampaignMetricsRefreshOutput, error) { + path := "/manager/campaigns/metrics/refresh" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.IncludeExpired != nil { + query.Set("includeExpired", strconv.FormatBool(*in.IncludeExpired)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignMetricsRefreshOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsPreviewsInput is the input for ListManagerCampaignsPreviews — Get Campaign Previews. +type ListManagerCampaignsPreviewsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsPreviews - Get Campaign Previews +// GET /manager/campaigns/previews +func (c *Client) ListManagerCampaignsPreviews(ctx context.Context, in ListManagerCampaignsPreviewsInput) (*models.EndpointsGetCampaignPreviewsOutput, error) { + path := "/manager/campaigns/previews" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignPreviewsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsSummariesInput is the input for ListManagerCampaignsSummaries — Get Campaign Summaries. +type ListManagerCampaignsSummariesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsSummaries - Get Campaign Summaries +// GET /manager/campaigns/summaries +func (c *Client) ListManagerCampaignsSummaries(ctx context.Context, in ListManagerCampaignsSummariesInput) (*models.EndpointsGetCampaignSummariesOutput, error) { + path := "/manager/campaigns/summaries" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignSummariesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteManagerCampaignsCampaignIdInput is the input for DeleteManagerCampaignsCampaignId — Delete Campaign. +type DeleteManagerCampaignsCampaignIdInput struct { + CampaignID string `path:"campaignId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteManagerCampaignsCampaignId - Delete Campaign +// DELETE /manager/campaigns/{campaignId} +func (c *Client) DeleteManagerCampaignsCampaignId(ctx context.Context, in DeleteManagerCampaignsCampaignIdInput) ([]byte, error) { + path := "/manager/campaigns/{campaignId}" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + return data, err +} + +// GetManagerCampaignsCampaignIdInput is the input for GetManagerCampaignsCampaignId — Get Campaign by ID. +type GetManagerCampaignsCampaignIdInput struct { + CampaignID string `path:"campaignId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetManagerCampaignsCampaignId - Get Campaign by ID +// GET /manager/campaigns/{campaignId} +func (c *Client) GetManagerCampaignsCampaignId(ctx context.Context, in GetManagerCampaignsCampaignIdInput) (*models.EndpointsGetCampaignOutput, error) { + path := "/manager/campaigns/{campaignId}" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchManagerCampaignsCampaignIdInput is the input for PatchManagerCampaignsCampaignId — Patch Campaign. +type PatchManagerCampaignsCampaignIdInput struct { + CampaignID string `path:"campaignId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ClearExploitValidated *bool `json:"clearExploitValidated,omitempty"` + ConfirmWholeBacklog *bool `json:"confirmWholeBacklog,omitempty"` + CreatedAfter *string `json:"createdAfter,omitempty"` + CreatedBefore *string `json:"createdBefore,omitempty"` + Description *string `json:"description,omitempty"` + EndDate *string `json:"endDate,omitempty"` + ExploitValidated *bool `json:"exploitValidated,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + GeneratedReasoning *string `json:"generatedReasoning,omitempty"` + IsActive *bool `json:"isActive,omitempty"` + LimitPerType *int `json:"limitPerType,omitempty"` + MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` + MinPriority *float64 `json:"minPriority,omitempty"` + NoEndDate *bool `json:"noEndDate,omitempty"` + Owner *string `json:"owner,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` + PriorityLabels []string `json:"priorityLabels,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` + SortByColumns *string `json:"sortByColumns,omitempty"` + SortByDirection *string `json:"sortByDirection,omitempty"` + StartDate *string `json:"startDate,omitempty"` + Summary *string `json:"summary,omitempty"` + TeamIDs []string `json:"teamIDs,omitempty"` + Title *string `json:"title,omitempty"` + Types []string `json:"types,omitempty"` + UserNames []string `json:"userNames,omitempty"` + VulnerabilityCVEIds []string `json:"vulnerabilityCVEIds,omitempty"` + VulnerabilityCWEIds []string `json:"vulnerabilityCWEIds,omitempty"` + models.RequestScope +} + +// PatchManagerCampaignsCampaignId - Patch Campaign +// PATCH /manager/campaigns/{campaignId} +func (c *Client) PatchManagerCampaignsCampaignId(ctx context.Context, in PatchManagerCampaignsCampaignIdInput) (*models.EndpointsPatchCampaignOutput, error) { + path := "/manager/campaigns/{campaignId}" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + ClearExploitValidated *bool `json:"clearExploitValidated,omitempty"` + ConfirmWholeBacklog *bool `json:"confirmWholeBacklog,omitempty"` + CreatedAfter *string `json:"createdAfter,omitempty"` + CreatedBefore *string `json:"createdBefore,omitempty"` + Description *string `json:"description,omitempty"` + EndDate *string `json:"endDate,omitempty"` + ExploitValidated *bool `json:"exploitValidated,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + GeneratedReasoning *string `json:"generatedReasoning,omitempty"` + IsActive *bool `json:"isActive,omitempty"` + LimitPerType *int `json:"limitPerType,omitempty"` + MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` + MinPriority *float64 `json:"minPriority,omitempty"` + NoEndDate *bool `json:"noEndDate,omitempty"` + Owner *string `json:"owner,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` + PriorityLabels []string `json:"priorityLabels,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` + SortByColumns *string `json:"sortByColumns,omitempty"` + SortByDirection *string `json:"sortByDirection,omitempty"` + StartDate *string `json:"startDate,omitempty"` + Summary *string `json:"summary,omitempty"` + TeamIDs []string `json:"teamIDs,omitempty"` + Title *string `json:"title,omitempty"` + Types []string `json:"types,omitempty"` + UserNames []string `json:"userNames,omitempty"` + VulnerabilityCVEIds []string `json:"vulnerabilityCVEIds,omitempty"` + VulnerabilityCWEIds []string `json:"vulnerabilityCWEIds,omitempty"` + }{ + ClearExploitValidated: in.ClearExploitValidated, + ConfirmWholeBacklog: in.ConfirmWholeBacklog, + CreatedAfter: in.CreatedAfter, + CreatedBefore: in.CreatedBefore, + Description: in.Description, + EndDate: in.EndDate, + ExploitValidated: in.ExploitValidated, + FindingIds: in.FindingIds, + GeneratedReasoning: in.GeneratedReasoning, + IsActive: in.IsActive, + LimitPerType: in.LimitPerType, + MaxStoryPoints: in.MaxStoryPoints, + MinPriority: in.MinPriority, + NoEndDate: in.NoEndDate, + Owner: in.Owner, + PrBudgetPerWeek: in.PrBudgetPerWeek, + PriorityLabels: in.PriorityLabels, + RepositoryIds: in.RepositoryIds, + SeverityConfidence: in.SeverityConfidence, + SortByColumns: in.SortByColumns, + SortByDirection: in.SortByDirection, + StartDate: in.StartDate, + Summary: in.Summary, + TeamIDs: in.TeamIDs, + Title: in.Title, + Types: in.Types, + UserNames: in.UserNames, + VulnerabilityCVEIds: in.VulnerabilityCVEIds, + VulnerabilityCWEIds: in.VulnerabilityCWEIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchCampaignOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsCampaignIdEventsInput is the input for ListManagerCampaignsCampaignIdEvents — Get Campaign Events. +type ListManagerCampaignsCampaignIdEventsInput struct { + CampaignID string `path:"campaignId" json:"-"` + ActionTypes []string `url:"actionTypes,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + Statuses []string `url:"statuses,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsCampaignIdEvents - Get Campaign Events +// GET /manager/campaigns/{campaignId}/events +func (c *Client) ListManagerCampaignsCampaignIdEvents(ctx context.Context, in ListManagerCampaignsCampaignIdEventsInput) (*models.EndpointsGetCampaignEventsOutput, error) { + path := "/manager/campaigns/{campaignId}/events" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + for _, v := range in.ActionTypes { + query.Add("actionTypes", string(v)) + } + for _, v := range in.Statuses { + query.Add("statuses", string(v)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignEventsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsCampaignIdFindingsInput is the input for ListManagerCampaignsCampaignIdFindings — Get (Triaged) Findings Associated with a campaign. +type ListManagerCampaignsCampaignIdFindingsInput struct { + CampaignID string `path:"campaignId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsCampaignIdFindings - Get (Triaged) Findings Associated with a campaign +// GET /manager/campaigns/{campaignId}/findings +func (c *Client) ListManagerCampaignsCampaignIdFindings(ctx context.Context, in ListManagerCampaignsCampaignIdFindingsInput) (*models.EndpointsGetCampaignFindingsOutput, error) { + path := "/manager/campaigns/{campaignId}/findings" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsCampaignIdPreviewInput is the input for ListManagerCampaignsCampaignIdPreview — Get Campaign Preview Details. +type ListManagerCampaignsCampaignIdPreviewInput struct { + CampaignID string `path:"campaignId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsCampaignIdPreview - Get Campaign Preview Details +// GET /manager/campaigns/{campaignId}/preview +func (c *Client) ListManagerCampaignsCampaignIdPreview(ctx context.Context, in ListManagerCampaignsCampaignIdPreviewInput) (*models.EndpointsGetCampaignPreviewOutput, error) { + path := "/manager/campaigns/{campaignId}/preview" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignPreviewOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerCampaignsCampaignIdRunsInput is the input for ListManagerCampaignsCampaignIdRuns — List Campaign Runs. +type ListManagerCampaignsCampaignIdRunsInput struct { + CampaignID string `path:"campaignId" json:"-"` + Cursor *string `url:"cursor,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + Offset *int32 `url:"offset,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerCampaignsCampaignIdRuns - List Campaign Runs +// GET /manager/campaigns/{campaignId}/runs +func (c *Client) ListManagerCampaignsCampaignIdRuns(ctx context.Context, in ListManagerCampaignsCampaignIdRunsInput) (*models.EndpointsGetCampaignRunsOutput, error) { + path := "/manager/campaigns/{campaignId}/runs" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignRunsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetManagerCampaignsCampaignIdRunsRunIdInput is the input for GetManagerCampaignsCampaignIdRunsRunId — Get Campaign Run. +type GetManagerCampaignsCampaignIdRunsRunIdInput struct { + CampaignID string `path:"campaignId" json:"-"` + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetManagerCampaignsCampaignIdRunsRunId - Get Campaign Run +// GET /manager/campaigns/{campaignId}/runs/{runId} +func (c *Client) GetManagerCampaignsCampaignIdRunsRunId(ctx context.Context, in GetManagerCampaignsCampaignIdRunsRunIdInput) (*models.EndpointsGetCampaignRunOutput, error) { + path := "/manager/campaigns/{campaignId}/runs/{runId}" + path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCampaignRunOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateManagerChatGeneralInput is the input for UpdateManagerChatGeneral — Get or create Operator General chat. +type UpdateManagerChatGeneralInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// UpdateManagerChatGeneral - Get or create Operator General chat +// PUT /manager/chat/general +func (c *Client) UpdateManagerChatGeneral(ctx context.Context, in UpdateManagerChatGeneralInput) (*models.EndpointsPutGeneralChatOutput, error) { + path := "/manager/chat/general" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "PUT", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsPutGeneralChatOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerChatSessionsInput is the input for ListManagerChatSessions — List Chat Sessions. +type ListManagerChatSessionsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerChatSessions - List Chat Sessions +// GET /manager/chat/sessions +func (c *Client) ListManagerChatSessions(ctx context.Context, in ListManagerChatSessionsInput) (*models.EndpointsListChatSessionsOutput, error) { + path := "/manager/chat/sessions" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsListChatSessionsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// DeleteManagerChatSessionsChatIDInput is the input for DeleteManagerChatSessionsChatID — Delete Chat Session. +type DeleteManagerChatSessionsChatIDInput struct { + ChatID string `path:"chatID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// DeleteManagerChatSessionsChatID - Delete Chat Session +// DELETE /manager/chat/sessions/{chatID} +func (c *Client) DeleteManagerChatSessionsChatID(ctx context.Context, in DeleteManagerChatSessionsChatIDInput) (*models.EndpointsDeleteChatSessionOutput, error) { + path := "/manager/chat/sessions/{chatID}" + path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteChatSessionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetManagerChatSessionsChatIDInput is the input for GetManagerChatSessionsChatID — Get Chat Session. +type GetManagerChatSessionsChatIDInput struct { + ChatID string `path:"chatID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetManagerChatSessionsChatID - Get Chat Session +// GET /manager/chat/sessions/{chatID} +func (c *Client) GetManagerChatSessionsChatID(ctx context.Context, in GetManagerChatSessionsChatIDInput) (*models.EndpointsGetChatSessionOutput, error) { + path := "/manager/chat/sessions/{chatID}" + path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetChatSessionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// PatchManagerChatSessionsChatIDInput is the input for PatchManagerChatSessionsChatID — Patch Chat Session. +type PatchManagerChatSessionsChatIDInput struct { + ChatID string `path:"chatID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Title *string `json:"title,omitempty"` + models.RequestScope +} + +// PatchManagerChatSessionsChatID - Patch Chat Session +// PATCH /manager/chat/sessions/{chatID} +func (c *Client) PatchManagerChatSessionsChatID(ctx context.Context, in PatchManagerChatSessionsChatIDInput) (*models.EndpointsPatchChatSessionOutput, error) { + path := "/manager/chat/sessions/{chatID}" + path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Title *string `json:"title,omitempty"` + }{ + Title: in.Title, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPatchChatSessionOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerChatSessionsChatIDActionsInput is the input for ListManagerChatSessionsChatIDActions — Get Chat Session Actions. +type ListManagerChatSessionsChatIDActionsInput struct { + ChatID string `path:"chatID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerChatSessionsChatIDActions - Get Chat Session Actions +// GET /manager/chat/sessions/{chatID}/actions +func (c *Client) ListManagerChatSessionsChatIDActions(ctx context.Context, in ListManagerChatSessionsChatIDActionsInput) (*models.EndpointsGetChatSessionActionsOutput, error) { + path := "/manager/chat/sessions/{chatID}/actions" + path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetChatSessionActionsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerChatSessionsChatIDAuditInput is the input for ListManagerChatSessionsChatIDAudit — Get chat session audit trail. +type ListManagerChatSessionsChatIDAuditInput struct { + ChatID string `path:"chatID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerChatSessionsChatIDAudit - Get chat session audit trail +// GET /manager/chat/sessions/{chatID}/audit +func (c *Client) ListManagerChatSessionsChatIDAudit(ctx context.Context, in ListManagerChatSessionsChatIDAuditInput) (*models.EndpointsGetChatSessionAuditOutput, error) { + path := "/manager/chat/sessions/{chatID}/audit" + path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetChatSessionAuditOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerChatSessionsChatIDHistoryInput is the input for ListManagerChatSessionsChatIDHistory — Get Chat Session History. +type ListManagerChatSessionsChatIDHistoryInput struct { + ChatID string `path:"chatID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeReplay *bool `url:"includeReplay,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerChatSessionsChatIDHistory - Get Chat Session History +// GET /manager/chat/sessions/{chatID}/history +func (c *Client) ListManagerChatSessionsChatIDHistory(ctx context.Context, in ListManagerChatSessionsChatIDHistoryInput) (*models.EndpointsGetChatSessionHistoryOutput, error) { + path := "/manager/chat/sessions/{chatID}/history" + path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.IncludeReplay != nil { + query.Set("includeReplay", strconv.FormatBool(*in.IncludeReplay)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetChatSessionHistoryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerConfigInput is the input for ListManagerConfig — Get Manager config. +type ListManagerConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerConfig - Get Manager config +// GET /manager/config +func (c *Client) ListManagerConfig(ctx context.Context, in ListManagerConfigInput) (*models.EndpointsGetManagerConfigOutput, error) { + path := "/manager/config" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetManagerConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateManagerConfigInput is the input for CreateManagerConfig — Update Manager config. +type CreateManagerConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Config models.EndpointsManagerConfigInput `json:"config"` + models.RequestScope +} + +// CreateManagerConfig - Update Manager config +// POST /manager/config +func (c *Client) CreateManagerConfig(ctx context.Context, in CreateManagerConfigInput) (*models.EndpointsPostManagerConfigOutput, error) { + path := "/manager/config" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Config models.EndpointsManagerConfigInput `json:"config"` + }{ + Config: in.Config, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostManagerConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateManagerDailySummaryTriggerInput is the input for CreateManagerDailySummaryTrigger — Start a daily summary run. +type CreateManagerDailySummaryTriggerInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Audience string `json:"audience"` + models.RequestScope +} + +// CreateManagerDailySummaryTrigger - Start a daily summary run +// POST /manager/daily-summary/trigger +func (c *Client) CreateManagerDailySummaryTrigger(ctx context.Context, in CreateManagerDailySummaryTriggerInput) (*models.EndpointsTriggerManagerDailySummaryOutput, error) { + path := "/manager/daily-summary/trigger" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Audience string `json:"audience"` + }{ + Audience: in.Audience, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsTriggerManagerDailySummaryOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerEngagementUsersInput is the input for ListManagerEngagementUsers — Get Developer Engagement. +type ListManagerEngagementUsersInput struct { + CampaignID *string `url:"campaignId,omitempty" json:"-"` + Cursor *string `url:"cursor,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Since *string `url:"since,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerEngagementUsers - Get Developer Engagement +// GET /manager/engagement/users +func (c *Client) ListManagerEngagementUsers(ctx context.Context, in ListManagerEngagementUsersInput) (*models.EndpointsGetEngagementUsersOutput, error) { + path := "/manager/engagement/users" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.CampaignID != nil { + query.Set("campaignId", string(*in.CampaignID)) + } + if in.Since != nil { + query.Set("since", string(*in.Since)) + } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetEngagementUsersOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerEscalationRecipientsInput is the input for ListManagerEscalationRecipients — Get Escalation Recipients. +type ListManagerEscalationRecipientsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerEscalationRecipients - Get Escalation Recipients +// GET /manager/escalation-recipients +func (c *Client) ListManagerEscalationRecipients(ctx context.Context, in ListManagerEscalationRecipientsInput) (*models.EndpointsGetEscalationRecipientsOutput, error) { + path := "/manager/escalation-recipients" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetEscalationRecipientsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListManagerEscalationsConfigInput is the input for ListManagerEscalationsConfig — Get Escalation Config. +type ListManagerEscalationsConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListManagerEscalationsConfig - Get Escalation Config +// GET /manager/escalations/config +func (c *Client) ListManagerEscalationsConfig(ctx context.Context, in ListManagerEscalationsConfigInput) (*models.EndpointsGetManagerEscalationConfigOutput, error) { + path := "/manager/escalations/config" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetManagerEscalationConfigOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateManagerEscalationsConfigInput is the input for UpdateManagerEscalationsConfig — Put Escalation Config. +type UpdateManagerEscalationsConfigInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Escalation models.ModelsEscalationRouting `json:"escalation"` + models.RequestScope +} + +// UpdateManagerEscalationsConfig - Put Escalation Config +// PUT /manager/escalations/config +func (c *Client) UpdateManagerEscalationsConfig(ctx context.Context, in UpdateManagerEscalationsConfigInput) (*models.EndpointsPutManagerEscalationConfigOutput, error) { + path := "/manager/escalations/config" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -504,87 +2192,36 @@ func (c *Client) PatchManagerCampaignsCampaignId(ctx context.Context, in PatchMa } bodyBytes, err := json.Marshal(struct { - CreatedAfter *string `json:"createdAfter,omitempty"` - CreatedBefore *string `json:"createdBefore,omitempty"` - Description *string `json:"description,omitempty"` - EndDate *string `json:"endDate,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - GeneratedReasoning *string `json:"generatedReasoning,omitempty"` - IsActive *bool `json:"isActive,omitempty"` - LimitPerType *int `json:"limitPerType,omitempty"` - MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` - MinPriority *float64 `json:"minPriority,omitempty"` - NoEndDate *bool `json:"noEndDate,omitempty"` - Owner *string `json:"owner,omitempty"` - PriorityLabels []string `json:"priorityLabels,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` - SortByColumns *string `json:"sortByColumns,omitempty"` - SortByDirection *string `json:"sortByDirection,omitempty"` - StartDate *string `json:"startDate,omitempty"` - Summary *string `json:"summary,omitempty"` - TeamIDs []string `json:"teamIDs,omitempty"` - TeamNames []string `json:"teamNames,omitempty"` - Title *string `json:"title,omitempty"` - Types []string `json:"types,omitempty"` - UserNames []string `json:"userNames,omitempty"` - VulnerabilityCVEIds []string `json:"vulnerabilityCVEIds,omitempty"` - VulnerabilityCWEIds []string `json:"vulnerabilityCWEIds,omitempty"` + Escalation models.ModelsEscalationRouting `json:"escalation"` }{ - CreatedAfter: in.CreatedAfter, - CreatedBefore: in.CreatedBefore, - Description: in.Description, - EndDate: in.EndDate, - FindingIds: in.FindingIds, - GeneratedReasoning: in.GeneratedReasoning, - IsActive: in.IsActive, - LimitPerType: in.LimitPerType, - MaxStoryPoints: in.MaxStoryPoints, - MinPriority: in.MinPriority, - NoEndDate: in.NoEndDate, - Owner: in.Owner, - PriorityLabels: in.PriorityLabels, - RepositoryNames: in.RepositoryNames, - SortByColumns: in.SortByColumns, - SortByDirection: in.SortByDirection, - StartDate: in.StartDate, - Summary: in.Summary, - TeamIDs: in.TeamIDs, - TeamNames: in.TeamNames, - Title: in.Title, - Types: in.Types, - UserNames: in.UserNames, - VulnerabilityCVEIds: in.VulnerabilityCVEIds, - VulnerabilityCWEIds: in.VulnerabilityCWEIds, + Escalation: in.Escalation, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchCampaignOutput + var out models.EndpointsPutManagerEscalationConfigOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsCampaignIdEventsInput is the input for ListManagerCampaignsCampaignIdEvents — Get Campaign Events. -type ListManagerCampaignsCampaignIdEventsInput struct { - CampaignID string `path:"campaignId" json:"-"` - ActionTypes []string `url:"actionTypes,omitempty" json:"-"` +// ListManagerEventsInput is the input for ListManagerEvents — Get Events. +type ListManagerEventsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Page *int `url:"page,omitempty" json:"-"` PageSize *int `url:"pageSize,omitempty" json:"-"` - Statuses []string `url:"statuses,omitempty" json:"-"` models.RequestScope } -// ListManagerCampaignsCampaignIdEvents - Get Campaign Events -// GET /manager/campaigns/{campaignId}/events -func (c *Client) ListManagerCampaignsCampaignIdEvents(ctx context.Context, in ListManagerCampaignsCampaignIdEventsInput) (*models.EndpointsGetCampaignEventsOutput, error) { - path := "/manager/campaigns/{campaignId}/events" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) +// ListManagerEvents - Get Events +// GET /manager/events +func (c *Client) ListManagerEvents(ctx context.Context, in ListManagerEventsInput) (*models.EndpointsGetEventsOutput, error) { + path := "/manager/events" query := url.Values{} for k, v := range c.DefaultParams { @@ -596,11 +2233,8 @@ func (c *Client) ListManagerCampaignsCampaignIdEvents(ctx context.Context, in Li if in.PageSize != nil { query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) } - for _, v := range in.ActionTypes { - query.Add("actionTypes", string(v)) - } - for _, v := range in.Statuses { - query.Add("statuses", string(v)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -613,29 +2247,37 @@ func (c *Client) ListManagerCampaignsCampaignIdEvents(ctx context.Context, in Li if err != nil { return nil, err } - var out models.EndpointsGetCampaignEventsOutput + var out models.EndpointsGetEventsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsCampaignIdFindingsInput is the input for ListManagerCampaignsCampaignIdFindings — Get (Triaged) Findings Associated with a campaign. -type ListManagerCampaignsCampaignIdFindingsInput struct { - CampaignID string `path:"campaignId" json:"-"` +// CreateManagerEventsDeduplicateInput is the input for CreateManagerEventsDeduplicate — Deduplicate Events. +type CreateManagerEventsDeduplicateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + DryRun *bool `json:"dryRun,omitempty"` + From *string `json:"from,omitempty"` + Keep *string `json:"keep,omitempty"` + Statuses []string `json:"statuses,omitempty"` + TimeoutSeconds *int `json:"timeoutSeconds,omitempty"` + To *string `json:"to,omitempty"` models.RequestScope } -// ListManagerCampaignsCampaignIdFindings - Get (Triaged) Findings Associated with a campaign -// GET /manager/campaigns/{campaignId}/findings -func (c *Client) ListManagerCampaignsCampaignIdFindings(ctx context.Context, in ListManagerCampaignsCampaignIdFindingsInput) (*models.EndpointsGetCampaignFindingsOutput, error) { - path := "/manager/campaigns/{campaignId}/findings" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) +// CreateManagerEventsDeduplicate - Deduplicate Events +// POST /manager/events/deduplicate +func (c *Client) CreateManagerEventsDeduplicate(ctx context.Context, in CreateManagerEventsDeduplicateInput) (*models.EndpointsPostDeduplicateEventsOutput, error) { + path := "/manager/events/deduplicate" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -643,33 +2285,55 @@ func (c *Client) ListManagerCampaignsCampaignIdFindings(ctx context.Context, in fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + DryRun *bool `json:"dryRun,omitempty"` + From *string `json:"from,omitempty"` + Keep *string `json:"keep,omitempty"` + Statuses []string `json:"statuses,omitempty"` + TimeoutSeconds *int `json:"timeoutSeconds,omitempty"` + To *string `json:"to,omitempty"` + }{ + DryRun: in.DryRun, + From: in.From, + Keep: in.Keep, + Statuses: in.Statuses, + TimeoutSeconds: in.TimeoutSeconds, + To: in.To, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetCampaignFindingsOutput + var out models.EndpointsPostDeduplicateEventsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsCampaignIdPreviewInput is the input for ListManagerCampaignsCampaignIdPreview — Get Campaign Preview Details. -type ListManagerCampaignsCampaignIdPreviewInput struct { - CampaignID string `path:"campaignId" json:"-"` +// DeleteManagerEventsEventIdInput is the input for DeleteManagerEventsEventId — Delete Event. +type DeleteManagerEventsEventIdInput struct { + EventID string `path:"eventId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerCampaignsCampaignIdPreview - Get Campaign Preview Details -// GET /manager/campaigns/{campaignId}/preview -func (c *Client) ListManagerCampaignsCampaignIdPreview(ctx context.Context, in ListManagerCampaignsCampaignIdPreviewInput) (*models.EndpointsGetCampaignPreviewOutput, error) { - path := "/manager/campaigns/{campaignId}/preview" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) +// DeleteManagerEventsEventId - Delete Event +// DELETE /manager/events/{eventId} +func (c *Client) DeleteManagerEventsEventId(ctx context.Context, in DeleteManagerEventsEventIdInput) (*models.EndpointsDeleteEventOutput, error) { + path := "/manager/events/{eventId}" + path = strings.Replace(path, "{eventId}", url.PathEscape(in.EventID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -677,41 +2341,56 @@ func (c *Client) ListManagerCampaignsCampaignIdPreview(ctx context.Context, in L fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetCampaignPreviewOutput + var out models.EndpointsDeleteEventOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCampaignsCampaignIdRunsInput is the input for ListManagerCampaignsCampaignIdRuns — List Campaign Runs. -type ListManagerCampaignsCampaignIdRunsInput struct { - CampaignID string `path:"campaignId" json:"-"` +// ListManagerFindingsFindingIdEventsInput is the input for ListManagerFindingsFindingIdEvents — Get Finding Events. +type ListManagerFindingsFindingIdEventsInput struct { + FindingID string `path:"findingId" json:"-"` + ActionTypes []string `url:"actionTypes,omitempty" json:"-"` Cursor *string `url:"cursor,omitempty" json:"-"` - Limit *int32 `url:"limit,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Statuses []string `url:"statuses,omitempty" json:"-"` models.RequestScope } -// ListManagerCampaignsCampaignIdRuns - List Campaign Runs -// GET /manager/campaigns/{campaignId}/runs -func (c *Client) ListManagerCampaignsCampaignIdRuns(ctx context.Context, in ListManagerCampaignsCampaignIdRunsInput) (*models.EndpointsGetCampaignRunsOutput, error) { - path := "/manager/campaigns/{campaignId}/runs" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) +// SetFindingID sets the finding that the request targets. +func (in *ListManagerFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + +// ListManagerFindingsFindingIdEvents - Get Finding Events +// GET /manager/findings/{findingId}/events +func (c *Client) ListManagerFindingsFindingIdEvents(ctx context.Context, in ListManagerFindingsFindingIdEventsInput) (*models.EndpointsGetFindingEventsOutput, error) { + path := "/manager/findings/{findingId}/events" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Cursor != nil { - query.Set("cursor", string(*in.Cursor)) + for _, v := range in.ActionTypes { + query.Add("actionTypes", string(v)) + } + for _, v := range in.Statuses { + query.Add("statuses", string(v)) } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.Cursor != nil { + query.Set("cursor", string(*in.Cursor)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -723,31 +2402,33 @@ func (c *Client) ListManagerCampaignsCampaignIdRuns(ctx context.Context, in List if err != nil { return nil, err } - var out models.EndpointsGetCampaignRunsOutput + var out models.EndpointsGetFindingEventsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetManagerCampaignsCampaignIdRunsRunIdInput is the input for GetManagerCampaignsCampaignIdRunsRunId — Get Campaign Run. -type GetManagerCampaignsCampaignIdRunsRunIdInput struct { - CampaignID string `path:"campaignId" json:"-"` - RunID string `path:"runId" json:"-"` +// ListManagerFixPrsRecordIdNudgeInput is the input for ListManagerFixPrsRecordIdNudge — Preview Fix PR Nudge. +type ListManagerFixPrsRecordIdNudgeInput struct { + RecordID string `path:"recordId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetManagerCampaignsCampaignIdRunsRunId - Get Campaign Run -// GET /manager/campaigns/{campaignId}/runs/{runId} -func (c *Client) GetManagerCampaignsCampaignIdRunsRunId(ctx context.Context, in GetManagerCampaignsCampaignIdRunsRunIdInput) (*models.EndpointsGetCampaignRunOutput, error) { - path := "/manager/campaigns/{campaignId}/runs/{runId}" - path = strings.Replace(path, "{campaignId}", url.PathEscape(in.CampaignID), 1) - path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) +// ListManagerFixPrsRecordIdNudge - Preview Fix PR Nudge +// GET /manager/fix-prs/{recordId}/nudge +func (c *Client) ListManagerFixPrsRecordIdNudge(ctx context.Context, in ListManagerFixPrsRecordIdNudgeInput) (*models.EndpointsGetFixPRNudgeOutput, error) { + path := "/manager/fix-prs/{recordId}/nudge" + path = strings.Replace(path, "{recordId}", url.PathEscape(in.RecordID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -759,34 +2440,33 @@ func (c *Client) GetManagerCampaignsCampaignIdRunsRunId(ctx context.Context, in if err != nil { return nil, err } - var out models.EndpointsGetCampaignRunOutput + var out models.EndpointsGetFixPRNudgeOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerChatSessionsInput is the input for ListManagerChatSessions — List Chat Sessions. -type ListManagerChatSessionsInput struct { - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` +// CreateManagerFixPrsRecordIdNudgeInput is the input for CreateManagerFixPrsRecordIdNudge — Nudge Fix PR Reviewers. +type CreateManagerFixPrsRecordIdNudgeInput struct { + RecordID string `path:"recordId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + RecipientUserIds []string `json:"recipientUserIds,omitempty"` models.RequestScope } -// ListManagerChatSessions - List Chat Sessions -// GET /manager/chat/sessions -func (c *Client) ListManagerChatSessions(ctx context.Context, in ListManagerChatSessionsInput) (*models.EndpointsListChatSessionsOutput, error) { - path := "/manager/chat/sessions" +// CreateManagerFixPrsRecordIdNudge - Nudge Fix PR Reviewers +// POST /manager/fix-prs/{recordId}/nudge +func (c *Client) CreateManagerFixPrsRecordIdNudge(ctx context.Context, in CreateManagerFixPrsRecordIdNudgeInput) (*models.EndpointsNudgeFixPROutput, error) { + path := "/manager/fix-prs/{recordId}/nudge" + path = strings.Replace(path, "{recordId}", url.PathEscape(in.RecordID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -795,33 +2475,43 @@ func (c *Client) ListManagerChatSessions(ctx context.Context, in ListManagerChat fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + RecipientUserIds []string `json:"recipientUserIds,omitempty"` + }{ + RecipientUserIds: in.RecipientUserIds, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsListChatSessionsOutput + var out models.EndpointsNudgeFixPROutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteManagerChatSessionsChatIDInput is the input for DeleteManagerChatSessionsChatID — Delete Chat Session. -type DeleteManagerChatSessionsChatIDInput struct { - ChatID string `path:"chatID" json:"-"` +// ListManagerGroundrulesInput is the input for ListManagerGroundrules — Get Manager ground rules. +type ListManagerGroundrulesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteManagerChatSessionsChatID - Delete Chat Session -// DELETE /manager/chat/sessions/{chatID} -func (c *Client) DeleteManagerChatSessionsChatID(ctx context.Context, in DeleteManagerChatSessionsChatIDInput) (*models.EndpointsDeleteChatSessionOutput, error) { - path := "/manager/chat/sessions/{chatID}" - path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) +// ListManagerGroundrules - Get Manager ground rules +// GET /manager/groundrules +func (c *Client) ListManagerGroundrules(ctx context.Context, in ListManagerGroundrulesInput) (*models.EndpointsGetManagerGroundRulesOutput, error) { + path := "/manager/groundrules" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -829,33 +2519,36 @@ func (c *Client) DeleteManagerChatSessionsChatID(ctx context.Context, in DeleteM fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteChatSessionOutput + var out models.EndpointsGetManagerGroundRulesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetManagerChatSessionsChatIDInput is the input for GetManagerChatSessionsChatID — Get Chat Session. -type GetManagerChatSessionsChatIDInput struct { - ChatID string `path:"chatID" json:"-"` +// PatchManagerGroundrulesInput is the input for PatchManagerGroundrules — Patch a GroundRules object. +type PatchManagerGroundrulesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` models.RequestScope } -// GetManagerChatSessionsChatID - Get Chat Session -// GET /manager/chat/sessions/{chatID} -func (c *Client) GetManagerChatSessionsChatID(ctx context.Context, in GetManagerChatSessionsChatIDInput) (*models.EndpointsGetChatSessionOutput, error) { - path := "/manager/chat/sessions/{chatID}" - path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) +// PatchManagerGroundrules - Patch a GroundRules object +// PATCH /manager/groundrules +func (c *Client) PatchManagerGroundrules(ctx context.Context, in PatchManagerGroundrulesInput) (*models.EndpointsPatchGroundRulesOutput, error) { + path := "/manager/groundrules" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -863,34 +2556,45 @@ func (c *Client) GetManagerChatSessionsChatID(ctx context.Context, in GetManager fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` + }{ + GroundRules: in.GroundRules, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetChatSessionOutput + var out models.EndpointsPatchGroundRulesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchManagerChatSessionsChatIDInput is the input for PatchManagerChatSessionsChatID — Patch Chat Session. -type PatchManagerChatSessionsChatIDInput struct { - ChatID string `path:"chatID" json:"-"` - Title *string `json:"title,omitempty"` +// CreateManagerGroundrulesInput is the input for CreateManagerGroundrules — Post a GroundRules object. +type CreateManagerGroundrulesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` models.RequestScope } -// PatchManagerChatSessionsChatID - Patch Chat Session -// PATCH /manager/chat/sessions/{chatID} -func (c *Client) PatchManagerChatSessionsChatID(ctx context.Context, in PatchManagerChatSessionsChatIDInput) (*models.EndpointsPatchChatSessionOutput, error) { - path := "/manager/chat/sessions/{chatID}" - path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) +// CreateManagerGroundrules - Post a GroundRules object +// POST /manager/groundrules +func (c *Client) CreateManagerGroundrules(ctx context.Context, in CreateManagerGroundrulesInput) (*models.EndpointsPostManagerGroundRulesOutput, error) { + path := "/manager/groundrules" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -899,40 +2603,48 @@ func (c *Client) PatchManagerChatSessionsChatID(ctx context.Context, in PatchMan } bodyBytes, err := json.Marshal(struct { - Title *string `json:"title,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` }{ - Title: in.Title, + ExpectedUpdatedAt: in.ExpectedUpdatedAt, + GroundRules: in.GroundRules, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchChatSessionOutput + var out models.EndpointsPostManagerGroundRulesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerChatSessionsChatIDActionsInput is the input for ListManagerChatSessionsChatIDActions — Get Chat Session Actions. -type ListManagerChatSessionsChatIDActionsInput struct { - ChatID string `path:"chatID" json:"-"` +// ListManagerIdentityClassificationsInput is the input for ListManagerIdentityClassifications — List Git Identity Classifications. +type ListManagerIdentityClassificationsInput struct { + Decision *string `url:"decision,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerChatSessionsChatIDActions - Get Chat Session Actions -// GET /manager/chat/sessions/{chatID}/actions -func (c *Client) ListManagerChatSessionsChatIDActions(ctx context.Context, in ListManagerChatSessionsChatIDActionsInput) (*models.EndpointsGetChatSessionActionsOutput, error) { - path := "/manager/chat/sessions/{chatID}/actions" - path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) +// ListManagerIdentityClassifications - List Git Identity Classifications +// GET /manager/identity-classifications +func (c *Client) ListManagerIdentityClassifications(ctx context.Context, in ListManagerIdentityClassificationsInput) (*models.EndpointsListIdentityClassificationsOutput, error) { + path := "/manager/identity-classifications" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Decision != nil { + query.Set("decision", string(*in.Decision)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -944,36 +2656,34 @@ func (c *Client) ListManagerChatSessionsChatIDActions(ctx context.Context, in Li if err != nil { return nil, err } - var out models.EndpointsGetChatSessionActionsOutput + var out models.EndpointsListIdentityClassificationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerChatSessionsChatIDAuditInput is the input for ListManagerChatSessionsChatIDAudit — Get chat session audit trail. -type ListManagerChatSessionsChatIDAuditInput struct { - ChatID string `path:"chatID" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - NextToken *string `url:"nextToken,omitempty" json:"-"` +// CreateManagerIdentityClassificationsInput is the input for CreateManagerIdentityClassifications — Classify Git Identity. +type CreateManagerIdentityClassificationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Decision string `json:"decision"` + Provider models.ModelsProviderID `json:"provider"` + ProviderUserID string `json:"providerUserId"` + Reason *string `json:"reason,omitempty"` models.RequestScope } -// ListManagerChatSessionsChatIDAudit - Get chat session audit trail -// GET /manager/chat/sessions/{chatID}/audit -func (c *Client) ListManagerChatSessionsChatIDAudit(ctx context.Context, in ListManagerChatSessionsChatIDAuditInput) (*models.EndpointsGetChatSessionAuditOutput, error) { - path := "/manager/chat/sessions/{chatID}/audit" - path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) +// CreateManagerIdentityClassifications - Classify Git Identity +// POST /manager/identity-classifications +func (c *Client) CreateManagerIdentityClassifications(ctx context.Context, in CreateManagerIdentityClassificationsInput) (*models.EndpointsClassifyIdentityOutput, error) { + path := "/manager/identity-classifications" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.NextToken != nil { - query.Set("nextToken", string(*in.NextToken)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -982,40 +2692,56 @@ func (c *Client) ListManagerChatSessionsChatIDAudit(ctx context.Context, in List fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Decision string `json:"decision"` + Provider models.ModelsProviderID `json:"provider"` + ProviderUserID string `json:"providerUserId"` + Reason *string `json:"reason,omitempty"` + }{ + Decision: in.Decision, + Provider: in.Provider, + ProviderUserID: in.ProviderUserID, + Reason: in.Reason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetChatSessionAuditOutput + var out models.EndpointsClassifyIdentityOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerChatSessionsChatIDHistoryInput is the input for ListManagerChatSessionsChatIDHistory — Get Chat Session History. -type ListManagerChatSessionsChatIDHistoryInput struct { - ChatID string `path:"chatID" json:"-"` - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// DeleteManagerIdentityClassificationsProviderProviderUserIdInput is the input for DeleteManagerIdentityClassificationsProviderProviderUserId — Revoke Git Identity Classification. +type DeleteManagerIdentityClassificationsProviderProviderUserIdInput struct { + Provider string `path:"provider" json:"-"` + ProviderUserID string `path:"providerUserId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Reason *string `url:"reason,omitempty" json:"-"` models.RequestScope } -// ListManagerChatSessionsChatIDHistory - Get Chat Session History -// GET /manager/chat/sessions/{chatID}/history -func (c *Client) ListManagerChatSessionsChatIDHistory(ctx context.Context, in ListManagerChatSessionsChatIDHistoryInput) (*models.EndpointsGetChatSessionHistoryOutput, error) { - path := "/manager/chat/sessions/{chatID}/history" - path = strings.Replace(path, "{chatID}", url.PathEscape(in.ChatID), 1) +// DeleteManagerIdentityClassificationsProviderProviderUserId - Revoke Git Identity Classification +// DELETE /manager/identity-classifications/{provider}/{providerUserId} +func (c *Client) DeleteManagerIdentityClassificationsProviderProviderUserId(ctx context.Context, in DeleteManagerIdentityClassificationsProviderProviderUserIdInput) (*models.EndpointsRevokeIdentityClassificationOutput, error) { + path := "/manager/identity-classifications/{provider}/{providerUserId}" + path = strings.Replace(path, "{provider}", url.PathEscape(in.Provider), 1) + path = strings.Replace(path, "{providerUserId}", url.PathEscape(in.ProviderUserID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.Reason != nil { + query.Set("reason", string(*in.Reason)) } in.RequestScope.AddTo(query) @@ -1024,31 +2750,39 @@ func (c *Client) ListManagerChatSessionsChatIDHistory(ctx context.Context, in Li fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "DELETE", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetChatSessionHistoryOutput + var out models.EndpointsRevokeIdentityClassificationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerConfigInput is the input for ListManagerConfig — Get Manager config. -type ListManagerConfigInput struct { +// ListManagerMetricsInput is the input for ListManagerMetrics — Get Metrics. +type ListManagerMetricsInput struct { + AsOf *string `url:"asOf,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerConfig - Get Manager config -// GET /manager/config -func (c *Client) ListManagerConfig(ctx context.Context, in ListManagerConfigInput) (*models.EndpointsGetManagerConfigOutput, error) { - path := "/manager/config" +// ListManagerMetrics - Get Metrics +// GET /manager/metrics +func (c *Client) ListManagerMetrics(ctx context.Context, in ListManagerMetricsInput) (*models.EndpointsGetManagerMetricsOutput, error) { + path := "/manager/metrics" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.AsOf != nil { + query.Set("asOf", string(*in.AsOf)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1060,28 +2794,33 @@ func (c *Client) ListManagerConfig(ctx context.Context, in ListManagerConfigInpu if err != nil { return nil, err } - var out models.EndpointsGetManagerConfigOutput + var out models.EndpointsGetManagerMetricsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerConfigInput is the input for CreateManagerConfig — Update Manager config. -type CreateManagerConfigInput struct { - Config models.EndpointsManagerConfigInput `json:"config"` +// CreateManagerOnboardingWizardProgressInput is the input for CreateManagerOnboardingWizardProgress — Onboarding Wizard Progress. +type CreateManagerOnboardingWizardProgressInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Detail *string `json:"detail,omitempty"` + Step models.ModelsOnboardingWizardStep `json:"step"` models.RequestScope } -// CreateManagerConfig - Update Manager config -// POST /manager/config -func (c *Client) CreateManagerConfig(ctx context.Context, in CreateManagerConfigInput) (*models.EndpointsPostManagerConfigOutput, error) { - path := "/manager/config" +// CreateManagerOnboardingWizardProgress - Onboarding Wizard Progress +// POST /manager/onboarding/wizard-progress +func (c *Client) CreateManagerOnboardingWizardProgress(ctx context.Context, in CreateManagerOnboardingWizardProgressInput) (*models.EndpointsWizardProgressOutput, error) { + path := "/manager/onboarding/wizard-progress" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1090,9 +2829,11 @@ func (c *Client) CreateManagerConfig(ctx context.Context, in CreateManagerConfig } bodyBytes, err := json.Marshal(struct { - Config models.EndpointsManagerConfigInput `json:"config"` + Detail *string `json:"detail,omitempty"` + Step models.ModelsOnboardingWizardStep `json:"step"` }{ - Config: in.Config, + Detail: in.Detail, + Step: in.Step, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -1101,27 +2842,43 @@ func (c *Client) CreateManagerConfig(ctx context.Context, in CreateManagerConfig if err != nil { return nil, err } - var out models.EndpointsPostManagerConfigOutput + var out models.EndpointsWizardProgressOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCreditsInput is the input for ListManagerCredits — Get Manager credit balance. -type ListManagerCreditsInput struct { +// ListManagerPlansInput is the input for ListManagerPlans — Get Plans. +type ListManagerPlansInput struct { + CampaignID *string `url:"campaignId,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` models.RequestScope } -// ListManagerCredits - Get Manager credit balance -// GET /manager/credits -func (c *Client) ListManagerCredits(ctx context.Context, in ListManagerCreditsInput) (*models.EndpointsGetCreditsOutput, error) { - path := "/manager/credits" +// ListManagerPlans - Get Plans +// GET /manager/plans +func (c *Client) ListManagerPlans(ctx context.Context, in ListManagerPlansInput) (*models.EndpointsGetPlansOutput, error) { + path := "/manager/plans" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.CampaignID != nil { + query.Set("campaignId", string(*in.CampaignID)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1133,28 +2890,31 @@ func (c *Client) ListManagerCredits(ctx context.Context, in ListManagerCreditsIn if err != nil { return nil, err } - var out models.EndpointsGetCreditsOutput + var out models.EndpointsGetPlansOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerCreditsInput is the input for CreateManagerCredits — Update Manager credit balance. -type CreateManagerCreditsInput struct { - Credits models.ModelsCreditsUpdate `json:"credits"` +// ListManagerProgramInput is the input for ListManagerProgram — Get Security Program. +type ListManagerProgramInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateManagerCredits - Update Manager credit balance -// POST /manager/credits -func (c *Client) CreateManagerCredits(ctx context.Context, in CreateManagerCreditsInput) (*models.EndpointsPostCreditsOutput, error) { - path := "/manager/credits" +// ListManagerProgram - Get Security Program +// GET /manager/program +func (c *Client) ListManagerProgram(ctx context.Context, in ListManagerProgramInput) (*models.EndpointsGetSecurityProgramOutput, error) { + path := "/manager/program" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1162,39 +2922,42 @@ func (c *Client) CreateManagerCredits(ctx context.Context, in CreateManagerCredi fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Credits models.ModelsCreditsUpdate `json:"credits"` - }{ - Credits: in.Credits, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostCreditsOutput + var out models.EndpointsGetSecurityProgramOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteManagerCustomerQuestionsInput is the input for DeleteManagerCustomerQuestions — Delete All Customer Question Sets. -type DeleteManagerCustomerQuestionsInput struct { +// PatchManagerProgramInput is the input for PatchManagerProgram — State Security Program. +type PatchManagerProgramInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AnnounceWindowDays int `json:"announceWindowDays"` + Autonomy string `json:"autonomy"` + CapacityPerWeek *int `json:"capacityPerWeek,omitempty"` + DefaultCampaignDays int `json:"defaultCampaignDays"` + MaxConcurrentCampaigns int `json:"maxConcurrentCampaigns"` + MinCoveragePerGoal int `json:"minCoveragePerGoal"` + ReviewCadenceDays int `json:"reviewCadenceDays"` models.RequestScope } -// DeleteManagerCustomerQuestions - Delete All Customer Question Sets -// DELETE /manager/customer-questions -func (c *Client) DeleteManagerCustomerQuestions(ctx context.Context, in DeleteManagerCustomerQuestionsInput) (*models.EndpointsDeleteAllCustomerQuestionSetsOutput, error) { - path := "/manager/customer-questions" +// PatchManagerProgram - State Security Program +// PATCH /manager/program +func (c *Client) PatchManagerProgram(ctx context.Context, in PatchManagerProgramInput) (*models.EndpointsPatchSecurityProgramOutput, error) { + path := "/manager/program" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1202,38 +2965,54 @@ func (c *Client) DeleteManagerCustomerQuestions(ctx context.Context, in DeleteMa fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + AnnounceWindowDays int `json:"announceWindowDays"` + Autonomy string `json:"autonomy"` + CapacityPerWeek *int `json:"capacityPerWeek,omitempty"` + DefaultCampaignDays int `json:"defaultCampaignDays"` + MaxConcurrentCampaigns int `json:"maxConcurrentCampaigns"` + MinCoveragePerGoal int `json:"minCoveragePerGoal"` + ReviewCadenceDays int `json:"reviewCadenceDays"` + }{ + AnnounceWindowDays: in.AnnounceWindowDays, + Autonomy: in.Autonomy, + CapacityPerWeek: in.CapacityPerWeek, + DefaultCampaignDays: in.DefaultCampaignDays, + MaxConcurrentCampaigns: in.MaxConcurrentCampaigns, + MinCoveragePerGoal: in.MinCoveragePerGoal, + ReviewCadenceDays: in.ReviewCadenceDays, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsDeleteAllCustomerQuestionSetsOutput + var out models.EndpointsPatchSecurityProgramOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerCustomerQuestionsInput is the input for ListManagerCustomerQuestions — List Customer Question Sets. -type ListManagerCustomerQuestionsInput struct { - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// ListManagerProposalsInput is the input for ListManagerProposals — List Open Proposals. +type ListManagerProposalsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerCustomerQuestions - List Customer Question Sets -// GET /manager/customer-questions -func (c *Client) ListManagerCustomerQuestions(ctx context.Context, in ListManagerCustomerQuestionsInput) (*models.EndpointsGetCustomerQuestionSetsOutput, error) { - path := "/manager/customer-questions" +// ListManagerProposals - List Open Proposals +// GET /manager/proposals +func (c *Client) ListManagerProposals(ctx context.Context, in ListManagerProposalsInput) (*models.EndpointsGetProposalsOutput, error) { + path := "/manager/proposals" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1246,29 +3025,33 @@ func (c *Client) ListManagerCustomerQuestions(ctx context.Context, in ListManage if err != nil { return nil, err } - var out models.EndpointsGetCustomerQuestionSetsOutput + var out models.EndpointsGetProposalsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteManagerCustomerQuestionsQuestionSetIdInput is the input for DeleteManagerCustomerQuestionsQuestionSetId — Delete Customer Question Set. -type DeleteManagerCustomerQuestionsQuestionSetIdInput struct { - QuestionSetID string `path:"questionSetId" json:"-"` +// CreateManagerProposalsDecisionInput is the input for CreateManagerProposalsDecision — Decide Proposed Campaign. +type CreateManagerProposalsDecisionInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Decision string `json:"decision"` + ProposalID string `json:"proposalId"` models.RequestScope } -// DeleteManagerCustomerQuestionsQuestionSetId - Delete Customer Question Set -// DELETE /manager/customer-questions/{questionSetId} -func (c *Client) DeleteManagerCustomerQuestionsQuestionSetId(ctx context.Context, in DeleteManagerCustomerQuestionsQuestionSetIdInput) (*models.EndpointsDeleteCustomerQuestionSetOutput, error) { - path := "/manager/customer-questions/{questionSetId}" - path = strings.Replace(path, "{questionSetId}", url.PathEscape(in.QuestionSetID), 1) +// CreateManagerProposalsDecision - Decide Proposed Campaign +// POST /manager/proposals/decision +func (c *Client) CreateManagerProposalsDecision(ctx context.Context, in CreateManagerProposalsDecisionInput) (*models.EndpointsPostProposalDecisionOutput, error) { + path := "/manager/proposals/decision" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1276,33 +3059,47 @@ func (c *Client) DeleteManagerCustomerQuestionsQuestionSetId(ctx context.Context fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Decision string `json:"decision"` + ProposalID string `json:"proposalId"` + }{ + Decision: in.Decision, + ProposalID: in.ProposalID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsDeleteCustomerQuestionSetOutput + var out models.EndpointsPostProposalDecisionOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// GetManagerCustomerQuestionsQuestionSetIdInput is the input for GetManagerCustomerQuestionsQuestionSetId — Get Customer Question Set. -type GetManagerCustomerQuestionsQuestionSetIdInput struct { - QuestionSetID string `path:"questionSetId" json:"-"` +// GetManagerRunsRunIdInput is the input for GetManagerRunsRunId — Get Manager Run. +type GetManagerRunsRunIdInput struct { + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// GetManagerCustomerQuestionsQuestionSetId - Get Customer Question Set -// GET /manager/customer-questions/{questionSetId} -func (c *Client) GetManagerCustomerQuestionsQuestionSetId(ctx context.Context, in GetManagerCustomerQuestionsQuestionSetIdInput) (*models.EndpointsGetCustomerQuestionSetOutput, error) { - path := "/manager/customer-questions/{questionSetId}" - path = strings.Replace(path, "{questionSetId}", url.PathEscape(in.QuestionSetID), 1) +// GetManagerRunsRunId - Get Manager Run +// GET /manager/runs/{runId} +func (c *Client) GetManagerRunsRunId(ctx context.Context, in GetManagerRunsRunIdInput) (*models.EndpointsGetManagerRunOutput, error) { + path := "/manager/runs/{runId}" + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1314,32 +3111,31 @@ func (c *Client) GetManagerCustomerQuestionsQuestionSetId(ctx context.Context, i if err != nil { return nil, err } - var out models.EndpointsGetCustomerQuestionSetOutput + var out models.EndpointsGetManagerRunOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionIdInput is the input for PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionId — Submit Question Answer. -type PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionIdInput struct { - QuestionSetID string `path:"questionSetId" json:"-"` - QuestionID string `path:"questionId" json:"-"` - Answer json.RawMessage `json:"answer"` +// ListManagerStateInput is the input for ListManagerState — Get Manager State. +type ListManagerStateInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionId - Submit Question Answer -// PATCH /manager/customer-questions/{questionSetId}/answers/{questionId} -func (c *Client) PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionId(ctx context.Context, in PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionIdInput) (*models.EndpointsPatchCustomerQuestionAnswerOutput, error) { - path := "/manager/customer-questions/{questionSetId}/answers/{questionId}" - path = strings.Replace(path, "{questionSetId}", url.PathEscape(in.QuestionSetID), 1) - path = strings.Replace(path, "{questionId}", url.PathEscape(in.QuestionID), 1) +// ListManagerState - Get Manager State +// GET /manager/state +func (c *Client) ListManagerState(ctx context.Context, in ListManagerStateInput) (*models.EndpointsGetManagerStateOutput, error) { + path := "/manager/state" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1347,43 +3143,35 @@ func (c *Client) PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionId(ctx fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Answer json.RawMessage `json:"answer"` - }{ - Answer: in.Answer, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPatchCustomerQuestionAnswerOutput + var out models.EndpointsGetManagerStateOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionIdInput is the input for DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionId — Delete Customer Question. -type DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionIdInput struct { - QuestionSetID string `path:"questionSetId" json:"-"` - QuestionID string `path:"questionId" json:"-"` +// ListManagerStateLatestInput is the input for ListManagerStateLatest — Get Manager State (Legacy). +type ListManagerStateLatestInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionId - Delete Customer Question -// DELETE /manager/customer-questions/{questionSetId}/questions/{questionId} -func (c *Client) DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionId(ctx context.Context, in DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionIdInput) (*models.EndpointsDeleteCustomerQuestionOutput, error) { - path := "/manager/customer-questions/{questionSetId}/questions/{questionId}" - path = strings.Replace(path, "{questionSetId}", url.PathEscape(in.QuestionSetID), 1) - path = strings.Replace(path, "{questionId}", url.PathEscape(in.QuestionID), 1) +// ListManagerStateLatest - Get Manager State (Legacy) +// GET /manager/state/latest +func (c *Client) ListManagerStateLatest(ctx context.Context, in ListManagerStateLatestInput) (*models.EndpointsGetManagerStateOutput, error) { + path := "/manager/state/latest" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1391,28 +3179,29 @@ func (c *Client) DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionId( fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteCustomerQuestionOutput + var out models.EndpointsGetManagerStateOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerEscalationsInput is the input for ListManagerEscalations — Get Escalations. -type ListManagerEscalationsInput struct { +// ListManagerStatesInput is the input for ListManagerStates — Get Manager States. +type ListManagerStatesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Page *int `url:"page,omitempty" json:"-"` PageSize *int `url:"pageSize,omitempty" json:"-"` models.RequestScope } -// ListManagerEscalations - Get Escalations -// GET /manager/escalations -func (c *Client) ListManagerEscalations(ctx context.Context, in ListManagerEscalationsInput) (*models.EndpointsGetEscalationsOutput, error) { - path := "/manager/escalations" +// ListManagerStates - Get Manager States +// GET /manager/states +func (c *Client) ListManagerStates(ctx context.Context, in ListManagerStatesInput) (*models.EndpointsGetManagerStatesOutput, error) { + path := "/manager/states" query := url.Values{} for k, v := range c.DefaultParams { @@ -1424,6 +3213,9 @@ func (c *Client) ListManagerEscalations(ctx context.Context, in ListManagerEscal if in.PageSize != nil { query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1435,73 +3227,30 @@ func (c *Client) ListManagerEscalations(ctx context.Context, in ListManagerEscal if err != nil { return nil, err } - var out models.EndpointsGetEscalationsOutput + var out models.EndpointsGetManagerStatesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchManagerEscalationsEscalationIdInput is the input for PatchManagerEscalationsEscalationId — Patch Escalation. -type PatchManagerEscalationsEscalationIdInput struct { - EscalationID string `path:"escalationId" json:"-"` - Reasoning *string `json:"reasoning,omitempty"` - Status *models.ModelsEscalationStatus `json:"status,omitempty"` - models.RequestScope -} - -// PatchManagerEscalationsEscalationId - Patch Escalation -// PATCH /manager/escalations/{escalationId} -func (c *Client) PatchManagerEscalationsEscalationId(ctx context.Context, in PatchManagerEscalationsEscalationIdInput) ([]byte, error) { - path := "/manager/escalations/{escalationId}" - path = strings.Replace(path, "{escalationId}", url.PathEscape(in.EscalationID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - bodyBytes, err := json.Marshal(struct { - Reasoning *string `json:"reasoning,omitempty"` - Status *models.ModelsEscalationStatus `json:"status,omitempty"` - }{ - Reasoning: in.Reasoning, - Status: in.Status, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) - return data, err -} - -// ListManagerEventsInput is the input for ListManagerEvents — Get Events. -type ListManagerEventsInput struct { - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// ListManagerStrategyInput is the input for ListManagerStrategy — Get Active Strategy. +type ListManagerStrategyInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerEvents - Get Events -// GET /manager/events -func (c *Client) ListManagerEvents(ctx context.Context, in ListManagerEventsInput) (*models.EndpointsGetEventsOutput, error) { - path := "/manager/events" - +// ListManagerStrategy - Get Active Strategy +// GET /manager/strategy +func (c *Client) ListManagerStrategy(ctx context.Context, in ListManagerStrategyInput) (*models.EndpointsGetStrategyOutput, error) { + path := "/manager/strategy" + query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1514,33 +3263,32 @@ func (c *Client) ListManagerEvents(ctx context.Context, in ListManagerEventsInpu if err != nil { return nil, err } - var out models.EndpointsGetEventsOutput + var out models.EndpointsGetStrategyOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerEventsDeduplicateInput is the input for CreateManagerEventsDeduplicate — Deduplicate Events. -type CreateManagerEventsDeduplicateInput struct { - DryRun *bool `json:"dryRun,omitempty"` - From *string `json:"from,omitempty"` - Keep *string `json:"keep,omitempty"` - Statuses []string `json:"statuses,omitempty"` - TimeoutSeconds *int `json:"timeoutSeconds,omitempty"` - To *string `json:"to,omitempty"` +// PatchManagerStrategyInput is the input for PatchManagerStrategy — Patch Active Strategy. +type PatchManagerStrategyInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Quarters []models.ModelsStrategyQuarterGoal `json:"quarters,omitempty"` models.RequestScope } -// CreateManagerEventsDeduplicate - Deduplicate Events -// POST /manager/events/deduplicate -func (c *Client) CreateManagerEventsDeduplicate(ctx context.Context, in CreateManagerEventsDeduplicateInput) (*models.EndpointsPostDeduplicateEventsOutput, error) { - path := "/manager/events/deduplicate" +// PatchManagerStrategy - Patch Active Strategy +// PATCH /manager/strategy +func (c *Client) PatchManagerStrategy(ctx context.Context, in PatchManagerStrategyInput) (*models.EndpointsPatchStrategyOutput, error) { + path := "/manager/strategy" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1549,50 +3297,42 @@ func (c *Client) CreateManagerEventsDeduplicate(ctx context.Context, in CreateMa } bodyBytes, err := json.Marshal(struct { - DryRun *bool `json:"dryRun,omitempty"` - From *string `json:"from,omitempty"` - Keep *string `json:"keep,omitempty"` - Statuses []string `json:"statuses,omitempty"` - TimeoutSeconds *int `json:"timeoutSeconds,omitempty"` - To *string `json:"to,omitempty"` + Quarters []models.ModelsStrategyQuarterGoal `json:"quarters,omitempty"` }{ - DryRun: in.DryRun, - From: in.From, - Keep: in.Keep, - Statuses: in.Statuses, - TimeoutSeconds: in.TimeoutSeconds, - To: in.To, + Quarters: in.Quarters, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPostDeduplicateEventsOutput + var out models.EndpointsPatchStrategyOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// DeleteManagerEventsEventIdInput is the input for DeleteManagerEventsEventId — Delete Event. -type DeleteManagerEventsEventIdInput struct { - EventID string `path:"eventId" json:"-"` +// ListManagerStrategyProposalInput is the input for ListManagerStrategyProposal — Get Proposed Strategy. +type ListManagerStrategyProposalInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// DeleteManagerEventsEventId - Delete Event -// DELETE /manager/events/{eventId} -func (c *Client) DeleteManagerEventsEventId(ctx context.Context, in DeleteManagerEventsEventIdInput) (*models.EndpointsDeleteEventOutput, error) { - path := "/manager/events/{eventId}" - path = strings.Replace(path, "{eventId}", url.PathEscape(in.EventID), 1) +// ListManagerStrategyProposal - Get Proposed Strategy +// GET /manager/strategy/proposal +func (c *Client) ListManagerStrategyProposal(ctx context.Context, in ListManagerStrategyProposalInput) (*models.EndpointsGetStrategyProposalOutput, error) { + path := "/manager/strategy/proposal" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1600,48 +3340,36 @@ func (c *Client) DeleteManagerEventsEventId(ctx context.Context, in DeleteManage fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "DELETE", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsDeleteEventOutput + var out models.EndpointsGetStrategyProposalOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerFindingsFindingIdEventsInput is the input for ListManagerFindingsFindingIdEvents — Get Finding Events. -type ListManagerFindingsFindingIdEventsInput struct { - FindingID string `path:"findingId" json:"-"` - ActionTypes []string `url:"actionTypes,omitempty" json:"-"` - Cursor *string `url:"cursor,omitempty" json:"-"` - Limit *int `url:"limit,omitempty" json:"-"` - Statuses []string `url:"statuses,omitempty" json:"-"` +// CreateManagerStrategyProposalDecisionInput is the input for CreateManagerStrategyProposalDecision — Decide Proposed Strategy. +type CreateManagerStrategyProposalDecisionInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Decision string `json:"decision"` + StrategyID string `json:"strategyId"` models.RequestScope } -// ListManagerFindingsFindingIdEvents - Get Finding Events -// GET /manager/findings/{findingId}/events -func (c *Client) ListManagerFindingsFindingIdEvents(ctx context.Context, in ListManagerFindingsFindingIdEventsInput) (*models.EndpointsGetFindingEventsOutput, error) { - path := "/manager/findings/{findingId}/events" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// CreateManagerStrategyProposalDecision - Decide Proposed Strategy +// POST /manager/strategy/proposal/decision +func (c *Client) CreateManagerStrategyProposalDecision(ctx context.Context, in CreateManagerStrategyProposalDecisionInput) (*models.EndpointsPostStrategyProposalDecisionOutput, error) { + path := "/manager/strategy/proposal/decision" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - for _, v := range in.ActionTypes { - query.Add("actionTypes", string(v)) - } - for _, v := range in.Statuses { - query.Add("statuses", string(v)) - } - if in.Limit != nil { - query.Set("limit", strconv.Itoa(int(*in.Limit))) - } - if in.Cursor != nil { - query.Set("cursor", string(*in.Cursor)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1650,31 +3378,45 @@ func (c *Client) ListManagerFindingsFindingIdEvents(ctx context.Context, in List fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Decision string `json:"decision"` + StrategyID string `json:"strategyId"` + }{ + Decision: in.Decision, + StrategyID: in.StrategyID, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetFindingEventsOutput + var out models.EndpointsPostStrategyProposalDecisionOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerGroundrulesInput is the input for ListManagerGroundrules — Get Manager ground rules. -type ListManagerGroundrulesInput struct { +// CreateManagerStrategyTriggerInput is the input for CreateManagerStrategyTrigger — Trigger Strategy Generation. +type CreateManagerStrategyTriggerInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerGroundrules - Get Manager ground rules -// GET /manager/groundrules -func (c *Client) ListManagerGroundrules(ctx context.Context, in ListManagerGroundrulesInput) (*models.EndpointsGetManagerGroundRulesOutput, error) { - path := "/manager/groundrules" +// CreateManagerStrategyTrigger - Trigger Strategy Generation +// POST /manager/strategy/trigger +func (c *Client) CreateManagerStrategyTrigger(ctx context.Context, in CreateManagerStrategyTriggerInput) (*models.EndpointsTriggerStrategyOutput, error) { + path := "/manager/strategy/trigger" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1682,32 +3424,43 @@ func (c *Client) ListManagerGroundrules(ctx context.Context, in ListManagerGroun fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetManagerGroundRulesOutput + var out models.EndpointsTriggerStrategyOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchManagerGroundrulesInput is the input for PatchManagerGroundrules — Patch a GroundRules object to S3. -type PatchManagerGroundrulesInput struct { - GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` +// ListManagerStrategyVersionsInput is the input for ListManagerStrategyVersions — List Strategy Versions. +type ListManagerStrategyVersionsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` models.RequestScope } -// PatchManagerGroundrules - Patch a GroundRules object to S3 -// PATCH /manager/groundrules -func (c *Client) PatchManagerGroundrules(ctx context.Context, in PatchManagerGroundrulesInput) (*models.EndpointsPatchGroundRulesOutput, error) { - path := "/manager/groundrules" +// ListManagerStrategyVersions - List Strategy Versions +// GET /manager/strategy/versions +func (c *Client) ListManagerStrategyVersions(ctx context.Context, in ListManagerStrategyVersionsInput) (*models.EndpointsListStrategyVersionsOutput, error) { + path := "/manager/strategy/versions" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1715,40 +3468,35 @@ func (c *Client) PatchManagerGroundrules(ctx context.Context, in PatchManagerGro fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` - }{ - GroundRules: in.GroundRules, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPatchGroundRulesOutput + var out models.EndpointsListStrategyVersionsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerGroundrulesInput is the input for CreateManagerGroundrules — Post a GroundRules object to S3. -type CreateManagerGroundrulesInput struct { - GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` +// CreateManagerTacitKnowledgeTriggerInput is the input for CreateManagerTacitKnowledgeTrigger — Trigger TacitKnowledge. +type CreateManagerTacitKnowledgeTriggerInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateManagerGroundrules - Post a GroundRules object to S3 -// POST /manager/groundrules -func (c *Client) CreateManagerGroundrules(ctx context.Context, in CreateManagerGroundrulesInput) (*models.EndpointsPostManagerGroundRulesOutput, error) { - path := "/manager/groundrules" +// CreateManagerTacitKnowledgeTrigger - Trigger TacitKnowledge +// POST /manager/tacit-knowledge/trigger +func (c *Client) CreateManagerTacitKnowledgeTrigger(ctx context.Context, in CreateManagerTacitKnowledgeTriggerInput) (*models.EndpointsTriggerTacitKnowledgeOutput, error) { + path := "/manager/tacit-knowledge/trigger" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1756,39 +3504,75 @@ func (c *Client) CreateManagerGroundrules(ctx context.Context, in CreateManagerG fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - GroundRules *models.ModelsManagerGroundRules `json:"groundRules,omitempty"` - }{ - GroundRules: in.GroundRules, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostManagerGroundRulesOutput + var out models.EndpointsTriggerTacitKnowledgeOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerMetricsInput is the input for ListManagerMetrics — Get Metrics. -type ListManagerMetricsInput struct { +// ListManagerThreatInvestigationsInput is the input for ListManagerThreatInvestigations — Get Threat Investigations. +type ListManagerThreatInvestigationsInput struct { + AffectedOnly *bool `url:"affectedOnly,omitempty" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` + Search *string `url:"search,omitempty" json:"-"` + Severity *string `url:"severity,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` + Status *string `url:"status,omitempty" json:"-"` models.RequestScope } -// ListManagerMetrics - Get Metrics -// GET /manager/metrics -func (c *Client) ListManagerMetrics(ctx context.Context, in ListManagerMetricsInput) (*models.EndpointsGetManagerMetricsOutput, error) { - path := "/manager/metrics" +// ListManagerThreatInvestigations - Get Threat Investigations +// GET /manager/threat-investigations +func (c *Client) ListManagerThreatInvestigations(ctx context.Context, in ListManagerThreatInvestigationsInput) (*models.EndpointsGetThreatInvestigationsOutput, error) { + path := "/manager/threat-investigations" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Search != nil { + query.Set("search", string(*in.Search)) + } + if in.Severity != nil { + query.Set("severity", string(*in.Severity)) + } + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Status != nil { + query.Set("status", string(*in.Status)) + } + if in.AffectedOnly != nil { + query.Set("affectedOnly", strconv.FormatBool(*in.AffectedOnly)) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1800,38 +3584,40 @@ func (c *Client) ListManagerMetrics(ctx context.Context, in ListManagerMetricsIn if err != nil { return nil, err } - var out models.EndpointsGetManagerMetricsOutput + var out models.EndpointsGetThreatInvestigationsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerPlansInput is the input for ListManagerPlans — Get Plans. -type ListManagerPlansInput struct { - CampaignID *string `url:"campaignId,omitempty" json:"-"` - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// CreateManagerThreatInvestigationsInput is the input for CreateManagerThreatInvestigations — Post Threat Investigation. +type CreateManagerThreatInvestigationsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Advice *string `json:"advice,omitempty"` + AffectedPackages []models.ModelsThreatInvestigationAffectedPackage `json:"affectedPackages,omitempty"` + ArticleLinks []string `json:"articleLinks,omitempty"` + CveIds []string `json:"cveIds,omitempty"` + Cvss *float64 `json:"cvss,omitempty"` + Description *string `json:"description,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + Keywords *string `json:"keywords,omitempty"` + Severity *string `json:"severity,omitempty"` + Title string `json:"title"` models.RequestScope } -// ListManagerPlans - Get Plans -// GET /manager/plans -func (c *Client) ListManagerPlans(ctx context.Context, in ListManagerPlansInput) (*models.EndpointsGetPlansOutput, error) { - path := "/manager/plans" +// CreateManagerThreatInvestigations - Post Threat Investigation +// POST /manager/threat-investigations +func (c *Client) CreateManagerThreatInvestigations(ctx context.Context, in CreateManagerThreatInvestigationsInput) (*models.EndpointsPostThreatInvestigationOutput, error) { + path := "/manager/threat-investigations" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) - } - if in.CampaignID != nil { - query.Set("campaignId", string(*in.CampaignID)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1839,32 +3625,76 @@ func (c *Client) ListManagerPlans(ctx context.Context, in ListManagerPlansInput) if len(query) > 0 { fullURL += "?" + query.Encode() } - - data, err := c.do(ctx, "GET", fullURL, nil) + + bodyBytes, err := json.Marshal(struct { + Advice *string `json:"advice,omitempty"` + AffectedPackages []models.ModelsThreatInvestigationAffectedPackage `json:"affectedPackages,omitempty"` + ArticleLinks []string `json:"articleLinks,omitempty"` + CveIds []string `json:"cveIds,omitempty"` + Cvss *float64 `json:"cvss,omitempty"` + Description *string `json:"description,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + Keywords *string `json:"keywords,omitempty"` + Severity *string `json:"severity,omitempty"` + Title string `json:"title"` + }{ + Advice: in.Advice, + AffectedPackages: in.AffectedPackages, + ArticleLinks: in.ArticleLinks, + CveIds: in.CveIds, + Cvss: in.Cvss, + Description: in.Description, + Ecosystem: in.Ecosystem, + Keywords: in.Keywords, + Severity: in.Severity, + Title: in.Title, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetPlansOutput + var out models.EndpointsPostThreatInvestigationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerStateInput is the input for ListManagerState — Get Manager State. -type ListManagerStateInput struct { +// GetManagerThreatInvestigationsThreatInvestigationIdInput is the input for GetManagerThreatInvestigationsThreatInvestigationId — Get Threat Investigation. +type GetManagerThreatInvestigationsThreatInvestigationIdInput struct { + ThreatInvestigationID string `path:"threatInvestigationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeVersions *bool `url:"includeVersions,omitempty" json:"-"` + VersionLimit *int `url:"versionLimit,omitempty" json:"-"` + VersionOffset *int `url:"versionOffset,omitempty" json:"-"` models.RequestScope } -// ListManagerState - Get Manager State -// GET /manager/state -func (c *Client) ListManagerState(ctx context.Context, in ListManagerStateInput) (*models.EndpointsGetManagerStateOutput, error) { - path := "/manager/state" +// GetManagerThreatInvestigationsThreatInvestigationId - Get Threat Investigation +// GET /manager/threat-investigations/{threatInvestigationId} +func (c *Client) GetManagerThreatInvestigationsThreatInvestigationId(ctx context.Context, in GetManagerThreatInvestigationsThreatInvestigationIdInput) (*models.EndpointsGetThreatInvestigationOutput, error) { + path := "/manager/threat-investigations/{threatInvestigationId}" + path = strings.Replace(path, "{threatInvestigationId}", url.PathEscape(in.ThreatInvestigationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.IncludeVersions != nil { + query.Set("includeVersions", strconv.FormatBool(*in.IncludeVersions)) + } + if in.VersionLimit != nil { + query.Set("versionLimit", strconv.Itoa(int(*in.VersionLimit))) + } + if in.VersionOffset != nil { + query.Set("versionOffset", strconv.Itoa(int(*in.VersionOffset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1876,27 +3706,34 @@ func (c *Client) ListManagerState(ctx context.Context, in ListManagerStateInput) if err != nil { return nil, err } - var out models.EndpointsGetManagerStateOutput + var out models.EndpointsGetThreatInvestigationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerStateLatestInput is the input for ListManagerStateLatest — Get Manager State (Legacy). -type ListManagerStateLatestInput struct { +// PatchManagerThreatInvestigationsThreatInvestigationIdInput is the input for PatchManagerThreatInvestigationsThreatInvestigationId — Patch Threat Investigation. +type PatchManagerThreatInvestigationsThreatInvestigationIdInput struct { + ThreatInvestigationID string `path:"threatInvestigationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Action string `json:"action"` models.RequestScope } -// ListManagerStateLatest - Get Manager State (Legacy) -// GET /manager/state/latest -func (c *Client) ListManagerStateLatest(ctx context.Context, in ListManagerStateLatestInput) (*models.EndpointsGetManagerStateOutput, error) { - path := "/manager/state/latest" +// PatchManagerThreatInvestigationsThreatInvestigationId - Patch Threat Investigation +// PATCH /manager/threat-investigations/{threatInvestigationId} +func (c *Client) PatchManagerThreatInvestigationsThreatInvestigationId(ctx context.Context, in PatchManagerThreatInvestigationsThreatInvestigationIdInput) (*models.EndpointsPatchThreatInvestigationOutput, error) { + path := "/manager/threat-investigations/{threatInvestigationId}" + path = strings.Replace(path, "{threatInvestigationId}", url.PathEscape(in.ThreatInvestigationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1904,38 +3741,44 @@ func (c *Client) ListManagerStateLatest(ctx context.Context, in ListManagerState fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + Action string `json:"action"` + }{ + Action: in.Action, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsGetManagerStateOutput + var out models.EndpointsPatchThreatInvestigationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerStatesInput is the input for ListManagerStates — Get Manager States. -type ListManagerStatesInput struct { - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// ListManagerThreatInvestigationsThreatInvestigationIdProgressInput is the input for ListManagerThreatInvestigationsThreatInvestigationIdProgress — Get Threat Investigation Progress. +type ListManagerThreatInvestigationsThreatInvestigationIdProgressInput struct { + ThreatInvestigationID string `path:"threatInvestigationId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerStates - Get Manager States -// GET /manager/states -func (c *Client) ListManagerStates(ctx context.Context, in ListManagerStatesInput) (*models.EndpointsGetManagerStatesOutput, error) { - path := "/manager/states" +// ListManagerThreatInvestigationsThreatInvestigationIdProgress - Get Threat Investigation Progress +// GET /manager/threat-investigations/{threatInvestigationId}/progress +func (c *Client) ListManagerThreatInvestigationsThreatInvestigationIdProgress(ctx context.Context, in ListManagerThreatInvestigationsThreatInvestigationIdProgressInput) (*models.EndpointsGetThreatInvestigationProgressOutput, error) { + path := "/manager/threat-investigations/{threatInvestigationId}/progress" + path = strings.Replace(path, "{threatInvestigationId}", url.PathEscape(in.ThreatInvestigationID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1948,27 +3791,39 @@ func (c *Client) ListManagerStates(ctx context.Context, in ListManagerStatesInpu if err != nil { return nil, err } - var out models.EndpointsGetManagerStatesOutput + var out models.EndpointsGetThreatInvestigationProgressOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerStrategyInput is the input for ListManagerStrategy — Get Active Strategy. -type ListManagerStrategyInput struct { +// ListManagerThreatReportsInput is the input for ListManagerThreatReports — List My Reported Threats. +type ListManagerThreatReportsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Page *int `url:"page,omitempty" json:"-"` + PageSize *int `url:"pageSize,omitempty" json:"-"` models.RequestScope } -// ListManagerStrategy - Get Active Strategy -// GET /manager/strategy -func (c *Client) ListManagerStrategy(ctx context.Context, in ListManagerStrategyInput) (*models.EndpointsGetStrategyOutput, error) { - path := "/manager/strategy" +// ListManagerThreatReports - List My Reported Threats +// GET /manager/threat-reports +func (c *Client) ListManagerThreatReports(ctx context.Context, in ListManagerThreatReportsInput) (*models.EndpointsListThreatReportsOutput, error) { + path := "/manager/threat-reports" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + if in.Page != nil { + query.Set("page", strconv.Itoa(int(*in.Page))) + } + if in.PageSize != nil { + query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1980,28 +3835,37 @@ func (c *Client) ListManagerStrategy(ctx context.Context, in ListManagerStrategy if err != nil { return nil, err } - var out models.EndpointsGetStrategyOutput + var out models.EndpointsListThreatReportsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchManagerStrategyInput is the input for PatchManagerStrategy — Patch Active Strategy. -type PatchManagerStrategyInput struct { - Quarters []models.ModelsStrategyQuarterGoal `json:"quarters,omitempty"` +// CreateManagerThreatReportsInput is the input for CreateManagerThreatReports — Report a Threat. +type CreateManagerThreatReportsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AdvisoryURL *string `json:"advisoryUrl,omitempty"` + Campaign *models.EndpointsThreatReportCampaign `json:"campaign,omitempty"` + CveID *string `json:"cveId,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + PackageName *string `json:"packageName,omitempty"` + RequestID string `json:"requestId"` models.RequestScope } -// PatchManagerStrategy - Patch Active Strategy -// PATCH /manager/strategy -func (c *Client) PatchManagerStrategy(ctx context.Context, in PatchManagerStrategyInput) (*models.EndpointsPatchStrategyOutput, error) { - path := "/manager/strategy" +// CreateManagerThreatReports - Report a Threat +// POST /manager/threat-reports +func (c *Client) CreateManagerThreatReports(ctx context.Context, in CreateManagerThreatReportsInput) (*models.EndpointsPostThreatReportOutput, error) { + path := "/manager/threat-reports" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2010,38 +3874,54 @@ func (c *Client) PatchManagerStrategy(ctx context.Context, in PatchManagerStrate } bodyBytes, err := json.Marshal(struct { - Quarters []models.ModelsStrategyQuarterGoal `json:"quarters,omitempty"` + AdvisoryURL *string `json:"advisoryUrl,omitempty"` + Campaign *models.EndpointsThreatReportCampaign `json:"campaign,omitempty"` + CveID *string `json:"cveId,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + PackageName *string `json:"packageName,omitempty"` + RequestID string `json:"requestId"` }{ - Quarters: in.Quarters, + AdvisoryURL: in.AdvisoryURL, + Campaign: in.Campaign, + CveID: in.CveID, + Ecosystem: in.Ecosystem, + PackageName: in.PackageName, + RequestID: in.RequestID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchStrategyOutput + var out models.EndpointsPostThreatReportOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerStrategyTriggerInput is the input for CreateManagerStrategyTrigger — Trigger Strategy Generation. -type CreateManagerStrategyTriggerInput struct { +// GetManagerThreatReportsRequestIdInput is the input for GetManagerThreatReportsRequestId — Get Threat Report Status. +type GetManagerThreatReportsRequestIdInput struct { + RequestID string `path:"requestId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateManagerStrategyTrigger - Trigger Strategy Generation -// POST /manager/strategy/trigger -func (c *Client) CreateManagerStrategyTrigger(ctx context.Context, in CreateManagerStrategyTriggerInput) (*models.EndpointsTriggerStrategyOutput, error) { - path := "/manager/strategy/trigger" +// GetManagerThreatReportsRequestId - Get Threat Report Status +// GET /manager/threat-reports/{requestId} +func (c *Client) GetManagerThreatReportsRequestId(ctx context.Context, in GetManagerThreatReportsRequestIdInput) (*models.EndpointsPostThreatReportOutput, error) { + path := "/manager/threat-reports/{requestId}" + path = strings.Replace(path, "{requestId}", url.PathEscape(in.RequestID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2049,38 +3929,36 @@ func (c *Client) CreateManagerStrategyTrigger(ctx context.Context, in CreateMana fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "POST", fullURL, nil) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsTriggerStrategyOutput + var out models.EndpointsPostThreatReportOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerStrategyVersionsInput is the input for ListManagerStrategyVersions — List Strategy Versions. -type ListManagerStrategyVersionsInput struct { - Page *int `url:"page,omitempty" json:"-"` - PageSize *int `url:"pageSize,omitempty" json:"-"` +// CreateManagerThreatReportsRequestIdResubmitInput is the input for CreateManagerThreatReportsRequestIdResubmit — Resubmit a Reported Threat. +type CreateManagerThreatReportsRequestIdResubmitInput struct { + RequestID string `path:"requestId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListManagerStrategyVersions - List Strategy Versions -// GET /manager/strategy/versions -func (c *Client) ListManagerStrategyVersions(ctx context.Context, in ListManagerStrategyVersionsInput) (*models.EndpointsListStrategyVersionsOutput, error) { - path := "/manager/strategy/versions" +// CreateManagerThreatReportsRequestIdResubmit - Resubmit a Reported Threat +// POST /manager/threat-reports/{requestId}/resubmit +func (c *Client) CreateManagerThreatReportsRequestIdResubmit(ctx context.Context, in CreateManagerThreatReportsRequestIdResubmitInput) (*models.EndpointsPostThreatReportOutput, error) { + path := "/manager/threat-reports/{requestId}/resubmit" + path = strings.Replace(path, "{requestId}", url.PathEscape(in.RequestID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.Page != nil { - query.Set("page", strconv.Itoa(int(*in.Page))) - } - if in.PageSize != nil { - query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -2089,31 +3967,37 @@ func (c *Client) ListManagerStrategyVersions(ctx context.Context, in ListManager fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsListStrategyVersionsOutput + var out models.EndpointsPostThreatReportOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateManagerTacitKnowledgeTriggerInput is the input for CreateManagerTacitKnowledgeTrigger — Trigger TacitKnowledge. -type CreateManagerTacitKnowledgeTriggerInput struct { +// CreateManagerThreatReportsRequestIdWithdrawInput is the input for CreateManagerThreatReportsRequestIdWithdraw — Withdraw a Reported Threat. +type CreateManagerThreatReportsRequestIdWithdrawInput struct { + RequestID string `path:"requestId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateManagerTacitKnowledgeTrigger - Trigger TacitKnowledge -// POST /manager/tacit-knowledge/trigger -func (c *Client) CreateManagerTacitKnowledgeTrigger(ctx context.Context, in CreateManagerTacitKnowledgeTriggerInput) (*models.EndpointsTriggerTacitKnowledgeOutput, error) { - path := "/manager/tacit-knowledge/trigger" +// CreateManagerThreatReportsRequestIdWithdraw - Withdraw a Reported Threat +// POST /manager/threat-reports/{requestId}/withdraw +func (c *Client) CreateManagerThreatReportsRequestIdWithdraw(ctx context.Context, in CreateManagerThreatReportsRequestIdWithdrawInput) (*models.EndpointsPostThreatReportOutput, error) { + path := "/manager/threat-reports/{requestId}/withdraw" + path = strings.Replace(path, "{requestId}", url.PathEscape(in.RequestID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2125,136 +4009,78 @@ func (c *Client) CreateManagerTacitKnowledgeTrigger(ctx context.Context, in Crea if err != nil { return nil, err } - var out models.EndpointsTriggerTacitKnowledgeOutput + var out models.EndpointsPostThreatReportOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListManagerThreatInvestigationsInput is the input for ListManagerThreatInvestigations — Get Threat Investigations. -type ListManagerThreatInvestigationsInput struct { +// ListManagerThreatsInput is the input for ListManagerThreats — Get Threat Catalog. +type ListManagerThreatsInput struct { + AdvisoryID *string `url:"advisoryId,omitempty" json:"-"` + CveID *string `url:"cveId,omitempty" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Kind *string `url:"kind,omitempty" json:"-"` Page *int `url:"page,omitempty" json:"-"` PageSize *int `url:"pageSize,omitempty" json:"-"` + PublishedAfter *string `url:"publishedAfter,omitempty" json:"-"` + PublishedBefore *string `url:"publishedBefore,omitempty" json:"-"` + Q *string `url:"q,omitempty" json:"-"` + Severity *string `url:"severity,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` + Verdict *string `url:"verdict,omitempty" json:"-"` models.RequestScope } -// ListManagerThreatInvestigations - Get Threat Investigations -// GET /manager/threat-investigations -func (c *Client) ListManagerThreatInvestigations(ctx context.Context, in ListManagerThreatInvestigationsInput) (*models.EndpointsGetThreatInvestigationsOutput, error) { - path := "/manager/threat-investigations" +// ListManagerThreats - Get Threat Catalog +// GET /manager/threats +func (c *Client) ListManagerThreats(ctx context.Context, in ListManagerThreatsInput) (*models.EndpointsGetThreatCatalogOutput, error) { + path := "/manager/threats" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } if in.Page != nil { query.Set("page", strconv.Itoa(int(*in.Page))) } if in.PageSize != nil { query.Set("pageSize", strconv.Itoa(int(*in.PageSize))) } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() + if in.CveID != nil { + query.Set("cveId", string(*in.CveID)) } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err + if in.AdvisoryID != nil { + query.Set("advisoryId", string(*in.AdvisoryID)) } - var out models.EndpointsGetThreatInvestigationsOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) } - return &out, nil -} - -// CreateManagerThreatInvestigationsInput is the input for CreateManagerThreatInvestigations — Post Threat Investigation. -type CreateManagerThreatInvestigationsInput struct { - Advice *string `json:"advice,omitempty"` - AffectedPackages []models.ModelsThreatInvestigationAffectedPackage `json:"affectedPackages,omitempty"` - ArticleLinks []string `json:"articleLinks,omitempty"` - CveIds []string `json:"cveIds,omitempty"` - Cvss *float64 `json:"cvss,omitempty"` - Description *string `json:"description,omitempty"` - Ecosystem *string `json:"ecosystem,omitempty"` - Keywords *string `json:"keywords,omitempty"` - Severity *string `json:"severity,omitempty"` - Title string `json:"title"` - models.RequestScope -} - -// CreateManagerThreatInvestigations - Post Threat Investigation -// POST /manager/threat-investigations -func (c *Client) CreateManagerThreatInvestigations(ctx context.Context, in CreateManagerThreatInvestigationsInput) (*models.EndpointsPostThreatInvestigationOutput, error) { - path := "/manager/threat-investigations" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) + if in.Severity != nil { + query.Set("severity", string(*in.Severity)) } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() + if in.Q != nil { + query.Set("q", string(*in.Q)) } - - bodyBytes, err := json.Marshal(struct { - Advice *string `json:"advice,omitempty"` - AffectedPackages []models.ModelsThreatInvestigationAffectedPackage `json:"affectedPackages,omitempty"` - ArticleLinks []string `json:"articleLinks,omitempty"` - CveIds []string `json:"cveIds,omitempty"` - Cvss *float64 `json:"cvss,omitempty"` - Description *string `json:"description,omitempty"` - Ecosystem *string `json:"ecosystem,omitempty"` - Keywords *string `json:"keywords,omitempty"` - Severity *string `json:"severity,omitempty"` - Title string `json:"title"` - }{ - Advice: in.Advice, - AffectedPackages: in.AffectedPackages, - ArticleLinks: in.ArticleLinks, - CveIds: in.CveIds, - Cvss: in.Cvss, - Description: in.Description, - Ecosystem: in.Ecosystem, - Keywords: in.Keywords, - Severity: in.Severity, - Title: in.Title, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) + if in.Verdict != nil { + query.Set("verdict", string(*in.Verdict)) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) - if err != nil { - return nil, err + if in.Kind != nil { + query.Set("kind", string(*in.Kind)) } - var out models.EndpointsPostThreatInvestigationOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) + if in.PublishedAfter != nil { + query.Set("publishedAfter", string(*in.PublishedAfter)) } - return &out, nil -} - -// GetManagerThreatInvestigationsThreatInvestigationIdInput is the input for GetManagerThreatInvestigationsThreatInvestigationId — Get Threat Investigation. -type GetManagerThreatInvestigationsThreatInvestigationIdInput struct { - ThreatInvestigationID string `path:"threatInvestigationId" json:"-"` - models.RequestScope -} - -// GetManagerThreatInvestigationsThreatInvestigationId - Get Threat Investigation -// GET /manager/threat-investigations/{threatInvestigationId} -func (c *Client) GetManagerThreatInvestigationsThreatInvestigationId(ctx context.Context, in GetManagerThreatInvestigationsThreatInvestigationIdInput) (*models.EndpointsGetThreatInvestigationOutput, error) { - path := "/manager/threat-investigations/{threatInvestigationId}" - path = strings.Replace(path, "{threatInvestigationId}", url.PathEscape(in.ThreatInvestigationID), 1) - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) + if in.PublishedBefore != nil { + query.Set("publishedBefore", string(*in.PublishedBefore)) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) } in.RequestScope.AddTo(query) @@ -2267,30 +4093,34 @@ func (c *Client) GetManagerThreatInvestigationsThreatInvestigationId(ctx context if err != nil { return nil, err } - var out models.EndpointsGetThreatInvestigationOutput + var out models.EndpointsGetThreatCatalogOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// PatchManagerThreatInvestigationsThreatInvestigationIdInput is the input for PatchManagerThreatInvestigationsThreatInvestigationId — Patch Threat Investigation. -type PatchManagerThreatInvestigationsThreatInvestigationIdInput struct { - ThreatInvestigationID string `path:"threatInvestigationId" json:"-"` +// CreateManagerThreatsThreatIdInvestigateInput is the input for CreateManagerThreatsThreatIdInvestigate — Investigate Threat in My Environment. +type CreateManagerThreatsThreatIdInvestigateInput struct { + ThreatID string `path:"threatId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Action string `json:"action"` models.RequestScope } -// PatchManagerThreatInvestigationsThreatInvestigationId - Patch Threat Investigation -// PATCH /manager/threat-investigations/{threatInvestigationId} -func (c *Client) PatchManagerThreatInvestigationsThreatInvestigationId(ctx context.Context, in PatchManagerThreatInvestigationsThreatInvestigationIdInput) (*models.EndpointsPatchThreatInvestigationOutput, error) { - path := "/manager/threat-investigations/{threatInvestigationId}" - path = strings.Replace(path, "{threatInvestigationId}", url.PathEscape(in.ThreatInvestigationID), 1) +// CreateManagerThreatsThreatIdInvestigate - Investigate Threat in My Environment +// POST /manager/threats/{threatId}/investigate +func (c *Client) CreateManagerThreatsThreatIdInvestigate(ctx context.Context, in CreateManagerThreatsThreatIdInvestigateInput) (*models.EndpointsPostThreatInvestigationOutput, error) { + path := "/manager/threats/{threatId}/investigate" + path = strings.Replace(path, "{threatId}", url.PathEscape(in.ThreatID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2306,11 +4136,11 @@ func (c *Client) PatchManagerThreatInvestigationsThreatInvestigationId(ctx conte if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "PATCH", fullURL, bytes.NewReader(bodyBytes)) + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) if err != nil { return nil, err } - var out models.EndpointsPatchThreatInvestigationOutput + var out models.EndpointsPostThreatInvestigationOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } @@ -2319,7 +4149,9 @@ func (c *Client) PatchManagerThreatInvestigationsThreatInvestigationId(ctx conte // CreateManagerTriggerInput is the input for CreateManagerTrigger — Start a Manager run. type CreateManagerTriggerInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` CampaignID *string `json:"campaignId,omitempty"` + EvaluationTime *string `json:"evaluationTime,omitempty"` Mode *string `json:"mode,omitempty"` models.RequestScope } @@ -2333,6 +4165,9 @@ func (c *Client) CreateManagerTrigger(ctx context.Context, in CreateManagerTrigg for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -2342,9 +4177,11 @@ func (c *Client) CreateManagerTrigger(ctx context.Context, in CreateManagerTrigg bodyBytes, err := json.Marshal(struct { CampaignID *string `json:"campaignId,omitempty"` + EvaluationTime *string `json:"evaluationTime,omitempty"` Mode *string `json:"mode,omitempty"` }{ CampaignID: in.CampaignID, + EvaluationTime: in.EvaluationTime, Mode: in.Mode, }) if err != nil { diff --git a/internal/api/models/admin.go b/internal/api/models/admin.go index f28a2d2..8494bfb 100644 --- a/internal/api/models/admin.go +++ b/internal/api/models/admin.go @@ -3,18 +3,249 @@ package models import "encoding/json" -type EndpointsAccountValidationResult struct { +type ConnectorsConfigField struct { + Description *string `json:"description,omitempty"` + EnumValues []string `json:"enumValues,omitempty"` + Key *string `json:"key,omitempty"` + Label *string `json:"label,omitempty"` + Required *bool `json:"required,omitempty"` + Secret *bool `json:"secret,omitempty"` + Type *ConnectorsFieldType `json:"type,omitempty"` +} + +type ConnectorsFieldType string + +const ( + ConnectorsFieldTypeString ConnectorsFieldType = "string" + ConnectorsFieldTypeSecret ConnectorsFieldType = "secret" + ConnectorsFieldTypeUrl ConnectorsFieldType = "url" + ConnectorsFieldTypeEnum ConnectorsFieldType = "enum" + ConnectorsFieldTypeBool ConnectorsFieldType = "bool" +) + +type ConnectorsLifecycleOps struct { + Configure *bool `json:"configure,omitempty"` + Connect *bool `json:"connect,omitempty"` + Disconnect *bool `json:"disconnect,omitempty"` + Test *bool `json:"test,omitempty"` +} + +type DatabaseFindingType string + +const ( + DatabaseFindingTypeSast DatabaseFindingType = "sast" + DatabaseFindingTypeScaDependencies DatabaseFindingType = "sca_dependencies" + DatabaseFindingTypeScaContainers DatabaseFindingType = "sca_containers" + DatabaseFindingTypeSecretsCredentials DatabaseFindingType = "secrets_credentials" + DatabaseFindingTypeSecretsSensitiveData DatabaseFindingType = "secrets_sensitive_data" + DatabaseFindingTypeScpm DatabaseFindingType = "scpm" + DatabaseFindingTypeCspm DatabaseFindingType = "cspm" + DatabaseFindingTypeDastBughunt DatabaseFindingType = "dast_bughunt" + DatabaseFindingTypeDastPentest DatabaseFindingType = "dast_pentest" +) + +type DatabaseTicketAuditActor string + +const ( + DatabaseTicketAuditActorSystem DatabaseTicketAuditActor = "system" + DatabaseTicketAuditActorUser DatabaseTicketAuditActor = "user" + DatabaseTicketAuditActorReconciler DatabaseTicketAuditActor = "reconciler" + DatabaseTicketAuditActorWebhook DatabaseTicketAuditActor = "webhook" + DatabaseTicketAuditActorManagerAgent DatabaseTicketAuditActor = "manager_agent" +) + +type DatabaseTicketAuditEventType string + +const ( + DatabaseTicketAuditEventTypeCreated DatabaseTicketAuditEventType = "created" + DatabaseTicketAuditEventTypeClosed DatabaseTicketAuditEventType = "closed" + DatabaseTicketAuditEventTypeReopened DatabaseTicketAuditEventType = "reopened" + DatabaseTicketAuditEventTypeMoved DatabaseTicketAuditEventType = "moved" + DatabaseTicketAuditEventTypeEligibilityFlagged DatabaseTicketAuditEventType = "eligibility_flagged" + DatabaseTicketAuditEventTypeBulkClose DatabaseTicketAuditEventType = "bulk_close" + DatabaseTicketAuditEventTypeBulkReopen DatabaseTicketAuditEventType = "bulk_reopen" + DatabaseTicketAuditEventTypeBulkMove DatabaseTicketAuditEventType = "bulk_move" + DatabaseTicketAuditEventTypeBulkResync DatabaseTicketAuditEventType = "bulk_resync" + DatabaseTicketAuditEventTypeBulkReassignTeam DatabaseTicketAuditEventType = "bulk_reassign_team" + DatabaseTicketAuditEventTypeBulkReassignAssignee DatabaseTicketAuditEventType = "bulk_reassign_assignee" + DatabaseTicketAuditEventTypeBulkAddComment DatabaseTicketAuditEventType = "bulk_add_comment" + DatabaseTicketAuditEventTypeBulkRelabel DatabaseTicketAuditEventType = "bulk_relabel" + DatabaseTicketAuditEventTypeBulkSetPriority DatabaseTicketAuditEventType = "bulk_set_priority" + DatabaseTicketAuditEventTypeBulkActionReaped DatabaseTicketAuditEventType = "bulk_action_reaped" + DatabaseTicketAuditEventTypeSettingsApplied DatabaseTicketAuditEventType = "settings_applied" + DatabaseTicketAuditEventTypeExternalSynced DatabaseTicketAuditEventType = "external_synced" + DatabaseTicketAuditEventTypeStaleTerminalCleared DatabaseTicketAuditEventType = "stale_terminal_cleared" + DatabaseTicketAuditEventTypeCreateFailed DatabaseTicketAuditEventType = "create_failed" +) + +type DatabaseTicketBulkActionType string + +const ( + DatabaseTicketBulkActionTypeBulkClose DatabaseTicketBulkActionType = "bulk_close" + DatabaseTicketBulkActionTypeBulkReopen DatabaseTicketBulkActionType = "bulk_reopen" + DatabaseTicketBulkActionTypeBulkMove DatabaseTicketBulkActionType = "bulk_move" + DatabaseTicketBulkActionTypeBulkResync DatabaseTicketBulkActionType = "bulk_resync" + DatabaseTicketBulkActionTypeBulkReassignTeam DatabaseTicketBulkActionType = "bulk_reassign_team" + DatabaseTicketBulkActionTypeBulkReassignAssignee DatabaseTicketBulkActionType = "bulk_reassign_assignee" + DatabaseTicketBulkActionTypeBulkAddComment DatabaseTicketBulkActionType = "bulk_add_comment" + DatabaseTicketBulkActionTypeBulkRelabel DatabaseTicketBulkActionType = "bulk_relabel" + DatabaseTicketBulkActionTypeBulkSetPriority DatabaseTicketBulkActionType = "bulk_set_priority" +) + +type DatabaseTicketBulkOperationStatus string + +const ( + DatabaseTicketBulkOperationStatusPending DatabaseTicketBulkOperationStatus = "pending" + DatabaseTicketBulkOperationStatusRunning DatabaseTicketBulkOperationStatus = "running" + DatabaseTicketBulkOperationStatusDone DatabaseTicketBulkOperationStatus = "done" + DatabaseTicketBulkOperationStatusFailed DatabaseTicketBulkOperationStatus = "failed" + DatabaseTicketBulkOperationStatusCancelled DatabaseTicketBulkOperationStatus = "cancelled" +) + +type DatabaseTicketMigrationAction string + +const ( + DatabaseTicketMigrationActionNone DatabaseTicketMigrationAction = "none" + DatabaseTicketMigrationActionCloseAutoCreated DatabaseTicketMigrationAction = "close_auto_created" + DatabaseTicketMigrationActionCloseAllOutOfScope DatabaseTicketMigrationAction = "close_all_out_of_scope" + DatabaseTicketMigrationActionMigrateBoard DatabaseTicketMigrationAction = "migrate_board" +) + +type DatabaseTicketPlatform string + +const ( + DatabaseTicketPlatformGithub DatabaseTicketPlatform = "GitHub" + DatabaseTicketPlatformJira DatabaseTicketPlatform = "Jira" + DatabaseTicketPlatformLinear DatabaseTicketPlatform = "Linear" + DatabaseTicketPlatformAzure DatabaseTicketPlatform = "Azure" + DatabaseTicketPlatformAsana DatabaseTicketPlatform = "Asana" +) + +type DatabaseTicketSource string + +const ( + DatabaseTicketSourceScanPipeline DatabaseTicketSource = "scan_pipeline" + DatabaseTicketSourceReconciliation DatabaseTicketSource = "reconciliation" + DatabaseTicketSourceManagerAgent DatabaseTicketSource = "manager_agent" + DatabaseTicketSourceRestApi DatabaseTicketSource = "rest_api" + DatabaseTicketSourceDashboard DatabaseTicketSource = "dashboard" + DatabaseTicketSourceUnknown DatabaseTicketSource = "unknown" +) + +type DatabaseTicketStatus string + +const ( + DatabaseTicketStatusPending DatabaseTicketStatus = "pending" + DatabaseTicketStatusOpen DatabaseTicketStatus = "open" + DatabaseTicketStatusInProgress DatabaseTicketStatus = "in_progress" + DatabaseTicketStatusResolved DatabaseTicketStatus = "resolved" + DatabaseTicketStatusClosed DatabaseTicketStatus = "closed" + DatabaseTicketStatusWontFix DatabaseTicketStatus = "wont_fix" +) + +type EndpointsAdminAccountValidationResult struct { AssumedRole *string `json:"assumedRole,omitempty"` ErrorMessage *string `json:"errorMessage,omitempty"` - IsValid *bool `json:"isValid,omitempty"` - Status *string `json:"status,omitempty"` + IsValid bool `json:"isValid"` + Status string `json:"status"` +} + +type EndpointsAdminActivateUserTarget struct { + Role string `json:"role"` + TeamIds []string `json:"teamIds,omitempty"` + UserID string `json:"userId"` +} + +type EndpointsAdminActivateUsersInput struct { + Users []EndpointsAdminActivateUserTarget `json:"users,omitempty"` +} + +type EndpointsAdminActivateUsersOutput struct { + Users []EndpointsAdminUserRole `json:"users,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminAsanaConfigOutput struct { + CreatedAt string `json:"createdAt"` + ProjectGid *string `json:"projectGid,omitempty"` + UpdatedAt string `json:"updatedAt"` + WorkspaceID *string `json:"workspaceId,omitempty"` + WorkspaceName *string `json:"workspaceName,omitempty"` } type EndpointsAdminAzureConfigOutput struct { ClientID string `json:"clientId"` CreatedAt string `json:"createdAt"` + Organization *string `json:"organization,omitempty"` + ProjectName *string `json:"projectName,omitempty"` TenantID string `json:"tenantId"` UpdatedAt string `json:"updatedAt"` + WorkItemType *string `json:"workItemType,omitempty"` +} + +type EndpointsAdminAzureHookFailure struct { + Event string `json:"event"` + Message string `json:"message"` + ProjectID string `json:"projectId"` + RepositoryID *string `json:"repositoryId,omitempty"` +} + +type EndpointsAdminAzureInstallation struct { + AdminDisabledAt *string `json:"adminDisabledAt,omitempty"` + AdminDisabledBy *string `json:"adminDisabledBy,omitempty"` + CreatedAt string `json:"createdAt"` + HooksHealth *EndpointsAdminAzureProjectHooksHealth `json:"hooksHealth,omitempty"` + ID string `json:"id"` + OrganizationID string `json:"organizationId"` + OrganizationName *string `json:"organizationName,omitempty"` + ProjectID string `json:"projectId"` + ProjectName *string `json:"projectName,omitempty"` + SourceControlReady bool `json:"sourceControlReady"` + TenantID string `json:"tenantId"` + Ungranted bool `json:"ungranted"` + UpdatedAt string `json:"updatedAt"` + WebhookSecretRotatable bool `json:"webhookSecretRotatable"` + WorkItemsEnabled bool `json:"workItemsEnabled"` +} + +type EndpointsAdminAzureMergeGateHealth struct { + Detail *string `json:"detail,omitempty"` + State string `json:"state"` +} + +type EndpointsAdminAzureProjectHooksHealth struct { + Deleted *bool `json:"deleted,omitempty"` + Failures []string `json:"failures,omitempty"` + MergeGate EndpointsAdminAzureMergeGateHealth `json:"mergeGate"` + NeedsHuman []string `json:"needsHuman,omitempty"` + NewProject *bool `json:"newProject,omitempty"` + Outcome string `json:"outcome"` + ProjectID string `json:"projectId"` + PullRequestsMissingReview *int `json:"pullRequestsMissingReview,omitempty"` + ReconciledAt string `json:"reconciledAt"` + Subscriptions []EndpointsAdminAzureSubscriptionHealth `json:"subscriptions,omitempty"` + Suspended *bool `json:"suspended,omitempty"` + Trigger string `json:"trigger"` +} + +type EndpointsAdminAzureSubscriptionHealth struct { + Action string `json:"action"` + Detail *string `json:"detail,omitempty"` + Event string `json:"event"` + NotificationType *string `json:"notificationType,omitempty"` + RootCause *string `json:"rootCause,omitempty"` + Status string `json:"status"` + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +type EndpointsAdminBatchSetUserRolesInput struct { + Role string `json:"role"` + Users []EndpointsAdminSetUserRoleTarget `json:"users,omitempty"` +} + +type EndpointsAdminBatchSetUserRolesOutput struct { + Users []EndpointsAdminUserRole `json:"users,omitempty"` + Version *string `json:"version,omitempty"` } type EndpointsAdminBotInteraction struct { @@ -49,23 +280,132 @@ type EndpointsAdminBotInteractionsOutput struct { Summary EndpointsAdminBotInteractionSummary `json:"summary"` } +type EndpointsAdminCLIPackageFeedControlInput struct { + ConnectionID *string `json:"connectionId,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + Fields map[string]string `json:"fields,omitempty"` + Operation string `json:"operation"` + ProviderID *string `json:"providerId,omitempty"` + Reason string `json:"reason"` +} + +type EndpointsAdminCLIPackageFeedControlOutput struct { + Connection *EndpointsIntegrationConnectionInstanceView `json:"connection,omitempty"` + MaxOutstandingLeaseExpiry *string `json:"maxOutstandingLeaseExpiry,omitempty"` + UpstreamRevocationRequired *bool `json:"upstreamRevocationRequired,omitempty"` +} + +type EndpointsAdminCLIPackageFeedsOutput struct { + Connections []EndpointsIntegrationConnectionInstanceView `json:"connections,omitempty"` +} + type EndpointsAdminChecklistOutput struct { Items []ModelsChecklistItem `json:"items,omitempty"` } +type EndpointsAdminConfigureIntegrationInput struct { + Fields map[string]string `json:"fields,omitempty"` +} + +type EndpointsAdminConfigureIntegrationOutput struct { + Connection *EndpointsIntegrationConnectionView `json:"connection,omitempty"` +} + +type EndpointsAdminConnectIntegrationInput struct { + Fields map[string]string `json:"fields,omitempty"` +} + +type EndpointsAdminConnectIntegrationOutput struct { + Connection *EndpointsIntegrationConnectionView `json:"connection,omitempty"` +} + +type EndpointsAdminCreateIntegrationConnectionInput struct { + DisplayName *string `json:"displayName,omitempty"` + Fields map[string]string `json:"fields,omitempty"` +} + +type EndpointsAdminCreateIntegrationConnectionOutput struct { + Connection *EndpointsIntegrationConnectionInstanceView `json:"connection,omitempty"` +} + +type EndpointsAdminDeactivateUserInput struct { + UserID string `json:"userId"` +} + +type EndpointsAdminDeactivateUserOutput struct { + LifecycleState string `json:"lifecycleState"` + UserID string `json:"userId"` + Username *string `json:"username,omitempty"` + Version *string `json:"version,omitempty"` +} + type EndpointsAdminDeleteAWSSettingsOutput struct { - Message *string `json:"message,omitempty"` - Success *bool `json:"success,omitempty"` + Message string `json:"message"` + Success bool `json:"success"` +} + +type EndpointsAdminDeleteAzureConnectOutput struct { + Failures []string `json:"failures,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminDeleteAzureInstallationOutput struct { + Failures []string `json:"failures,omitempty"` + Version *string `json:"version,omitempty"` } type EndpointsAdminDeleteAzureSettingsOutput struct { - Message *string `json:"message,omitempty"` - Success *bool `json:"success,omitempty"` + Message string `json:"message"` + Success bool `json:"success"` } type EndpointsAdminDeleteGCPSettingsOutput struct { - Message *string `json:"message,omitempty"` - Success *bool `json:"success,omitempty"` + Message string `json:"message"` + Success bool `json:"success"` +} + +type EndpointsAdminDeleteK8SClusterOutput struct { + Deleted bool `json:"deleted"` +} + +type EndpointsAdminDeleteK8SSettingsOutput struct { + Deleted bool `json:"deleted"` +} + +type EndpointsAdminDisconnectIntegrationConnectionOutput struct { + ConnectionID *string `json:"connectionId,omitempty"` + MaxOutstandingLeaseExpiry *string `json:"maxOutstandingLeaseExpiry,omitempty"` + NewLeasesBlocked *bool `json:"newLeasesBlocked,omitempty"` + Status *string `json:"status,omitempty"` + StoredSecretDeleted *bool `json:"storedSecretDeleted,omitempty"` + UpstreamRevocationRequired *bool `json:"upstreamRevocationRequired,omitempty"` +} + +type EndpointsAdminDisconnectIntegrationOutput struct { + Disconnected *bool `json:"disconnected,omitempty"` +} + +type EndpointsAdminDiscoverGitHubPackagesCredentialInput struct { + Token string `json:"token"` +} + +type EndpointsAdminDiscoverGitHubPackagesCredentialOutput struct { + PackageOrigin *string `json:"packageOrigin,omitempty"` + Packages []EndpointsGitHubPackagesDiscoveredPackage `json:"packages,omitempty"` + Username string `json:"username"` +} + +type EndpointsAdminElevateSupportAccessInput struct { + Agent *string `json:"agent,omitempty"` + Reason string `json:"reason"` + TtlSeconds *int64 `json:"ttlSeconds,omitempty"` +} + +type EndpointsAdminElevateSupportAccessOutput struct { + Extended *bool `json:"extended,omitempty"` + Grant EndpointsAdminSupportAccessGrant `json:"grant"` + Version *string `json:"version,omitempty"` } type EndpointsAdminFileContentsOutput struct { @@ -88,6 +428,21 @@ type EndpointsAdminFindingsDownloadOutput struct { Csv *string `json:"csv,omitempty"` } +type EndpointsAdminFindingsGroupsInput struct { + GroupBy ModelsFindingsGroupBy `json:"groupBy"` + Limit *int `json:"limit,omitempty"` + Page *int `json:"page,omitempty"` + Query ModelsUnifiedFindingsQuery `json:"query"` +} + +type EndpointsAdminFindingsGroupsOutput struct { + Groups []ModelsFindingsGroup `json:"groups,omitempty"` + Page int `json:"page"` + TotalGroups int `json:"totalGroups"` + Truncated bool `json:"truncated"` + Ungrouped int `json:"ungrouped"` +} + type EndpointsAdminFixEffortMapInput struct { Easy int `json:"easy"` Hard int `json:"hard"` @@ -106,18 +461,21 @@ type EndpointsAdminFixEffortMapOutput struct { type EndpointsAdminGetAWSSettingsOutput struct { AwsAccounts []ModelsAWSAccountWithStatus `json:"awsAccounts,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - ExternalID *string `json:"externalId,omitempty"` - IamRoleName *string `json:"iamRoleName,omitempty"` + ConnectorPermissionGaps []ModelsAWSConnectorPermissionGap `json:"connectorPermissionGaps,omitempty"` + ConnectorPermissionProbe *EndpointsConnectorPermissionProbeStatus `json:"connectorPermissionProbe,omitempty"` + CreatedAt string `json:"createdAt"` + ExternalID string `json:"externalId"` + IamRoleName string `json:"iamRoleName"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` LastValidationStatus *string `json:"lastValidationStatus,omitempty"` NullifyK8sCollectorRoleArn *string `json:"nullifyK8sCollectorRoleArn,omitempty"` - NullifyKMSKeyArn *string `json:"nullifyKMSKeyArn,omitempty"` - NullifyRoleArn *string `json:"nullifyRoleArn,omitempty"` - NullifyS3Bucket *string `json:"nullifyS3Bucket,omitempty"` - OverallStatus *string `json:"overallStatus,omitempty"` - PreferredDeployment *ModelsDeploymentType `json:"preferredDeployment,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` + NullifyKMSKeyArn string `json:"nullifyKMSKeyArn"` + NullifyRoleArn string `json:"nullifyRoleArn"` + NullifyS3AccessPointArn *string `json:"nullifyS3AccessPointArn,omitempty"` + NullifyS3Bucket string `json:"nullifyS3Bucket"` + OverallStatus string `json:"overallStatus"` + PreferredDeployment ModelsDeploymentType `json:"preferredDeployment"` + UpdatedAt string `json:"updatedAt"` } type EndpointsAdminGetAzureConfigOutput struct { @@ -128,17 +486,42 @@ type EndpointsAdminGetAzureConfigOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsAdminGetAzureConnectStatusOutput struct { + AdminConsentURL *string `json:"adminConsentUrl,omitempty"` + Checklist []EndpointsAzureConnectChecklistItem `json:"checklist,omitempty"` + ContinueURL *string `json:"continueUrl,omitempty"` + EnableBuildGate *bool `json:"enableBuildGate,omitempty"` + ErrorCode *string `json:"errorCode,omitempty"` + Organizations []EndpointsAzureConnectOrganization `json:"organizations,omitempty"` + Status EndpointsAzureConnectStatus `json:"status"` + Version *string `json:"version,omitempty"` +} + type EndpointsAdminGetAzureSettingsOutput struct { + AuthMode string `json:"authMode"` ClientID *string `json:"clientId,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` + CreatedAt string `json:"createdAt"` DisplayName *string `json:"displayName,omitempty"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` LastValidationStatus *string `json:"lastValidationStatus,omitempty"` - OverallStatus *string `json:"overallStatus,omitempty"` + OverallStatus string `json:"overallStatus"` Subscriptions []ModelsAzureSubscriptionWithStatus `json:"subscriptions,omitempty"` - TenantID *string `json:"tenantId,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` - UseManagedIdentity *bool `json:"useManagedIdentity,omitempty"` + TenantID string `json:"tenantId"` + UpdatedAt string `json:"updatedAt"` + WifIssuerURL *string `json:"wifIssuerUrl,omitempty"` + WifSubject *string `json:"wifSubject,omitempty"` +} + +type EndpointsAdminGetCallerAccessOutput struct { + LifecycleState *string `json:"lifecycleState,omitempty"` + ManagedBy *string `json:"managedBy,omitempty"` + Permissions []string `json:"permissions,omitempty"` + Role *string `json:"role,omitempty"` + SupportAccessExpiresAt *string `json:"supportAccessExpiresAt,omitempty"` + TeamIds []string `json:"teamIds,omitempty"` + TeamScopeEnabled *bool `json:"teamScopeEnabled,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` + Version *string `json:"version,omitempty"` } type EndpointsAdminGetFindingOutput struct { @@ -151,18 +534,38 @@ type EndpointsAdminGetFixEffortOutput struct { } type EndpointsAdminGetGCPSettingsOutput struct { - CreatedAt *string `json:"createdAt,omitempty"` + CreatedAt string `json:"createdAt"` DisplayName *string `json:"displayName,omitempty"` GkeClusterOidcIssuerUrls []string `json:"gkeClusterOidcIssuerUrls,omitempty"` GkeServiceAccountUniqueID *string `json:"gkeServiceAccountUniqueId,omitempty"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` LastValidationStatus *string `json:"lastValidationStatus,omitempty"` NullifyK8sCollectorRoleArn *string `json:"nullifyK8sCollectorRoleArn,omitempty"` - OverallStatus *string `json:"overallStatus,omitempty"` + OverallStatus string `json:"overallStatus"` Projects []ModelsGCPProjectWithStatus `json:"projects,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` - WorkloadIdentityProvider *string `json:"workloadIdentityProvider,omitempty"` - WorkloadIdentityServiceAccountEmail *string `json:"workloadIdentityServiceAccountEmail,omitempty"` + UpdatedAt string `json:"updatedAt"` + WorkloadIdentityProvider string `json:"workloadIdentityProvider"` + WorkloadIdentityServiceAccountEmail string `json:"workloadIdentityServiceAccountEmail"` +} + +type EndpointsAdminGetGCPSetupOutput struct { + AttributeMapping string `json:"attributeMapping"` + CustomRoleID string `json:"customRoleId"` + CustomRoleNote string `json:"customRoleNote"` + DiscoveryRoles []string `json:"discoveryRoles,omitempty"` + InstallerEnv string `json:"installerEnv"` + OidcIssuerURL string `json:"oidcIssuerUrl"` + RequiredApis []string `json:"requiredApis,omitempty"` + RoleGrantNote string `json:"roleGrantNote"` + ServiceAccountBindingMember string `json:"serviceAccountBindingMember"` + ServiceAccountBindingRole string `json:"serviceAccountBindingRole"` + ServiceAccountID string `json:"serviceAccountId"` + TenantID string `json:"tenantId"` + TerraformVariables string `json:"terraformVariables"` + ViewerRoles []string `json:"viewerRoles,omitempty"` + WorkloadIdentityPoolID string `json:"workloadIdentityPoolId"` + WorkloadIdentityProviderAttributeCondition string `json:"workloadIdentityProviderAttributeCondition"` + WorkloadIdentityProviderID string `json:"workloadIdentityProviderId"` } type EndpointsAdminGetGitHubAppSettingsOutput struct { @@ -170,6 +573,7 @@ type EndpointsAdminGetGitHubAppSettingsOutput struct { Events []string `json:"events,omitempty"` IncorrectPermissions map[string]EndpointsIncorrectPermission `json:"incorrect_permissions,omitempty"` InstallationID int64 `json:"installation_id"` + ManagedBySharedApp bool `json:"managed_by_shared_app"` MissingEvents []string `json:"missing_events,omitempty"` MissingPermissions map[string]string `json:"missing_permissions,omitempty"` Permissions map[string]string `json:"permissions,omitempty"` @@ -185,52 +589,208 @@ type EndpointsAdminGetIntegrationUsersOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsAdminGetIntegrationsCatalogOutput struct { + Connectors []EndpointsCatalogConnector `json:"connectors,omitempty"` +} + type EndpointsAdminGetJiraConfigOutput struct { Configuration *ModelsJiraConfig `json:"configuration,omitempty"` Enabled bool `json:"enabled"` Version *string `json:"version,omitempty"` } +type EndpointsAdminGetK8SCollectorAccountsOutput struct { + AccountIds []string `json:"accountIds,omitempty"` + Initialized bool `json:"initialized"` + LegacyAccessPreserved bool `json:"legacyAccessPreserved"` + Revision int64 `json:"revision"` + StateID string `json:"stateId"` +} + +type EndpointsAdminGetK8SSettingsOutput struct { + Clusters []ModelsK8SClusterWithStatus `json:"clusters,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + LastValidatedAt *string `json:"lastValidatedAt,omitempty"` + LastValidationStatus *string `json:"lastValidationStatus,omitempty"` + NullifyRoleArn *string `json:"nullifyRoleArn,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type EndpointsAdminGetLinearConfigOutput struct { + ClientSecretUploaded bool `json:"clientSecretUploaded"` + ConfigUploaded bool `json:"configUploaded"` + Configuration *EndpointsAdminLinearConfigOutput `json:"configuration,omitempty"` + RedactedClientSecret *string `json:"redactedClientSecret,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminGetLinearMembersOutput struct { + HasMore bool `json:"hasMore"` + Members []EndpointsAdminLinearMember `json:"members,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminGetLinearTeamsOutput struct { + Teams []EndpointsAdminLinearTeam `json:"teams,omitempty"` + Version *string `json:"version,omitempty"` +} + type EndpointsAdminGetOrganizationOutput struct { Organization *ModelsOrganization `json:"organization,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsAdminGetPRGateSettingsOutput struct { + AllowApprovingReviews *bool `json:"allowApprovingReviews,omitempty"` + AllowRequestChangesReviews *bool `json:"allowRequestChangesReviews,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + CvssEnforcement *bool `json:"cvssEnforcement,omitempty"` + Enabled bool `json:"enabled"` + FailOnIncompleteCoverage *bool `json:"failOnIncompleteCoverage,omitempty"` + FindingsPolicy EndpointsPRGateFindingsPolicy `json:"findingsPolicy"` + MinPriority ModelsPriorityEnum `json:"minPriority"` + Mode *string `json:"mode,omitempty"` + PrReviewsEnabled *bool `json:"prReviewsEnabled,omitempty"` + PrScansEnabled *bool `json:"prScansEnabled,omitempty"` + PushScansEnabled *bool `json:"pushScansEnabled,omitempty"` + ScaBlockCvssThreshold *float64 `json:"scaBlockCvssThreshold,omitempty"` + SCPM *EndpointsEffectiveSCPMGateSettings `json:"scpm,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminGetPullRequestRecordOutput struct { + PullRequest *ModelsFindingPullRequestRecord `json:"pullRequest,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminGetRBACPreferencesOutput struct { + CreatedAt *string `json:"createdAt,omitempty"` + DefaultInviteeRole string `json:"defaultInviteeRole"` + TeamScopedRoles []string `json:"teamScopedRoles,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminGetRepoRecommendationsOutput struct { + GeneratedAt string `json:"generatedAt"` + Recommended []EndpointsRepoRecommendation `json:"recommended,omitempty"` + ScanID string `json:"scanId"` + UncoveredCaps []string `json:"uncoveredCaps,omitempty"` +} + type EndpointsAdminGetRepositoriesOutput struct { NextToken string `json:"nextToken"` NumItems int `json:"numItems"` Repositories []ModelsRepositoryPublic `json:"repositories,omitempty"` + TotalCount int `json:"totalCount"` Version *string `json:"version,omitempty"` } +type EndpointsAdminGetSupportAccessOutput struct { + Active *EndpointsAdminSupportAccessGrant `json:"active,omitempty"` + Grants []EndpointsAdminSupportAccessGrant `json:"grants,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminGetThreatNotificationDestinationsOutput struct { + Destinations EndpointsThreatNotificationDestinations `json:"destinations"` +} + type EndpointsAdminGetUserInstallationsOutput struct { Installations []EndpointsAdminInstallationOutput `json:"installations,omitempty"` Version *string `json:"version,omitempty"` } type EndpointsAdminGetUsersOutput struct { - Users []ModelsUser `json:"users,omitempty"` + Users []EndpointsAdminUserWithRole `json:"users,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsAdminGitLabConnectConfirmInput struct { + Handle string `json:"handle"` +} + +type EndpointsAdminGitLabConnectOutput struct { + AuthorizeURL string `json:"authorizeUrl"` + Handle string `json:"handle"` +} + +type EndpointsAdminGitLabConnectStatusOutput struct { + Available *bool `json:"available,omitempty"` + CompletedRepositories *int `json:"completedRepositories,omitempty"` + Connected *bool `json:"connected,omitempty"` + Error *string `json:"error,omitempty"` + Group *GitlabauthGroup `json:"group,omitempty"` + Handle *string `json:"handle,omitempty"` + Repositories []GitlabauthProject `json:"repositories,omitempty"` + Status *string `json:"status,omitempty"` +} + type EndpointsAdminInstallationOutput struct { AvatarURL string `json:"avatarUrl"` + IsOnboarded *bool `json:"isOnboarded,omitempty"` Name string `json:"name"` NullifyBaseURL *string `json:"nullifyBaseUrl,omitempty"` Provider ModelsOwnerProvider `json:"provider"` + ProvisioningStatus *string `json:"provisioningStatus,omitempty"` QueryParameters map[string]string `json:"queryParameters,omitempty"` } type EndpointsAdminK8SConnectorWhitelistInput struct { AccountIds []string `json:"accountIds,omitempty"` + ExpectedRevision *int `json:"expectedRevision,omitempty"` + ExpectedStateID *string `json:"expectedStateId,omitempty"` } type EndpointsAdminK8SConnectorWhitelistOutput struct { + AccessPointError *string `json:"accessPointError,omitempty"` + AccessPointPolicyUpdated *bool `json:"accessPointPolicyUpdated,omitempty"` KmsError *string `json:"kmsError,omitempty"` - KmsPolicyUpdated *bool `json:"kmsPolicyUpdated,omitempty"` + KmsPolicyUpdated bool `json:"kmsPolicyUpdated"` + KmsSkipped bool `json:"kmsSkipped"` Message *string `json:"message,omitempty"` + Revision int64 `json:"revision"` S3Error *string `json:"s3Error,omitempty"` - S3PolicyUpdated *bool `json:"s3PolicyUpdated,omitempty"` + S3PolicyUpdated bool `json:"s3PolicyUpdated"` + StateID string `json:"stateId"` +} + +type EndpointsAdminLinearConfigOutput struct { + AutoCreate *bool `json:"autoCreate,omitempty"` + ClientID string `json:"clientId"` + CreatedAt string `json:"createdAt"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` + PriorityThreshold *string `json:"priorityThreshold,omitempty"` + TeamID *string `json:"teamId,omitempty"` + UpdatedAt string `json:"updatedAt"` +} + +type EndpointsAdminLinearMember struct { + Email *string `json:"email,omitempty"` + ID string `json:"id"` + Name string `json:"name"` +} + +type EndpointsAdminLinearTeam struct { + ID string `json:"id"` + Key *string `json:"key,omitempty"` + Name string `json:"name"` +} + +type EndpointsAdminListAzureInstallationsOutput struct { + Installations []EndpointsAdminAzureInstallation `json:"installations,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminListIntegrationConnectionsOutput struct { + Connections []EndpointsIntegrationConnectionInstanceView `json:"connections,omitempty"` +} + +type EndpointsAdminListOrgOwnersOutput struct { + UserIds []string `json:"userIds,omitempty"` + Version *string `json:"version,omitempty"` } type EndpointsAdminListUnifiedEventsByTeamInput struct { @@ -240,81 +800,473 @@ type EndpointsAdminListUnifiedEventsByTeamInput struct { BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` CampaignID *string `json:"campaignId,omitempty"` EventTypes []string `json:"eventTypes,omitempty"` + ExcludeEventTypes []string `json:"excludeEventTypes,omitempty"` + ExcludeServices []string `json:"excludeServices,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + HideNoise *bool `json:"hideNoise,omitempty"` + Limit *int `json:"limit,omitempty"` + PrCanonicalID *string `json:"prCanonicalId,omitempty"` + Query *string `json:"query,omitempty"` + QueryEventTypes []string `json:"queryEventTypes,omitempty"` + RunID *string `json:"runId,omitempty"` + Services []string `json:"services,omitempty"` +} + +type EndpointsAdminListUnifiedEventsInput struct { + AfterID *string `json:"afterId,omitempty"` + AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` + AutofixID *string `json:"autofixId,omitempty"` + BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + EventTypes []string `json:"eventTypes,omitempty"` + ExcludeEventTypes []string `json:"excludeEventTypes,omitempty"` + ExcludeServices []string `json:"excludeServices,omitempty"` FindingIds []string `json:"findingIds,omitempty"` + HideNoise *bool `json:"hideNoise,omitempty"` Limit *int `json:"limit,omitempty"` PrCanonicalID *string `json:"prCanonicalId,omitempty"` + Query *string `json:"query,omitempty"` + QueryEventTypes []string `json:"queryEventTypes,omitempty"` RunID *string `json:"runId,omitempty"` Services []string `json:"services,omitempty"` } -type EndpointsAdminListUnifiedEventsInput struct { - AfterID *string `json:"afterId,omitempty"` - AfterTimeUnix *int `json:"afterTimeUnix,omitempty"` - AutofixID *string `json:"autofixId,omitempty"` - BeforeTimeUnix *int `json:"beforeTimeUnix,omitempty"` - CampaignID *string `json:"campaignId,omitempty"` - EventTypes []string `json:"eventTypes,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - Limit *int `json:"limit,omitempty"` - PrCanonicalID *string `json:"prCanonicalId,omitempty"` - RunID *string `json:"runId,omitempty"` - Services []string `json:"services,omitempty"` +type EndpointsAdminListUnifiedEventsOutput struct { + Events []EndpointsUnifiedEventOutput `json:"events,omitempty"` + HasMore *bool `json:"hasMore,omitempty"` + NextCursorID *string `json:"nextCursorId,omitempty"` + NextCursorTime *int `json:"nextCursorTime,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminListUserRolesOutput struct { + NextKey *string `json:"nextKey,omitempty"` + Total *int `json:"total,omitempty"` + Users []EndpointsAdminUserRole `json:"users,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminMintGCPAccessTokenOutput struct { + AccessToken string `json:"accessToken"` + ExpiresAt string `json:"expiresAt"` +} + +type EndpointsAdminNewRoleUser struct { + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + Username string `json:"username"` +} + +type EndpointsAdminPostAsanaTicketConfigInput struct { + AccessToken string `json:"accessToken"` + ProjectGid string `json:"projectGid"` + WorkspaceID string `json:"workspaceId"` + WorkspaceName *string `json:"workspaceName,omitempty"` +} + +type EndpointsAdminPostAsanaTicketConfigOutput struct { + Configuration *EndpointsAdminAsanaConfigOutput `json:"configuration,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPostAzureCodeownersPreviewInput struct { + OrganizationID string `json:"organizationId"` + Path *string `json:"path,omitempty"` + ProjectID string `json:"projectId"` + Ref *string `json:"ref,omitempty"` + RepositoryID string `json:"repositoryId"` +} + +type EndpointsAdminPostAzureCodeownersPreviewOutput struct { + Applied bool `json:"applied"` + Found bool `json:"found"` + Path *string `json:"path,omitempty"` + Plans []EndpointsAzureCodeownersPolicyPlan `json:"plans,omitempty"` + Ref *string `json:"ref,omitempty"` + Rules int `json:"rules"` + Unresolved []string `json:"unresolved,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPostAzureConnectConfirmInput struct { + OrganizationIds []string `json:"organizationIds,omitempty"` + Projects string `json:"projects"` +} + +type EndpointsAdminPostAzureConnectConfirmOutput struct { + Status EndpointsAzureConnectStatus `json:"status"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPostAzureConnectInput struct { + AlsoEnableSignIn *bool `json:"alsoEnableSignIn,omitempty"` + EnableBuildGate *bool `json:"enableBuildGate,omitempty"` + EnableWorkItems *bool `json:"enableWorkItems,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + ReauthorizeHandle *string `json:"reauthorizeHandle,omitempty"` + RequestAdminConsent *bool `json:"requestAdminConsent,omitempty"` + ReturnPath *string `json:"returnPath,omitempty"` +} + +type EndpointsAdminPostAzureConnectOutput struct { + AuthorizeURL string `json:"authorizeUrl"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPostAzureConnectRetryInput struct { + OrganizationID string `json:"organizationId"` +} + +type EndpointsAdminPostAzureConnectRetryOutput struct { + Status EndpointsAzureConnectStatus `json:"status"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPostAzureCredentialsInput struct { + ClientID string `json:"clientId"` + ClientSecret *string `json:"clientSecret,omitempty"` + Organization *string `json:"organization,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + TenantID string `json:"tenantId"` + WorkItemType *string `json:"workItemType,omitempty"` +} + +type EndpointsAdminPostAzureCredentialsOutput struct { + ClientID string `json:"clientId"` + ClientSecret *string `json:"clientSecret,omitempty"` + CreatedAt string `json:"createdAt"` + Organization *string `json:"organization,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + TenantID string `json:"tenantId"` + UpdatedAt string `json:"updatedAt"` + Version *string `json:"version,omitempty"` + WorkItemType *string `json:"workItemType,omitempty"` +} + +type EndpointsAdminPostAzureInstallOutput struct { + DryRun *bool `json:"dryRun,omitempty"` + Failures []EndpointsAdminAzureHookFailure `json:"failures,omitempty"` + HooksCreated *int `json:"hooksCreated,omitempty"` + HooksReplaced *int `json:"hooksReplaced,omitempty"` + HooksSkipped *int `json:"hooksSkipped,omitempty"` + Outcome *string `json:"outcome,omitempty"` + Projects []EndpointsAdminAzureProjectHooksHealth `json:"projects,omitempty"` + RouterManaged *bool `json:"routerManaged,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPostLinearTicketConfigInput struct { + AutoCreate *bool `json:"autoCreate,omitempty"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` + PriorityThreshold *string `json:"priorityThreshold,omitempty"` + TeamID string `json:"teamId"` +} + +type EndpointsAdminPostLinearTicketConfigOutput struct { + Configuration *EndpointsAdminLinearConfigOutput `json:"configuration,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPutFixEffortInput struct { + FixEffort EndpointsAdminFixEffortMapInput `json:"fixEffort"` +} + +type EndpointsAdminPutFixEffortOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPutPRGateSettingsInput struct { + AllowApprovingReviews *bool `json:"allowApprovingReviews,omitempty"` + AllowRequestChangesReviews *bool `json:"allowRequestChangesReviews,omitempty"` + CvssEnforcement *bool `json:"cvssEnforcement,omitempty"` + Enabled bool `json:"enabled"` + ExpectedPrScansEnabled *bool `json:"expectedPrScansEnabled,omitempty"` + ExpectedPushScansEnabled *bool `json:"expectedPushScansEnabled,omitempty"` + FailOnIncompleteCoverage *bool `json:"failOnIncompleteCoverage,omitempty"` + FindingsPolicy *EndpointsPRGateFindingsPolicy `json:"findingsPolicy,omitempty"` + MinPriority ModelsPriorityEnum `json:"minPriority"` + Mode *string `json:"mode,omitempty"` + PrReviewsEnabled *bool `json:"prReviewsEnabled,omitempty"` + PrScansEnabled *bool `json:"prScansEnabled,omitempty"` + PushScansEnabled *bool `json:"pushScansEnabled,omitempty"` + ScaBlockCvssThreshold *float64 `json:"scaBlockCvssThreshold,omitempty"` +} + +type EndpointsAdminPutPRGateSettingsOutput struct { + AllowApprovingReviews *bool `json:"allowApprovingReviews,omitempty"` + AllowRequestChangesReviews *bool `json:"allowRequestChangesReviews,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + CvssEnforcement *bool `json:"cvssEnforcement,omitempty"` + Enabled bool `json:"enabled"` + FailOnIncompleteCoverage *bool `json:"failOnIncompleteCoverage,omitempty"` + FindingsPolicy EndpointsPRGateFindingsPolicy `json:"findingsPolicy"` + MinPriority ModelsPriorityEnum `json:"minPriority"` + Mode *string `json:"mode,omitempty"` + PrReviewsEnabled *bool `json:"prReviewsEnabled,omitempty"` + PrScansEnabled *bool `json:"prScansEnabled,omitempty"` + PushScansEnabled *bool `json:"pushScansEnabled,omitempty"` + ScaBlockCvssThreshold *float64 `json:"scaBlockCvssThreshold,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPutRBACPreferencesInput struct { + DefaultInviteeRole string `json:"defaultInviteeRole"` + TeamScopedRoles []string `json:"teamScopedRoles,omitempty"` +} + +type EndpointsAdminPutRBACPreferencesOutput struct { + CreatedAt *string `json:"createdAt,omitempty"` + DefaultInviteeRole string `json:"defaultInviteeRole"` + TeamScopedRoles []string `json:"teamScopedRoles,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminPutRoutingExclusionsInput struct { + Users []EndpointsAdminRoutingExclusionUser `json:"users,omitempty"` +} + +type EndpointsAdminPutSecurityOwnerInput struct { + TeamID string `json:"teamId"` + UserID string `json:"userId"` +} + +type EndpointsAdminPutThreatNotificationDestinationsInput struct { + MicrosoftTeamsWebhookURL *string `json:"microsoftTeamsWebhookUrl,omitempty"` + NullifySharedSlack *bool `json:"nullifySharedSlack,omitempty"` + TenantSlackChannelID *string `json:"tenantSlackChannelId,omitempty"` +} + +type EndpointsAdminPutThreatNotificationDestinationsOutput struct { + Destinations EndpointsThreatNotificationDestinations `json:"destinations"` +} + +type EndpointsAdminQueryFindingsFrameworksOutput struct { + Frameworks []ModelsFrameworkFindingsSummary `json:"frameworks,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminQueryFindingsInput struct { + Query ModelsUnifiedFindingsQuery `json:"query"` +} + +type EndpointsAdminQueryFindingsMetricsByRepositoryInput struct { + Query ModelsLimitedUnifiedFindingsQuery `json:"query"` +} + +type EndpointsAdminQueryFindingsMetricsByRepositoryOutput struct { + Repositories []ModelsFindingsRepositoryMetrics `json:"repositories,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminQueryFindingsMetricsInput struct { + IncludeFunnel *bool `json:"includeFunnel,omitempty"` + Query ModelsLimitedUnifiedFindingsQuery `json:"query"` +} + +type EndpointsAdminQueryFindingsMetricsOutput struct { + FindingsAnalysis ModelsFindingsMetrics `json:"findingsAnalysis"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminQueryFindingsOutput struct { + Findings []ModelsUnifiedFindingPreview `json:"findings,omitempty"` + HasMoreData bool `json:"hasMoreData"` + Page int `json:"page"` + ScrollID *string `json:"scrollId,omitempty"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminQueryFindingsProgressInput struct { + Query ModelsUnifiedFindingsQuery `json:"query"` +} + +type EndpointsAdminQueryFindingsProgressOutput struct { + HasMoreData bool `json:"hasMoreData"` + Progress []ModelsFindingProgress `json:"progress,omitempty"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminQueryPullRequestMetricsInput struct { + Query ModelsPullRequestMetricsQuery `json:"query"` +} + +type EndpointsAdminQueryPullRequestMetricsOutput struct { + PullRequests ModelsPullRequestMetrics `json:"pullRequests"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminQueryPullRequestsInput struct { + Query *ModelsFindingPullRequestQuery `json:"query,omitempty"` +} + +type EndpointsAdminQueryPullRequestsOutput struct { + PullRequests []ModelsFindingPullRequestRecord `json:"pullRequests,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminQueryTicketMetricsInput struct { + Query ModelsTicketMetricsQuery `json:"query"` +} + +type EndpointsAdminQueryTicketMetricsOutput struct { + Tickets ModelsTicketMetrics `json:"tickets"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminReactivateUserInput struct { + UserID string `json:"userId"` +} + +type EndpointsAdminReactivateUserOutput struct { + LifecycleState string `json:"lifecycleState"` + UserID string `json:"userId"` + Username *string `json:"username,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminRefreshPullRequestsCIInput struct { + Ids []string `json:"ids,omitempty"` +} + +type EndpointsAdminRefreshPullRequestsCIOutput struct { + FailedIds []string `json:"failedIds,omitempty"` + RefreshedIds []string `json:"refreshedIds,omitempty"` + RejectedIds []string `json:"rejectedIds,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminRevokeSupportAccessOutput struct { + Revoked *EndpointsAdminSupportAccessGrant `json:"revoked,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAdminRotateIntegrationConnectionInput struct { + ExpectedAuthorityRevision *int `json:"expectedAuthorityRevision,omitempty"` + Fields map[string]string `json:"fields,omitempty"` +} + +type EndpointsAdminRotateIntegrationConnectionOutput struct { + Connection *EndpointsIntegrationConnectionInstanceView `json:"connection,omitempty"` +} + +type EndpointsAdminRoutingExclusion struct { + CurrentLogin string `json:"currentLogin"` + GitUserRefs []string `json:"gitUserRefs,omitempty"` + JiraID string `json:"jiraId"` + LinearID string `json:"linearId"` + Login string `json:"login"` + ProviderID ModelsProviderID `json:"providerId"` + ProviderUserID string `json:"providerUserId"` + SlackID string `json:"slackId"` + Source string `json:"source"` + TeamsID string `json:"teamsId"` + Unresolved []string `json:"unresolved,omitempty"` + UserID string `json:"userId"` +} + +type EndpointsAdminRoutingExclusionUser struct { + Login string `json:"login"` + ProviderID ModelsProviderID `json:"providerId"` + Source *string `json:"source,omitempty"` +} + +type EndpointsAdminRoutingExclusionsOutput struct { + Fallback EndpointsAdminRoutingFallback `json:"fallback"` + Users []EndpointsAdminRoutingExclusion `json:"users,omitempty"` +} + +type EndpointsAdminRoutingFallback struct { + Eligible bool `json:"eligible"` + GitUserRefs []string `json:"gitUserRefs,omitempty"` + Login string `json:"login"` + Name string `json:"name"` + ProviderID ModelsProviderID `json:"providerId"` + ProviderUserID string `json:"providerUserId"` + Reason string `json:"reason"` + SlackID string `json:"slackId"` + TeamsID string `json:"teamsId"` + UserID string `json:"userId"` } -type EndpointsAdminListUnifiedEventsOutput struct { - Events []EndpointsUnifiedEventOutput `json:"events,omitempty"` - HasMore *bool `json:"hasMore,omitempty"` - NextCursorID *string `json:"nextCursorId,omitempty"` - NextCursorTime *int `json:"nextCursorTime,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsAdminSecurityOwnerContact struct { + InteractionCount int64 `json:"interactionCount"` + Name string `json:"name"` + UserID string `json:"userId"` } -type EndpointsAdminPostAzureCredentialsInput struct { - ClientID string `json:"clientId"` - ClientSecret *string `json:"clientSecret,omitempty"` - TenantID string `json:"tenantId"` +type EndpointsAdminSecurityOwnerOutput struct { + ResolvedUserID string `json:"resolvedUserId"` + Suggestions []EndpointsAdminSecurityOwnerContact `json:"suggestions,omitempty"` + TeamID string `json:"teamId"` + UserID string `json:"userId"` } -type EndpointsAdminPostAzureCredentialsOutput struct { - ClientID string `json:"clientId"` - ClientSecret *string `json:"clientSecret,omitempty"` +type EndpointsAdminSetUserRoleTarget struct { + NewUser *EndpointsAdminNewRoleUser `json:"newUser,omitempty"` + UserID *string `json:"userId,omitempty"` +} + +type EndpointsAdminSupportAccessGrant struct { + Actor string `json:"actor"` + Agent *string `json:"agent,omitempty"` CreatedAt string `json:"createdAt"` - TenantID string `json:"tenantId"` - UpdatedAt string `json:"updatedAt"` - Version *string `json:"version,omitempty"` + ExpiresAt string `json:"expiresAt"` + ID string `json:"id"` + Reason string `json:"reason"` + RevokedAt *string `json:"revokedAt,omitempty"` + RevokedBy *string `json:"revokedBy,omitempty"` + Role string `json:"role"` + Username string `json:"username"` } -type EndpointsAdminPostAzureInstallOutput struct { +type EndpointsAdminSuspendAzureInstallationInput struct { + OrganizationID string `json:"organizationId"` + Suspended bool `json:"suspended"` +} + +type EndpointsAdminSuspendAzureInstallationOutput struct { + Failures []string `json:"failures,omitempty"` + InstallationsAffected int `json:"installationsAffected"` + SubscriptionsAffected int `json:"subscriptionsAffected"` + Suspended bool `json:"suspended"` Version *string `json:"version,omitempty"` } -type EndpointsAdminPutFixEffortInput struct { - FixEffort EndpointsAdminFixEffortMapInput `json:"fixEffort"` +type EndpointsAdminTestAzureInstallationInput struct { + OrganizationID string `json:"organizationId"` } -type EndpointsAdminPutFixEffortOutput struct { +type EndpointsAdminTestAzureInstallationOutput struct { + Checklist []EndpointsAzureConnectChecklistItem `json:"checklist,omitempty"` + Ok bool `json:"ok"` Version *string `json:"version,omitempty"` } -type EndpointsAdminQueryFindingsInput struct { - Query ModelsUnifiedFindingsQuery `json:"query"` +type EndpointsAdminTestIntegrationConnectionOutput struct { + Healthy *bool `json:"healthy,omitempty"` + LastError *string `json:"lastError,omitempty"` + Status *string `json:"status,omitempty"` } -type EndpointsAdminQueryFindingsMetricsInput struct { - Query ModelsLimitedUnifiedFindingsQuery `json:"query"` +type EndpointsAdminTestIntegrationOutput struct { + Healthy *bool `json:"healthy,omitempty"` + LastError *string `json:"lastError,omitempty"` + Status *string `json:"status,omitempty"` } -type EndpointsAdminQueryFindingsMetricsOutput struct { - FindingsAnalysis ModelsFindingsMetrics `json:"findingsAnalysis"` - Version *string `json:"version,omitempty"` +type EndpointsAdminTriageContextCensusInput struct { + FindingIds []string `json:"findingIds,omitempty"` } -type EndpointsAdminQueryFindingsOutput struct { - Findings []ModelsUnifiedFindingPreview `json:"findings,omitempty"` - HasMoreData bool `json:"hasMoreData"` - Page int `json:"page"` - ScrollID *string `json:"scrollId,omitempty"` - Total int `json:"total"` +type EndpointsAdminTriageContextCensusOutput struct { + Blind []EndpointsTriageContextCensusFinding `json:"blind,omitempty"` + Requested int `json:"requested"` + TenantSummary []EndpointsTriageContextCensusSummary `json:"tenantSummary,omitempty"` Version *string `json:"version,omitempty"` } @@ -327,41 +1279,55 @@ type EndpointsAdminUpsertAWSSettingsInput struct { type EndpointsAdminUpsertAWSSettingsOutput struct { AwsAccounts []ModelsAWSAccountWithStatus `json:"awsAccounts,omitempty"` - ExternalID *string `json:"externalId,omitempty"` + ExternalID string `json:"externalId"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` LastValidationStatus *string `json:"lastValidationStatus,omitempty"` Message *string `json:"message,omitempty"` - NullifyKMSKeyArn *string `json:"nullifyKMSKeyArn,omitempty"` - NullifyRoleArn *string `json:"nullifyRoleArn,omitempty"` - NullifyS3Bucket *string `json:"nullifyS3Bucket,omitempty"` - OverallStatus *string `json:"overallStatus,omitempty"` + NullifyKMSKeyArn string `json:"nullifyKMSKeyArn"` + NullifyRoleArn string `json:"nullifyRoleArn"` + NullifyS3Bucket string `json:"nullifyS3Bucket"` + OverallStatus string `json:"overallStatus"` +} + +type EndpointsAdminUpsertAzureInstallationInput struct { + OrganizationID string `json:"organizationId"` + ProjectID string `json:"projectId"` +} + +type EndpointsAdminUpsertAzureInstallationOutput struct { + Installation EndpointsAdminAzureInstallation `json:"installation"` + Version *string `json:"version,omitempty"` + WebhookSecret string `json:"webhookSecret"` } type EndpointsAdminUpsertAzureSettingsInput struct { + AuthMode string `json:"authMode"` ClientID *string `json:"clientId,omitempty"` ClientSecret *string `json:"clientSecret,omitempty"` DisplayName *string `json:"displayName,omitempty"` Subscriptions []ModelsAzureSubscriptionInput `json:"subscriptions,omitempty"` TenantID string `json:"tenantId"` - UseManagedIdentity *bool `json:"useManagedIdentity,omitempty"` } type EndpointsAdminUpsertAzureSettingsOutput struct { + AuthMode string `json:"authMode"` ClientID *string `json:"clientId,omitempty"` DisplayName *string `json:"displayName,omitempty"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` LastValidationStatus *string `json:"lastValidationStatus,omitempty"` Message *string `json:"message,omitempty"` - OverallStatus *string `json:"overallStatus,omitempty"` + OverallStatus string `json:"overallStatus"` Subscriptions []ModelsAzureSubscriptionWithStatus `json:"subscriptions,omitempty"` - TenantID *string `json:"tenantId,omitempty"` - UseManagedIdentity *bool `json:"useManagedIdentity,omitempty"` + TenantID string `json:"tenantId"` } type EndpointsAdminUpsertGCPSettingsInput struct { + DiscoveryScope *string `json:"discoveryScope,omitempty"` DisplayName *string `json:"displayName,omitempty"` + FolderID *string `json:"folderId,omitempty"` GkeClusterOidcIssuerUrls []string `json:"gkeClusterOidcIssuerUrls,omitempty"` GkeServiceAccountUniqueID *string `json:"gkeServiceAccountUniqueId,omitempty"` + OrganizationID *string `json:"organizationId,omitempty"` Projects []ModelsGCPProjectInput `json:"projects,omitempty"` WorkloadIdentityProvider string `json:"workloadIdentityProvider"` WorkloadIdentityServiceAccountEmail string `json:"workloadIdentityServiceAccountEmail"` @@ -375,10 +1341,40 @@ type EndpointsAdminUpsertGCPSettingsOutput struct { LastValidationStatus *string `json:"lastValidationStatus,omitempty"` Message *string `json:"message,omitempty"` NullifyK8sCollectorRoleArn *string `json:"nullifyK8sCollectorRoleArn,omitempty"` - OverallStatus *string `json:"overallStatus,omitempty"` + OverallStatus string `json:"overallStatus"` Projects []ModelsGCPProjectWithStatus `json:"projects,omitempty"` - WorkloadIdentityProvider *string `json:"workloadIdentityProvider,omitempty"` - WorkloadIdentityServiceAccountEmail *string `json:"workloadIdentityServiceAccountEmail,omitempty"` + WorkloadIdentityProvider string `json:"workloadIdentityProvider"` + WorkloadIdentityServiceAccountEmail string `json:"workloadIdentityServiceAccountEmail"` +} + +type EndpointsAdminUpsertK8SClusterInput struct { + CloudAccountID *string `json:"cloudAccountId,omitempty"` + ClusterName string `json:"clusterName"` + ClusterType string `json:"clusterType"` + CollectConfigMaps *bool `json:"collectConfigMaps,omitempty"` + CollectSecrets *bool `json:"collectSecrets,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Region *string `json:"region,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` +} + +type EndpointsAdminUpsertK8SClusterOutput struct { + Cluster ModelsK8SClusterWithStatus `json:"cluster"` + Created bool `json:"created"` +} + +type EndpointsAdminUpsertK8SSettingsInput struct { + Clusters []ModelsK8SClusterInput `json:"clusters,omitempty"` + NullifyRoleArn *string `json:"nullifyRoleArn,omitempty"` +} + +type EndpointsAdminUpsertK8SSettingsOutput struct { + Clusters []ModelsK8SClusterWithStatus `json:"clusters,omitempty"` + LastValidatedAt *string `json:"lastValidatedAt,omitempty"` + LastValidationStatus *string `json:"lastValidationStatus,omitempty"` + Message *string `json:"message,omitempty"` + NullifyRoleArn *string `json:"nullifyRoleArn,omitempty"` + OverallStatus string `json:"overallStatus"` } type EndpointsAdminUsageAggregateGroup struct { @@ -443,6 +1439,60 @@ type EndpointsAdminUsageMetricsTimeseriesOutput struct { To string `json:"to"` } +type EndpointsAdminUserRole struct { + Email *string `json:"email,omitempty"` + IsActivated *bool `json:"isActivated,omitempty"` + IsCaller *bool `json:"isCaller,omitempty"` + LifecycleState *string `json:"lifecycleState,omitempty"` + Name *string `json:"name,omitempty"` + OperatorGranted *bool `json:"operatorGranted,omitempty"` + Role string `json:"role"` + UserID string `json:"userId"` + Username *string `json:"username,omitempty"` +} + +type EndpointsAdminUserSource string + +const ( + EndpointsAdminUserSourceNullify EndpointsAdminUserSource = "nullify" + EndpointsAdminUserSourceGitProvider EndpointsAdminUserSource = "git_provider" + EndpointsAdminUserSourceSlack EndpointsAdminUserSource = "slack" + EndpointsAdminUserSourceJira EndpointsAdminUserSource = "jira" + EndpointsAdminUserSourceTeams EndpointsAdminUserSource = "teams" +) + +type EndpointsAdminUserWithRole struct { + Asana *ModelsAsanaUserProvider `json:"asana,omitempty"` + Azure *ModelsAzureUserProvider `json:"azure,omitempty"` + AzureEntra *ModelsAzureEntraUserProvider `json:"azureEntra,omitempty"` + Bitbucket *ModelsBitbucketUserProvider `json:"bitbucket,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + Deleted *bool `json:"deleted,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Email *string `json:"email,omitempty"` + Github *ModelsGitHubUserProvider `json:"github,omitempty"` + Gitlab *ModelsGitLabUserProvider `json:"gitlab,omitempty"` + GoogleWorkspace *ModelsGoogleWorkspaceUserProvider `json:"googleWorkspace,omitempty"` + ID string `json:"id"` + IsBot bool `json:"isBot"` + IsRestricted *bool `json:"isRestricted,omitempty"` + Jira *ModelsJiraUserProvider `json:"jira,omitempty"` + LastUpdatedBy *string `json:"lastUpdatedBy,omitempty"` + Linear *ModelsLinearUserProvider `json:"linear,omitempty"` + Name string `json:"name"` + Okta *ModelsOktaUserProvider `json:"okta,omitempty"` + Provider ModelsUserProvider `json:"provider"` + RealName *string `json:"realName,omitempty"` + Role *string `json:"role,omitempty"` + Slack *ModelsSlackUserProvider `json:"slack,omitempty"` + Slug string `json:"slug"` + Source *EndpointsAdminUserSource `json:"source,omitempty"` + Teams *ModelsTeamsUserProvider `json:"teams,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + Username string `json:"username"` +} + type EndpointsAdminValidateAWSRoleInput struct { AccountIds []string `json:"accountIds,omitempty"` Onboarding *bool `json:"onboarding,omitempty"` @@ -450,10 +1500,24 @@ type EndpointsAdminValidateAWSRoleInput struct { } type EndpointsAdminValidateAWSRoleOutput struct { + ConnectorPermissionGaps []ModelsAWSConnectorPermissionGap `json:"connectorPermissionGaps,omitempty"` + ConnectorPermissionProbe *EndpointsConnectorPermissionProbeStatus `json:"connectorPermissionProbe,omitempty"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` LastValidationStatus *string `json:"lastValidationStatus,omitempty"` - OverallStatus *string `json:"overallStatus,omitempty"` - Results map[string]EndpointsAccountValidationResult `json:"results,omitempty"` + OverallStatus string `json:"overallStatus"` + Results map[string]EndpointsAdminAccountValidationResult `json:"results,omitempty"` +} + +type EndpointsAdminValidateAzureInput struct { + SubscriptionIds []string `json:"subscriptionIds,omitempty"` +} + +type EndpointsAdminValidateAzureOutput struct { + ConnectorPermissionProbe *EndpointsConnectorPermissionProbeStatus `json:"connectorPermissionProbe,omitempty"` + LastValidatedAt *string `json:"lastValidatedAt,omitempty"` + LastValidationStatus *EndpointsCloudValidationStatus `json:"lastValidationStatus,omitempty"` + OverallStatus *EndpointsCloudValidationStatus `json:"overallStatus,omitempty"` + Results map[string]EndpointsAzureSubscriptionValidationResult `json:"results,omitempty"` } type EndpointsAdminValidateGCPInput struct { @@ -461,12 +1525,233 @@ type EndpointsAdminValidateGCPInput struct { } type EndpointsAdminValidateGCPOutput struct { + ConnectorPermissionProbe *EndpointsConnectorPermissionProbeStatus `json:"connectorPermissionProbe,omitempty"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` LastValidationStatus *EndpointsCloudValidationStatus `json:"lastValidationStatus,omitempty"` OverallStatus *EndpointsCloudValidationStatus `json:"overallStatus,omitempty"` Results map[string]EndpointsGCPProjectValidationResult `json:"results,omitempty"` } +type EndpointsAzureCodeownersPolicyPlan struct { + FilenamePatterns []string `json:"filenamePatterns,omitempty"` + Owners []string `json:"owners,omitempty"` + RequiredReviewerIds []string `json:"requiredReviewerIds,omitempty"` + SourceLine int `json:"sourceLine"` + SourcePattern string `json:"sourcePattern"` +} + +type EndpointsAzureConnectChecklistCode string + +const ( + EndpointsAzureConnectChecklistCodeNotCollectionAdmin EndpointsAzureConnectChecklistCode = "not_collection_admin" + EndpointsAzureConnectChecklistCodeAuthorizationExpired EndpointsAzureConnectChecklistCode = "authorization_expired" + EndpointsAzureConnectChecklistCodeProjectsExcluded EndpointsAzureConnectChecklistCode = "projects_excluded" +) + +type EndpointsAzureConnectChecklistItem struct { + Code *EndpointsAzureConnectChecklistCode `json:"code,omitempty"` + Fix *string `json:"fix,omitempty"` + Message *string `json:"message,omitempty"` + OrganizationID string `json:"organizationId"` + ProjectID *string `json:"projectId,omitempty"` + State EndpointsAzureConnectChecklistState `json:"state"` + Step EndpointsAzureConnectChecklistStep `json:"step"` +} + +type EndpointsAzureConnectChecklistState string + +const ( + EndpointsAzureConnectChecklistStatePending EndpointsAzureConnectChecklistState = "pending" + EndpointsAzureConnectChecklistStateOk EndpointsAzureConnectChecklistState = "ok" + EndpointsAzureConnectChecklistStateFailed EndpointsAzureConnectChecklistState = "failed" +) + +type EndpointsAzureConnectChecklistStep string + +const ( + EndpointsAzureConnectChecklistStepEntitlement EndpointsAzureConnectChecklistStep = "entitlement" + EndpointsAzureConnectChecklistStepServiceHooksPermission EndpointsAzureConnectChecklistStep = "service_hooks_permission" + EndpointsAzureConnectChecklistStepGitPermission EndpointsAzureConnectChecklistStep = "git_permission" + EndpointsAzureConnectChecklistStepAutofixBranchPermission EndpointsAzureConnectChecklistStep = "autofix_branch_permission" + EndpointsAzureConnectChecklistStepPermissionCleanup EndpointsAzureConnectChecklistStep = "permission_cleanup" + EndpointsAzureConnectChecklistStepProjectPermission EndpointsAzureConnectChecklistStep = "project_permission" + EndpointsAzureConnectChecklistStepWorkItemPermission EndpointsAzureConnectChecklistStep = "work_item_permission" + EndpointsAzureConnectChecklistStepBuildPermission EndpointsAzureConnectChecklistStep = "build_permission" + EndpointsAzureConnectChecklistStepLibraryPermission EndpointsAzureConnectChecklistStep = "library_permission" + EndpointsAzureConnectChecklistStepAccessProbeRead EndpointsAzureConnectChecklistStep = "access_probe_read" + EndpointsAzureConnectChecklistStepAccessProbeWrite EndpointsAzureConnectChecklistStep = "access_probe_write" + EndpointsAzureConnectChecklistStepAccessProbeWorkItems EndpointsAzureConnectChecklistStep = "access_probe_work_items" + EndpointsAzureConnectChecklistStepOrgRosterRead EndpointsAzureConnectChecklistStep = "org_roster_read" + EndpointsAzureConnectChecklistStepOrgMembershipRead EndpointsAzureConnectChecklistStep = "org_membership_read" + EndpointsAzureConnectChecklistStepCodeSearchAvailable EndpointsAzureConnectChecklistStep = "code_search_available" + EndpointsAzureConnectChecklistStepRouteBinding EndpointsAzureConnectChecklistStep = "route_binding" + EndpointsAzureConnectChecklistStepSubscriptions EndpointsAzureConnectChecklistStep = "subscriptions" + EndpointsAzureConnectChecklistStepRepositories EndpointsAzureConnectChecklistStep = "repositories" + EndpointsAzureConnectChecklistStepBranchPolicy EndpointsAzureConnectChecklistStep = "branch_policy" + EndpointsAzureConnectChecklistStepFirstScan EndpointsAzureConnectChecklistStep = "first_scan" + EndpointsAzureConnectChecklistStepMicrosoftSignIn EndpointsAzureConnectChecklistStep = "microsoft_sign_in" +) + +type EndpointsAzureConnectEligibility string + +const ( + EndpointsAzureConnectEligibilityAllowed EndpointsAzureConnectEligibility = "allowed" + EndpointsAzureConnectEligibilityDenied EndpointsAzureConnectEligibility = "denied" + EndpointsAzureConnectEligibilityUnavailable EndpointsAzureConnectEligibility = "unavailable" +) + +type EndpointsAzureConnectEligibilityReason string + +const ( + EndpointsAzureConnectEligibilityReasonNotCollectionAdmin EndpointsAzureConnectEligibilityReason = "not_collection_admin" + EndpointsAzureConnectEligibilityReasonAuthorizationExpired EndpointsAzureConnectEligibilityReason = "authorization_expired" + EndpointsAzureConnectEligibilityReasonCheckFailed EndpointsAzureConnectEligibilityReason = "check_failed" + EndpointsAzureConnectEligibilityReasonNotChecked EndpointsAzureConnectEligibilityReason = "not_checked" + EndpointsAzureConnectEligibilityReasonDisconnected EndpointsAzureConnectEligibilityReason = "disconnected" + EndpointsAzureConnectEligibilityReasonOtherDirectory EndpointsAzureConnectEligibilityReason = "other_directory" + EndpointsAzureConnectEligibilityReasonNotEntraBacked EndpointsAzureConnectEligibilityReason = "not_entra_backed" +) + +type EndpointsAzureConnectOrganization struct { + Connected *bool `json:"connected,omitempty"` + Eligibility EndpointsAzureConnectEligibility `json:"eligibility"` + EligibilityReason *EndpointsAzureConnectEligibilityReason `json:"eligibilityReason,omitempty"` + EntraTenantID string `json:"entraTenantId"` + ID string `json:"id"` + Name string `json:"name"` + Selected *bool `json:"selected,omitempty"` +} + +type EndpointsAzureConnectStatus string + +const ( + EndpointsAzureConnectStatusDiscovering EndpointsAzureConnectStatus = "discovering" + EndpointsAzureConnectStatusPendingSelection EndpointsAzureConnectStatus = "pending_selection" + EndpointsAzureConnectStatusConnecting EndpointsAzureConnectStatus = "connecting" + EndpointsAzureConnectStatusDone EndpointsAzureConnectStatus = "done" + EndpointsAzureConnectStatusFailed EndpointsAzureConnectStatus = "failed" +) + +type EndpointsAzureSubscriptionValidationResult struct { + DisplayName *string `json:"displayName,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + IsValid *bool `json:"isValid,omitempty"` + State *string `json:"state,omitempty"` + Status *EndpointsAzureSubscriptionValidationStatus `json:"status,omitempty"` + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +type EndpointsAzureSubscriptionValidationStatus string + +const ( + EndpointsAzureSubscriptionValidationStatusValid EndpointsAzureSubscriptionValidationStatus = "valid" + EndpointsAzureSubscriptionValidationStatusInvalid EndpointsAzureSubscriptionValidationStatus = "invalid" +) + +type EndpointsBoardImpactCount struct { + BoardID *string `json:"boardId,omitempty"` + Count *int `json:"count,omitempty"` +} + +type EndpointsBuildkiteOrganization struct { + Name string `json:"name"` + Slug string `json:"slug"` +} + +type EndpointsBulkActionDryRunResult struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + Count *int64 `json:"count,omitempty"` + Sample []EndpointsFindingTicketRow `json:"sample,omitempty"` +} + +type EndpointsBulkActionStartResult struct { + OperationID *string `json:"operationId,omitempty"` +} + +type EndpointsBulkAddCommentParams struct { + Comment string `json:"comment"` +} + +type EndpointsBulkCloseParams struct { + Comment *string `json:"comment,omitempty"` + IncludeManualSource *bool `json:"includeManualSource,omitempty"` + SettingsOutOfScopeFindingType *DatabaseFindingType `json:"settingsOutOfScopeFindingType,omitempty"` +} + +type EndpointsBulkMoveParams struct { + TargetBoardID string `json:"targetBoardId"` +} + +type EndpointsBulkOperationStatusEntry struct { + ActionType *DatabaseTicketBulkActionType `json:"actionType,omitempty"` + Actor *DatabaseTicketAuditActor `json:"actor,omitempty"` + ActorID *string `json:"actorId,omitempty"` + AffectedCount *int32 `json:"affectedCount,omitempty"` + CancellationRequestedAt *string `json:"cancellationRequestedAt,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + ErrorCount *int32 `json:"errorCount,omitempty"` + FilterSnapshotJson *string `json:"filterSnapshotJson,omitempty"` + ID *string `json:"id,omitempty"` + ParamsJson *string `json:"paramsJson,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *DatabaseTicketBulkOperationStatus `json:"status,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type EndpointsBulkReassignAssigneeParams struct { + TargetAssigneeEmail string `json:"targetAssigneeEmail"` +} + +type EndpointsBulkReassignTeamParams struct { + TargetTeamID string `json:"targetTeamId"` +} + +type EndpointsBulkRelabelParams struct { + AddLabels []string `json:"addLabels,omitempty"` + RemoveLabels []string `json:"removeLabels,omitempty"` +} + +type EndpointsBulkReopenParams struct { +} + +type EndpointsBulkResyncParams struct { +} + +type EndpointsBulkSetPriorityParams struct { + TargetPriority ModelsPriorityLabel `json:"targetPriority"` +} + +type EndpointsCSPMScanCadenceOutput struct { + CspmScanCadence string `json:"cspmScanCadence"` +} + +type EndpointsCapabilityFitPublic struct { + Reason string `json:"reason"` + RequiresConfirmation bool `json:"requiresConfirmation"` + Score int `json:"score"` + Strength string `json:"strength"` +} + +type EndpointsCatalogConnector struct { + Auth *string `json:"auth,omitempty"` + Capability *string `json:"capability,omitempty"` + Category *string `json:"category,omitempty"` + ConfigSchema []ConnectorsConfigField `json:"configSchema,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FeatureFlag *string `json:"featureFlag,omitempty"` + IconRef *string `json:"iconRef,omitempty"` + InstanceCount *int `json:"instanceCount,omitempty"` + LastError *string `json:"lastError,omitempty"` + LastVerifiedAt *string `json:"lastVerifiedAt,omitempty"` + Lifecycle *ConnectorsLifecycleOps `json:"lifecycle,omitempty"` + MultiInstance *bool `json:"multiInstance,omitempty"` + ProviderID *string `json:"providerId,omitempty"` + Status *string `json:"status,omitempty"` +} + type EndpointsCloudValidationStatus string const ( @@ -474,6 +1759,14 @@ const ( EndpointsCloudValidationStatusUnhealthy EndpointsCloudValidationStatus = "unhealthy" ) +type EndpointsConnectorPermissionProbeStatus string + +const ( + EndpointsConnectorPermissionProbeStatusComplete EndpointsConnectorPermissionProbeStatus = "complete" + EndpointsConnectorPermissionProbeStatusIncomplete EndpointsConnectorPermissionProbeStatus = "incomplete" + EndpointsConnectorPermissionProbeStatusNotProbed EndpointsConnectorPermissionProbeStatus = "not_probed" +) + type EndpointsContextEnvironment string const ( @@ -524,6 +1817,10 @@ type EndpointsDeleteCircleCIIntegrationOutput struct { Version string `json:"version"` } +type EndpointsDeleteIdentityScimCredentialOutput struct { + Version *string `json:"version,omitempty"` +} + type EndpointsDeleteJenkinsIntegrationOutput struct { Message string `json:"message"` Version string `json:"version"` @@ -541,6 +1838,14 @@ type EndpointsDeleteTeamOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsDeleteTicketSavedFilterOutput struct { + Deleted bool `json:"deleted"` +} + +type EndpointsDeleteUIPreferencesOutput struct { + Deleted bool `json:"deleted"` +} + type EndpointsDeleteUISavedViewOutput struct { ID string `json:"id"` } @@ -549,13 +1854,51 @@ type EndpointsDeleteUserErasureOutput struct { Report *EndpointsErasureReport `json:"report,omitempty"` } -type EndpointsErasureReport struct { - AdminUserDeleted *bool `json:"adminUserDeleted,omitempty"` - AuditLogsAnonymized *int64 `json:"auditLogsAnonymized,omitempty"` - ErasedAt *string `json:"erasedAt,omitempty"` - PrivacyAcknowledgmentsDeleted *int64 `json:"privacyAcknowledgmentsDeleted,omitempty"` - TeamMembershipsDeleted *int64 `json:"teamMembershipsDeleted,omitempty"` - UserID *string `json:"userId,omitempty"` +type EndpointsDeleteUserMappingOutput struct { + UserMapping *ModelsUserMapping `json:"userMapping,omitempty"` +} + +type EndpointsEffectiveSCPMGateSettings struct { + DetectionsFeatureFlagKey string `json:"detectionsFeatureFlagKey"` + ExemptRuleGatePriority ModelsPriorityLabel `json:"exemptRuleGatePriority"` + FindingsPolicy EndpointsPRGateFindingsPolicy `json:"findingsPolicy"` + FloorExemptRuleIds []string `json:"floorExemptRuleIds,omitempty"` + GateEnabled bool `json:"gateEnabled"` + MinPriority ModelsPriorityEnum `json:"minPriority"` + Mode *string `json:"mode,omitempty"` + PlatformEnforcementFloor ModelsSeverity `json:"platformEnforcementFloor"` +} + +type EndpointsErasureReport struct { + AdminUserDeleted *bool `json:"adminUserDeleted,omitempty"` + AuditLogsAnonymized *int64 `json:"auditLogsAnonymized,omitempty"` + ErasedAt *string `json:"erasedAt,omitempty"` + PrivacyAcknowledgmentsDeleted *int64 `json:"privacyAcknowledgmentsDeleted,omitempty"` + TeamMembershipsDeleted *int64 `json:"teamMembershipsDeleted,omitempty"` + UserID *string `json:"userId,omitempty"` +} + +type EndpointsExternalWriteView struct { + Enabled bool `json:"enabled"` + LockReason *string `json:"lockReason,omitempty"` + Locked bool `json:"locked"` +} + +type EndpointsExternalWritesOutput struct { + ExternalWrites EndpointsExternalWritesView `json:"externalWrites"` +} + +type EndpointsExternalWritesView struct { + GitWrites EndpointsExternalWriteView `json:"gitWrites"` + Messaging EndpointsExternalWriteView `json:"messaging"` + PullRequestReviews EndpointsExternalWriteView `json:"pullRequestReviews"` + PullRequests EndpointsExternalWriteView `json:"pullRequests"` + Tickets EndpointsExternalWriteView `json:"tickets"` +} + +type EndpointsFacetCount struct { + Count *int64 `json:"count,omitempty"` + Value *string `json:"value,omitempty"` } type EndpointsFileOwnersRequest struct { @@ -565,11 +1908,50 @@ type EndpointsFileOwnersRequest struct { RepositoryName string `json:"repositoryName"` } +type EndpointsFindingTicketRow struct { + AssigneeEmail *string `json:"assigneeEmail,omitempty"` + AssigneeName *string `json:"assigneeName,omitempty"` + BoardID *string `json:"boardId,omitempty"` + ClosedAt *string `json:"closedAt,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + FindingID *string `json:"findingId,omitempty"` + FindingType *DatabaseFindingType `json:"findingType,omitempty"` + ID *string `json:"id,omitempty"` + LastSyncedAt *string `json:"lastSyncedAt,omitempty"` + OutOfEligibilitySince *string `json:"outOfEligibilitySince,omitempty"` + Platform *DatabaseTicketPlatform `json:"platform,omitempty"` + PriorityName *string `json:"priorityName,omitempty"` + ProjectKey *string `json:"projectKey,omitempty"` + Source *DatabaseTicketSource `json:"source,omitempty"` + SyncError *string `json:"syncError,omitempty"` + TicketIdentifier *string `json:"ticketIdentifier,omitempty"` + TicketStatus *DatabaseTicketStatus `json:"ticketStatus,omitempty"` + TicketTitle *string `json:"ticketTitle,omitempty"` + TicketURL *string `json:"ticketUrl,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type EndpointsFindingTicketSummary struct { + BoardID *string `json:"boardId,omitempty"` + FindingID *string `json:"findingId,omitempty"` + FindingPriorityLabel *ModelsPriorityLabel `json:"findingPriorityLabel,omitempty"` + FindingType *DatabaseFindingType `json:"findingType,omitempty"` + Platform *DatabaseTicketPlatform `json:"platform,omitempty"` + Source *DatabaseTicketSource `json:"source,omitempty"` + TicketID *string `json:"ticketId,omitempty"` + TicketIdentifier *string `json:"ticketIdentifier,omitempty"` + TicketStatus *DatabaseTicketStatus `json:"ticketStatus,omitempty"` + TicketTitle *string `json:"ticketTitle,omitempty"` + TicketURL *string `json:"ticketUrl,omitempty"` +} + type EndpointsFunnelData struct { CRITICAL int `json:"CRITICAL"` HIGH int `json:"HIGH"` - LOW int `json:"LOW"` + INFO int `json:"INFO"` + LOWONLY int `json:"LOW_ONLY"` MEDIUM int `json:"MEDIUM"` + UNRATED int `json:"UNRATED"` FunnelKey string `json:"funnelKey"` } @@ -590,16 +1972,38 @@ const ( ) type EndpointsGetAdminNotificationConfigOutput struct { + CentralSecurityChannel *ModelsMessageChannelProvider `json:"centralSecurityChannel,omitempty"` Notifications []ModelsNotification `json:"notifications,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsGetAsanaStatusOutput struct { + Installed bool `json:"installed"` + InstalledAt *string `json:"installedAt,omitempty"` +} + +type EndpointsGetAtlassianInstallationOutput struct { + CloudID *string `json:"cloudId,omitempty"` + CompassInstalled *bool `json:"compassInstalled,omitempty"` + ConfluenceInstalled *bool `json:"confluenceInstalled,omitempty"` + InstallUnavailableReason *string `json:"installUnavailableReason,omitempty"` + InstallURL *string `json:"installUrl,omitempty"` + InstallationID *string `json:"installationId,omitempty"` + Linked *bool `json:"linked,omitempty"` + Settings *ModelsForgeProductSettings `json:"settings,omitempty"` + SiteURL *string `json:"siteUrl,omitempty"` +} + type EndpointsGetBuildkiteIntegrationOutput struct { Configured bool `json:"configured"` OrgSlug *string `json:"orgSlug,omitempty"` Version string `json:"version"` } +type EndpointsGetBulkOperationOutput struct { + Operation EndpointsBulkOperationStatusEntry `json:"operation"` +} + type EndpointsGetCircleCIIntegrationOutput struct { Configured bool `json:"configured"` Version string `json:"version"` @@ -610,18 +2014,49 @@ type EndpointsGetCurrentUserOutput struct { Username string `json:"username"` } +type EndpointsGetIdentityScimOutput struct { + BaseURL string `json:"baseUrl"` + Credentials []EndpointsScimCredentialView `json:"credentials,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetIntegrationOAuthInstallOutput struct { + AuthorizeURL string `json:"authorizeUrl"` +} + type EndpointsGetJenkinsIntegrationOutput struct { Configured bool `json:"configured"` Version string `json:"version"` } +type EndpointsGetJiraForgeStatusOutput struct { + CloudID *string `json:"cloudId,omitempty"` + Linked bool `json:"linked"` + SiteURL *string `json:"siteUrl,omitempty"` +} + +type EndpointsGetJiraInstallOutput struct { + AuthorizeURL string `json:"authorizeUrl"` +} + type EndpointsGetLinearInstallOutput struct { AuthorizeURL string `json:"authorizeUrl"` } type EndpointsGetLinearOAuthStatusOutput struct { + Configured *bool `json:"configured,omitempty"` + CredentialsRejectedAt *string `json:"credentialsRejectedAt,omitempty"` Installed bool `json:"installed"` InstalledAt *string `json:"installedAt,omitempty"` + Message *string `json:"message,omitempty"` + ReconnectRequired *bool `json:"reconnectRequired,omitempty"` + ReconnectRequiredAt *string `json:"reconnectRequiredAt,omitempty"` + State *ModelsLinearInstallState `json:"state,omitempty"` +} + +type EndpointsGetManagerSettingsOutput struct { + Installed EndpointsManagerIntegrationInstalled `json:"installed"` + Settings EndpointsManagerSettings `json:"settings"` } type EndpointsGetPrivacyAcknowledgmentOutput struct { @@ -640,6 +2075,14 @@ type EndpointsGetPullRequestStateOutput struct { PullRequestState *ModelsPullRequestStateWithDiffs `json:"pullRequestState,omitempty"` } +type EndpointsGetRepositoryDirectoriesOutput struct { + Directories []EndpointsRepositoryDirectory `json:"directories,omitempty"` + Path string `json:"path"` + Ref string `json:"ref"` + RepositoryID string `json:"repositoryId"` + Truncated bool `json:"truncated"` +} + type EndpointsGetRepositoryPropertyTeamKeysOutput struct { Keys []EndpointsRepositoryPropertyTeamKey `json:"keys,omitempty"` Version *string `json:"version,omitempty"` @@ -656,7 +2099,10 @@ type EndpointsGetScanCoverageFindingsOutput struct { } type EndpointsGetScanCoverageOutput struct { + ActiveScannedCount *int `json:"activeScannedCount,omitempty"` + ActiveTotalCount *int `json:"activeTotalCount,omitempty"` Repositories []EndpointsScanCoverageRepo `json:"repositories,omitempty"` + ScannedCount *int `json:"scannedCount,omitempty"` TotalCount *int `json:"totalCount,omitempty"` } @@ -667,6 +2113,7 @@ type EndpointsGetServiceAccountsOutput struct { type EndpointsGetSlackConfigOutput struct { Enabled bool `json:"enabled"` + Healthy bool `json:"healthy"` Message *string `json:"message,omitempty"` } @@ -676,6 +2123,7 @@ type EndpointsGetSlackDistributedInstallOutput struct { type EndpointsGetSuggestedUserMappingsOutput struct { Suggestions []EndpointsUserMappingSuggestion `json:"suggestions,omitempty"` + Unavailable []EndpointsPlatformUnavailable `json:"unavailable,omitempty"` Version *string `json:"version,omitempty"` } @@ -709,6 +2157,40 @@ type EndpointsGetTeamsOutput struct { Teams []ModelsTeam `json:"teams,omitempty"` } +type EndpointsGetTicketActivityOutput struct { + Entries []EndpointsTicketActivityEntry `json:"entries,omitempty"` +} + +type EndpointsGetTicketSavedFiltersOutput struct { + Filters []EndpointsSavedFilterEntry `json:"filters,omitempty"` +} + +type EndpointsGetTicketSettingsHistoryOutput struct { + Entries []EndpointsTicketSettingsHistoryEntry `json:"entries,omitempty"` +} + +type EndpointsGetTicketWorkbenchCountsOutput struct { + ByFindingType []EndpointsFacetCount `json:"byFindingType,omitempty"` + ByPlatform []EndpointsFacetCount `json:"byPlatform,omitempty"` + BySource []EndpointsFacetCount `json:"bySource,omitempty"` + ByStatus []EndpointsFacetCount `json:"byStatus,omitempty"` +} + +type EndpointsGetTicketWorkbenchDrilldownOutput struct { + AuditHistory []EndpointsTicketWorkbenchAuditEntry `json:"auditHistory,omitempty"` + Ticket EndpointsFindingTicketRow `json:"ticket"` +} + +type EndpointsGetTicketWorkbenchListOutput struct { + Tickets []EndpointsFindingTicketRow `json:"tickets,omitempty"` + Total int64 `json:"total"` +} + +type EndpointsGetUIPreferencesOutput struct { + Preferences map[string]json.RawMessage `json:"preferences,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + type EndpointsGetUISavedViewsOutput struct { SavedViews []ModelsUISavedView `json:"savedViews,omitempty"` } @@ -730,22 +2212,201 @@ type EndpointsGetUserOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsGitHubPackagesDiscoveredPackage struct { + Name string `json:"name"` + Owner string `json:"owner"` +} + +type EndpointsGitHubTenantRouteOperatorInput struct { + DeploymentID *string `json:"deploymentId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedBaseDomain *string `json:"expectedBaseDomain,omitempty"` + ExpectedRegion *string `json:"expectedRegion,omitempty"` + ExpectedStackOwnerIds []int64 `json:"expectedStackOwnerIds,omitempty"` + GithubOwnerID *int64 `json:"githubOwnerId,omitempty"` + Inspect *bool `json:"inspect,omitempty"` + InstallationID *int64 `json:"installationId,omitempty"` + OperationID *string `json:"operationId,omitempty"` + PrepareBeforeInstallation *bool `json:"prepareBeforeInstallation,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type EndpointsIPAllowlistEntryInput struct { + Cidr string `json:"cidr"` + Description *string `json:"description,omitempty"` +} + +type EndpointsIPAllowlistEntryView struct { + Cidr string `json:"cidr"` + CreatedAt string `json:"createdAt"` + CreatedBy string `json:"createdBy"` + Description string `json:"description"` + ID string `json:"id"` +} + +type EndpointsIdentityEntraConnectPostOutput struct { + RedirectURL string `json:"redirectUrl"` +} + +type EndpointsIdentityEntraGetOutput struct { + Configured bool `json:"configured"` + Connected bool `json:"connected"` + DirectoryID *string `json:"directoryId,omitempty"` + Status *string `json:"status,omitempty"` + VerifiedAt *string `json:"verifiedAt,omitempty"` + VerifiedDomains []string `json:"verifiedDomains,omitempty"` +} + +type EndpointsIdentityEntraHandoff struct { + CreatedAt string `json:"createdAt"` + CreatedBy string `json:"createdBy"` + DirectoryID string `json:"directoryId"` + ExpiresAt string `json:"expiresAt"` + ID string `json:"id"` + Status string `json:"status"` +} + +type EndpointsIdentityEntraHandoffListOutput struct { + Handoffs []EndpointsIdentityEntraHandoff `json:"handoffs"` + LastOutcome *EndpointsIdentityEntraHandoffOutcome `json:"lastOutcome,omitempty"` +} + +type EndpointsIdentityEntraHandoffOutcome struct { + At string `json:"at"` + Code *string `json:"code,omitempty"` + Result string `json:"result"` +} + +type EndpointsIdentityEntraHandoffPostInput struct { + DirectoryID string `json:"directoryId"` +} + +type EndpointsIdentityEntraHandoffPostOutput struct { + CreatedAt *string `json:"createdAt,omitempty"` + ExpiresAt string `json:"expiresAt"` + HandoffURL string `json:"handoffUrl"` +} + +type EndpointsIdentityEntraLinkPostOutput struct { + RedirectURL string `json:"redirectUrl"` +} + +type EndpointsIdentityEntraSignInPostOutput struct { + Upgraded bool `json:"upgraded"` +} + type EndpointsIncorrectPermission struct { Actual string `json:"actual"` Expected string `json:"expected"` } +type EndpointsInferenceRegionOutput struct { + InferenceRegion ModelsInferenceRegion `json:"inferenceRegion"` +} + +type EndpointsInitializeExternalWritesInput struct { + DryRun *bool `json:"dryRun,omitempty"` + Reason string `json:"reason"` + TenantID string `json:"tenantId"` +} + +type EndpointsInitializeExternalWritesOutput struct { + DryRun bool `json:"dryRun"` + ExternalWrites EndpointsExternalWritesView `json:"externalWrites"` + Initialized bool `json:"initialized"` + TenantID string `json:"tenantId"` +} + +type EndpointsIntegrationConnectionInstanceView struct { + AuthorityRevision *int64 `json:"authorityRevision,omitempty"` + Capability *string `json:"capability,omitempty"` + Category *string `json:"category,omitempty"` + Config map[string]json.RawMessage `json:"config,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + HasCredentials *bool `json:"hasCredentials,omitempty"` + ID *string `json:"id,omitempty"` + LastError *string `json:"lastError,omitempty"` + LastVerifiedAt *string `json:"lastVerifiedAt,omitempty"` + ProviderID *string `json:"providerId,omitempty"` + Status *string `json:"status,omitempty"` +} + +type EndpointsIntegrationConnectionView struct { + AuthorityRevision *int64 `json:"authorityRevision,omitempty"` + Capability *string `json:"capability,omitempty"` + Category *string `json:"category,omitempty"` + Config map[string]json.RawMessage `json:"config,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + HasCredentials *bool `json:"hasCredentials,omitempty"` + LastError *string `json:"lastError,omitempty"` + LastVerifiedAt *string `json:"lastVerifiedAt,omitempty"` + ProviderID *string `json:"providerId,omitempty"` + Status *string `json:"status,omitempty"` +} + +type EndpointsListMergedScansOutput struct { + Scans []EndpointsMergedScanSummary `json:"scans,omitempty"` + TotalCount *int `json:"totalCount,omitempty"` +} + type EndpointsListTeamFindingsOutput struct { TeamFindings []ModelsTeamFindings `json:"teamFindings,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsManagerIntegrationInstalled struct { + Messaging *bool `json:"messaging,omitempty"` + PrCreation *bool `json:"prCreation,omitempty"` + Tickets *bool `json:"tickets,omitempty"` +} + +type EndpointsManagerSettings struct { + AutomatedThreatInvestigations *bool `json:"automatedThreatInvestigations,omitempty"` + BlockedActionTypes []string `json:"blockedActionTypes,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DailyUpdatesEnabled *bool `json:"dailyUpdatesEnabled,omitempty"` + GroundRules *string `json:"groundRules,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + WeeklyUpdatesEnabled *bool `json:"weeklyUpdatesEnabled,omitempty"` +} + type EndpointsMappedCanonicalIDs struct { Jira string `json:"jira"` Slack string `json:"slack"` Teams string `json:"teams"` } +type EndpointsMergedScanSummary struct { + Branch *string `json:"branch,omitempty"` + CommitHash *string `json:"commitHash,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + CompletedCount *int `json:"completedCount,omitempty"` + CoverageStatus *string `json:"coverageStatus,omitempty"` + FailedCount *int `json:"failedCount,omitempty"` + FixedFindingsCount *int `json:"fixedFindingsCount,omitempty"` + HasRunningScanForCommit bool `json:"hasRunningScanForCommit"` + IsDefaultBranch *bool `json:"isDefaultBranch,omitempty"` + LatestScanStartedAtForCommit *string `json:"latestScanStartedAtForCommit,omitempty"` + LiveFindingsCount *int `json:"liveFindingsCount,omitempty"` + NewFindingsCount *int `json:"newFindingsCount,omitempty"` + OverallStatus *string `json:"overallStatus,omitempty"` + Owner *string `json:"owner,omitempty"` + Platform *string `json:"platform,omitempty"` + ReintroducedFindingsCount *int `json:"reintroducedFindingsCount,omitempty"` + Repository *string `json:"repository,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + RunningCount *int `json:"runningCount,omitempty"` + ScannerCount *int `json:"scannerCount,omitempty"` + Scanners []EndpointsScannerRun `json:"scanners,omitempty"` + SeverityCritical *int `json:"severityCritical,omitempty"` + SeverityHigh *int `json:"severityHigh,omitempty"` + SeverityLow *int `json:"severityLow,omitempty"` + SeverityMedium *int `json:"severityMedium,omitempty"` + SkippedCount *int `json:"skippedCount,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + TriggerType *string `json:"triggerType,omitempty"` +} + type EndpointsMetricData struct { LastMonth float64 `json:"lastMonth"` ThisMonth float64 `json:"thisMonth"` @@ -760,14 +2421,167 @@ type EndpointsMetricWithValue struct { Value string `json:"value"` } +type EndpointsNativeTenantRouteOperatorInput struct { + Administrators []ServiceNativeBootstrapAdministrator `json:"administrators,omitempty"` + BaseDomain *string `json:"baseDomain,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + DirectoryID *string `json:"directoryId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + Inspect *bool `json:"inspect,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Operator *string `json:"operator,omitempty"` + Reason *string `json:"reason,omitempty"` + Region *string `json:"region,omitempty"` + Stage *string `json:"stage,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} + +type EndpointsNetworkIPAllowlistOutput struct { + CallerAllowed *bool `json:"callerAllowed,omitempty"` + CallerIp string `json:"callerIp"` + DryRun *bool `json:"dryRun,omitempty"` + Entries []EndpointsIPAllowlistEntryView `json:"entries,omitempty"` + Version *string `json:"version,omitempty"` + Warnings []string `json:"warnings,omitempty"` +} + +type EndpointsOperatorRepositoryScanScopeView struct { + CodeEnrolled bool `json:"codeEnrolled"` + CodePaths ModelsPathScope `json:"codePaths"` + Effective ModelsScanScope `json:"effective"` + Excluded bool `json:"excluded"` + Explanation ModelsScanScopeExplanation `json:"explanation"` + Owner string `json:"owner"` + Repository string `json:"repository"` + RepositoryID string `json:"repositoryId"` + ScopeUpdatedAt *string `json:"scopeUpdatedAt,omitempty"` + SecretsEnrolled bool `json:"secretsEnrolled"` + SecretsExcludes []string `json:"secretsExcludes,omitempty"` + StaffAllowed bool `json:"staffAllowed"` + StaffCodePaths ModelsPathScope `json:"staffCodePaths"` + StaffUpdatedAt *string `json:"staffUpdatedAt,omitempty"` + StaffUpdatedBy string `json:"staffUpdatedBy"` +} + +type EndpointsOperatorRepositoryScanScopesOutput struct { + Repositories []EndpointsOperatorRepositoryScanScopeView `json:"repositories,omitempty"` + ScopingEnabled bool `json:"scopingEnabled"` + SecretsMode string `json:"secretsMode"` + StaffRepositoryAllowlist bool `json:"staffRepositoryAllowlist"` + TenantID string `json:"tenantId"` +} + +type EndpointsOperatorRepositoryStaffScopesOutput struct { + Backfill []EndpointsScanScopeBackfill `json:"backfill,omitempty"` + CoverageLost []EndpointsScanScopeCoverageLoss `json:"coverageLost,omitempty"` + EnrollmentReset []EndpointsScanScopeEnrollmentReset `json:"enrollmentReset,omitempty"` + Repositories []EndpointsOperatorRepositoryScanScopeView `json:"repositories,omitempty"` + TenantID string `json:"tenantId"` +} + +type EndpointsOperatorRepositoryStaffScopesPutInput struct { + Reason string `json:"reason"` + Repositories []EndpointsRepositoryStaffScopeChange `json:"repositories,omitempty"` + TenantID string `json:"tenantId"` +} + +type EndpointsOperatorScanEntitlementOutput struct { + Backfill []EndpointsScanScopeBackfill `json:"backfill,omitempty"` + CoverageLost []EndpointsScanScopeCoverageLoss `json:"coverageLost,omitempty"` + EnrollmentReset []EndpointsScanScopeEnrollmentReset `json:"enrollmentReset,omitempty"` + Entitlement EndpointsOperatorScanEntitlementView `json:"entitlement"` + TenantID string `json:"tenantId"` + Version *string `json:"version,omitempty"` +} + +type EndpointsOperatorScanEntitlementPutInput struct { + CodeRepositoryCap *int `json:"codeRepositoryCap,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + Reason string `json:"reason"` + ScopingEnabled *bool `json:"scopingEnabled,omitempty"` + SecretsMode *string `json:"secretsMode,omitempty"` + SecretsRepositoryCap *int `json:"secretsRepositoryCap,omitempty"` + StaffRepositoryAllowlist *bool `json:"staffRepositoryAllowlist,omitempty"` + TenantID string `json:"tenantId"` +} + +type EndpointsOperatorScanEntitlementView struct { + CodeEnrolledCount int `json:"codeEnrolledCount"` + CodeExcludedCount int `json:"codeExcludedCount"` + CodeRepositoryCap *int `json:"codeRepositoryCap,omitempty"` + EntitlementUpdatedAt *string `json:"entitlementUpdatedAt,omitempty"` + EntitlementUpdatedBy string `json:"entitlementUpdatedBy"` + LegacyCapInert bool `json:"legacyCapInert"` + MaxChangesPerRequest int `json:"maxChangesPerRequest"` + MaxPathsPerList int `json:"maxPathsPerList"` + ScopingEnabled bool `json:"scopingEnabled"` + SecretsEnrolledCount int `json:"secretsEnrolledCount"` + SecretsExcludedCount int `json:"secretsExcludedCount"` + SecretsMode string `json:"secretsMode"` + SecretsRepositoryCap *int `json:"secretsRepositoryCap,omitempty"` + StaffRepositoryAllowlist bool `json:"staffRepositoryAllowlist"` + WarningThresholdPercent int `json:"warningThresholdPercent"` +} + +type EndpointsOperatorTenantCapabilitiesOutput struct { + Capabilities []EndpointsOperatorTenantCapabilityView `json:"capabilities,omitempty"` + TenantID string `json:"tenantId"` +} + +type EndpointsOperatorTenantCapabilityPutInput struct { + Capability string `json:"capability"` + ExpectedStaffUpdatedAt *string `json:"expectedStaffUpdatedAt,omitempty"` + LockReason *string `json:"lockReason,omitempty"` + Reason string `json:"reason"` + Repository *string `json:"repository,omitempty"` + SeedCustomerEnabled *bool `json:"seedCustomerEnabled,omitempty"` + SeedRepositoryDisabled *bool `json:"seedRepositoryDisabled,omitempty"` + SeedStaffIfAbsent *bool `json:"seedStaffIfAbsent,omitempty"` + StaffState string `json:"staffState"` + TenantID string `json:"tenantId"` +} + +type EndpointsOperatorTenantCapabilityPutOutput struct { + Capability EndpointsOperatorTenantCapabilityView `json:"capability"` + TenantID string `json:"tenantId"` +} + +type EndpointsOperatorTenantCapabilityView struct { + Capability string `json:"capability"` + CustomerEnabled *bool `json:"customerEnabled,omitempty"` + CustomerUpdatedAt *string `json:"customerUpdatedAt,omitempty"` + CustomerUpdatedBy string `json:"customerUpdatedBy"` + CustomerVisible bool `json:"customerVisible"` + Enabled *bool `json:"enabled,omitempty"` + Fallback string `json:"fallback"` + Initialized *bool `json:"initialized,omitempty"` + LockReason string `json:"lockReason"` + Repository *string `json:"repository,omitempty"` + Scope string `json:"scope"` + Source string `json:"source"` + StaffState string `json:"staffState"` + StaffUpdatedAt *string `json:"staffUpdatedAt,omitempty"` + StaffUpdatedBy string `json:"staffUpdatedBy"` + Title string `json:"title"` +} + type EndpointsOverviewType struct { API EndpointsMetricWithValue `json:"api"` Code EndpointsMetricWithValue `json:"code"` Container EndpointsMetricWithValue `json:"container"` Dependency EndpointsMetricWithValue `json:"dependency"` Secret EndpointsMetricWithValue `json:"secret"` + Supplychain EndpointsMetricWithValue `json:"supplychain"` } +type EndpointsPRGateFindingsPolicy string + +const ( + EndpointsPRGateFindingsPolicyNone EndpointsPRGateFindingsPolicy = "none" + EndpointsPRGateFindingsPolicyConfirmed EndpointsPRGateFindingsPolicy = "confirmed" +) + type EndpointsPatchSLAInput struct { AllowExtensions *bool `json:"allowExtensions,omitempty"` MaxDaysToFix *int `json:"maxDaysToFix,omitempty"` @@ -780,6 +2594,8 @@ type EndpointsPatchSLAOutput struct { } type EndpointsPatchTeamInput struct { + AddMemberIds []string `json:"addMemberIds,omitempty"` + ClearLead *bool `json:"clearLead,omitempty"` CodeOwnerships []ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` Github *ModelsTeamProviderGitHub `json:"github,omitempty"` Gitlab *ModelsTeamProviderGitLab `json:"gitlab,omitempty"` @@ -790,40 +2606,187 @@ type EndpointsPatchTeamInput struct { MessageChannelProvider *ModelsMessageChannelProvider `json:"messageChannelProvider,omitempty"` Name *string `json:"name,omitempty"` Privacy *ModelsTeamPrivacy `json:"privacy,omitempty"` + RemoveMemberIds []string `json:"removeMemberIds,omitempty"` Slug *string `json:"slug,omitempty"` + TicketBoardID *string `json:"ticketBoardId,omitempty"` TicketProjectProvider *ModelsTicketProjectProvider `json:"ticketProjectProvider,omitempty"` } -type EndpointsPatchTeamOutput struct { - Team ModelsTeam `json:"team"` +type EndpointsPatchTeamOutput struct { + Team ModelsTeam `json:"team"` +} + +type EndpointsPatchTicketSavedFilterInput struct { + Filter *EndpointsTicketWorkbenchFilter `json:"filter,omitempty"` + Name *string `json:"name,omitempty"` +} + +type EndpointsPatchTicketSavedFilterOutput struct { + Filter EndpointsSavedFilterEntry `json:"filter"` +} + +type EndpointsPatchUISavedViewInput struct { + SavedView ModelsUISavedViewAPIInput `json:"savedView"` +} + +type EndpointsPatchUISavedViewOutput struct { + SavedView ModelsUISavedView `json:"savedView"` +} + +type EndpointsPlatformUnavailable struct { + Platform string `json:"platform"` + Reason string `json:"reason"` +} + +type EndpointsPostAtlassianSettingsInput struct { + InstallationID *string `json:"installationId,omitempty"` + Settings *ModelsForgeProductSettings `json:"settings,omitempty"` +} + +type EndpointsPostAtlassianSettingsOutput struct { + Revision *int64 `json:"revision,omitempty"` +} + +type EndpointsPostBuildkiteOrganizationsInput struct { + ApiToken string `json:"apiToken"` +} + +type EndpointsPostBuildkiteOrganizationsOutput struct { + Organizations []EndpointsBuildkiteOrganization `json:"organizations,omitempty"` + Version string `json:"version"` +} + +type EndpointsPostBuildkiteTokenInput struct { + ApiToken string `json:"apiToken"` + OrgSlug *string `json:"orgSlug,omitempty"` +} + +type EndpointsPostBuildkiteTokenOutput struct { + Message string `json:"message"` + OrgSlug string `json:"orgSlug"` + Version string `json:"version"` +} + +type EndpointsPostBulkAddCommentInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkAddCommentParams `json:"params,omitempty"` +} + +type EndpointsPostBulkAddCommentOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` +} + +type EndpointsPostBulkCloseInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkCloseParams `json:"params,omitempty"` +} + +type EndpointsPostBulkCloseOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` +} + +type EndpointsPostBulkGetUserMappingsInput struct { + GitCanonicalUserIds []string `json:"gitCanonicalUserIds,omitempty"` + GithubCanonicalUserIds []string `json:"githubCanonicalUserIds,omitempty"` +} + +type EndpointsPostBulkGetUserMappingsOutput struct { + Users map[string]EndpointsMappedCanonicalIDs `json:"users,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsPostBulkMoveInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkMoveParams `json:"params,omitempty"` +} + +type EndpointsPostBulkMoveOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` +} + +type EndpointsPostBulkOperationCancelOutput struct { + Operation EndpointsBulkOperationStatusEntry `json:"operation"` +} + +type EndpointsPostBulkReassignAssigneeInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkReassignAssigneeParams `json:"params,omitempty"` } -type EndpointsPatchUISavedViewInput struct { - SavedView ModelsUISavedViewAPIInput `json:"savedView"` +type EndpointsPostBulkReassignAssigneeOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` } -type EndpointsPatchUISavedViewOutput struct { - SavedView ModelsUISavedView `json:"savedView"` +type EndpointsPostBulkReassignTeamInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkReassignTeamParams `json:"params,omitempty"` } -type EndpointsPostBuildkiteTokenInput struct { - ApiToken string `json:"apiToken"` - OrgSlug string `json:"orgSlug"` +type EndpointsPostBulkReassignTeamOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` } -type EndpointsPostBuildkiteTokenOutput struct { - Message string `json:"message"` - Version string `json:"version"` +type EndpointsPostBulkRelabelInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkRelabelParams `json:"params,omitempty"` } -type EndpointsPostBulkGetUserMappingsInput struct { - GitCanonicalUserIds []string `json:"gitCanonicalUserIds,omitempty"` - GithubCanonicalUserIds []string `json:"githubCanonicalUserIds,omitempty"` +type EndpointsPostBulkRelabelOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` } -type EndpointsPostBulkGetUserMappingsOutput struct { - Users map[string]EndpointsMappedCanonicalIDs `json:"users,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsPostBulkReopenInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkReopenParams `json:"params,omitempty"` +} + +type EndpointsPostBulkReopenOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` +} + +type EndpointsPostBulkResyncInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkResyncParams `json:"params,omitempty"` +} + +type EndpointsPostBulkResyncOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` +} + +type EndpointsPostBulkSetPriorityInput struct { + ConfirmationToken *string `json:"confirmationToken,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Params *EndpointsBulkSetPriorityParams `json:"params,omitempty"` +} + +type EndpointsPostBulkSetPriorityOutput struct { + DryRun *EndpointsBulkActionDryRunResult `json:"dryRun,omitempty"` + Start *EndpointsBulkActionStartResult `json:"start,omitempty"` } type EndpointsPostCircleCITokenInput struct { @@ -848,12 +2811,10 @@ type EndpointsPostCompassTeamOutput struct { Team ModelsTeam `json:"team"` } -type EndpointsPostInitializeRepositoriesInput struct { - Repositories []ModelsGitRepositoryProvider `json:"repositories,omitempty"` -} - -type EndpointsPostInitializeRepositoriesOutput struct { - Repositories []EndpointsRepositotryInitializationStatus `json:"repositories,omitempty"` +type EndpointsPostIdentityScimCredentialOutput struct { + ID string `json:"id"` + Token string `json:"token"` + Version *string `json:"version,omitempty"` } type EndpointsPostJenkinsTokenInput struct { @@ -900,6 +2861,7 @@ type EndpointsPostSLAOutput struct { type EndpointsPostServiceAccountInput struct { Name string `json:"name"` Platform ModelsProviderID `json:"platform"` + Role *string `json:"role,omitempty"` } type EndpointsPostServiceAccountOutput struct { @@ -916,7 +2878,19 @@ type EndpointsPostSlackAPIKeyOutput struct { Version string `json:"version"` } +type EndpointsPostTeamCodeOwnershipInput struct { + Actor *string `json:"actor,omitempty"` + RepositoryID string `json:"repositoryId"` +} + +type EndpointsPostTeamCodeOwnershipOutput struct { + RepositoryID string `json:"repositoryId"` + TeamID string `json:"teamId"` + Version string `json:"version"` +} + type EndpointsPostTeamFindingsInput struct { + Actor *string `json:"actor,omitempty"` Mappings []EndpointsPostTeamFindingsMapping `json:"mappings,omitempty"` } @@ -975,6 +2949,14 @@ type EndpointsPostTeamOutput struct { Team ModelsTeam `json:"team"` } +type EndpointsPostTeamSLABreakdownInput struct { + FindingIDs []string `json:"findingIDs,omitempty"` +} + +type EndpointsPostTeamSLABreakdownOutput struct { + Teams []EndpointsTeamSLABreakdown `json:"teams,omitempty"` +} + type EndpointsPostTeamSyncRunInput struct { Source *string `json:"source,omitempty"` } @@ -984,20 +2966,42 @@ type EndpointsPostTeamSyncRunOutput struct { Version *string `json:"version,omitempty"` } -type EndpointsPostUISavedViewInput struct { - SavedView ModelsUISavedViewAPIInput `json:"savedView"` +type EndpointsPostTicketSavedFilterInput struct { + Filter EndpointsTicketWorkbenchFilter `json:"filter"` + Name string `json:"name"` } -type EndpointsPostUISavedViewOutput struct { - SavedView ModelsUISavedView `json:"savedView"` +type EndpointsPostTicketSavedFilterOutput struct { + Filter EndpointsSavedFilterEntry `json:"filter"` +} + +type EndpointsPostTicketSettingsInput struct { + MigrationAction *DatabaseTicketMigrationAction `json:"migrationAction,omitempty"` + Proposal EndpointsTicketSettingsProposal `json:"proposal"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostTicketSettingsOutput struct { + HistoryID string `json:"historyId"` + MigrationAction DatabaseTicketMigrationAction `json:"migrationAction"` + Settings EndpointsSavedTicketSettings `json:"settings"` +} + +type EndpointsPostTicketSettingsPreviewInput struct { + Proposal EndpointsTicketSettingsProposal `json:"proposal"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostTicketSettingsPreviewOutput struct { + Preview EndpointsTicketSettingsImpactPreview `json:"preview"` } -type EndpointsPostUninitializeRepositoriesInput struct { - Repositories []ModelsGitRepositoryProvider `json:"repositories,omitempty"` +type EndpointsPostUISavedViewInput struct { + SavedView ModelsUISavedViewAPIInput `json:"savedView"` } -type EndpointsPostUninitializeRepositoriesOutput struct { - Repositories []EndpointsRepositotryInitializationStatus `json:"repositories,omitempty"` +type EndpointsPostUISavedViewOutput struct { + SavedView ModelsUISavedView `json:"savedView"` } type EndpointsPostUserInput struct { @@ -1010,6 +3014,8 @@ type EndpointsPostUserMappingInput struct { } type EndpointsPostUserMappingOutput struct { + SkippedMappings []EndpointsSkippedUserMapping `json:"skippedMappings,omitempty"` + Unavailable []EndpointsPlatformUnavailable `json:"unavailable,omitempty"` UserMappings []ModelsUserMapping `json:"userMappings,omitempty"` } @@ -1018,6 +3024,10 @@ type EndpointsPostUserOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsPreviewNetworkIPAllowlistInput struct { + Entries []EndpointsIPAllowlistEntryInput `json:"entries,omitempty"` +} + type EndpointsPrivacyAcknowledgmentExport struct { AcknowledgedAt *string `json:"acknowledgedAt,omitempty"` PolicyVersion *string `json:"policyVersion,omitempty"` @@ -1025,6 +3035,7 @@ type EndpointsPrivacyAcknowledgmentExport struct { } type EndpointsPutAdminNotificationConfigInput struct { + CentralSecurityChannel *ModelsMessageChannelProvider `json:"centralSecurityChannel,omitempty"` Notifications []ModelsNotification `json:"notifications,omitempty"` } @@ -1040,9 +3051,15 @@ type EndpointsPutBulkSLAOutput struct { SlaIds []string `json:"slaIds,omitempty"` } +type EndpointsPutCSPMScanCadenceInput struct { + CspmScanCadence *string `json:"cspmScanCadence,omitempty"` +} + type EndpointsPutEditUserMappingInput struct { Azure *ModelsAzureUserProvider `json:"azure,omitempty"` Bitbucket *ModelsBitbucketUserProvider `json:"bitbucket,omitempty"` + ClearSlack *bool `json:"clearSlack,omitempty"` + ClearTeams *bool `json:"clearTeams,omitempty"` Github *ModelsGitHubUserProvider `json:"github,omitempty"` Gitlab *ModelsGitLabUserProvider `json:"gitlab,omitempty"` Jira *ModelsJiraUserProvider `json:"jira,omitempty"` @@ -1051,6 +3068,63 @@ type EndpointsPutEditUserMappingInput struct { Teams *ModelsTeamsUserProvider `json:"teams,omitempty"` } +type EndpointsPutEditUserMappingOutput struct { + UserMapping *ModelsUserMapping `json:"userMapping,omitempty"` +} + +type EndpointsPutExternalWritesInput struct { + GitWrites *bool `json:"gitWrites,omitempty"` + Messaging *bool `json:"messaging,omitempty"` + PullRequestReviews *bool `json:"pullRequestReviews,omitempty"` + PullRequests *bool `json:"pullRequests,omitempty"` + Tickets *bool `json:"tickets,omitempty"` +} + +type EndpointsPutInferenceRegionInput struct { + InferenceRegion ModelsInferenceRegion `json:"inferenceRegion"` +} + +type EndpointsPutManagerSettingsInput struct { + AutomatedThreatInvestigations *bool `json:"automatedThreatInvestigations,omitempty"` + BlockedActionTypes []string `json:"blockedActionTypes,omitempty"` + DailyUpdatesEnabled *bool `json:"dailyUpdatesEnabled,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` + GroundRules *string `json:"groundRules,omitempty"` + WeeklyUpdatesEnabled *bool `json:"weeklyUpdatesEnabled,omitempty"` +} + +type EndpointsPutManagerSettingsOutput struct { + Settings EndpointsManagerSettings `json:"settings"` +} + +type EndpointsPutNetworkIPAllowlistInput struct { + Entries []EndpointsIPAllowlistEntryInput `json:"entries,omitempty"` + ExpectedCidrs []string `json:"expectedCidrs,omitempty"` +} + +type EndpointsPutRepositoryScanScopesInput struct { + Repositories []EndpointsRepositoryScanScopeChange `json:"repositories,omitempty"` +} + +type EndpointsPutRepositoryScanScopesOutput struct { + Backfill []EndpointsScanScopeBackfill `json:"backfill,omitempty"` + CodeEnrolledCount int `json:"codeEnrolledCount"` + CodeUnenrolledCount int `json:"codeUnenrolledCount"` + Entitlement EndpointsScanEntitlementView `json:"entitlement"` + Repositories []EndpointsRepositoryScanScopeView `json:"repositories,omitempty"` + SecretsEnrolledCount int `json:"secretsEnrolledCount"` +} + +type EndpointsPutScanScopeInput struct { + ScopingEnabled *bool `json:"scopingEnabled,omitempty"` + SecretsMode *string `json:"secretsMode,omitempty"` +} + +type EndpointsPutScanScopeOutput struct { + Backfill []EndpointsScanScopeBackfill `json:"backfill,omitempty"` + Entitlement EndpointsScanEntitlementView `json:"entitlement"` +} + type EndpointsPutTeamSourcePreferencesInput struct { GithubTeamsEnabled bool `json:"githubTeamsEnabled"` RepositoryPropertyEnabled bool `json:"repositoryPropertyEnabled"` @@ -1062,13 +3136,32 @@ type EndpointsPutTeamSourcePreferencesOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsPutTenantCapabilityInput struct { + Enabled *bool `json:"enabled,omitempty"` + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` +} + +type EndpointsPutTenantCapabilityOutput struct { + Capability EndpointsTenantCapabilityView `json:"capability"` +} + +type EndpointsPutUIPreferencesInput struct { + Preferences map[string]json.RawMessage `json:"preferences,omitempty"` +} + +type EndpointsPutUIPreferencesOutput struct { + Preferences map[string]json.RawMessage `json:"preferences,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + type EndpointsQueryMetricsOverTimeInput struct { Query ModelsUnifiedFindingsQuery `json:"query"` } type EndpointsQueryMetricsOverTimeOutput struct { - Fixed []EndpointsCount `json:"fixed,omitempty"` Introduced []EndpointsCount `json:"introduced,omitempty"` + Resolved []EndpointsCount `json:"resolved,omitempty"` + VerifiedFixed []EndpointsCount `json:"verifiedFixed,omitempty"` Version *string `json:"version,omitempty"` } @@ -1087,25 +3180,22 @@ type EndpointsQueryOverviewInput struct { type EndpointsQueryOverviewOutput struct { AppName []EndpointsMetricWithValue `json:"appName,omitempty"` - AppType []EndpointsMetricWithValue `json:"appType,omitempty"` AutofixMerged EndpointsMetricData `json:"autofixMerged"` - BotInteractions EndpointsMetricData `json:"botInteractions"` Branch []EndpointsMetricWithValue `json:"branch,omitempty"` - CleanPrsMerged EndpointsMetricData `json:"cleanPrsMerged"` + Canonical ModelsOverviewCanonical `json:"canonical"` Cve []EndpointsMetricWithValue `json:"cve,omitempty"` Cwe []EndpointsMetricWithValue `json:"cwe,omitempty"` + EstimatedTriageWorkHours json.RawMessage `json:"estimatedTriageWorkHours"` FalsePositives EndpointsMetricData `json:"falsePositives"` - FindingsResolved EndpointsMetricData `json:"findingsResolved"` FunnelData []EndpointsFunnelData `json:"funnelData,omitempty"` Host []EndpointsMetricWithValue `json:"host,omitempty"` - HoursSaved EndpointsMetricData `json:"hoursSaved"` ImageName []EndpointsMetricWithValue `json:"imageName,omitempty"` InSLAFindings EndpointsMetricData `json:"inSLAFindings"` InvestigateData EndpointsMetricData `json:"investigateData"` - IssuesFoundInPR EndpointsMetricData `json:"issuesFoundInPR"` Language []EndpointsMetricWithValue `json:"language,omitempty"` MeanTriageDurationMs EndpointsMetricData `json:"meanTriageDurationMs"` - MergeReadyRate EndpointsMetricData `json:"mergeReadyRate"` + OpenPastSLAFindings EndpointsMetricData `json:"openPastSLAFindings"` + OpenWithSLAFindings EndpointsMetricData `json:"openWithSLAFindings"` OverviewCWE []EndpointsMetricWithValue `json:"overviewCWE,omitempty"` OverviewLanguage []EndpointsMetricWithValue `json:"overviewLanguage,omitempty"` OverviewRepos []EndpointsMetricWithValue `json:"overviewRepos,omitempty"` @@ -1113,18 +3203,31 @@ type EndpointsQueryOverviewOutput struct { Owners []EndpointsMetricWithValue `json:"owners,omitempty"` Package []EndpointsMetricWithValue `json:"package,omitempty"` Repos []EndpointsMetricWithValue `json:"repos,omitempty"` + ResolvedPastSLAFindings EndpointsMetricData `json:"resolvedPastSLAFindings"` RuleID []EndpointsMetricWithValue `json:"ruleId,omitempty"` SecretType []EndpointsMetricWithValue `json:"secretType,omitempty"` Teams []EndpointsMetricWithValue `json:"teams,omitempty"` - TotalPrsMerged EndpointsMetricData `json:"totalPrsMerged"` - Type map[string]EndpointsMetricData `json:"type,omitempty"` + TriageableFindings EndpointsMetricData `json:"triageableFindings"` + TriagedFindings EndpointsMetricData `json:"triagedFindings"` Version *string `json:"version,omitempty"` } -type EndpointsRepositoryInitializationTaskStatus struct { - Error string `json:"error"` - Status string `json:"status"` - TaskName string `json:"taskName"` +type EndpointsRepoRecommendation struct { + CapabilityFit map[string]EndpointsCapabilityFitPublic `json:"capabilityFit,omitempty"` + Covers []string `json:"covers,omitempty"` + ImportanceScore int `json:"importanceScore"` + IsEnrolled bool `json:"isEnrolled"` + IsRecommended bool `json:"isRecommended"` + Owner string `json:"owner"` + PrimaryCapability string `json:"primaryCapability"` + Repository string `json:"repository"` + RepositoryID string `json:"repositoryId"` + RequiresConfirmation bool `json:"requiresConfirmation"` +} + +type EndpointsRepositoryDirectory struct { + Name string `json:"name"` + Path string `json:"path"` } type EndpointsRepositoryPropertyTeamKey struct { @@ -1136,10 +3239,58 @@ type EndpointsRepositoryPropertyTeamKey struct { UpdatedAt string `json:"updatedAt"` } -type EndpointsRepositotryInitializationStatus struct { - IsInitialized bool `json:"isInitialized"` - Repository ModelsGitRepositoryProvider `json:"repository"` - TaskStatuses []EndpointsRepositoryInitializationTaskStatus `json:"taskStatuses,omitempty"` +type EndpointsRepositoryScanScopeChange struct { + CodeEnrolled *bool `json:"codeEnrolled,omitempty"` + CodePaths *ModelsPathScope `json:"codePaths,omitempty"` + Excluded *bool `json:"excluded,omitempty"` + ExpectedScopeUpdatedAt *string `json:"expectedScopeUpdatedAt,omitempty"` + RepositoryID string `json:"repositoryId"` + SecretsEnrolled *bool `json:"secretsEnrolled,omitempty"` + SecretsExcludes []string `json:"secretsExcludes,omitempty"` +} + +type EndpointsRepositoryScanScopeView struct { + CodeEnrolled bool `json:"codeEnrolled"` + CodePaths ModelsPathScope `json:"codePaths"` + Excluded bool `json:"excluded"` + Owner string `json:"owner"` + Repository string `json:"repository"` + RepositoryID string `json:"repositoryId"` + ScopeUpdatedAt *string `json:"scopeUpdatedAt,omitempty"` + SecretsEnrolled bool `json:"secretsEnrolled"` + SecretsExcludes []string `json:"secretsExcludes,omitempty"` +} + +type EndpointsRepositoryStaffScopeChange struct { + Allowed *bool `json:"allowed,omitempty"` + CodePaths *ModelsPathScope `json:"codePaths,omitempty"` + ExpectedStaffUpdatedAt *string `json:"expectedStaffUpdatedAt,omitempty"` + RepositoryID string `json:"repositoryId"` +} + +type EndpointsSavedFilterEntry struct { + CreatedAt *string `json:"createdAt,omitempty"` + FilterSnapshotJson *string `json:"filterSnapshotJson,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + UserID *string `json:"userId,omitempty"` +} + +type EndpointsSavedTicketSettings struct { + CreatedAt *string `json:"createdAt,omitempty"` + DefaultBoardID *string `json:"defaultBoardId,omitempty"` + FiltersCweAllowlist []string `json:"filtersCweAllowlist,omitempty"` + FiltersCweBlocklist []string `json:"filtersCweBlocklist,omitempty"` + FiltersRepoAllowlist []string `json:"filtersRepoAllowlist,omitempty"` + FiltersRepoBlocklist []string `json:"filtersRepoBlocklist,omitempty"` + FindingType *DatabaseFindingType `json:"findingType,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + PriorityThreshold *ModelsPriorityLabel `json:"priorityThreshold,omitempty"` + SeverityThreshold *ModelsSeverity `json:"severityThreshold,omitempty"` + TeamRoutingEnabled *bool `json:"teamRoutingEnabled,omitempty"` + UnroutedBehavior *string `json:"unroutedBehavior,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` } type EndpointsScanCoverageCVECounts struct { @@ -1179,10 +3330,13 @@ type EndpointsScanCoverageFinding struct { type EndpointsScanCoverageRepo struct { CriticalCount *int `json:"criticalCount,omitempty"` HighCount *int `json:"highCount,omitempty"` + InfoCount *int `json:"infoCount,omitempty"` LastCommitAt *string `json:"lastCommitAt,omitempty"` LastCommitHash *string `json:"lastCommitHash,omitempty"` LastScanAt *string `json:"lastScanAt,omitempty"` LastScanCommitHash *string `json:"lastScanCommitHash,omitempty"` + LastScanIncomplete *bool `json:"lastScanIncomplete,omitempty"` + LastScanIncompleteReason *string `json:"lastScanIncompleteReason,omitempty"` LowCount *int `json:"lowCount,omitempty"` MediumCount *int `json:"mediumCount,omitempty"` Owner *string `json:"owner,omitempty"` @@ -1192,15 +3346,89 @@ type EndpointsScanCoverageRepo struct { TotalCount *int `json:"totalCount,omitempty"` } +type EndpointsScanEntitlementView struct { + CodeEnrolledCount int `json:"codeEnrolledCount"` + CodeExcludedCount int `json:"codeExcludedCount"` + CodeRepositoryCap *int `json:"codeRepositoryCap,omitempty"` + EntitlementUpdatedAt *string `json:"entitlementUpdatedAt,omitempty"` + MaxChangesPerRequest int `json:"maxChangesPerRequest"` + MaxPathsPerList int `json:"maxPathsPerList"` + ScopingEnabled bool `json:"scopingEnabled"` + SecretsEnrolledCount int `json:"secretsEnrolledCount"` + SecretsExcludedCount int `json:"secretsExcludedCount"` + SecretsMode string `json:"secretsMode"` + SecretsRepositoryCap *int `json:"secretsRepositoryCap,omitempty"` + StaffRepositoryAllowlist bool `json:"staffRepositoryAllowlist"` + WarningThresholdPercent int `json:"warningThresholdPercent"` +} + +type EndpointsScanScopeBackfill struct { + Dispatched bool `json:"dispatched"` + Error *string `json:"error,omitempty"` + Families []string `json:"families,omitempty"` + Queued *bool `json:"queued,omitempty"` + RepositoryID string `json:"repositoryId"` + RunID *string `json:"runId,omitempty"` +} + +type EndpointsScanScopeCoverageLoss struct { + Families []string `json:"families,omitempty"` + RepositoryID string `json:"repositoryId"` +} + +type EndpointsScanScopeEnrollmentReset struct { + Families []string `json:"families,omitempty"` + RepositoryID string `json:"repositoryId"` +} + +type EndpointsScanScopeOutput struct { + Entitlement EndpointsScanEntitlementView `json:"entitlement"` + UnavailableFromGitHub *EndpointsUnavailableFromGitHub `json:"unavailableFromGitHub,omitempty"` + UnavailableFromGitHubKnown bool `json:"unavailableFromGitHubKnown"` +} + +type EndpointsScannerRun struct { + CompletedAt *string `json:"completedAt,omitempty"` + CoverageStatus *string `json:"coverageStatus,omitempty"` + DegradedScanShards *int `json:"degradedScanShards,omitempty"` + FixedFindingsCount *int `json:"fixedFindingsCount,omitempty"` + IncompleteEntrypoints *int `json:"incompleteEntrypoints,omitempty"` + NewFindingsCount *int `json:"newFindingsCount,omitempty"` + ReintroducedFindingsCount *int `json:"reintroducedFindingsCount,omitempty"` + ScanRunID *string `json:"scanRunId,omitempty"` + ScanType *string `json:"scanType,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *string `json:"status,omitempty"` + TotalScanShards *int `json:"totalScanShards,omitempty"` +} + +type EndpointsScimCredentialView struct { + CreatedAt string `json:"createdAt"` + ID string `json:"id"` + LastUsedAt *string `json:"lastUsedAt,omitempty"` +} + type EndpointsServiceAccount struct { CreatedAt string `json:"createdAt"` Name string `json:"name"` Platform ModelsProviderID `json:"platform"` + Role *string `json:"role,omitempty"` ServiceAccountID string `json:"serviceAccountId"` TenantID string `json:"tenantId"` Token *string `json:"token,omitempty"` } +type EndpointsSkippedUserMapping struct { + ProviderID *string `json:"providerId,omitempty"` + ProviderUserID *string `json:"providerUserId,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type EndpointsSourceImpactCount struct { + Count *int `json:"count,omitempty"` + Source *DatabaseTicketSource `json:"source,omitempty"` +} + type EndpointsTeamMembershipExport struct { Role *string `json:"role,omitempty"` TeamID *string `json:"teamId,omitempty"` @@ -1212,6 +3440,14 @@ type EndpointsTeamMergeSource struct { TeamID string `json:"teamId"` } +type EndpointsTeamSLABreakdown struct { + InSLA int64 `json:"inSLA"` + OutOfSLA int64 `json:"outOfSLA"` + TeamID string `json:"teamID"` + TeamName string `json:"teamName"` + TeamSlug string `json:"teamSlug"` +} + type EndpointsTeamSourcePreferences struct { GithubTeamsEnabled bool `json:"githubTeamsEnabled"` RepositoryPropertyEnabled bool `json:"repositoryPropertyEnabled"` @@ -1230,6 +3466,150 @@ type EndpointsTeamSyncRun struct { TriggeredBy string `json:"triggeredBy"` } +type EndpointsTenantCapabilitiesOutput struct { + Capabilities []EndpointsTenantCapabilityView `json:"capabilities,omitempty"` +} + +type EndpointsTenantCapabilityView struct { + Capability string `json:"capability"` + CustomerEnabled *bool `json:"customerEnabled,omitempty"` + CustomerUpdatedAt *string `json:"customerUpdatedAt,omitempty"` + Description string `json:"description"` + DisabledLabel string `json:"disabledLabel"` + Enabled *bool `json:"enabled,omitempty"` + EnabledLabel string `json:"enabledLabel"` + LockReason string `json:"lockReason"` + Locked bool `json:"locked"` + Source string `json:"source"` + Title string `json:"title"` +} + +type EndpointsThreatNotificationDeliveryFailure struct { + FailedAt string `json:"failedAt"` + Message string `json:"message"` + Reason string `json:"reason"` +} + +type EndpointsThreatNotificationDestinations struct { + MicrosoftTeams EndpointsThreatNotificationTeams `json:"microsoftTeams"` + NullifySharedSlack EndpointsThreatNotificationNullifySlack `json:"nullifySharedSlack"` + TenantSlack EndpointsThreatNotificationTenantSlack `json:"tenantSlack"` +} + +type EndpointsThreatNotificationNullifySlack struct { + Enabled bool `json:"enabled"` +} + +type EndpointsThreatNotificationTeams struct { + Enabled bool `json:"enabled"` + LastDeliveryFailure *EndpointsThreatNotificationDeliveryFailure `json:"lastDeliveryFailure,omitempty"` + WebhookHost *string `json:"webhookHost,omitempty"` +} + +type EndpointsThreatNotificationTenantSlack struct { + Available bool `json:"available"` + ChannelID *string `json:"channelId,omitempty"` + Enabled bool `json:"enabled"` + LastDeliveryFailure *EndpointsThreatNotificationDeliveryFailure `json:"lastDeliveryFailure,omitempty"` +} + +type EndpointsTicketActivityEntry struct { + Actor *DatabaseTicketAuditActor `json:"actor,omitempty"` + ActorID *string `json:"actorId,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DetailsJson *string `json:"detailsJson,omitempty"` + EventType *DatabaseTicketAuditEventType `json:"eventType,omitempty"` + FindingTicketID *string `json:"findingTicketId,omitempty"` + ID *string `json:"id,omitempty"` +} + +type EndpointsTicketSettingsHistoryEntry struct { + AppliedAt *string `json:"appliedAt,omitempty"` + AppliedBy *string `json:"appliedBy,omitempty"` + FindingType *DatabaseFindingType `json:"findingType,omitempty"` + ID *string `json:"id,omitempty"` + MigrationAction *DatabaseTicketMigrationAction `json:"migrationAction,omitempty"` + NewSettingsJson *string `json:"newSettingsJson,omitempty"` + OldSettingsJson *string `json:"oldSettingsJson,omitempty"` +} + +type EndpointsTicketSettingsImpactPreview struct { + ByBoard []EndpointsBoardImpactCount `json:"byBoard,omitempty"` + BySource []EndpointsSourceImpactCount `json:"bySource,omitempty"` + SampleTickets []EndpointsFindingTicketSummary `json:"sampleTickets,omitempty"` + TicketsNowOutOfScopeCount *int `json:"ticketsNowOutOfScopeCount,omitempty"` + TicketsToCreateCount *int `json:"ticketsToCreateCount,omitempty"` +} + +type EndpointsTicketSettingsProposal struct { + DefaultBoardID *string `json:"defaultBoardId,omitempty"` + FiltersCweAllowlist []string `json:"filtersCweAllowlist,omitempty"` + FiltersCweBlocklist []string `json:"filtersCweBlocklist,omitempty"` + FiltersRepoAllowlist []string `json:"filtersRepoAllowlist,omitempty"` + FiltersRepoBlocklist []string `json:"filtersRepoBlocklist,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + PriorityThreshold ModelsPriorityLabel `json:"priorityThreshold"` + SeverityThreshold *ModelsSeverity `json:"severityThreshold,omitempty"` + TeamRoutingEnabled *bool `json:"teamRoutingEnabled,omitempty"` + UnroutedBehavior *string `json:"unroutedBehavior,omitempty"` +} + +type EndpointsTicketWorkbenchAuditEntry struct { + Actor *DatabaseTicketAuditActor `json:"actor,omitempty"` + ActorID *string `json:"actorId,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DetailsJson *string `json:"detailsJson,omitempty"` + EventType *DatabaseTicketAuditEventType `json:"eventType,omitempty"` + ID *string `json:"id,omitempty"` +} + +type EndpointsTicketWorkbenchFilter struct { + BoardID *string `json:"boardId,omitempty"` + ClosedAfter *string `json:"closedAfter,omitempty"` + ClosedBefore *string `json:"closedBefore,omitempty"` + CreatedAfter *string `json:"createdAfter,omitempty"` + CreatedBefore *string `json:"createdBefore,omitempty"` + FindingTypes []DatabaseFindingType `json:"findingTypes,omitempty"` + HasSyncError *bool `json:"hasSyncError,omitempty"` + Ids []string `json:"ids,omitempty"` + LastSyncedBefore *string `json:"lastSyncedBefore,omitempty"` + OutOfEligibilitySinceAfter *string `json:"outOfEligibilitySinceAfter,omitempty"` + Platforms []DatabaseTicketPlatform `json:"platforms,omitempty"` + Sources []DatabaseTicketSource `json:"sources,omitempty"` + Statuses []DatabaseTicketStatus `json:"statuses,omitempty"` + TextSearch *string `json:"textSearch,omitempty"` +} + +type EndpointsTriageContextCensusFinding struct { + FindingID string `json:"findingId"` + FindingType string `json:"findingType"` + MissingOrgContext bool `json:"missingOrgContext"` + MissingRepoContext bool `json:"missingRepoContext"` + OrgContextVersion *string `json:"orgContextVersion,omitempty"` + RepoContextVersion *string `json:"repoContextVersion,omitempty"` +} + +type EndpointsTriageContextCensusSummary struct { + FindingType string `json:"findingType"` + MissingOrgContext int64 `json:"missingOrgContext"` + MissingRepoContext int64 `json:"missingRepoContext"` + Total int64 `json:"total"` +} + +// EndpointsUnavailableFromGitHub — The GitHub repositories GitHub stopped sharing with Nullify. Repositories on other git platforms are never listed or counted, so a tenant without GitHub repositories always reads count 0 +type EndpointsUnavailableFromGitHub struct { + Count int `json:"count"` + Repositories []EndpointsUnavailableRepository `json:"repositories,omitempty"` +} + +type EndpointsUnavailableRepository struct { + DeactivatedAt *string `json:"deactivatedAt,omitempty"` + Owner string `json:"owner"` + Reason string `json:"reason"` + Repository string `json:"repository"` + RepositoryID string `json:"repositoryId"` +} + type EndpointsUnifiedEventOutput struct { AutofixID *string `json:"autofixId,omitempty"` CampaignID *string `json:"campaignId,omitempty"` @@ -1248,9 +3628,11 @@ type EndpointsUnifiedEventOutput struct { type EndpointsUpdateJiraConfigInput struct { AutoCreate bool `json:"autoCreate"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` IssueType string `json:"issueType"` + PriorityThreshold string `json:"priorityThreshold"` ProjectKey string `json:"projectKey"` - SeverityThreshold string `json:"severityThreshold"` } type EndpointsUpdateJiraConfigOutput struct { @@ -1303,6 +3685,82 @@ type EndpointsUserMappingSuggestion struct { Teams []ModelsUser `json:"teams,omitempty"` } +type EndpointsWorkspaceBootstrapIssueOutput struct { + ExpiresAt *string `json:"expiresAt,omitempty"` + InvitationToken *string `json:"invitationToken,omitempty"` + OperationID *string `json:"operationId,omitempty"` +} + +type EndpointsWorkspaceBootstrapOperatorInput struct { + DeploymentID *string `json:"deploymentId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedDirectoryID *string `json:"expectedDirectoryId,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + Reason *string `json:"reason,omitempty"` + Recipient *string `json:"recipient,omitempty"` +} + +type EndpointsWorkspaceBootstrapOperatorOutput struct { + DryRun *bool `json:"dryRun,omitempty"` + Invitation *EndpointsWorkspaceBootstrapIssueOutput `json:"invitation,omitempty"` + Target *WorkspacebootstrapTarget `json:"target,omitempty"` +} + +type EndpointsWorkspaceBootstrapRenewInput struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type EndpointsWorkspaceBootstrapRevokeInput struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type EndpointsWorkspaceEntraSSOPolicyInput struct { + DryRun *bool `json:"dryRun,omitempty"` + ExpectedUpdatedAt string `json:"expectedUpdatedAt"` + Reason string `json:"reason"` + Required *bool `json:"required,omitempty"` +} + +type EndpointsWorkspaceEntraSSOPolicyOutput struct { + DirectoryID *string `json:"directoryId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + MinimumAdminCount *int `json:"minimumAdminCount,omitempty"` + Pending *bool `json:"pending,omitempty"` + PendingRequired *bool `json:"pendingRequired,omitempty"` + Required *bool `json:"required,omitempty"` + UnlinkedMemberCount *int `json:"unlinkedMemberCount,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + UsableAdminCount *int `json:"usableAdminCount,omitempty"` +} + +type EndpointsWorkspaceProvisioningApproveInput struct { + Action *string `json:"action,omitempty"` + Confirm *bool `json:"confirm,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + ExpectedOperationRevision *int64 `json:"expectedOperationRevision,omitempty"` + ExpectedRevision *int64 `json:"expectedRevision,omitempty"` + Reason *string `json:"reason,omitempty"` + RequestID *string `json:"requestId,omitempty"` + SetupKind *string `json:"setupKind,omitempty"` +} + +type EndpointsWorkspaceProvisioningApproveOutput struct { + Decision *WorkspacebootstrapProvisioningDecision `json:"decision,omitempty"` +} + +type EndpointsWorkspaceProvisioningQueueOutput struct { + NextCursor *string `json:"nextCursor,omitempty"` + Requests []WorkspacebootstrapProvisioningRequest `json:"requests,omitempty"` +} + type EventbusService string const ( @@ -1321,6 +3779,57 @@ const ( EventbusServiceBilling EventbusService = "billing" ) +type GitlabauthGroup struct { + FullPath *string `json:"full_path,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ParentID *int `json:"parent_id,omitempty"` +} + +type GitlabauthProject struct { + Archived *bool `json:"archived,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + HttpUrlToRepo *string `json:"http_url_to_repo,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PathWithNamespace *string `json:"path_with_namespace,omitempty"` + WebURL *string `json:"web_url,omitempty"` +} + +type MetricdefsPeriod struct { + Days int `json:"days"` + End string `json:"end"` + Kind string `json:"kind"` + Label string `json:"label"` + PreviousStart string `json:"previousStart"` + Start string `json:"start"` +} + +type MetricdefsSpoke struct { + Available bool `json:"available"` + Definition string `json:"definition"` + Denominator int64 `json:"denominator"` + Key string `json:"key"` + Label string `json:"label"` + Numerator int64 `json:"numerator"` + SampleSize int64 `json:"sampleSize"` + Unit string `json:"unit"` + Value *float64 `json:"value,omitempty"` +} + +type MetricdefsState string + +const ( + MetricdefsStateOpen MetricdefsState = "open" + MetricdefsStateFixed MetricdefsState = "fixed" + MetricdefsStateFixPendingVerification MetricdefsState = "fix_pending_verification" + MetricdefsStateNoLongerDetected MetricdefsState = "no_longer_detected" + MetricdefsStateFalsePositive MetricdefsState = "false_positive" + MetricdefsStateAllowlisted MetricdefsState = "allowlisted" + MetricdefsStateArchived MetricdefsState = "archived" + MetricdefsStateDuplicate MetricdefsState = "duplicate" +) + type ModelsAWSAccount struct { AccountID string `json:"accountId"` AccountName string `json:"accountName"` @@ -1342,9 +3851,34 @@ type ModelsAWSAccountWithStatus struct { Status *string `json:"status,omitempty"` } -type ModelsAssignee struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` +type ModelsAWSConnectorPermissionGap struct { + AccountID string `json:"accountId"` + CheckedAt *string `json:"checkedAt,omitempty"` + Permission string `json:"permission"` + Service *string `json:"service,omitempty"` +} + +type ModelsAsanaOwnerProvider struct { + AccessToken string `json:"accessToken"` + WorkspaceID string `json:"workspaceId"` + WorkspaceName string `json:"workspaceName"` +} + +type ModelsAsanaTicketProject struct { + ProjectGid string `json:"projectGid"` + ProjectName string `json:"projectName"` + TeamGid *string `json:"teamGid,omitempty"` + WorkspaceGid string `json:"workspaceGid"` +} + +type ModelsAsanaTicketProvider struct { + ProjectGid string `json:"projectGid"` + TaskGid string `json:"taskGid"` + URL string `json:"url"` +} + +type ModelsAsanaUserProvider struct { + ID string `json:"id"` } type ModelsAzureEntraOwnerProvider struct { @@ -1372,7 +3906,7 @@ type ModelsAzureOwnerProvider struct { BaseURL string `json:"baseUrl"` OrganizationID string `json:"organizationId"` OrganizationName string `json:"organizationName"` - TenantID string `json:"tenantId"` + TenantID *string `json:"tenantId,omitempty"` } type ModelsAzureSubscriptionInput struct { @@ -1439,21 +3973,6 @@ type ModelsChecklistItem struct { Name string `json:"name"` } -type ModelsCode struct { - EnableFailBuilds *bool `json:"enableFailBuilds,omitempty"` - Ignore []ModelsCodeIgnore `json:"ignore,omitempty"` -} - -type ModelsCodeIgnore struct { - Cwes []int `json:"cwes,omitempty"` - Dirs []string `json:"dirs,omitempty"` - Expiry *string `json:"expiry,omitempty"` - Paths []string `json:"paths,omitempty"` - Reason *string `json:"reason,omitempty"` - Repositories []string `json:"repositories,omitempty"` - RuleIds []string `json:"ruleIds,omitempty"` -} - type ModelsCollection struct { CollectionID string `json:"collectionId"` Collections []ModelsSubCollection `json:"collections,omitempty"` @@ -1461,21 +3980,6 @@ type ModelsCollection struct { Name string `json:"name"` } -type ModelsConfiguration struct { - Code *ModelsCode `json:"code,omitempty"` - Dependencies *ModelsDependencies `json:"dependencies,omitempty"` - EnableFailBuilds *bool `json:"enableFailBuilds,omitempty"` - EnableIssueDashboards *bool `json:"enableIssueDashboards,omitempty"` - EnablePullRequestReviews *bool `json:"enablePullRequestReviews,omitempty"` - IgnoreDirs []string `json:"ignoreDirs,omitempty"` - IgnorePaths []string `json:"ignorePaths,omitempty"` - Integrations *ModelsIntegrations `json:"integrations,omitempty"` - PriorityThreshold *string `json:"priorityThreshold,omitempty"` - Secrets *ModelsSecrets `json:"secrets,omitempty"` - SecretsWhitelist []string `json:"secretsWhitelist,omitempty"` - SeverityThreshold *string `json:"severityThreshold,omitempty"` -} - type ModelsContainerImageMetadata struct { Digest *string `json:"digest,omitempty"` Distro map[string]json.RawMessage `json:"distro,omitempty"` @@ -1489,20 +3993,6 @@ type ModelsContainerImageMetadata struct { type ModelsDataMap struct { } -type ModelsDependencies struct { - EnableFailBuilds *bool `json:"enableFailBuilds,omitempty"` - Ignore []ModelsDependenciesIgnore `json:"ignore,omitempty"` -} - -type ModelsDependenciesIgnore struct { - Cves []string `json:"cves,omitempty"` - Dirs []string `json:"dirs,omitempty"` - Expiry *string `json:"expiry,omitempty"` - Paths []string `json:"paths,omitempty"` - Reason *string `json:"reason,omitempty"` - Repositories []string `json:"repositories,omitempty"` -} - type ModelsDeploymentType string const ( @@ -1535,11 +4025,139 @@ type ModelsExternalOwnerProvider struct { InstallationID string `json:"installationId"` } +type ModelsFamilyScope struct { + InScope *bool `json:"inScope,omitempty"` + Paths *ModelsPathScope `json:"paths,omitempty"` + Reason *ModelsScanScopeReason `json:"reason,omitempty"` +} + type ModelsFileOwners struct { ID string `json:"id"` Owners []ModelsFileOwner `json:"owners,omitempty"` } +type ModelsFindingPullRequestQuery struct { + FindingIds []string `json:"findingIds,omitempty"` + Page *int `json:"page,omitempty"` + PageSize *int `json:"pageSize,omitempty"` + PrIdentifiers []string `json:"prIdentifiers,omitempty"` + PrTypes []string `json:"prTypes,omitempty"` + RepositoryNames []string `json:"repositoryNames,omitempty"` + RepositoryOwners []string `json:"repositoryOwners,omitempty"` + Statuses []string `json:"statuses,omitempty"` +} + +type ModelsFindingPullRequestRecord struct { + AutofixID *string `json:"autofixId,omitempty"` + AzureProjectID *string `json:"azureProjectId,omitempty"` + BitbucketWorkspace *string `json:"bitbucketWorkspace,omitempty"` + CiCheckedAt *string `json:"ciCheckedAt,omitempty"` + CiDetailURL *string `json:"ciDetailUrl,omitempty"` + CiState *ModelsPullRequestCIState `json:"ciState,omitempty"` + ClosedAt *string `json:"closedAt,omitempty"` + ClosedAtSource *string `json:"closedAtSource,omitempty"` + ClosedBy *string `json:"closedBy,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + CurrentIterationID *string `json:"currentIterationId,omitempty"` + FindingID string `json:"findingId"` + FindingType string `json:"findingType"` + FirstReviewedAt *string `json:"firstReviewedAt,omitempty"` + GitlabProjectID *int `json:"gitlabProjectId,omitempty"` + HasCustomerCommit *bool `json:"hasCustomerCommit,omitempty"` + HasCustomerFeedback *bool `json:"hasCustomerFeedback,omitempty"` + ID string `json:"id"` + LastReviewedAt *string `json:"lastReviewedAt,omitempty"` + MergedAt *string `json:"mergedAt,omitempty"` + Platform string `json:"platform"` + PrCustomerInteracted *bool `json:"prCustomerInteracted,omitempty"` + PrIdentifier string `json:"prIdentifier"` + PrStatus string `json:"prStatus"` + PrTitle *string `json:"prTitle,omitempty"` + PrType string `json:"prType"` + PrURL *string `json:"prUrl,omitempty"` + Recovery *ModelsPullRequestRecoveryObservation `json:"recovery,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + RepositoryName *string `json:"repositoryName,omitempty"` + RepositoryOwner *string `json:"repositoryOwner,omitempty"` + SourceBranch *string `json:"sourceBranch,omitempty"` + TargetBranch *string `json:"targetBranch,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type ModelsFindingStatus string + +const ( + ModelsFindingStatusBacklog ModelsFindingStatus = "BACKLOG" + ModelsFindingStatusInProgress ModelsFindingStatus = "IN_PROGRESS" + ModelsFindingStatusResolved ModelsFindingStatus = "RESOLVED" +) + +type ModelsFindingsGroup struct { + Count int `json:"count"` + Key string `json:"key"` + Label string `json:"label"` +} + +type ModelsFindingsGroupBy string + +const ( + ModelsFindingsGroupByRepository ModelsFindingsGroupBy = "repository" + ModelsFindingsGroupByBranch ModelsFindingsGroupBy = "branch" + ModelsFindingsGroupByType ModelsFindingsGroupBy = "type" + ModelsFindingsGroupByPriority ModelsFindingsGroupBy = "priority" + ModelsFindingsGroupByLanguage ModelsFindingsGroupBy = "language" +) + +type ModelsFindingsRepositoryMetrics struct { + FindingsCount int `json:"findingsCount"` + FindingsFalsePositiveCount *int `json:"findingsFalsePositiveCount,omitempty"` + FindingsFixedCount *int `json:"findingsFixedCount,omitempty"` + FindingsNoLongerDetectedCount *int `json:"findingsNoLongerDetectedCount,omitempty"` + FindingsOtherResolvedCount *int `json:"findingsOtherResolvedCount,omitempty"` + FindingsResolvedCount int `json:"findingsResolvedCount"` + MeanTimeToResolve *int `json:"meanTimeToResolve,omitempty"` + MedianTimeToResolve *int `json:"medianTimeToResolve,omitempty"` + Platform *string `json:"platform,omitempty"` + Repository string `json:"repository"` + RepositoryID string `json:"repositoryId"` + RepositoryOwner *string `json:"repositoryOwner,omitempty"` +} + +type ModelsForgeProductSettings struct { + CompassEnabled *bool `json:"compassEnabled,omitempty"` + ConfluenceEnabled *bool `json:"confluenceEnabled,omitempty"` + ConfluenceSpaceIds []string `json:"confluenceSpaceIds,omitempty"` + JiraEnabled *bool `json:"jiraEnabled,omitempty"` + Revision *int64 `json:"revision,omitempty"` +} + +type ModelsFrameworkControlSummary struct { + Control string `json:"control"` + Critical int `json:"critical"` + High int `json:"high"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + +type ModelsFrameworkFindingsSummary struct { + Assessed bool `json:"assessed"` + Controls []ModelsFrameworkControlSummary `json:"controls,omitempty"` + Critical int `json:"critical"` + Framework string `json:"framework"` + High int `json:"high"` + Source ModelsFrameworkSource `json:"source"` + Title string `json:"title"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + +type ModelsFrameworkSource string + +const ( + ModelsFrameworkSourceCode ModelsFrameworkSource = "code" + ModelsFrameworkSourceCloud ModelsFrameworkSource = "cloud" +) + type ModelsGCPProjectInput struct { DisplayName *string `json:"displayName,omitempty"` IsDefault *bool `json:"isDefault,omitempty"` @@ -1549,8 +4167,10 @@ type ModelsGCPProjectInput struct { type ModelsGCPProjectWithStatus struct { AccountType *string `json:"accountType,omitempty"` + AutoDiscovered bool `json:"autoDiscovered"` IsDefault bool `json:"isDefault"` IsEnabled bool `json:"isEnabled"` + LastDiscoveredAt *string `json:"lastDiscoveredAt,omitempty"` LastVerifiedAt *string `json:"lastVerifiedAt,omitempty"` LastVerifiedStatus *string `json:"lastVerifiedStatus,omitempty"` ProjectID string `json:"projectId"` @@ -1558,6 +4178,13 @@ type ModelsGCPProjectWithStatus struct { State *string `json:"state,omitempty"` } +type ModelsGitHubCredentialSource string + +const ( + ModelsGitHubCredentialSourceDedicatedDirect ModelsGitHubCredentialSource = "dedicated_direct" + ModelsGitHubCredentialSourceSharedRouter ModelsGitHubCredentialSource = "shared_router" +) + type ModelsGitHubGitPullRequest struct { PullRequestNodeID string `json:"pullRequestNodeId"` PullRequestNumber int64 `json:"pullRequestNumber"` @@ -1574,6 +4201,7 @@ type ModelsGitHubGitRepositoryProvider struct { type ModelsGitHubOwnerProvider struct { BaseURL string `json:"baseUrl"` + ExecutionIdentity *ModelsGitHubExecutionIdentity `json:"executionIdentity,omitempty"` InstallationID int64 `json:"installationId"` Owner string `json:"owner"` OwnerID int64 `json:"ownerId"` @@ -1596,7 +4224,7 @@ type ModelsGitHubTicketProvider struct { type ModelsGitHubUserProvider struct { ID int64 `json:"id"` - NodeID string `json:"nodeId"` + NodeID *string `json:"nodeId,omitempty"` } type ModelsGitLabGitPullRequest struct { @@ -1612,6 +4240,7 @@ type ModelsGitLabOwnerProvider struct { BaseURL string `json:"baseUrl"` GroupID int64 `json:"groupId"` GroupName string `json:"groupName"` + Oauth *bool `json:"oauth,omitempty"` } type ModelsGitLabTicketProject struct { @@ -1625,6 +4254,7 @@ type ModelsGitLabUserProvider struct { } type ModelsGoogleWorkspaceOwnerProvider struct { + AdminEmail *string `json:"adminEmail,omitempty"` Domain string `json:"domain"` ServiceAccountJson string `json:"serviceAccountJson"` } @@ -1639,41 +4269,28 @@ type ModelsGroundRule struct { Title string `json:"title"` } -type ModelsIntegrations struct { - Jira *ModelsJira `json:"jira,omitempty"` -} +type ModelsInferenceRegion string -type ModelsJira struct { - Assignee *ModelsAssignee `json:"assignee,omitempty"` - CommentOnClose *bool `json:"commentOnClose,omitempty"` - DescriptionTemplate *string `json:"descriptionTemplate,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - IssueType *string `json:"issueType,omitempty"` - Labels []string `json:"labels,omitempty"` - OnFixTransition *string `json:"onFixTransition,omitempty"` - Priorities *ModelsPriorities `json:"priorities,omitempty"` - PriorityThreshold *string `json:"priorityThreshold,omitempty"` - ProjectKey *string `json:"projectKey,omitempty"` - SeverityThreshold *string `json:"severityThreshold,omitempty"` - TitleTemplate *string `json:"titleTemplate,omitempty"` -} +const ( + ModelsInferenceRegionGlobal ModelsInferenceRegion = "global" + ModelsInferenceRegionUs ModelsInferenceRegion = "us" +) type ModelsJiraConfig struct { AutoCreate bool `json:"autoCreate"` CreatedAt string `json:"createdAt"` + DefaultAssigneeID *string `json:"defaultAssigneeId,omitempty"` + EnabledFindingTypes []string `json:"enabledFindingTypes,omitempty"` IssueType string `json:"issueType"` + PriorityThreshold ModelsPriorityLabel `json:"priorityThreshold"` ProjectKey string `json:"projectKey"` - SeverityThreshold string `json:"severityThreshold"` UpdatedAt string `json:"updatedAt"` } type ModelsJiraOwnerProvider struct { - AppKeyID string `json:"appKeyId"` BaseURL string `json:"baseUrl"` InstallationID string `json:"installationId"` OwnerID string `json:"ownerId"` - SharedSecret string `json:"sharedSecret"` } type ModelsJiraTicketProject struct { @@ -1692,6 +4309,43 @@ type ModelsJiraUserProvider struct { Name *string `json:"name,omitempty"` } +type ModelsK8SClusterInput struct { + CloudAccountID *string `json:"cloudAccountId,omitempty"` + ClusterName string `json:"clusterName"` + ClusterType ModelsK8SClusterType `json:"clusterType"` + CollectConfigMaps *bool `json:"collectConfigMaps,omitempty"` + CollectSecrets *bool `json:"collectSecrets,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Region *string `json:"region,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` +} + +type ModelsK8SClusterType string + +const ( + ModelsK8SClusterTypeEks ModelsK8SClusterType = "EKS" + ModelsK8SClusterTypeAks ModelsK8SClusterType = "AKS" + ModelsK8SClusterTypeGke ModelsK8SClusterType = "GKE" + ModelsK8SClusterTypeOnPrem ModelsK8SClusterType = "ON_PREM" +) + +type ModelsK8SClusterWithStatus struct { + CloudAccountID *string `json:"cloudAccountId,omitempty"` + ClusterName string `json:"clusterName"` + ClusterType ModelsK8SClusterType `json:"clusterType"` + CollectConfigMaps *bool `json:"collectConfigMaps,omitempty"` + CollectSecrets *bool `json:"collectSecrets,omitempty"` + ID string `json:"id"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LastVerificationCode *string `json:"lastVerificationCode,omitempty"` + LastVerificationDetail *string `json:"lastVerificationDetail,omitempty"` + LastVerifiedAt *string `json:"lastVerifiedAt,omitempty"` + LastVerifiedStatus *string `json:"lastVerifiedStatus,omitempty"` + Region *string `json:"region,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + ScanIdentity string `json:"scanIdentity"` +} + type ModelsLanguageName string const ( @@ -1709,8 +4363,10 @@ const ( ModelsLanguageNameCsharp ModelsLanguageName = "C#" ModelsLanguageNameDart ModelsLanguageName = "Dart" ModelsLanguageNameElixir ModelsLanguageName = "Elixir" + ModelsLanguageNameErlang ModelsLanguageName = "Erlang" ModelsLanguageNameGeneric ModelsLanguageName = "Generic" ModelsLanguageNameGo ModelsLanguageName = "Go" + ModelsLanguageNameHaskell ModelsLanguageName = "Haskell" ModelsLanguageNameHcl ModelsLanguageName = "HCL" ModelsLanguageNameHtml ModelsLanguageName = "HTML" ModelsLanguageNameJava ModelsLanguageName = "Java" @@ -1735,6 +4391,7 @@ const ( ModelsLanguageNameServerless ModelsLanguageName = "Serverless" ModelsLanguageNameShell ModelsLanguageName = "Shell" ModelsLanguageNameSolidity ModelsLanguageName = "Solidity" + ModelsLanguageNameSql ModelsLanguageName = "SQL" ModelsLanguageNameSwift ModelsLanguageName = "Swift" ModelsLanguageNameTerraform ModelsLanguageName = "Terraform" ModelsLanguageNameTypescript ModelsLanguageName = "TypeScript" @@ -1743,18 +4400,23 @@ const ( ) type ModelsLimitedUnifiedFindingsQuery struct { + AiGenerated *bool `json:"aiGenerated,omitempty"` AppName []string `json:"appName,omitempty"` - AppType []string `json:"appType,omitempty"` + AsOf *string `json:"asOf,omitempty"` AutoFixState []string `json:"autoFixState,omitempty"` Branch []string `json:"branch,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` Cve []string `json:"cve,omitempty"` Cwe []string `json:"cwe,omitempty"` ExploitValidated *bool `json:"exploitValidated,omitempty"` FileOwner []string `json:"fileOwner,omitempty"` FindingID []string `json:"findingId,omitempty"` + FixEvidence []string `json:"fixEvidence,omitempty"` + Frameworks []string `json:"frameworks,omitempty"` FromDate *string `json:"fromDate,omitempty"` FromPriorityScore *int `json:"fromPriorityScore,omitempty"` HasAutoFix *bool `json:"hasAutoFix,omitempty"` + HasMultipleVersions *bool `json:"hasMultipleVersions,omitempty"` HasTicket *bool `json:"hasTicket,omitempty"` HasTicketOrPR *bool `json:"hasTicketOrPR,omitempty"` Host []string `json:"host,omitempty"` @@ -1765,13 +4427,16 @@ type ModelsLimitedUnifiedFindingsQuery struct { IsAllowlisted *bool `json:"isAllowlisted,omitempty"` IsArchived *bool `json:"isArchived,omitempty"` IsAutofixed *bool `json:"isAutofixed,omitempty"` + IsDefaultBranch *bool `json:"isDefaultBranch,omitempty"` IsDirect *bool `json:"isDirect,omitempty"` IsFalsePositive *bool `json:"isFalsePositive,omitempty"` IsFixed *bool `json:"isFixed,omitempty"` IsInternetReachable *bool `json:"isInternetReachable,omitempty"` IsPushWorkflow *bool `json:"isPushWorkflow,omitempty"` + IsRepositoryArchived *bool `json:"isRepositoryArchived,omitempty"` IsResolved *bool `json:"isResolved,omitempty"` Language []string `json:"language,omitempty"` + MetricState []string `json:"metricState,omitempty"` NotfindingID []string `json:"notfindingId,omitempty"` Package []string `json:"package,omitempty"` Platform []string `json:"platform,omitempty"` @@ -1779,9 +4444,12 @@ type ModelsLimitedUnifiedFindingsQuery struct { Repository []string `json:"repository,omitempty"` RepositoryID []string `json:"repositoryId,omitempty"` RuleID []string `json:"ruleId,omitempty"` + ScanRunID []string `json:"scanRunId,omitempty"` Search *string `json:"search,omitempty"` SecretType []string `json:"secretType,omitempty"` + SecretValidated *bool `json:"secretValidated,omitempty"` Severity []string `json:"severity,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` Sort []map[string]map[string]json.RawMessage `json:"sort,omitempty"` SortPreset *ModelsUnifiedFindingsSortPreset `json:"sortPreset,omitempty"` TeamIDs []string `json:"teamIDs,omitempty"` @@ -1792,6 +4460,16 @@ type ModelsLimitedUnifiedFindingsQuery struct { UrgentMaxDays *int `json:"urgentMaxDays,omitempty"` } +type ModelsLinearInstallState string + +const ( + ModelsLinearInstallStateUnavailable ModelsLinearInstallState = "unavailable" + ModelsLinearInstallStateNotInstalled ModelsLinearInstallState = "not_installed" + ModelsLinearInstallStateCredentialsRejected ModelsLinearInstallState = "credentials_rejected" + ModelsLinearInstallStateReconnectRequired ModelsLinearInstallState = "reconnect_required" + ModelsLinearInstallStateInstalled ModelsLinearInstallState = "installed" +) + type ModelsLinearOwnerProvider struct { AccessToken *string `json:"accessToken,omitempty"` ClientID string `json:"clientId"` @@ -1850,6 +4528,12 @@ type ModelsNotificationEventNewAPIFindings struct { MinimumSeverity *ModelsSeverity `json:"minimumSeverity,omitempty"` } +type ModelsNotificationEventNewCloudFindings struct { + CloudProviders []string `json:"cloudProviders,omitempty"` + MinimumPriority *int `json:"minimumPriority,omitempty"` + MinimumSeverity *ModelsSeverity `json:"minimumSeverity,omitempty"` +} + type ModelsNotificationEventNewCodeFindings struct { Cwes []int `json:"cwes,omitempty"` MinimumPriority *int `json:"minimumPriority,omitempty"` @@ -1867,6 +4551,11 @@ type ModelsNotificationEventNewSecretFindings struct { Types []string `json:"types,omitempty"` } +type ModelsNotificationEventNewSupplyChainFindings struct { + FindingTypes []string `json:"findingTypes,omitempty"` + MinimumSeverity *ModelsSeverity `json:"minimumSeverity,omitempty"` +} + type ModelsNotificationEventThreatIntel struct { Cves []string `json:"cves,omitempty"` Ecosystems []string `json:"ecosystems,omitempty"` @@ -1876,9 +4565,11 @@ type ModelsNotificationEventThreatIntel struct { type ModelsNotificationEvents struct { All *ModelsNotificationEventAll `json:"all,omitempty"` NewApiFindings *ModelsNotificationEventNewAPIFindings `json:"newApiFindings,omitempty"` + NewCloudFindings *ModelsNotificationEventNewCloudFindings `json:"newCloudFindings,omitempty"` NewCodeFindings *ModelsNotificationEventNewCodeFindings `json:"newCodeFindings,omitempty"` NewDependencyFindings *ModelsNotificationEventNewDependencyFindings `json:"newDependencyFindings,omitempty"` NewSecretFindings *ModelsNotificationEventNewSecretFindings `json:"newSecretFindings,omitempty"` + NewSupplyChainFindings *ModelsNotificationEventNewSupplyChainFindings `json:"newSupplyChainFindings,omitempty"` ThreatIntel *ModelsNotificationEventThreatIntel `json:"threatIntel,omitempty"` } @@ -1929,6 +4620,129 @@ type ModelsOrganization struct { Teams []ModelsTeam `json:"teams,omitempty"` } +type ModelsOverviewBotSignal struct { + BotPullRequests int64 `json:"botPullRequests"` + IssuesFoundInPullRequests int64 `json:"issuesFoundInPullRequests"` + Ratio MetricdefsRatio `json:"ratio"` +} + +type ModelsOverviewCanonical struct { + Fixes ModelsOverviewFixes `json:"fixes"` + Funnel []ModelsOverviewFunnelStage `json:"funnel,omitempty"` + Lifecycle ModelsOverviewLifecycle `json:"lifecycle"` + Period MetricdefsPeriod `json:"period"` + Posture []MetricdefsSpoke `json:"posture,omitempty"` + Priority ModelsOverviewPriorityBands `json:"priority"` + PullRequests ModelsOverviewPullRequests `json:"pullRequests"` + Scope ModelsOverviewScope `json:"scope"` + Severity ModelsOverviewSeverityBands `json:"severity"` + SeverityFunnels []ModelsOverviewSeverityFunnel `json:"severityFunnels,omitempty"` + TimeToResolve ModelsOverviewTimeToResolve `json:"timeToResolve"` + Types []ModelsOverviewTypeTile `json:"types,omitempty"` +} + +type ModelsOverviewFixEvidenceCounts struct { + BaseImageChanged int64 `json:"baseImageChanged"` + DependencyRemoved int64 `json:"dependencyRemoved"` + DependencyVersionChanged int64 `json:"dependencyVersionChanged"` + FileRemoved int64 `json:"fileRemoved"` + MergedFixPr int64 `json:"mergedFixPr"` + VulnerableLinesChanged int64 `json:"vulnerableLinesChanged"` +} + +type ModelsOverviewFixes struct { + ByEvidence ModelsOverviewFixEvidenceCounts `json:"byEvidence"` + Dismissed int64 `json:"dismissed"` + InPeriod int64 `json:"inPeriod"` + InPeriodStillReported int64 `json:"inPeriodStillReported"` + InPreviousPeriod int64 `json:"inPreviousPeriod"` + PendingVerification int64 `json:"pendingVerification"` + RemovedWithMergedPrInPeriod int64 `json:"removedWithMergedPrInPeriod"` + ShippedInPeriod int64 `json:"shippedInPeriod"` + ToDate int64 `json:"toDate"` +} + +type ModelsOverviewFunnelStage struct { + Count int64 `json:"count"` + Key string `json:"key"` + Label string `json:"label"` +} + +type ModelsOverviewLifecycle struct { + Allowlisted int64 `json:"allowlisted"` + Archived int64 `json:"archived"` + Duplicate int64 `json:"duplicate"` + FalsePositive int64 `json:"falsePositive"` + FixPendingVerification int64 `json:"fixPendingVerification"` + Fixed int64 `json:"fixed"` + NoLongerDetected int64 `json:"noLongerDetected"` + Open int64 `json:"open"` +} + +type ModelsOverviewPriorityBands struct { + Important int64 `json:"important"` + Negligible int64 `json:"negligible"` + Urgent int64 `json:"urgent"` +} + +type ModelsOverviewPullRequests struct { + BotSignal ModelsOverviewBotSignal `json:"botSignal"` + ByType ModelsPullRequestTypeCounts `json:"byType"` + Closed int64 `json:"closed"` + ClosedUnmergedInPeriod int64 `json:"closedUnmergedInPeriod"` + CreatedInPeriod int64 `json:"createdInPeriod"` + Distinct int64 `json:"distinct"` + Draft int64 `json:"draft"` + MergeReady MetricdefsRatio `json:"mergeReady"` + Merged int64 `json:"merged"` + MergedAtWithoutMergedStatus int64 `json:"mergedAtWithoutMergedStatus"` + MergedInPeriod int64 `json:"mergedInPeriod"` + Open int64 `json:"open"` + TimeToMerge ModelsDurationStats `json:"timeToMerge"` + Unclassified int64 `json:"unclassified"` +} + +type ModelsOverviewScope struct { + Description string `json:"description"` + Open int64 `json:"open"` + OpenFailedTriage int64 `json:"openFailedTriage"` + OpenUntriaged int64 `json:"openUntriaged"` + Total int64 `json:"total"` +} + +type ModelsOverviewSeverityBands struct { + Critical int64 `json:"critical"` + High int64 `json:"high"` + Info int64 `json:"info"` + Low int64 `json:"low"` + Medium int64 `json:"medium"` + Unrated int64 `json:"unrated"` +} + +type ModelsOverviewSeverityFunnel struct { + Critical int64 `json:"critical"` + High int64 `json:"high"` + Info int64 `json:"info"` + Key string `json:"key"` + Low int64 `json:"low"` + Medium int64 `json:"medium"` + Unrated int64 `json:"unrated"` +} + +type ModelsOverviewTimeToResolve struct { + InPeriod ModelsDurationStats `json:"inPeriod"` + ToDate ModelsDurationStats `json:"toDate"` +} + +type ModelsOverviewTypeTile struct { + Important int64 `json:"important"` + Key string `json:"key"` + Label string `json:"label"` + Negligible int64 `json:"negligible"` + Open int64 `json:"open"` + Urgent int64 `json:"urgent"` +} + type ModelsOwnerType string const ( @@ -1946,21 +4760,51 @@ type ModelsPII struct { Sources []ModelsSource `json:"sources,omitempty"` } -type ModelsPriorities struct { - Critical *string `json:"critical,omitempty"` - High *string `json:"high,omitempty"` - Important *string `json:"important,omitempty"` - Low *string `json:"low,omitempty"` - Medium *string `json:"medium,omitempty"` - Negligible *string `json:"negligible,omitempty"` - Urgent *string `json:"urgent,omitempty"` -} - type ModelsProcessing struct { Occurrences []ModelsOccurrence `json:"occurrences,omitempty"` SourceID string `json:"sourceId"` } +type ModelsPullRequestDefinitions struct { + ByType ModelsPullRequestTypeCounts `json:"byType"` + Closed int64 `json:"closed"` + ClosedUnmergedInPeriod int64 `json:"closedUnmergedInPeriod"` + CreatedInPeriod int64 `json:"createdInPeriod"` + Distinct int64 `json:"distinct"` + Draft int64 `json:"draft"` + MergeReady MetricdefsRatio `json:"mergeReady"` + Merged int64 `json:"merged"` + MergedAtWithoutMergedStatus int64 `json:"mergedAtWithoutMergedStatus"` + MergedInPeriod int64 `json:"mergedInPeriod"` + Open int64 `json:"open"` + TimeToMerge ModelsDurationStats `json:"timeToMerge"` + Unclassified int64 `json:"unclassified"` +} + +type ModelsPullRequestMetrics struct { + Definitions ModelsPullRequestDefinitions `json:"definitions"` + Period MetricdefsPeriod `json:"period"` +} + +type ModelsPullRequestMetricsQuery struct { + FindingType []string `json:"findingType,omitempty"` + FromDate *string `json:"fromDate,omitempty"` + Platform []string `json:"platform,omitempty"` + PrType []string `json:"prType,omitempty"` + RepositoryID []string `json:"repositoryId,omitempty"` + RepositoryOwner []string `json:"repositoryOwner,omitempty"` + ToDate *string `json:"toDate,omitempty"` +} + +type ModelsPullRequestRecoveryObservation struct { + Detail *string `json:"detail,omitempty"` + Disposition string `json:"disposition"` + Kind string `json:"kind"` + ObservedAt string `json:"observedAt"` + StuckDetectedAt *string `json:"stuckDetectedAt,omitempty"` + StuckReason *string `json:"stuckReason,omitempty"` +} + type ModelsPullRequestStateWithDiffs struct { Diffs []ModelsDiffFile `json:"diffs,omitempty"` ID string `json:"id"` @@ -1968,6 +4812,35 @@ type ModelsPullRequestStateWithDiffs struct { URL string `json:"url"` } +type ModelsPullRequestTypeCounts struct { + Allowlist int64 `json:"allowlist"` + Autofix int64 `json:"autofix"` + ManualFix int64 `json:"manualFix"` +} + +type ModelsRemediationFunnel struct { + Aging ModelsRemediationFunnelAging `json:"aging"` + FixSourceBreakdown map[string]int `json:"fixSourceBreakdown,omitempty"` + Stages ModelsRemediationFunnelStages `json:"stages"` + Version int `json:"version"` +} + +type ModelsRemediationFunnelAging struct { + CachedNoPr ModelsStageAge `json:"cachedNoPr"` + PrOpenReviewedUnmerged ModelsStageAge `json:"prOpenReviewedUnmerged"` + PrOpenUnreviewed ModelsStageAge `json:"prOpenUnreviewed"` +} + +type ModelsRemediationFunnelStages struct { + CachedNoPr int `json:"cachedNoPr"` + Detected int `json:"detected"` + PrMerged int `json:"prMerged"` + PrOpenReviewed int `json:"prOpenReviewed"` + PrOpenUnreviewed int `json:"prOpenUnreviewed"` + Triaged int `json:"triaged"` + VerifiedFixed int `json:"verifiedFixed"` +} + type ModelsRepository struct { CloneURL string `json:"cloneURL"` CreatedAt *string `json:"createdAt,omitempty"` @@ -1991,6 +4864,7 @@ type ModelsRepository struct { OwnerProvider ModelsOwnerProvider `json:"ownerProvider"` Provider ModelsGitRepositoryProvider `json:"provider"` PushedAt *string `json:"pushedAt,omitempty"` + RepoSizeBytes *int64 `json:"repoSizeBytes,omitempty"` RepoSizeGiB int32 `json:"repoSizeGiB"` StarCount *int `json:"starCount,omitempty"` Topics []string `json:"topics,omitempty"` @@ -1998,6 +4872,31 @@ type ModelsRepository struct { Visibility *string `json:"visibility,omitempty"` } +type ModelsSCPMEnforcementSource string + +const ( + ModelsSCPMEnforcementSourceDefault ModelsSCPMEnforcementSource = "default" + ModelsSCPMEnforcementSourceOrganization ModelsSCPMEnforcementSource = "organization" + ModelsSCPMEnforcementSourceRepository ModelsSCPMEnforcementSource = "repository" +) + +type ModelsSCPMRuleMode string + +const ( + ModelsSCPMRuleModeOff ModelsSCPMRuleMode = "off" + ModelsSCPMRuleModeWarn ModelsSCPMRuleMode = "warn" + ModelsSCPMRuleModeBlock ModelsSCPMRuleMode = "block" +) + +type ModelsSCPMRuleSuppression string + +const ( + // (skipped value "" — no representable Go identifier) + ModelsSCPMRuleSuppressionRuleOff ModelsSCPMRuleSuppression = "rule_off" + ModelsSCPMRuleSuppressionPathExcluded ModelsSCPMRuleSuppression = "path_excluded" + ModelsSCPMRuleSuppressionSeverityFloor ModelsSCPMRuleSuppression = "severity_floor" +) + type ModelsSLA struct { AllowExtensions bool `json:"allowExtensions"` ID *string `json:"id,omitempty"` @@ -2006,32 +4905,65 @@ type ModelsSLA struct { Severity ModelsSeverity `json:"severity"` } -type ModelsSecrets struct { - CustomPatterns map[string]ModelsSecretsCustomPattern `json:"customPatterns,omitempty"` - CustomPatternsOverrideGlobal *bool `json:"customPatternsOverrideGlobal,omitempty"` - EnableFailBuilds *bool `json:"enableFailBuilds,omitempty"` - Ignore []ModelsSecretsIgnore `json:"ignore,omitempty"` +type ModelsScanScope struct { + Code *ModelsFamilyScope `json:"code,omitempty"` + Scoped *bool `json:"scoped,omitempty"` + Secrets *ModelsFamilyScope `json:"secrets,omitempty"` } -type ModelsSecretsCustomPattern struct { - Description *string `json:"description,omitempty"` - Entropy *float64 `json:"entropy,omitempty"` - Keywords []string `json:"keywords,omitempty"` - PathRegex *string `json:"pathRegex,omitempty"` - SecretRegex *string `json:"secretRegex,omitempty"` - SecretRegexGroup *int `json:"secretRegexGroup,omitempty"` +type ModelsScanScopeAvailability string + +const ( + ModelsScanScopeAvailabilityInScope ModelsScanScopeAvailability = "in_scope" + ModelsScanScopeAvailabilityCustomerDisabled ModelsScanScopeAvailability = "customer_disabled" + ModelsScanScopeAvailabilityStaffExcluded ModelsScanScopeAvailability = "staff_excluded" + ModelsScanScopeAvailabilityGithubNotInstalled ModelsScanScopeAvailability = "github_not_installed" + ModelsScanScopeAvailabilityUnknown ModelsScanScopeAvailability = "unknown" +) + +// ModelsScanScopeExplanation — lockedBy: who holds the repository out of the customer's reach: github when the platform no longer shares it, staff when the staff allowlist leaves it out. staff still lets the customer un-enroll the repository and edit its directories. none does not mean enrolling fits: check the entitlement's usage against its cap. An unscoped tenant reports in_scope alongside lockedBy github for an inactive or missing row; lockedBy is authoritative for display only, never for whether a family scans +type ModelsScanScopeExplanation struct { + Code ModelsScanScopeFamilyExplanation `json:"code"` + CodePaths ModelsScanScopePathProvenance `json:"codePaths"` + LockedBy ModelsScanScopeLock `json:"lockedBy"` + Secrets ModelsScanScopeFamilyExplanation `json:"secrets"` + SecretsExcludes []string `json:"secretsExcludes,omitempty"` } -type ModelsSecretsIgnore struct { - Expiry *string `json:"expiry,omitempty"` - Paths []string `json:"paths,omitempty"` - Pattern *string `json:"pattern,omitempty"` - Reason *string `json:"reason,omitempty"` - Repositories []string `json:"repositories,omitempty"` - Sha256 *string `json:"sha256,omitempty"` - Value *string `json:"value,omitempty"` +// ModelsScanScopeFamilyExplanation — reason: in_scope, or the first level that keeps the family out: github_not_installed, staff_excluded, then customer_disabled. unknown is out of scope for a reason none of those names: treat it as out of scope and not changeable +type ModelsScanScopeFamilyExplanation struct { + InScope bool `json:"inScope"` + Reason ModelsScanScopeAvailability `json:"reason"` +} + +type ModelsScanScopeLock string + +const ( + ModelsScanScopeLockNone ModelsScanScopeLock = "none" + ModelsScanScopeLockStaff ModelsScanScopeLock = "staff" + ModelsScanScopeLockGithub ModelsScanScopeLock = "github" +) + +// ModelsScanScopePathProvenance — effective: the directories code scans read, the customer rules cut to the staff rules, an empty scope being the whole repository; absent when code scans read nothing, because code is out of scope or every stored include is invalid. staff: the directories Nullify limits code scanning to and skips, as stored. customer: the directories the customer chose, as stored +type ModelsScanScopePathProvenance struct { + Customer ModelsPathScope `json:"customer"` + Effective *ModelsPathScope `json:"effective,omitempty"` + Staff ModelsPathScope `json:"staff"` } +type ModelsScanScopeReason string + +const ( + ModelsScanScopeReasonUnscoped ModelsScanScopeReason = "unscoped" + ModelsScanScopeReasonEnrolled ModelsScanScopeReason = "enrolled" + ModelsScanScopeReasonNotEnrolled ModelsScanScopeReason = "not_enrolled" + ModelsScanScopeReasonNotSynced ModelsScanScopeReason = "not_synced" + ModelsScanScopeReasonInactive ModelsScanScopeReason = "inactive" + ModelsScanScopeReasonNotAllowlisted ModelsScanScopeReason = "not_allowlisted" + ModelsScanScopeReasonOutsideStaffPaths ModelsScanScopeReason = "outside_staff_paths" + ModelsScanScopeReasonExcluded ModelsScanScopeReason = "excluded" +) + type ModelsSensitivity string const ( @@ -2069,12 +5001,33 @@ type ModelsSource struct { Tags ModelsDataMap `json:"tags"` } +type ModelsStageAge struct { + Count int `json:"count"` + OldestMs int `json:"oldestMs"` + P50Ms int `json:"p50Ms"` + P90Ms int `json:"p90Ms"` +} + +type ModelsStageSampleSizes struct { + Autofix *int `json:"autofix,omitempty"` + DetectAndTriage *int `json:"detectAndTriage,omitempty"` + DetectAndTriageAfterOutliers *int `json:"detectAndTriageAfterOutliers,omitempty"` + Merge *int `json:"merge,omitempty"` + MergeAfterOutliers *int `json:"mergeAfterOutliers,omitempty"` + PullRequestCreation *int `json:"pullRequestCreation,omitempty"` + PullRequestCreationAfterOutliers *int `json:"pullRequestCreationAfterOutliers,omitempty"` + Review *int `json:"review,omitempty"` + ReviewAfterOutliers *int `json:"reviewAfterOutliers,omitempty"` + Triage *int `json:"triage,omitempty"` +} + type ModelsSubCollection struct { Occurrences []ModelsOccurrence `json:"occurrences,omitempty"` SourceID string `json:"sourceId"` } type ModelsTeam struct { + Azure *ModelsTeamProviderAzure `json:"azure,omitempty"` CodeOwnerships []ModelsTeamCodeOwnership `json:"codeOwnerships,omitempty"` Github *ModelsTeamProviderGitHub `json:"github,omitempty"` Gitlab *ModelsTeamProviderGitLab `json:"gitlab,omitempty"` @@ -2101,6 +5054,7 @@ type ModelsTeam struct { Source ModelsTeamSource `json:"source"` SourceRepositoryPropertyName *string `json:"sourceRepositoryPropertyName,omitempty"` SourceRepositoryPropertyValue *string `json:"sourceRepositoryPropertyValue,omitempty"` + TicketBoardID *string `json:"ticketBoardId,omitempty"` TicketProjectProvider ModelsTicketProjectProvider `json:"ticketProjectProvider"` } @@ -2113,6 +5067,7 @@ type ModelsTeamCodeOwnership struct { type ModelsTeamCodeOwnershipDataSource string const ( + ModelsTeamCodeOwnershipDataSourceDx ModelsTeamCodeOwnershipDataSource = "dx" ModelsTeamCodeOwnershipDataSourceGithubTeams ModelsTeamCodeOwnershipDataSource = "github_teams" ModelsTeamCodeOwnershipDataSourceAtlassianCompass ModelsTeamCodeOwnershipDataSource = "atlassian_compass" ModelsTeamCodeOwnershipDataSourceManual ModelsTeamCodeOwnershipDataSource = "manual" @@ -2157,6 +5112,10 @@ const ( ModelsTeamPrivacySecret ModelsTeamPrivacy = "secret" ) +type ModelsTeamProviderAzure struct { + TeamID *string `json:"teamId,omitempty"` +} + type ModelsTeamProviderGitHub struct { OrgLogin *string `json:"orgLogin,omitempty"` TeamID *int64 `json:"teamId,omitempty"` @@ -2191,6 +5150,7 @@ type ModelsTeamProviderSlack struct { type ModelsTeamSource string const ( + ModelsTeamSourceDx ModelsTeamSource = "dx" ModelsTeamSourceGithubTeams ModelsTeamSource = "github_teams" ModelsTeamSourceRepositoryProperty ModelsTeamSource = "repository_property" ModelsTeamSourceManual ModelsTeamSource = "manual" @@ -2213,7 +5173,36 @@ type ModelsTeamsUserProvider struct { TeamIDs []string `json:"teamIDs,omitempty"` } +type ModelsTicketMetrics struct { + AutoResolvedTrend ModelsTicketTrend `json:"autoResolvedTrend"` + ByPlatform ModelsTicketPlatformBreakdown `json:"byPlatform"` + Closed int `json:"closed"` + ClosedTrend ModelsTicketTrend `json:"closedTrend"` + CreatedTrend ModelsTicketTrend `json:"createdTrend"` + InProgress int `json:"inProgress"` + Open int `json:"open"` + Resolved int `json:"resolved"` + Total int `json:"total"` + WontFix int `json:"wontFix"` +} + +type ModelsTicketMetricsQuery struct { + FindingType []string `json:"findingType,omitempty"` + FromDate *string `json:"fromDate,omitempty"` + Platform []string `json:"platform,omitempty"` + Source []string `json:"source,omitempty"` + ToDate *string `json:"toDate,omitempty"` +} + +type ModelsTicketPlatformBreakdown struct { + Azure int `json:"azure"` + Github int `json:"github"` + Jira int `json:"jira"` + Linear int `json:"linear"` +} + type ModelsTicketProjectProvider struct { + Asana *ModelsAsanaTicketProject `json:"asana,omitempty"` Azure *ModelsAzureTicketProject `json:"azure,omitempty"` Bitbucket *ModelsBitbucketTicketProject `json:"bitbucket,omitempty"` Github *ModelsGitHubTicketProject `json:"github,omitempty"` @@ -2223,6 +5212,11 @@ type ModelsTicketProjectProvider struct { Linear *ModelsLinearTicketProject `json:"linear,omitempty"` } +type ModelsTicketTrend struct { + LastMonth int `json:"lastMonth"` + ThisMonth int `json:"thisMonth"` +} + type ModelsUISavedView struct { CreatedAt string `json:"createdAt"` CreatedBy string `json:"createdBy"` @@ -2260,6 +5254,7 @@ const ( type ModelsUnifiedFindingPreview struct { AiDevTitle string `json:"aiDevTitle"` + AiGenerated bool `json:"aiGenerated"` AiTitle string `json:"aiTitle"` AllowlistReason *string `json:"allowlistReason,omitempty"` AllowlistState ModelsAllowlistState `json:"allowlistState"` @@ -2267,24 +5262,33 @@ type ModelsUnifiedFindingPreview struct { AppName string `json:"appName"` AppType string `json:"appType"` AssessmentFactors map[string]string `json:"assessmentFactors,omitempty"` + AssignedTeamID *string `json:"assignedTeamId,omitempty"` + AssignedTeamName *string `json:"assignedTeamName,omitempty"` AutoFixEndTime *string `json:"autoFixEndTime,omitempty"` AutoFixStartTime *string `json:"autoFixStartTime,omitempty"` AutoFixState ModelsAutoFixState `json:"autoFixState"` Branch string `json:"branch"` + BudgetExhausted *bool `json:"budgetExhausted,omitempty"` + BudgetLimit *float64 `json:"budgetLimit,omitempty"` + BudgetUsed *float64 `json:"budgetUsed,omitempty"` Category string `json:"category"` Commit string `json:"commit"` CommitHash string `json:"commitHash"` + ConcurrencyLimit *int `json:"concurrencyLimit,omitempty"` CreatedAt string `json:"createdAt"` Cwe string `json:"cwe"` EndLine int `json:"endLine"` EndpointMethod string `json:"endpointMethod"` EndpointPath string `json:"endpointPath"` + Enforcement *ModelsSCPMEnforcement `json:"enforcement,omitempty"` Entropy float64 `json:"entropy"` Entrypoint string `json:"entrypoint"` ErrorDescription string `json:"errorDescription"` ErrorType string `json:"errorType"` ExploitValidated *bool `json:"exploitValidated,omitempty"` + ExploitabilityLabel *string `json:"exploitabilityLabel,omitempty"` FailedTriage *bool `json:"failedTriage,omitempty"` + FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` FileOwners []ModelsFileOwner `json:"fileOwners,omitempty"` FilePath string `json:"filePath"` FirstSeenCommit string `json:"firstSeenCommit"` @@ -2305,13 +5309,18 @@ type ModelsUnifiedFindingPreview struct { IsFalsePositive bool `json:"isFalsePositive"` IsInternetReachable *bool `json:"isInternetReachable,omitempty"` IsLatest *bool `json:"isLatest,omitempty"` + IsRepositoryArchived *bool `json:"isRepositoryArchived,omitempty"` IsResolved *bool `json:"isResolved,omitempty"` Language ModelsLanguageName `json:"language"` LastEvent string `json:"lastEvent"` + LastObservedAt *string `json:"lastObservedAt,omitempty"` + LastScannedAt *string `json:"lastScannedAt,omitempty"` Line int `json:"line"` Match string `json:"match"` Message string `json:"message"` Method string `json:"method"` + MetricState *MetricdefsState `json:"metricState,omitempty"` + Movements []ModelsSCPMFindingMovement `json:"movements,omitempty"` NumCritical int `json:"numCritical"` NumHigh int `json:"numHigh"` NumLow int `json:"numLow"` @@ -2324,12 +5333,14 @@ type ModelsUnifiedFindingPreview struct { PriorityLabel ModelsPriorityLabel `json:"priorityLabel"` PriorityOverride ModelsPriorityLabel `json:"priorityOverride"` PriorityScore int `json:"priorityScore"` + PrioritySource *ModelsPrioritySource `json:"prioritySource,omitempty"` ProjectID string `json:"projectId"` ProjectName string `json:"projectName"` ProjectPathPrefix string `json:"projectPathPrefix"` PullRequestsAllowlist []ModelsPullRequestInfo `json:"pullRequestsAllowlist,omitempty"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` QueryParameters map[string]string `json:"queryParameters,omitempty"` + ReachableSuggestedVersion *string `json:"reachableSuggestedVersion,omitempty"` RedactedSecret string `json:"redactedSecret"` Repository string `json:"repository"` RepositoryID string `json:"repositoryId"` @@ -2349,7 +5360,9 @@ type ModelsUnifiedFindingPreview struct { Scopes []string `json:"scopes,omitempty"` SecretHash string `json:"secretHash"` SecretType string `json:"secretType"` + SecretValidation *ModelsSecretsValidationResult `json:"secretValidation,omitempty"` Severity ModelsSeverity `json:"severity"` + SeverityConfidence *ModelsTriageSeverityConfidence `json:"severityConfidence,omitempty"` Solution string `json:"solution"` Source string `json:"source"` StartLine int `json:"startLine"` @@ -2360,40 +5373,51 @@ type ModelsUnifiedFindingPreview struct { TargetURL string `json:"targetUrl"` TenantID string `json:"tenantId"` Ticket *ModelsTicketProvider `json:"ticket,omitempty"` + TicketState *string `json:"ticketState,omitempty"` + TicketSyncPending *bool `json:"ticketSyncPending,omitempty"` TimeSaved TimeDuration `json:"timeSaved"` Title string `json:"title"` TriageEnd *string `json:"triageEnd,omitempty"` TriageStart *string `json:"triageStart,omitempty"` + TriageStopReason *string `json:"triageStopReason,omitempty"` + TriageTokenCount *int `json:"triageTokenCount,omitempty"` TriageVersion string `json:"triageVersion"` Type ModelsFindingType `json:"type"` UpdatedAt string `json:"updatedAt"` URI string `json:"uri"` UserName string `json:"userName"` Version string `json:"version"` + Versions []string `json:"versions,omitempty"` VulnerabilitiesCVEIds []string `json:"vulnerabilitiesCVEIds,omitempty"` VulnerabilitiesCWEIds []string `json:"vulnerabilitiesCWEIds,omitempty"` VulnerabilitiesMaxPriority ModelsPriorityLabel `json:"vulnerabilitiesMaxPriority"` VulnerabilitiesMaxSeverity ModelsSeverity `json:"vulnerabilitiesMaxSeverity"` VulnerableParameterName string `json:"vulnerableParameterName"` VulnerableParameterValue string `json:"vulnerableParameterValue"` + Workflow *string `json:"workflow,omitempty"` } type ModelsUnifiedFindingsMetricsQuery struct { } type ModelsUnifiedFindingsQuery struct { + AiGenerated *bool `json:"aiGenerated,omitempty"` AppName []string `json:"appName,omitempty"` - AppType []string `json:"appType,omitempty"` + AsOf *string `json:"asOf,omitempty"` AutoFixState []string `json:"autoFixState,omitempty"` Branch []string `json:"branch,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` Cve []string `json:"cve,omitempty"` Cwe []string `json:"cwe,omitempty"` ExploitValidated *bool `json:"exploitValidated,omitempty"` FileOwner []string `json:"fileOwner,omitempty"` FindingID []string `json:"findingId,omitempty"` + FixEvidence []string `json:"fixEvidence,omitempty"` + Frameworks []string `json:"frameworks,omitempty"` FromDate *string `json:"fromDate,omitempty"` FromPriorityScore *int `json:"fromPriorityScore,omitempty"` HasAutoFix *bool `json:"hasAutoFix,omitempty"` + HasMultipleVersions *bool `json:"hasMultipleVersions,omitempty"` HasTicket *bool `json:"hasTicket,omitempty"` HasTicketOrPR *bool `json:"hasTicketOrPR,omitempty"` Host []string `json:"host,omitempty"` @@ -2404,13 +5428,16 @@ type ModelsUnifiedFindingsQuery struct { IsAllowlisted *bool `json:"isAllowlisted,omitempty"` IsArchived *bool `json:"isArchived,omitempty"` IsAutofixed *bool `json:"isAutofixed,omitempty"` + IsDefaultBranch *bool `json:"isDefaultBranch,omitempty"` IsDirect *bool `json:"isDirect,omitempty"` IsFalsePositive *bool `json:"isFalsePositive,omitempty"` IsFixed *bool `json:"isFixed,omitempty"` IsInternetReachable *bool `json:"isInternetReachable,omitempty"` IsPushWorkflow *bool `json:"isPushWorkflow,omitempty"` + IsRepositoryArchived *bool `json:"isRepositoryArchived,omitempty"` IsResolved *bool `json:"isResolved,omitempty"` Language []string `json:"language,omitempty"` + MetricState []string `json:"metricState,omitempty"` NotfindingID []string `json:"notfindingId,omitempty"` Package []string `json:"package,omitempty"` Page *int `json:"page,omitempty"` @@ -2420,10 +5447,13 @@ type ModelsUnifiedFindingsQuery struct { Repository []string `json:"repository,omitempty"` RepositoryID []string `json:"repositoryId,omitempty"` RuleID []string `json:"ruleId,omitempty"` + ScanRunID []string `json:"scanRunId,omitempty"` ScrollID *string `json:"scrollId,omitempty"` Search *string `json:"search,omitempty"` SecretType []string `json:"secretType,omitempty"` + SecretValidated *bool `json:"secretValidated,omitempty"` Severity []string `json:"severity,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` Sort []map[string]map[string]json.RawMessage `json:"sort,omitempty"` SortPreset *string `json:"sortPreset,omitempty"` TeamIDs []string `json:"teamIDs,omitempty"` @@ -2445,9 +5475,16 @@ const ( ModelsUnifiedFindingsSortPresetCreatedAtAsc ModelsUnifiedFindingsSortPreset = "created_at_asc" ModelsUnifiedFindingsSortPresetPriorityDesc ModelsUnifiedFindingsSortPreset = "priority_desc" ModelsUnifiedFindingsSortPresetSeverityDesc ModelsUnifiedFindingsSortPreset = "severity_desc" + ModelsUnifiedFindingsSortPresetPriorityAsc ModelsUnifiedFindingsSortPreset = "priority_asc" + ModelsUnifiedFindingsSortPresetSeverityAsc ModelsUnifiedFindingsSortPreset = "severity_asc" + ModelsUnifiedFindingsSortPresetSeverityConfidenceDesc ModelsUnifiedFindingsSortPreset = "severity_confidence_desc" + ModelsUnifiedFindingsSortPresetSeverityConfidenceAsc ModelsUnifiedFindingsSortPreset = "severity_confidence_asc" + ModelsUnifiedFindingsSortPresetFixStageAsc ModelsUnifiedFindingsSortPreset = "fix_stage_asc" + ModelsUnifiedFindingsSortPresetFixStageDesc ModelsUnifiedFindingsSortPreset = "fix_stage_desc" ) type ModelsUserMapping struct { + Asana *ModelsAsanaUserProvider `json:"asana,omitempty"` Azure *ModelsAzureUserProvider `json:"azure,omitempty"` AzureEntra *ModelsAzureEntraUserProvider `json:"azureEntra,omitempty"` Bitbucket *ModelsBitbucketUserProvider `json:"bitbucket,omitempty"` @@ -2467,6 +5504,7 @@ type ModelsUserMapping struct { } type ModelsUserProvider struct { + Asana *ModelsAsanaUserProvider `json:"asana,omitempty"` Azure *ModelsAzureUserProvider `json:"azure,omitempty"` AzureEntra *ModelsAzureEntraUserProvider `json:"azureEntra,omitempty"` BitBucket *ModelsBitbucketUserProvider `json:"bitBucket,omitempty"` @@ -2481,4 +5519,213 @@ type ModelsUserProvider struct { Teams *ModelsTeamsUserProvider `json:"teams,omitempty"` } +type RuneventsEngine string + +const ( + RuneventsEngineStepFunctions RuneventsEngine = "step_functions" + RuneventsEngineTemporal RuneventsEngine = "temporal" + RuneventsEngineFargate RuneventsEngine = "fargate" + RuneventsEngineInline RuneventsEngine = "inline" +) + +type RuneventsMachineRef struct { + DefinitionID *string `json:"definitionId,omitempty"` + DefinitionVersion *string `json:"definitionVersion,omitempty"` + Engine *RuneventsEngine `json:"engine,omitempty"` + ExecutionID *string `json:"executionId,omitempty"` +} + +type RuneventsRunRef struct { + CausationEventID *string `json:"causationEventId,omitempty"` + ID *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + ParentID *string `json:"parentId,omitempty"` + ParentKind *string `json:"parentKind,omitempty"` + RootID *string `json:"rootId,omitempty"` + RootKind *string `json:"rootKind,omitempty"` +} + +type RuneventsRunStatus string + +const ( + RuneventsRunStatusPending RuneventsRunStatus = "pending" + RuneventsRunStatusRunning RuneventsRunStatus = "running" + RuneventsRunStatusWaitingApproval RuneventsRunStatus = "waiting_approval" + RuneventsRunStatusCompleted RuneventsRunStatus = "completed" + RuneventsRunStatusFailed RuneventsRunStatus = "failed" + RuneventsRunStatusCancelled RuneventsRunStatus = "cancelled" + RuneventsRunStatusSkipped RuneventsRunStatus = "skipped" +) + +type RunsnapshotChild struct { + Run *RuneventsRunRef `json:"run,omitempty"` + Status *RuneventsRunStatus `json:"status,omitempty"` +} + +type RunsnapshotSnapshot struct { + Children []RunsnapshotChild `json:"children,omitempty"` + ChildrenTruncated *bool `json:"childrenTruncated,omitempty"` + Cursor *string `json:"cursor,omitempty"` + EndedAt *string `json:"endedAt,omitempty"` + EventsTruncated *bool `json:"eventsTruncated,omitempty"` + Machine *RuneventsMachineRef `json:"machine,omitempty"` + Run *RuneventsRunRef `json:"run,omitempty"` + SkippedRows *int `json:"skippedRows,omitempty"` + Stages []RunsnapshotStage `json:"stages,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *RuneventsRunStatus `json:"status,omitempty"` +} + +type RunsnapshotStage struct { + CompletedAt *string `json:"completedAt,omitempty"` + EnteredAt *string `json:"enteredAt,omitempty"` + Index *int `json:"index,omitempty"` + Name *string `json:"name,omitempty"` + State *RunsnapshotStageState `json:"state,omitempty"` + Total *int `json:"total,omitempty"` +} + +type RunsnapshotStageState string + +const ( + RunsnapshotStageStateActive RunsnapshotStageState = "active" + RunsnapshotStageStateDone RunsnapshotStageState = "done" + RunsnapshotStageStateFailed RunsnapshotStageState = "failed" +) + +type ServiceGitHubTenantRouteInventory struct { + CreatedAt *string `json:"createdAt,omitempty"` + CreatedByUserID *int64 `json:"createdByUserId,omitempty"` + FirstSeenAt *string `json:"firstSeenAt,omitempty"` + GithubAppID *int64 `json:"githubAppId,omitempty"` + GithubOwner *string `json:"githubOwner,omitempty"` + GithubOwnerType *string `json:"githubOwnerType,omitempty"` + ID *string `json:"id,omitempty"` + InstallationID *int64 `json:"installationId,omitempty"` + LastObservedAction *string `json:"lastObservedAction,omitempty"` + LastSeenAt *string `json:"lastSeenAt,omitempty"` +} + +type ServiceGitHubTenantRouteResult struct { + DryRun *bool `json:"dryRun,omitempty"` + Inventory *ServiceGitHubTenantRouteInventory `json:"inventory,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Route *ServiceGitHubTenantRouteRow `json:"route,omitempty"` + Siblings []ServiceGitHubTenantRouteRow `json:"siblings,omitempty"` + Status *string `json:"status,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} + +type ServiceGitHubTenantRouteRow struct { + BaseDomain *string `json:"baseDomain,omitempty"` + ControlsUpdatedBy *string `json:"controlsUpdatedBy,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + GithubOwner *string `json:"githubOwner,omitempty"` + GithubOwnerID *int64 `json:"githubOwnerId,omitempty"` + ID *string `json:"id,omitempty"` + InstallationID *int64 `json:"installationId,omitempty"` + Paused *bool `json:"paused,omitempty"` + PausedReason *string `json:"pausedReason,omitempty"` + PendingAppID *int64 `json:"pendingAppId,omitempty"` + Region *string `json:"region,omitempty"` + RepoAllowlistEnforced *bool `json:"repoAllowlistEnforced,omitempty"` + ScheduledWorkEnabled *bool `json:"scheduledWorkEnabled,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} + +type ServiceNativeBootstrapAdministrator struct { + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + Subject *string `json:"subject,omitempty"` +} + +type ServiceNativeTenantBootstrapInput struct { + Administrators []ServiceNativeBootstrapAdministrator `json:"administrators,omitempty"` + BaseDomain *string `json:"baseDomain,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + DirectoryID *string `json:"directoryId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + ExpectedState *string `json:"expectedState,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Operator *string `json:"operator,omitempty"` + Reason *string `json:"reason,omitempty"` + Region *string `json:"region,omitempty"` + Stage *string `json:"stage,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} + +type ServiceNativeTenantBootstrapResult struct { + AdministratorSubjects []string `json:"administratorSubjects,omitempty"` + DesiredState *ServiceNativeTenantBootstrapInput `json:"desiredState,omitempty"` + DirectoryID *string `json:"directoryId,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + IdentityReady *bool `json:"identityReady,omitempty"` + RouteReady *bool `json:"routeReady,omitempty"` + Stage *string `json:"stage,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} + type TimeDuration = int64 + +type WorkspacebootstrapOperatorInspection struct { + CanonicalTenantID *string `json:"canonicalTenantId,omitempty"` + Expired *bool `json:"expired,omitempty"` + ExpiresAt *string `json:"expiresAt,omitempty"` + OperationID *string `json:"operationId,omitempty"` + PendingStage *string `json:"pendingStage,omitempty"` + Recipient *string `json:"recipient,omitempty"` + RenewAllowed *bool `json:"renewAllowed,omitempty"` + RenewedAt *string `json:"renewedAt,omitempty"` + RenewedBy *string `json:"renewedBy,omitempty"` + RenewedReason *string `json:"renewedReason,omitempty"` + Revision *int64 `json:"revision,omitempty"` + RevokeAllowed *bool `json:"revokeAllowed,omitempty"` + RevokedAt *string `json:"revokedAt,omitempty"` + RevokedBy *string `json:"revokedBy,omitempty"` + RevokedReason *string `json:"revokedReason,omitempty"` + Status *string `json:"status,omitempty"` + Target *WorkspacebootstrapTarget `json:"target,omitempty"` +} + +type WorkspacebootstrapProvisioningDecision struct { + After *WorkspacebootstrapProvisioningSecurityState `json:"after,omitempty"` + Before *WorkspacebootstrapProvisioningSecurityState `json:"before,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` +} + +type WorkspacebootstrapProvisioningRequest struct { + CompanyName *string `json:"companyName,omitempty"` + ContactEmail *string `json:"contactEmail,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DirectoryID *string `json:"directoryId,omitempty"` + OperationID *string `json:"operationId,omitempty"` + OperationRevision *int64 `json:"operationRevision,omitempty"` + OperationStatus *string `json:"operationStatus,omitempty"` + ProviderID *string `json:"providerId,omitempty"` + RequestID *string `json:"requestId,omitempty"` + ReviewedBy *string `json:"reviewedBy,omitempty"` + ReviewedReason *string `json:"reviewedReason,omitempty"` + Revision *int64 `json:"revision,omitempty"` + SetupKind *string `json:"setupKind,omitempty"` + SetupLive *bool `json:"setupLive,omitempty"` + Status *string `json:"status,omitempty"` + Subject *string `json:"subject,omitempty"` + Target *WorkspacebootstrapTarget `json:"target,omitempty"` + UsesAzureDevOps *bool `json:"usesAzureDevOps,omitempty"` +} + +type WorkspacebootstrapProvisioningSecurityState struct { + OperationID *string `json:"operationId,omitempty"` + Revision *int64 `json:"revision,omitempty"` + SetupKind *string `json:"setupKind,omitempty"` + Status *string `json:"status,omitempty"` + Target *WorkspacebootstrapTarget `json:"target,omitempty"` +} + +type WorkspacebootstrapTarget struct { + AccountID *string `json:"accountId,omitempty"` + ApiOrigin *string `json:"apiOrigin,omitempty"` + DeploymentID *string `json:"deploymentId,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Region *string `json:"region,omitempty"` +} diff --git a/internal/api/models/asset-graph.go b/internal/api/models/asset-graph.go deleted file mode 100644 index 12f3544..0000000 --- a/internal/api/models/asset-graph.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by scripts/generate/main.go. DO NOT EDIT. -package models - -import "encoding/json" - -type AssetgraphSearchIndexEntry struct { - AccountID *string `json:"accountId,omitempty"` - Name *string `json:"name,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - ObjectType *string `json:"objectType,omitempty"` - Region *string `json:"region,omitempty"` - SubTitle *string `json:"subTitle,omitempty"` -} - -type EndpointsAssetGraphComponent struct { - AccountType *string `json:"accountType,omitempty"` - ComponentType string `json:"componentType"` - DownloadURL string `json:"downloadUrl"` - EdgeCount int `json:"edgeCount"` - ExpiresAt string `json:"expiresAt"` - ID string `json:"id"` - LastUpdated *string `json:"lastUpdated,omitempty"` - Name *string `json:"name,omitempty"` - NodeCount int `json:"nodeCount"` - OwnerID *string `json:"ownerId,omitempty"` - Platform *string `json:"platform,omitempty"` - Services []string `json:"services,omitempty"` -} - -type EndpointsGetAssetGraphReachabilityOutput struct { - IsInternetFacing bool `json:"isInternetFacing"` - Paths []EndpointsNetworkPathDTO `json:"paths,omitempty"` - Summary *string `json:"summary,omitempty"` - TargetNodeID string `json:"targetNodeId"` - TargetNodeType *string `json:"targetNodeType,omitempty"` - Version *string `json:"version,omitempty"` -} - -type EndpointsGetAssetGraphSearchOutput struct { - Results []AssetgraphSearchIndexEntry `json:"results,omitempty"` - Total int `json:"total"` - Version *string `json:"version,omitempty"` -} - -type EndpointsGetAssetGraphSubgraphOutput struct { - HierarchyEdges []GraphEdge `json:"hierarchyEdges,omitempty"` - LateralEdges []GraphEdge `json:"lateralEdges,omitempty"` - Nodes []json.RawMessage `json:"nodes,omitempty"` - RootNodeID string `json:"rootNodeId"` - TotalChildren int `json:"totalChildren"` - Truncated bool `json:"truncated"` - Version *string `json:"version,omitempty"` -} - -type EndpointsGetAssetGraphSummaryOutput struct { - AccountCount int `json:"accountCount"` - CombinedGraphExpiresAt *string `json:"combinedGraphExpiresAt,omitempty"` - CombinedGraphURL *string `json:"combinedGraphUrl,omitempty"` - FindingNodeCount *int `json:"findingNodeCount,omitempty"` - GraphInfo *EndpointsInfrastructureGraphInfo `json:"graphInfo,omitempty"` - InfrastructureGraphs []EndpointsAssetGraphComponent `json:"infrastructureGraphs,omitempty"` - InternetFacingNodeCount *int `json:"internetFacingNodeCount,omitempty"` - LastUpdated string `json:"lastUpdated"` - MergedGraphEdgeCount *int `json:"mergedGraphEdgeCount,omitempty"` - MergedGraphExpiresAt *string `json:"mergedGraphExpiresAt,omitempty"` - MergedGraphNodeCount *int `json:"mergedGraphNodeCount,omitempty"` - MergedGraphURL *string `json:"mergedGraphUrl,omitempty"` - RepoContextGraphs []EndpointsAssetGraphComponent `json:"repoContextGraphs,omitempty"` - TotalInfraEdges int `json:"totalInfraEdges"` - TotalInfraNodes int `json:"totalInfraNodes"` - TotalRepoGraphs int `json:"totalRepoGraphs"` - Version *string `json:"version,omitempty"` -} - -type EndpointsInfrastructureAccountInfo struct { - AccountID string `json:"accountId"` - AccountName *string `json:"accountName,omitempty"` - AccountType string `json:"accountType"` - CloudProvider *string `json:"cloudProvider,omitempty"` - EdgeCount int `json:"edgeCount"` - GraphFilePath *string `json:"graphFilePath,omitempty"` - HasApiGateway bool `json:"hasApiGateway"` - HasCloudFrontCdn bool `json:"hasCloudFrontCdn"` - HasCloudFunctions *bool `json:"hasCloudFunctions,omitempty"` - HasCloudRunServices *bool `json:"hasCloudRunServices,omitempty"` - HasCrossAccountRefs bool `json:"hasCrossAccountRefs"` - HasDatabases bool `json:"hasDatabases"` - HasEcsServices bool `json:"hasEcsServices"` - HasEksClusters bool `json:"hasEksClusters"` - HasGceInstances *bool `json:"hasGceInstances,omitempty"` - HasGkeClusters *bool `json:"hasGkeClusters,omitempty"` - HasK8sClusters *bool `json:"hasK8sClusters,omitempty"` - HasLambdaFunctions bool `json:"hasLambdaFunctions"` - HasPublicAlb bool `json:"hasPublicAlb"` - HasPublicNlb bool `json:"hasPublicNlb"` - HasRoute53Dns bool `json:"hasRoute53Dns"` - HasTransitGateway bool `json:"hasTransitGateway"` - InternalServiceCount int `json:"internalServiceCount"` - NodeCount int `json:"nodeCount"` - PublicEndpointCount int `json:"publicEndpointCount"` - Regions []string `json:"regions,omitempty"` - Services []string `json:"services,omitempty"` -} - -type EndpointsInfrastructureCrossAccountConnection struct { - ConnectionCount int `json:"connectionCount"` - ConnectionType string `json:"connectionType"` - SourceAccountID string `json:"sourceAccountId"` - SourceAccountType *string `json:"sourceAccountType,omitempty"` - TargetAccountID string `json:"targetAccountId"` - TargetAccountType *string `json:"targetAccountType,omitempty"` -} - -type EndpointsInfrastructureCrossAccountStatistics struct { - CrossAccountConnections []EndpointsInfrastructureCrossAccountConnection `json:"crossAccountConnections,omitempty"` - CrossAccountEdgesCreated int `json:"crossAccountEdgesCreated"` - HasCrossAccountReferences bool `json:"hasCrossAccountReferences"` - OrphanedReferences int `json:"orphanedReferences"` - ReferencesByType map[string]int `json:"referencesByType,omitempty"` - TotalReferences int `json:"totalReferences"` - ValidatedReferences int `json:"validatedReferences"` -} - -type EndpointsInfrastructureEdgeStatistics struct { - BidirectionalEdges int `json:"bidirectionalEdges"` - EdgesByType map[string]int `json:"edgesByType,omitempty"` - TotalEdges int `json:"totalEdges"` - UnidirectionalEdges int `json:"unidirectionalEdges"` -} - -type EndpointsInfrastructureGraphInfoMetadata struct { - DestinationBucket *string `json:"destinationBucket,omitempty"` - GeneratedAt string `json:"generatedAt"` - GeneratedBy string `json:"generatedBy"` - GraphType string `json:"graphType"` - ID string `json:"id"` - IsCombinedGraph bool `json:"isCombinedGraph"` - ProcessingDuration string `json:"processingDuration"` - SourceBucket string `json:"sourceBucket"` - Version string `json:"version"` -} - -type EndpointsInfrastructureNodeStatistics struct { - NodesByAccount map[string]int `json:"nodesByAccount,omitempty"` - NodesByObjectType map[string]int `json:"nodesByObjectType,omitempty"` - NodesByRegion map[string]int `json:"nodesByRegion,omitempty"` - NodesBySubType map[string]int `json:"nodesBySubType,omitempty"` - NodesByType map[string]int `json:"nodesByType,omitempty"` - TotalNodes int `json:"totalNodes"` -} - -type EndpointsInfrastructureValidationCheck struct { - Details *string `json:"details,omitempty"` - Name string `json:"name"` - Passed bool `json:"passed"` -} - -type EndpointsInfrastructureValidationResults struct { - Checks []EndpointsInfrastructureValidationCheck `json:"checks,omitempty"` - ErrorCount int `json:"errorCount"` - Errors []string `json:"errors,omitempty"` - IsValid bool `json:"isValid"` - WarningCount int `json:"warningCount"` - Warnings []string `json:"warnings,omitempty"` -} - -type EndpointsNetworkPathDTO struct { - Description *string `json:"description,omitempty"` - Edges []GraphEdge `json:"edges,omitempty"` - NodeIds []string `json:"nodeIds,omitempty"` - PathID string `json:"pathId"` - ReachesInternet bool `json:"reachesInternet"` - StartNodeID string `json:"startNodeId"` - StartNodeType string `json:"startNodeType"` -} diff --git a/internal/api/models/common.go b/internal/api/models/common.go index 44550e2..0273ba1 100644 --- a/internal/api/models/common.go +++ b/internal/api/models/common.go @@ -3,14 +3,20 @@ package models import "encoding/json" +type AgentsAgentLogs = []json.RawMessage + type EndpointsAutofixStatusOutput struct { + AutofixID *string `json:"autofixId,omitempty"` AutofixVerdictExplanation *string `json:"autofixVerdictExplanation,omitempty"` AutofixVerdictReason *ModelsAutofixFailureReason `json:"autofixVerdictReason,omitempty"` + AvailableActions []EndpointsAvailableAction `json:"availableActions,omitempty"` + Coordination *EndpointsAutofixCoordination `json:"coordination,omitempty"` CurrentActivity *string `json:"currentActivity,omitempty"` CurrentPhase *ModelsAutofixPhase `json:"currentPhase,omitempty"` IsAutoFixable *bool `json:"isAutoFixable,omitempty"` Iterations *EndpointsIterationSummary `json:"iterations,omitempty"` LastActivityAt *string `json:"lastActivityAt,omitempty"` + Outcome *EndpointsAutofixOutcome `json:"outcome,omitempty"` PullRequestState *ModelsPullRequestState `json:"pullRequestState,omitempty"` PullRequestURL *string `json:"pullRequestUrl,omitempty"` PullRequests []EndpointsPullRequestSummary `json:"pullRequests,omitempty"` @@ -20,6 +26,15 @@ type EndpointsAutofixStatusOutput struct { UpdatedAt *string `json:"updatedAt,omitempty"` } +type EndpointsFindingTriageStatus string + +const ( + EndpointsFindingTriageStatusPending EndpointsFindingTriageStatus = "pending" + EndpointsFindingTriageStatusCompleted EndpointsFindingTriageStatus = "completed" + EndpointsFindingTriageStatusIncomplete EndpointsFindingTriageStatus = "incomplete" + EndpointsFindingTriageStatusFailed EndpointsFindingTriageStatus = "failed" +) + type EndpointsGetAutofixActivityLogOutput struct { Entries []EndpointsAutofixActivityLogEntry `json:"entries,omitempty"` NextCursor *string `json:"nextCursor,omitempty"` @@ -30,21 +45,21 @@ type EndpointsGetScanRunsOutput struct { TotalCount *int `json:"totalCount,omitempty"` } -type EndpointsInfrastructureGraphInfo struct { - AccountsInfo []EndpointsInfrastructureAccountInfo `json:"accountsInfo,omitempty"` - CrossAccountStatistics EndpointsInfrastructureCrossAccountStatistics `json:"crossAccountStatistics"` - EdgeStatistics EndpointsInfrastructureEdgeStatistics `json:"edgeStatistics"` - Metadata EndpointsInfrastructureGraphInfoMetadata `json:"metadata"` - NodeStatistics EndpointsInfrastructureNodeStatistics `json:"nodeStatistics"` - ValidationResults EndpointsInfrastructureValidationResults `json:"validationResults"` -} +type EndpointsRunState string + +const ( + EndpointsRunStatePending EndpointsRunState = "PENDING" + EndpointsRunStateRunning EndpointsRunState = "RUNNING" + EndpointsRunStateSucceeded EndpointsRunState = "SUCCEEDED" + EndpointsRunStateFailed EndpointsRunState = "FAILED" + EndpointsRunStateSkipped EndpointsRunState = "SKIPPED" + EndpointsRunStateTimedOut EndpointsRunState = "TIMED_OUT" + EndpointsRunStateAborted EndpointsRunState = "ABORTED" +) type EventsEventType string const ( - EventsEventTypeOrgContextAgentStarted EventsEventType = "org_context_agent_started" - EventsEventTypeOrgContextAgentFinished EventsEventType = "org_context_agent_finished" - EventsEventTypeOrgContextAgentFailed EventsEventType = "org_context_agent_failed" EventsEventTypeRepoContextAgentStarted EventsEventType = "repo_context_agent_started" EventsEventTypeRepoContextAgentFinished EventsEventType = "repo_context_agent_finished" EventsEventTypeRepoContextAgentFailed EventsEventType = "repo_context_agent_failed" @@ -53,9 +68,10 @@ const ( EventsEventTypeTriageAgentFailed EventsEventType = "triage_agent_failed" EventsEventTypeTriageAgentSkipped EventsEventType = "triage_agent_skipped" EventsEventTypeTriageAgentQualityDegraded EventsEventType = "triage_agent_quality_degraded" - EventsEventTypeAutoFixAgentStarted EventsEventType = "auto_fix_agent_started" EventsEventTypeAutoFixAgentFinished EventsEventType = "auto_fix_agent_finished" - EventsEventTypeAutoFixAgentFailed EventsEventType = "auto_fix_agent_failed" + EventsEventTypeAutoFixRunStarted EventsEventType = "auto-fix-run-started" + EventsEventTypeAutoFixRunFinished EventsEventType = "auto-fix-run-finished" + EventsEventTypeAutoFixRunFailed EventsEventType = "auto-fix-run-failed" EventsEventTypeSchemaReversingAgentStarted EventsEventType = "schema_reversing_agent_started" EventsEventTypeSchemaReversingAgentFinished EventsEventType = "schema_reversing_agent_finished" EventsEventTypeSchemaReversingAgentFailed EventsEventType = "schema_reversing_agent_failed" @@ -73,13 +89,19 @@ const ( EventsEventTypeBillingLeaseEnded EventsEventType = "billing-lease-ended" EventsEventTypeBillingLeaseExtended EventsEventType = "billing-lease-extended" EventsEventTypeBillingUsageRecorded EventsEventType = "billing-usage-recorded" + EventsEventTypeRepositoryContextPublished EventsEventType = "repository-context-published" EventsEventTypeAccountScanCompleted EventsEventType = "account-scan-completed" EventsEventTypeCloudIntegrationScanCompleted EventsEventType = "cloud-integration-scan-completed" EventsEventTypeCspmNewFinding EventsEventType = "cspm-new-finding" EventsEventTypeCspmNewFindings EventsEventType = "cspm-new-findings" EventsEventTypeCspmFindingTriaged EventsEventType = "cspm-finding-triaged" EventsEventTypeCspmFindingsTriaged EventsEventType = "cspm-findings-triaged" + EventsEventTypeCspmFindingRetriaged EventsEventType = "cspm-finding-retriaged" EventsEventTypeCspmNewAllowlistedFinding EventsEventType = "cspm-new-allowlisted-finding" + EventsEventTypeCspmFindingResolved EventsEventType = "cspm-finding-resolved" + EventsEventTypeCspmFindingReintroduced EventsEventType = "cspm-finding-reintroduced" + EventsEventTypeCspmFindingsDigest EventsEventType = "cspm-findings-digest" + EventsEventTypeCspmFindingOverridden EventsEventType = "cspm-finding-overridden" EventsEventTypeCspmTicketCreated EventsEventType = "cspm-ticket-created" EventsEventTypeCspmTicketUpdated EventsEventType = "cspm-ticket-updated" EventsEventTypeCspmTicketAssigned EventsEventType = "cspm-ticket-assigned" @@ -87,14 +109,11 @@ const ( EventsEventTypeCspmTicketReopened EventsEventType = "cspm-ticket-reopened" EventsEventTypeAccountScanStarted EventsEventType = "account-scan-started" EventsEventTypeAccountScanFailed EventsEventType = "account-scan-failed" - EventsEventTypeCloudIntegrationScanStarted EventsEventType = "cloud-integration-scan-started" - EventsEventTypeCloudIntegrationScanFailed EventsEventType = "cloud-integration-scan-failed" EventsEventTypeCspmScanStarted EventsEventType = "cspm-scan-started" EventsEventTypeCspmScanCompleted EventsEventType = "cspm-scan-completed" EventsEventTypeCspmScanFailed EventsEventType = "cspm-scan-failed" EventsEventTypeDastNewFindings EventsEventType = "dast-new-findings" EventsEventTypeDastNewFixes EventsEventType = "dast-new-fixes" - EventsEventTypeDastUpdateEndpoints EventsEventType = "dast-update-endpoints" EventsEventTypeDastBughuntNewFinding EventsEventType = "dast-bughunt-new-finding" EventsEventTypeDastBughuntFindingFixed EventsEventType = "dast-bughunt-finding-fixed" EventsEventTypeDastBughuntFindingUnfixed EventsEventType = "dast-bughunt-finding-unfixed" @@ -119,18 +138,25 @@ const ( EventsEventTypeDastPentestScanAbortedConfigError EventsEventType = "dast-pentest-scan-aborted-config-error" EventsEventTypeDastPentestScanHumanFallback EventsEventType = "dast-pentest-scan-human-fallback" EventsEventTypeDastPentestScanFailsafeInvoked EventsEventType = "dast-pentest-scan-failsafe-invoked" + EventsEventTypeDastBughuntTicketUpdated EventsEventType = "dast-bughunt-ticket-updated" + EventsEventTypeDastBughuntTicketAssigned EventsEventType = "dast-bughunt-ticket-assigned" + EventsEventTypeDastBughuntTicketClosed EventsEventType = "dast-bughunt-ticket-closed" + EventsEventTypeDastBughuntTicketReopened EventsEventType = "dast-bughunt-ticket-reopened" + EventsEventTypeDastPentestTicketUpdated EventsEventType = "dast-pentest-ticket-updated" + EventsEventTypeDastPentestTicketAssigned EventsEventType = "dast-pentest-ticket-assigned" + EventsEventTypeDastPentestTicketClosed EventsEventType = "dast-pentest-ticket-closed" + EventsEventTypeDastPentestTicketReopened EventsEventType = "dast-pentest-ticket-reopened" EventsEventTypeDastBughuntScanStarted EventsEventType = "dast-bughunt-scan-started" EventsEventTypeDastBughuntScanCompleted EventsEventType = "dast-bughunt-scan-completed" EventsEventTypeDastPentestScanStarted EventsEventType = "dast-pentest-scan-started" EventsEventTypeDastPentestScanCompleted EventsEventType = "dast-pentest-scan-completed" EventsEventTypeDastPentestScanFailed EventsEventType = "dast-pentest-scan-failed" + EventsEventTypeDastPentestStageTransition EventsEventType = "dast-pentest-stage-transition" EventsEventTypeBotInteraction EventsEventType = "bot-interaction" EventsEventTypeBotInteractionIssueDashboardReply EventsEventType = "bot-interaction-issue-dashboard-reply" - EventsEventTypeBotInteractionPullRequestCommentReply EventsEventType = "bot-interaction-pull-request-comment-reply" EventsEventTypeBotInteractionPullRequestDiscussionReply EventsEventType = "bot-interaction-pull-request-discussion-reply" EventsEventTypeBotInteractionPullRequestReviewDiffThreadReply EventsEventType = "bot-interaction-pull-request-review-diff-thread-reply" EventsEventTypeBotInteractionPullRequestReviewDiscussionReply EventsEventType = "bot-interaction-pull-request-review-discussion-reply" - EventsEventTypeBotInteractionPullRequestReview EventsEventType = "bot-interaction-pull-request-review" EventsEventTypeAutoFixPullRequestCreated EventsEventType = "auto-fix-pull-request-created" EventsEventTypeAutoFixPullRequestAccepted EventsEventType = "auto-fix-pull-request-accepted" EventsEventTypeAutoFixPullRequestClosed EventsEventType = "auto-fix-pull-request-closed" @@ -138,11 +164,11 @@ const ( EventsEventTypeAutoFixSuggestionAccepted EventsEventType = "auto-fix-suggestion-accepted" EventsEventTypeScpmNewBranchSummary EventsEventType = "scpm-new-branch-summary" EventsEventTypeScpmNewFinding EventsEventType = "scpm-new-finding" + EventsEventTypeScpmNewFindings EventsEventType = "scpm-new-findings" + EventsEventTypeScpmReintroducedFinding EventsEventType = "scpm-reintroduced-finding" EventsEventTypeScpmNewAllowlistedFinding EventsEventType = "scpm-new-allowlisted-finding" EventsEventTypeScpmNewUnallowlistedFinding EventsEventType = "scpm-new-unallowlisted-finding" - EventsEventTypeScpmNewVulnerabilityMerged EventsEventType = "scpm-new-vulnerability-merged" EventsEventTypeScpmNewFix EventsEventType = "scpm-new-fix" - EventsEventTypeScpmNewPullRequestFinding EventsEventType = "scpm-new-pull-request-finding" EventsEventTypeScpmNewPullRequestFix EventsEventType = "scpm-new-pull-request-fix" EventsEventTypeScpmTicketCreated EventsEventType = "scpm-ticket-created" EventsEventTypeScpmTicketUpdated EventsEventType = "scpm-ticket-updated" @@ -153,12 +179,18 @@ const ( EventsEventTypeScpmScanCompleted EventsEventType = "scpm-scan-completed" EventsEventTypeScpmScanFailed EventsEventType = "scpm-scan-failed" EventsEventTypeScpmFindingRetriaged EventsEventType = "scpm-finding-retriaged" - EventsEventTypeScpmArchivedFinding EventsEventType = "scpm-archived-finding" + EventsEventTypeScpmFindingResolved EventsEventType = "scpm-finding-resolved" + EventsEventTypeScpmFindingOverridden EventsEventType = "scpm-finding-overridden" EventsEventTypeManagerCampaignCreated EventsEventType = "manager-campaign-created" EventsEventTypeManagerCampaignUpdated EventsEventType = "manager-campaign-updated" EventsEventTypeManagerCampaignDeleted EventsEventType = "manager-campaign-deleted" EventsEventTypeManagerScheduledPlanCompleted EventsEventType = "manager-scheduled-plan-completed" EventsEventTypeManagerPlanCreated EventsEventType = "manager-plan-created" + EventsEventTypeManagerActionItemCreated EventsEventType = "manager-action-item-created" + EventsEventTypeManagerActionItemResolved EventsEventType = "manager-action-item-resolved" + EventsEventTypeManagerActionItemReopened EventsEventType = "manager-action-item-reopened" + EventsEventTypeManagerActionItemSnoozed EventsEventType = "manager-action-item-snoozed" + EventsEventTypeManagerActionItemUpdated EventsEventType = "manager-action-item-updated" EventsEventTypeManagerActionAllowlist EventsEventType = "manager-action-allowlist" EventsEventTypeManagerActionEscalate EventsEventType = "manager-action-escalate" EventsEventTypeManagerActionTicketCreate EventsEventType = "manager-action-ticket-create" @@ -169,6 +201,7 @@ const ( EventsEventTypeManagerActionPrComment EventsEventType = "manager-action-pr-comment" EventsEventTypeManagerActionPrClose EventsEventType = "manager-action-pr-close" EventsEventTypeManagerActionPrReassign EventsEventType = "manager-action-pr-reassign" + EventsEventTypeManagerActionPrRebase EventsEventType = "manager-action-pr-rebase" EventsEventTypeManagerActionMessageUser EventsEventType = "manager-action-message-user" EventsEventTypeManagerActionMessageChannel EventsEventType = "manager-action-message-channel" EventsEventTypeManagerActionAssignUserTask EventsEventType = "manager-action-assign-user-task" @@ -186,31 +219,33 @@ const ( EventsEventTypeOrchestratorOnboardingStarted EventsEventType = "orchestrator-onboarding-started" EventsEventTypeOrchestratorOnboardingPhaseAdvanced EventsEventType = "orchestrator-onboarding-phase-advanced" EventsEventTypeOrchestratorOnboardingCompleted EventsEventType = "orchestrator-onboarding-completed" + EventsEventTypeOrchestratorOnboardingPartialCompleted EventsEventType = "orchestrator-onboarding-partial-completed" EventsEventTypeOrchestratorOnboardingFailed EventsEventType = "orchestrator-onboarding-failed" EventsEventTypeOrchestratorRetriageRequested EventsEventType = "orchestrator-retriage-requested" EventsEventTypeOrchestratorRetriageQueued EventsEventType = "orchestrator-retriage-queued" + EventsEventTypeOrchestratorCheckRunOverridden EventsEventType = "orchestrator-check-run-overridden" EventsEventTypePipelineTriggered EventsEventType = "pipeline-triggered" EventsEventTypePipelineFinished EventsEventType = "pipeline-finished" EventsEventTypePipelineFailed EventsEventType = "pipeline-failed" + EventsEventTypeRunStarted EventsEventType = "run-started" + EventsEventTypeRunStage EventsEventType = "run-stage" + EventsEventTypeRunFinished EventsEventType = "run-finished" EventsEventTypeSastNewBranchSummary EventsEventType = "sast-new-branch-summary" EventsEventTypeSastNewFinding EventsEventType = "sast-new-finding" EventsEventTypeSastNewFindings EventsEventType = "sast-new-findings" EventsEventTypeSastNewFix EventsEventType = "sast-new-fix" EventsEventTypeSastNewFixes EventsEventType = "sast-new-fixes" EventsEventTypeSastNewAllowlistedFinding EventsEventType = "sast-new-allowlisted-finding" - EventsEventTypeSastNewAllowlistedFindings EventsEventType = "sast-new-allowlisted-findings" EventsEventTypeSastNewUnallowlistedFinding EventsEventType = "sast-new-unallowlisted-finding" - EventsEventTypeSastNewUnallowlistedFindings EventsEventType = "sast-new-unallowlisted-findings" EventsEventTypeSastNewPullRequestFinding EventsEventType = "sast-new-pull-request-finding" - EventsEventTypeSastNewPullRequestFindings EventsEventType = "sast-new-pull-request-findings" EventsEventTypeSastNewPullRequestFix EventsEventType = "sast-new-pull-request-fix" EventsEventTypeSastNewPullRequestFixes EventsEventType = "sast-new-pull-request-fixes" - EventsEventTypeSastNewPullRequestAllowlistedFinding EventsEventType = "sast-new-pull-request-allowlisted-finding" - EventsEventTypeSastNewPullRequestUnallowlistedFinding EventsEventType = "sast-new-pull-request-unallowlisted-finding" EventsEventTypeSastNewVulnerabilityMerged EventsEventType = "sast-new-vulnerability-merged" EventsEventTypeSastReintroducedFinding EventsEventType = "sast-reintroduced-finding" EventsEventTypeSastReintroducedPullRequestFinding EventsEventType = "sast-reintroduced-pull-request-finding" EventsEventTypeSastFindingRetriaged EventsEventType = "sast-finding-retriaged" + EventsEventTypeSastFindingTriaged EventsEventType = "sast-finding-triaged" + EventsEventTypeSastFindingOverridden EventsEventType = "sast-finding-overridden" EventsEventTypeSastArchivedFinding EventsEventType = "sast-archived-finding" EventsEventTypeSastTicketCreated EventsEventType = "sast-ticket-created" EventsEventTypeSastTicketUpdated EventsEventType = "sast-ticket-updated" @@ -228,17 +263,15 @@ const ( EventsEventTypeScaNewFix EventsEventType = "sca-new-fix" EventsEventTypeScaNewFixes EventsEventType = "sca-new-fixes" EventsEventTypeScaNewAllowlistedFinding EventsEventType = "sca-new-allowlisted-finding" - EventsEventTypeScaNewAllowlistedFindings EventsEventType = "sca-new-allowlisted-findings" EventsEventTypeScaNewUnallowlistedFinding EventsEventType = "sca-new-unallowlisted-finding" EventsEventTypeScaNewPullRequestFinding EventsEventType = "sca-new-pull-request-finding" - EventsEventTypeScaNewPullRequestFindings EventsEventType = "sca-new-pull-request-findings" EventsEventTypeScaNewPullRequestFix EventsEventType = "sca-new-pull-request-fix" EventsEventTypeScaNewPullRequestFixes EventsEventType = "sca-new-pull-request-fixes" EventsEventTypeScaDependencyReintroducedFinding EventsEventType = "sca-dependency-reintroduced-finding" EventsEventTypeScaContainerReintroducedFinding EventsEventType = "sca-container-reintroduced-finding" - EventsEventTypeScaDependencyArchivedFinding EventsEventType = "sca-dependency-archived-finding" - EventsEventTypeScaContainerArchivedFinding EventsEventType = "sca-container-archived-finding" EventsEventTypeScaFindingRetriaged EventsEventType = "sca-finding-retriaged" + EventsEventTypeScaFindingTriaged EventsEventType = "sca-finding-triaged" + EventsEventTypeScaFindingOverridden EventsEventType = "sca-finding-overridden" EventsEventTypeScaTicketCreated EventsEventType = "sca-ticket-created" EventsEventTypeScaTicketUpdated EventsEventType = "sca-ticket-updated" EventsEventTypeScaTicketAssigned EventsEventType = "sca-ticket-assigned" @@ -252,19 +285,18 @@ const ( EventsEventTypeSecretsNewFinding EventsEventType = "secrets-new-finding" EventsEventTypeSecretsNewFindings EventsEventType = "secrets-new-findings" EventsEventTypeSecretsNewAllowlistedFinding EventsEventType = "secrets-new-allowlisted-finding" - EventsEventTypeSecretsNewAllowlistedFindings EventsEventType = "secrets-new-allowlisted-findings" EventsEventTypeSecretsNewUnallowlistedFinding EventsEventType = "secrets-new-unallowlisted-finding" EventsEventTypeSecretsArchivedFinding EventsEventType = "secrets-archived-finding" EventsEventTypeSecretsCredentialTriageCompleted EventsEventType = "secrets-credential-triage-completed" EventsEventTypeSecretsSensitivedataTriageCompleted EventsEventType = "secrets-sensitivedata-triage-completed" EventsEventTypeSecretsFindingRetriaged EventsEventType = "secrets-finding-retriaged" + EventsEventTypeSecretsFindingOverridden EventsEventType = "secrets-finding-overridden" EventsEventTypeSecretsTicketCreated EventsEventType = "secrets-ticket-created" EventsEventTypeSecretsTicketUpdated EventsEventType = "secrets-ticket-updated" EventsEventTypeSecretsTicketAssigned EventsEventType = "secrets-ticket-assigned" EventsEventTypeSecretsTicketClosed EventsEventType = "secrets-ticket-closed" EventsEventTypeSecretsTicketReopened EventsEventType = "secrets-ticket-reopened" EventsEventTypeSensitivedataNewFinding EventsEventType = "sensitivedata-new-finding" - EventsEventTypeSensitivedataNewFindings EventsEventType = "sensitivedata-new-findings" EventsEventTypeSensitivedataAllowlisted EventsEventType = "sensitivedata-allowlisted" EventsEventTypeSensitivedataUnallowlisted EventsEventType = "sensitivedata-unallowlisted" EventsEventTypeSensitivedataTicketCreated EventsEventType = "sensitivedata-ticket-created" @@ -272,7 +304,6 @@ const ( EventsEventTypeSensitivedataTicketAssigned EventsEventType = "sensitivedata-ticket-assigned" EventsEventTypeSensitivedataTicketClosed EventsEventType = "sensitivedata-ticket-closed" EventsEventTypeSensitivedataTicketReopened EventsEventType = "sensitivedata-ticket-reopened" - EventsEventTypeSensitivedataArchivedFinding EventsEventType = "sensitivedata-archived-finding" EventsEventTypeSecretsScanStarted EventsEventType = "secrets-scan-started" EventsEventTypeSecretsScanCompleted EventsEventType = "secrets-scan-completed" EventsEventTypeSecretsScanFailed EventsEventType = "secrets-scan-failed" @@ -289,110 +320,14 @@ const ( EventsEventTypeWebhookPushReceived EventsEventType = "webhook-push-received" ) -type GraphEdge struct { - Explanation *string `json:"explanation,omitempty"` - SourceID *string `json:"sourceId,omitempty"` - TargetID *string `json:"targetId,omitempty"` - Type *GraphEdgeType `json:"type,omitempty"` +type FrameworksVulnManagementFrameworks struct { + Results []FrameworksResult `json:"results,omitempty"` } -type GraphEdgeType string - -const ( - GraphEdgeTypeAccessedBy GraphEdgeType = "ACCESSED_BY" - GraphEdgeTypeAllowedBy GraphEdgeType = "ALLOWED_BY" - GraphEdgeTypeAllowsEgressTo GraphEdgeType = "ALLOWS_EGRESS_TO" - GraphEdgeTypeAllowsIngressFrom GraphEdgeType = "ALLOWS_INGRESS_FROM" - GraphEdgeTypeAppliesTo GraphEdgeType = "APPLIES_TO" - GraphEdgeTypeAssumes GraphEdgeType = "ASSUMES" - GraphEdgeTypeAssumesRole GraphEdgeType = "ASSUMES_ROLE" - GraphEdgeTypeAttachedTo GraphEdgeType = "ATTACHED_TO" - GraphEdgeTypeAuthenticates GraphEdgeType = "AUTHENTICATES" - GraphEdgeTypeBasedOnContainerfile GraphEdgeType = "BASED_ON_CONTAINERFILE" - GraphEdgeTypeBelongsTo GraphEdgeType = "BELONGS_TO" - GraphEdgeTypeBuilds GraphEdgeType = "BUILDS" - GraphEdgeTypeBuiltFrom GraphEdgeType = "BUILT_FROM" - GraphEdgeTypeCalls GraphEdgeType = "CALLS" - GraphEdgeTypeCanReach GraphEdgeType = "CAN_REACH" - GraphEdgeTypeClaims GraphEdgeType = "CLAIMS" - GraphEdgeTypeContains GraphEdgeType = "CONTAINS" - GraphEdgeTypeContributesTo GraphEdgeType = "CONTRIBUTES_TO" - GraphEdgeTypeContributesToProject GraphEdgeType = "CONTRIBUTES_TO_PROJECT" - GraphEdgeTypeControls GraphEdgeType = "CONTROLS" - GraphEdgeTypeDeployedBy GraphEdgeType = "DEPLOYED_BY" - GraphEdgeTypeDeployedIn GraphEdgeType = "DEPLOYED_IN" - GraphEdgeTypeDeployedTo GraphEdgeType = "DEPLOYED_TO" - GraphEdgeTypeEncrypts GraphEdgeType = "ENCRYPTS" - GraphEdgeTypeEnforcedBy GraphEdgeType = "ENFORCED_BY" - GraphEdgeTypeEnforces GraphEdgeType = "ENFORCES" - GraphEdgeTypeEntryPoints GraphEdgeType = "ENTRY_POINTS" - GraphEdgeTypeExecutes GraphEdgeType = "EXECUTES" - GraphEdgeTypeExists GraphEdgeType = "EXISTS" - GraphEdgeTypeExistsIn GraphEdgeType = "EXISTS_IN" - GraphEdgeTypeExposedAt GraphEdgeType = "EXPOSED_AT" - GraphEdgeTypeExposedBy GraphEdgeType = "EXPOSED_BY" - GraphEdgeTypeExposedOn GraphEdgeType = "EXPOSED_ON" - GraphEdgeTypeExposes GraphEdgeType = "EXPOSES" - GraphEdgeTypeFilteredBy GraphEdgeType = "FILTERED_BY" - GraphEdgeTypeForwardsTo GraphEdgeType = "FORWARDS_TO" - GraphEdgeTypeGrantsAccess GraphEdgeType = "GRANTS_ACCESS" - GraphEdgeTypeHasAuth GraphEdgeType = "HAS_AUTH" - GraphEdgeTypeHasContributor GraphEdgeType = "HAS_CONTRIBUTOR" - GraphEdgeTypeHasEndpoint GraphEdgeType = "HAS_ENDPOINT" - GraphEdgeTypeHasEntrypoint GraphEdgeType = "HAS_ENTRYPOINT" - GraphEdgeTypeHasFinding GraphEdgeType = "HAS_FINDING" - GraphEdgeTypeHasHost GraphEdgeType = "HAS_HOST" - GraphEdgeTypeHasMember GraphEdgeType = "HAS_MEMBER" - GraphEdgeTypeHasNote GraphEdgeType = "HAS_NOTE" - GraphEdgeTypeHasRole GraphEdgeType = "HAS_ROLE" - GraphEdgeTypeHasRule GraphEdgeType = "HAS_RULE" - GraphEdgeTypeHasSecurityGroup GraphEdgeType = "HAS_SECURITY_GROUP" - GraphEdgeTypeHosts GraphEdgeType = "HOSTS" - GraphEdgeTypeInProject GraphEdgeType = "IN_PROJECT" - GraphEdgeTypeInRepository GraphEdgeType = "IN_REPOSITORY" - GraphEdgeTypeInSubnet GraphEdgeType = "IN_SUBNET" - GraphEdgeTypeInVpc GraphEdgeType = "IN_VPC" - GraphEdgeTypeIssuedTo GraphEdgeType = "ISSUED_TO" - GraphEdgeTypeMemberOf GraphEdgeType = "MEMBER_OF" - GraphEdgeTypeMonitors GraphEdgeType = "MONITORS" - GraphEdgeTypeMountedBy GraphEdgeType = "MOUNTED_BY" - GraphEdgeTypeOpenOn GraphEdgeType = "OPEN_ON" - GraphEdgeTypeOrigin GraphEdgeType = "ORIGIN" - GraphEdgeTypePeeredWith GraphEdgeType = "PEERED_WITH" - GraphEdgeTypeProducedBy GraphEdgeType = "PRODUCED_BY" - GraphEdgeTypeProtectedBy GraphEdgeType = "PROTECTED_BY" - GraphEdgeTypeProvidedBy GraphEdgeType = "PROVIDED_BY" - GraphEdgeTypeProvides GraphEdgeType = "PROVIDES" - GraphEdgeTypePublishesTo GraphEdgeType = "PUBLISHES_TO" - GraphEdgeTypeQueriedBy GraphEdgeType = "QUERIED_BY" - GraphEdgeTypeQueries GraphEdgeType = "QUERIES" - GraphEdgeTypeReferences GraphEdgeType = "REFERENCES" - GraphEdgeTypeResolvesTo GraphEdgeType = "RESOLVES_TO" - GraphEdgeTypeRoutedBy GraphEdgeType = "ROUTED_BY" - GraphEdgeTypeRoutesTo GraphEdgeType = "ROUTES_TO" - GraphEdgeTypeRunsImage GraphEdgeType = "RUNS_IMAGE" - GraphEdgeTypeScales GraphEdgeType = "SCALES" - GraphEdgeTypeSecuredBy GraphEdgeType = "SECURED_BY" - GraphEdgeTypeServes GraphEdgeType = "SERVES" - GraphEdgeTypeSourcedFrom GraphEdgeType = "SOURCED_FROM" - GraphEdgeTypeStoredIn GraphEdgeType = "STORED_IN" - GraphEdgeTypeSubscribesTo GraphEdgeType = "SUBSCRIBES_TO" - GraphEdgeTypeTargets GraphEdgeType = "TARGETS" - GraphEdgeTypeTargetWorkload GraphEdgeType = "TARGET_WORKLOAD" - GraphEdgeTypeTriggeredBy GraphEdgeType = "TRIGGERED_BY" - GraphEdgeTypeTriggers GraphEdgeType = "TRIGGERS" - GraphEdgeTypeUploadedTo GraphEdgeType = "UPLOADED_TO" - GraphEdgeTypeUsedBy GraphEdgeType = "USED_BY" - GraphEdgeTypeUses GraphEdgeType = "USES" - GraphEdgeTypeUsesContainer GraphEdgeType = "USES_CONTAINER" - GraphEdgeTypeUsesPod GraphEdgeType = "USES_POD" - GraphEdgeTypeUsesSecurityGroup GraphEdgeType = "USES_SECURITY_GROUP" - GraphEdgeTypeUsesTaskDefinition GraphEdgeType = "USES_TASK_DEFINITION" -) - type GraphGraph struct { Edges []GraphEdge `json:"edges,omitempty"` Nodes []json.RawMessage `json:"nodes,omitempty"` + PathAssessment *GraphPathAssessment `json:"pathAssessment,omitempty"` } type LanguageCodeLanguage string @@ -406,12 +341,16 @@ const ( LanguageCodeLanguageCloudformation LanguageCodeLanguage = "CloudFormation" LanguageCodeLanguageContainerfile LanguageCodeLanguage = "Containerfile" LanguageCodeLanguageDockerfile LanguageCodeLanguage = "Dockerfile" + LanguageCodeLanguageElixir LanguageCodeLanguage = "Elixir" + LanguageCodeLanguageErlang LanguageCodeLanguage = "Erlang" LanguageCodeLanguageFsharp LanguageCodeLanguage = "FSharp" LanguageCodeLanguageGo LanguageCodeLanguage = "Go" LanguageCodeLanguageHcl LanguageCodeLanguage = "HCL" + LanguageCodeLanguageHaskell LanguageCodeLanguage = "Haskell" LanguageCodeLanguageJson LanguageCodeLanguage = "JSON" LanguageCodeLanguageJava LanguageCodeLanguage = "Java" LanguageCodeLanguageJavascript LanguageCodeLanguage = "JavaScript" + LanguageCodeLanguageJulia LanguageCodeLanguage = "Julia" LanguageCodeLanguageKotlin LanguageCodeLanguage = "Kotlin" LanguageCodeLanguageKubernetes LanguageCodeLanguage = "Kubernetes" LanguageCodeLanguageObjectiveC LanguageCodeLanguage = "Objective-C" @@ -432,6 +371,13 @@ const ( LanguageCodeLanguageYaml LanguageCodeLanguage = "YAML" ) +type MetricdefsRatio struct { + Available bool `json:"available"` + Denominator int64 `json:"denominator"` + Numerator int64 `json:"numerator"` + Percent *float64 `json:"percent,omitempty"` +} + type ModelsAllowlistState string const ( @@ -451,6 +397,8 @@ const ( ModelsAllowlistTypeUserassumerisk ModelsAllowlistType = "UserAssumeRisk" ModelsAllowlistTypeUserfalsepositive ModelsAllowlistType = "UserFalsePositive" ModelsAllowlistTypeUserother ModelsAllowlistType = "UserOther" + ModelsAllowlistTypeRuleexception ModelsAllowlistType = "RuleException" + ModelsAllowlistTypeUserunallowlisted ModelsAllowlistType = "UserUnallowlisted" ) type ModelsAssessmentFactor struct { @@ -475,6 +423,7 @@ const ( ModelsAutoFixStatePrMerged ModelsAutoFixState = "pr_merged" ModelsAutoFixStatePrClosed ModelsAutoFixState = "pr_closed" ModelsAutoFixStateFailedPrCreation ModelsAutoFixState = "failed_pr_creation" + ModelsAutoFixStateFailedIteration ModelsAutoFixState = "failed_iteration" ) type ModelsAutofixFailureReason string @@ -483,31 +432,29 @@ const ( ModelsAutofixFailureReasonAgentError ModelsAutofixFailureReason = "AGENT_ERROR" ModelsAutofixFailureReasonAgentSurrendered ModelsAutofixFailureReason = "AGENT_SURRENDERED" ModelsAutofixFailureReasonCodeNotFound ModelsAutofixFailureReason = "CODE_NOT_FOUND" - ModelsAutofixFailureReasonDependabotNoOp ModelsAutofixFailureReason = "DEPENDABOT_NO_OP" ModelsAutofixFailureReasonEcosystemNotSupported ModelsAutofixFailureReason = "ECOSYSTEM_NOT_SUPPORTED" - ModelsAutofixFailureReasonFixGenerationFailed ModelsAutofixFailureReason = "FIX_GENERATION_FAILED" - ModelsAutofixFailureReasonFixReviewRejected ModelsAutofixFailureReason = "FIX_REVIEW_REJECTED" - ModelsAutofixFailureReasonNoFixVersionAvailable ModelsAutofixFailureReason = "NO_FIX_VERSION_AVAILABLE" - ModelsAutofixFailureReasonTimeout ModelsAutofixFailureReason = "TIMEOUT" - ModelsAutofixFailureReasonTransitiveNoParentBumpPath ModelsAutofixFailureReason = "TRANSITIVE_NO_PARENT_BUMP_PATH" + ModelsAutofixFailureReasonFixRejected ModelsAutofixFailureReason = "FIX_REJECTED" + ModelsAutofixFailureReasonMultipleSourceFiles ModelsAutofixFailureReason = "MULTIPLE_SOURCE_FILES" + ModelsAutofixFailureReasonNoFixAvailable ModelsAutofixFailureReason = "NO_FIX_AVAILABLE" + ModelsAutofixFailureReasonNoPatchedVersion ModelsAutofixFailureReason = "NO_PATCHED_VERSION" + ModelsAutofixFailureReasonPrCreateFailed ModelsAutofixFailureReason = "PR_CREATE_FAILED" ) -type ModelsCDXGen struct { - BomFormat string `json:"bomFormat"` - Components []ModelsCDXComponents `json:"components,omitempty"` - Dependencies []ModelsCDXDeps `json:"dependencies,omitempty"` - Metadata ModelsCDXMetaData `json:"metadata"` - SerialNumber string `json:"serialNumber"` - Services []ModelsCDXService `json:"services,omitempty"` - SpecVersion string `json:"specVersion"` - Version int `json:"version"` -} - type ModelsCandidate struct { Reason string `json:"reason"` User ModelsUser `json:"user"` } +type ModelsCloudProvider string + +const ( + ModelsCloudProviderAws ModelsCloudProvider = "AWS" + ModelsCloudProviderAzure ModelsCloudProvider = "AZURE" + ModelsCloudProviderGcp ModelsCloudProvider = "GCP" + ModelsCloudProviderK8s ModelsCloudProvider = "K8S" + ModelsCloudProviderOther ModelsCloudProvider = "OTHER" +) + type ModelsCodeContext struct { CodeBlocks []ModelsCodeBlock `json:"codeBlocks,omitempty"` DataFlow *string `json:"dataFlow,omitempty"` @@ -526,20 +473,29 @@ type ModelsCodeFindingPriority struct { Severity *ModelsCodeFindingPrioritySeverity `json:"severity,omitempty"` } -type ModelsCustomerQuestion struct { - Answer *json.RawMessage `json:"answer,omitempty"` - AnswerMemoryID *string `json:"answerMemoryId,omitempty"` - AnsweredAt *string `json:"answeredAt,omitempty"` - CustomMessage *string `json:"customMessage,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` +type ModelsComment struct { + Body string `json:"body"` + CommentProvider *ModelsCommentProvider `json:"commentProvider,omitempty"` + CreatedAt string `json:"createdAt"` ID *string `json:"id,omitempty"` - Options []ModelsCustomerQuestionOptionsElem `json:"options,omitempty"` - QuestionText *string `json:"questionText,omitempty"` - QuestionType *ModelsCustomerQuestionQuestionType `json:"questionType,omitempty"` - RelatedMemoryIds []string `json:"relatedMemoryIds,omitempty"` - Scope *ModelsCustomerQuestionScope `json:"scope,omitempty"` - ScopeResourceID *string `json:"scopeResourceId,omitempty"` - UnknownIds []string `json:"unknownIds,omitempty"` + IsBot *bool `json:"isBot,omitempty"` + IsNullify bool `json:"isNullify"` + UpdatedAt string `json:"updatedAt"` + UserID string `json:"userId"` + UserName string `json:"userName"` +} + +type ModelsCommentProvider struct { + Asana *ModelsAsanaCommentProvider `json:"asana,omitempty"` + Azure *ModelsAzureCommentProvider `json:"azure,omitempty"` + Bitbucket *ModelsBitbucketCommentProvider `json:"bitbucket,omitempty"` + Github *ModelsGitHubCommentProvider `json:"github,omitempty"` + Gitlab *ModelsGitLabCommentProvider `json:"gitlab,omitempty"` + ID *ModelsProviderID `json:"id,omitempty"` + Jira *ModelsJiraCommentProvider `json:"jira,omitempty"` + Linear *ModelsLinearCommentProvider `json:"linear,omitempty"` + Slack *ModelsSlackCommentProvider `json:"slack,omitempty"` + Teams *ModelsTeamsCommentProvider `json:"teams,omitempty"` } type ModelsDiffFile struct { @@ -550,11 +506,43 @@ type ModelsDiffFile struct { OrigName string `json:"origName"` } +type ModelsDurationStats struct { + MeanMs *int `json:"meanMs,omitempty"` + MedianMs *int `json:"medianMs,omitempty"` + Sample int64 `json:"sample"` +} + +type ModelsExploitEvidenceAttachment struct { + ContentType string `json:"contentType"` + ID string `json:"id"` + Kind string `json:"kind"` +} + type ModelsFileOwner struct { Name string `json:"name"` Type ModelsOwnerType `json:"type"` } +type ModelsFindingProgress struct { + AutofixDuration *int `json:"autofixDuration,omitempty"` + AutofixedAt *string `json:"autofixedAt,omitempty"` + CreatedAt string `json:"createdAt"` + DetectionDuration *int `json:"detectionDuration,omitempty"` + DiscoveredAt *string `json:"discoveredAt,omitempty"` + FindingID string `json:"findingId"` + FindingType ModelsFindingType `json:"findingType"` + HasOpenAutoFixPR *bool `json:"hasOpenAutoFixPR,omitempty"` + HasOpenTicket *bool `json:"hasOpenTicket,omitempty"` + InProgressAt *string `json:"inProgressAt,omitempty"` + ResolvedAt *string `json:"resolvedAt,omitempty"` + Status ModelsFindingStatus `json:"status"` + TimeSaved *int `json:"timeSaved,omitempty"` + TotalRemediationDuration *int `json:"totalRemediationDuration,omitempty"` + TriageDuration *int `json:"triageDuration,omitempty"` + TriagedAt *string `json:"triagedAt,omitempty"` + UpdatedAt string `json:"updatedAt"` +} + type ModelsFindingType string const ( @@ -567,7 +555,8 @@ const ( ModelsFindingTypePentest ModelsFindingType = "Pentest" ModelsFindingTypeBughunt ModelsFindingType = "BugHunt" ModelsFindingTypeCloud ModelsFindingType = "Cloud" - ModelsFindingTypePlatform ModelsFindingType = "Platform" + ModelsFindingTypeSupplychain ModelsFindingType = "SupplyChain" + ModelsFindingTypeAiReview ModelsFindingType = "AI Review" ) type ModelsFindingsMetrics struct { @@ -576,25 +565,49 @@ type ModelsFindingsMetrics struct { EstimatedBacklogStoryPoints *int `json:"estimatedBacklogStoryPoints,omitempty"` FindingsAllowlistedCount *int `json:"findingsAllowlistedCount,omitempty"` FindingsCount int `json:"findingsCount"` + FindingsFixPendingVerificationCount *int `json:"findingsFixPendingVerificationCount,omitempty"` + FindingsFixedCount *int `json:"findingsFixedCount,omitempty"` FindingsInBacklogCount int `json:"findingsInBacklogCount"` FindingsInProgressCount *int `json:"findingsInProgressCount,omitempty"` + FindingsNoLongerDetectedCount *int `json:"findingsNoLongerDetectedCount,omitempty"` FindingsResolvedCount int `json:"findingsResolvedCount"` FindingsWithOpenAutoFixPRCount int `json:"findingsWithOpenAutoFixPRCount"` FindingsWithOpenTicketCount int `json:"findingsWithOpenTicketCount"` + FixedTimeToResolve *ModelsDurationStats `json:"fixedTimeToResolve,omitempty"` + Funnel *ModelsRemediationFunnel `json:"funnel,omitempty"` + MeanTimeToAutofix *int `json:"meanTimeToAutofix,omitempty"` MeanTimeToDetectAndTriage *int `json:"meanTimeToDetectAndTriage,omitempty"` MeanTimeToMerge *int `json:"meanTimeToMerge,omitempty"` MeanTimeToPullRequestCreation *int `json:"meanTimeToPullRequestCreation,omitempty"` - MeanTimeToResolve *int `json:"meanTimeToResolve,omitempty"` MeanTimeToReview *int `json:"meanTimeToReview,omitempty"` + MeanTimeToTriage *int `json:"meanTimeToTriage,omitempty"` + MedianTimeToAutofix *int `json:"medianTimeToAutofix,omitempty"` MedianTimeToDetectAndTriage *int `json:"medianTimeToDetectAndTriage,omitempty"` MedianTimeToMerge *int `json:"medianTimeToMerge,omitempty"` MedianTimeToPullRequestCreation *int `json:"medianTimeToPullRequestCreation,omitempty"` - MedianTimeToResolve *int `json:"medianTimeToResolve,omitempty"` MedianTimeToReview *int `json:"medianTimeToReview,omitempty"` - TimeSaved *int `json:"timeSaved,omitempty"` + MedianTimeToTriage *int `json:"medianTimeToTriage,omitempty"` + StageSamples *ModelsStageSampleSizes `json:"stageSamples,omitempty"` TriageTimeTotal *int `json:"triageTimeTotal,omitempty"` } +type ModelsFixEvidence string + +const ( + ModelsFixEvidenceMergedFixPr ModelsFixEvidence = "merged_fix_pr" + ModelsFixEvidenceVulnerableLinesChanged ModelsFixEvidence = "vulnerable_lines_changed" + ModelsFixEvidenceFileRemoved ModelsFixEvidence = "file_removed" + ModelsFixEvidenceDependencyVersionChanged ModelsFixEvidence = "dependency_version_changed" + ModelsFixEvidenceDependencyRemoved ModelsFixEvidence = "dependency_removed" + ModelsFixEvidenceBaseImageChanged ModelsFixEvidence = "base_image_changed" +) + +type ModelsGitHubExecutionIdentity struct { + AppID *int64 `json:"appID,omitempty"` + Proof *string `json:"proof,omitempty"` + Source *ModelsGitHubCredentialSource `json:"source,omitempty"` +} + type ModelsGitPullRequestProvider struct { Azure *ModelsAzureGitPullRequest `json:"azure,omitempty"` Bitbucket *ModelsBitbucketGitPullRequest `json:"bitbucket,omitempty"` @@ -617,6 +630,7 @@ type ModelsInvestigationStep struct { } type ModelsOwnerProvider struct { + Asana *ModelsAsanaOwnerProvider `json:"asana,omitempty"` Azure *ModelsAzureOwnerProvider `json:"azure,omitempty"` AzureEntra *ModelsAzureEntraOwnerProvider `json:"azureEntra,omitempty"` Bitbucket *ModelsBitbucketOwnerProvider `json:"bitbucket,omitempty"` @@ -632,6 +646,24 @@ type ModelsOwnerProvider struct { Teams *ModelsTeamsOwnerProvider `json:"teams,omitempty"` } +type ModelsPathScope struct { + Exclude []string `json:"exclude,omitempty"` + Include []string `json:"include,omitempty"` +} + +type ModelsPriorityEnum string + +const ( + ModelsPriorityEnumFalsePositive ModelsPriorityEnum = "FALSE_POSITIVE" + ModelsPriorityEnumImportant ModelsPriorityEnum = "IMPORTANT" + ModelsPriorityEnumInformational ModelsPriorityEnum = "INFORMATIONAL" + ModelsPriorityEnumLow ModelsPriorityEnum = "LOW" + ModelsPriorityEnumMedium ModelsPriorityEnum = "MEDIUM" + ModelsPriorityEnumNegligible ModelsPriorityEnum = "NEGLIGIBLE" + ModelsPriorityEnumUnknown ModelsPriorityEnum = "UNKNOWN" + ModelsPriorityEnumUrgent ModelsPriorityEnum = "URGENT" +) + type ModelsPriorityLabel string const ( @@ -645,9 +677,17 @@ const ( ModelsPriorityLabelUnknown ModelsPriorityLabel = "UNKNOWN" ) +type ModelsPrioritySource string + +const ( + ModelsPrioritySourceTriage ModelsPrioritySource = "TRIAGE" + ModelsPrioritySourceScanner ModelsPrioritySource = "SCANNER" +) + type ModelsProviderID string const ( + ModelsProviderIDDx ModelsProviderID = "DX" ModelsProviderIDNullify ModelsProviderID = "Nullify" ModelsProviderIDGithub ModelsProviderID = "GitHub" ModelsProviderIDBitbucket ModelsProviderID = "Bitbucket" @@ -659,10 +699,11 @@ const ( ModelsProviderIDGithubnullify ModelsProviderID = "GitHubNullify" ModelsProviderIDJira ModelsProviderID = "Jira" ModelsProviderIDLinear ModelsProviderID = "Linear" + ModelsProviderIDAsana ModelsProviderID = "Asana" ModelsProviderIDSlack ModelsProviderID = "Slack" ModelsProviderIDTeams ModelsProviderID = "Teams" ModelsProviderIDAws ModelsProviderID = "AWS" - // (duplicate "Azure" collides with "Azure" → ModelsProviderIDAzure) + ModelsProviderIDAzurecloud ModelsProviderID = "AzureCloud" ModelsProviderIDGcp ModelsProviderID = "GCP" ModelsProviderIDAlibaba ModelsProviderID = "Alibaba" ModelsProviderIDOracle ModelsProviderID = "Oracle" @@ -686,11 +727,60 @@ const ( ModelsProviderIDSemaphore ModelsProviderID = "Semaphore" ModelsProviderIDTeamcity ModelsProviderID = "TeamCity" ModelsProviderIDAzurepipelines ModelsProviderID = "AzurePipelines" + ModelsProviderIDCodefresh ModelsProviderID = "Codefresh" + ModelsProviderIDMicrosoftsentinel ModelsProviderID = "MicrosoftSentinel" + ModelsProviderIDGenericsiem ModelsProviderID = "GenericSIEM" + ModelsProviderIDVanta ModelsProviderID = "Vanta" + ModelsProviderIDDrata ModelsProviderID = "Drata" + ModelsProviderIDSecureframe ModelsProviderID = "Secureframe" + ModelsProviderIDScrut ModelsProviderID = "Scrut" + ModelsProviderIDDelve ModelsProviderID = "Delve" + ModelsProviderIDServicenowvr ModelsProviderID = "ServiceNowVR" + ModelsProviderIDTenable ModelsProviderID = "Tenable" + ModelsProviderIDKenna ModelsProviderID = "Kenna" + ModelsProviderIDArmorcode ModelsProviderID = "ArmorCode" + ModelsProviderIDBrinqa ModelsProviderID = "Brinqa" + ModelsProviderIDNucleus ModelsProviderID = "Nucleus" + ModelsProviderIDPhoenix ModelsProviderID = "Phoenix" + ModelsProviderIDWiz ModelsProviderID = "Wiz" + ModelsProviderIDEmail ModelsProviderID = "Email" + ModelsProviderIDWebhook ModelsProviderID = "Webhook" + ModelsProviderIDPagerduty ModelsProviderID = "PagerDuty" + ModelsProviderIDOpsgenie ModelsProviderID = "Opsgenie" + ModelsProviderIDEcr ModelsProviderID = "ECR" + ModelsProviderIDAcr ModelsProviderID = "ACR" + ModelsProviderIDGcr ModelsProviderID = "GCR" + ModelsProviderIDDockerhub ModelsProviderID = "DockerHub" + ModelsProviderIDArtifactory ModelsProviderID = "Artifactory" + ModelsProviderIDHarbor ModelsProviderID = "Harbor" + ModelsProviderIDQuay ModelsProviderID = "Quay" + ModelsProviderIDGhcr ModelsProviderID = "GHCR" + ModelsProviderIDGitlabregistry ModelsProviderID = "GitLabRegistry" + ModelsProviderIDPrivatenpm ModelsProviderID = "PrivateNpm" + ModelsProviderIDPrivatemaven ModelsProviderID = "PrivateMaven" + ModelsProviderIDPrivatepypi ModelsProviderID = "PrivatePyPI" + ModelsProviderIDPrivategoproxy ModelsProviderID = "PrivateGoProxy" + ModelsProviderIDArtifactorypackages ModelsProviderID = "ArtifactoryPackages" + ModelsProviderIDNexuspackages ModelsProviderID = "NexusPackages" + ModelsProviderIDAwscodeartifact ModelsProviderID = "AWSCodeArtifact" + ModelsProviderIDGithubpackages ModelsProviderID = "GitHubPackages" + ModelsProviderIDGoogleartifactregistry ModelsProviderID = "GoogleArtifactRegistry" ModelsProviderIDExternal ModelsProviderID = "External" ModelsProviderIDRepositoryproperty ModelsProviderID = "RepositoryProperty" ) +type ModelsPullRequestCIState string + +const ( + ModelsPullRequestCIStatePending ModelsPullRequestCIState = "pending" + ModelsPullRequestCIStateSuccess ModelsPullRequestCIState = "success" + ModelsPullRequestCIStateFailure ModelsPullRequestCIState = "failure" +) + type ModelsPullRequestInfo struct { + CiCheckedAt *string `json:"ciCheckedAt,omitempty"` + CiDetailURL *string `json:"ciDetailUrl,omitempty"` + CiState *ModelsPullRequestCIState `json:"ciState,omitempty"` CreatedAt string `json:"createdAt"` Explanation string `json:"explanation"` FirstReviewedAt *string `json:"firstReviewedAt,omitempty"` @@ -701,6 +791,7 @@ type ModelsPullRequestInfo struct { Link string `json:"link"` MergedAt *string `json:"mergedAt,omitempty"` PullRequestProvider ModelsGitPullRequestProvider `json:"pullRequestProvider"` + RecordID *string `json:"recordId,omitempty"` Status ModelsPullRequestState `json:"status"` Title *string `json:"title,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` @@ -716,27 +807,66 @@ const ( ) type ModelsRepositoryPublic struct { + CodePaths *ModelsPathScope `json:"codePaths,omitempty"` CountsBySeverity map[string]int `json:"countsBySeverity,omitempty"` CountsByType map[string]int `json:"countsByType,omitempty"` DefaultBranch *string `json:"defaultBranch,omitempty"` DefaultBranchCommittedAt *string `json:"defaultBranchCommittedAt,omitempty"` DefaultBranchSha *string `json:"defaultBranchSha,omitempty"` + Excluded *bool `json:"excluded,omitempty"` ID string `json:"id"` IsArchived bool `json:"isArchived"` IsDefaultBranch bool `json:"isDefaultBranch"` - NullifyConfigFile *ModelsConfiguration `json:"nullifyConfigFile,omitempty"` + IsEnrolled bool `json:"isEnrolled"` + Language *string `json:"language,omitempty"` + Languages []string `json:"languages,omitempty"` Owner string `json:"owner"` OwnerType string `json:"ownerType"` Pii *ModelsPII `json:"pii,omitempty"` Platform string `json:"platform"` + RepoSizeBytes *int `json:"repoSizeBytes,omitempty"` Repository string `json:"repository"` RepositoryID string `json:"repositoryId"` Sbom string `json:"sbom"` + ScanScope *ModelsScanScopeExplanation `json:"scanScope,omitempty"` + ScopeUpdatedAt *string `json:"scopeUpdatedAt,omitempty"` + SecretsEnrolled *bool `json:"secretsEnrolled,omitempty"` + SecretsExcludes []string `json:"secretsExcludes,omitempty"` TenantID string `json:"tenantId"` Timestamp string `json:"timestamp"` TimestampUnix int64 `json:"timestampUnix"` } +type ModelsSBOMPackageAuth struct { + Credential *string `json:"credential,omitempty"` + Dir *string `json:"dir,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + Evidence *string `json:"evidence,omitempty"` + Registry *string `json:"registry,omitempty"` + Tool *string `json:"tool,omitempty"` + Version *int `json:"version,omitempty"` +} + +type ModelsSCPMEnforcement struct { + Mode ModelsSCPMRuleMode `json:"mode"` + Severity ModelsSeverity `json:"severity"` + Source *ModelsSCPMEnforcementSource `json:"source,omitempty"` + Suppressed bool `json:"suppressed"` + SuppressedBy *ModelsSCPMRuleSuppression `json:"suppressedBy,omitempty"` +} + +type ModelsSCPMFindingMovement struct { + CommitHash string `json:"commitHash"` + CommitTime *string `json:"commitTime,omitempty"` + EndLine *int `json:"endLine,omitempty"` + FilePath string `json:"filePath"` + PackageVersion *string `json:"packageVersion,omitempty"` + PreviousCommitHash *string `json:"previousCommitHash,omitempty"` + PreviousFilePath *string `json:"previousFilePath,omitempty"` + Reason string `json:"reason"` + StartLine *int `json:"startLine,omitempty"` +} + type ModelsScanStatus string const ( @@ -748,6 +878,16 @@ const ( ModelsScanStatusFailed ModelsScanStatus = "failed" ModelsScanStatusAbortedConfigError ModelsScanStatus = "aborted_config_error" ModelsScanStatusHumanFallback ModelsScanStatus = "human_fallback" + ModelsScanStatusAwaitingManual ModelsScanStatus = "awaiting_manual" + ModelsScanStatusSkipped ModelsScanStatus = "skipped" +) + +type ModelsSecretsValidationResult string + +const ( + ModelsSecretsValidationResultInvalid ModelsSecretsValidationResult = "INVALID" + ModelsSecretsValidationResultUnknown ModelsSecretsValidationResult = "UNKNOWN" + ModelsSecretsValidationResultValid ModelsSecretsValidationResult = "VALID" ) type ModelsSeverity string @@ -762,7 +902,18 @@ const ( ModelsSeverityUnknown ModelsSeverity = "UNKNOWN" ) +type ModelsSeverityEnum string + +const ( + ModelsSeverityEnumCritical ModelsSeverityEnum = "CRITICAL" + ModelsSeverityEnumHigh ModelsSeverityEnum = "HIGH" + ModelsSeverityEnumInformational ModelsSeverityEnum = "INFORMATIONAL" + ModelsSeverityEnumLow ModelsSeverityEnum = "LOW" + ModelsSeverityEnumMedium ModelsSeverityEnum = "MEDIUM" +) + type ModelsTicketProvider struct { + Asana *ModelsAsanaTicketProvider `json:"asana,omitempty"` Azure *ModelsAzureTicketProvider `json:"azure,omitempty"` Github *ModelsGitHubTicketProvider `json:"github,omitempty"` Gitlab *ModelsGitLabTicketProvider `json:"gitlab,omitempty"` @@ -772,13 +923,19 @@ type ModelsTicketProvider struct { } type ModelsTriage struct { + AgentConfidence *ModelsTriageAgentConfidence `json:"agentConfidence,omitempty"` BudgetExhausted *bool `json:"budgetExhausted,omitempty"` CampaignMetadata *ModelsTriageCampaignMetadata `json:"campaignMetadata,omitempty"` CloudContext *ModelsTriageCloudContext `json:"cloudContext,omitempty"` + ComplianceImpact *ModelsTriageComplianceImpact `json:"complianceImpact,omitempty"` + ContainerAssessment *ModelsTriageContainerAssessment `json:"containerAssessment,omitempty"` CustomerQuestions *ModelsCustomerQuestionSet `json:"customerQuestions,omitempty"` Description *string `json:"description,omitempty"` + DescriptionSummary *string `json:"descriptionSummary,omitempty"` DevDescription *string `json:"devDescription,omitempty"` DevTitle *string `json:"devTitle,omitempty"` + DismissalBasis *string `json:"dismissalBasis,omitempty"` + DismissalEvidence *string `json:"dismissalEvidence,omitempty"` Evidence *GraphGraph `json:"evidence,omitempty"` ExploitHypothesis *GraphGraph `json:"exploitHypothesis,omitempty"` Exploitability *ModelsTriageExploitability `json:"exploitability,omitempty"` @@ -786,38 +943,69 @@ type ModelsTriage struct { FixEffort *ModelsTriageFixEffort `json:"fixEffort,omitempty"` ID *string `json:"id,omitempty"` Impact *ModelsTriageImpact `json:"impact,omitempty"` + InvestigationConfidence *ModelsTriageInvestigationConfidence `json:"investigationConfidence,omitempty"` + InvestigationID *string `json:"investigationId,omitempty"` + InvestigationUnknowns []string `json:"investigationUnknowns,omitempty"` LastTriagedAt *string `json:"lastTriagedAt,omitempty"` MemoriesGenerated []string `json:"memoriesGenerated,omitempty"` MemoriesUsed []string `json:"memoriesUsed,omitempty"` ParentTriageID *string `json:"parentTriageId,omitempty"` Pentest *ModelsTriagePentest `json:"pentest,omitempty"` Priority *ModelsPriorityEnum `json:"priority,omitempty"` + References []ModelsTriageReference `json:"references,omitempty"` + RetriageComparison *ModelsTriageRetriageComparison `json:"retriageComparison,omitempty"` RetriageMetadata *ModelsTriageRetriageMetadata `json:"retriageMetadata,omitempty"` RetriageStatus *ModelsTriageRetriageStatus `json:"retriageStatus,omitempty"` Severity *ModelsTriageSeverity `json:"severity,omitempty"` + StopReason *ModelsTriageStopReason `json:"stopReason,omitempty"` Thoughts *string `json:"thoughts,omitempty"` Title *string `json:"title,omitempty"` + VerdictHoldReason *string `json:"verdictHoldReason,omitempty"` Version *int `json:"version,omitempty"` } +type ModelsTriageContainerAssessment struct { + AssessedCVEs *int `json:"assessedCVEs,omitempty"` + Batches []ModelsTriageContainerAssessmentBatchesElem `json:"batches,omitempty"` + FailureReasons []string `json:"failureReasons,omitempty"` + InputHash *string `json:"inputHash,omitempty"` + Status *ModelsTriageContainerAssessmentStatus `json:"status,omitempty"` + TotalCVEs *int `json:"totalCVEs,omitempty"` + UnassessedCVEs []string `json:"unassessedCVEs,omitempty"` + UnassessedCount *int `json:"unassessedCount,omitempty"` +} + +type ModelsTriageSeverityConfidence string + +const ( + ModelsTriageSeverityConfidenceHigh ModelsTriageSeverityConfidence = "HIGH" + ModelsTriageSeverityConfidenceLow ModelsTriageSeverityConfidence = "LOW" + ModelsTriageSeverityConfidenceMedium ModelsTriageSeverityConfidence = "MEDIUM" +) + type ModelsUser struct { + Asana *ModelsAsanaUserProvider `json:"asana,omitempty"` Azure *ModelsAzureUserProvider `json:"azure,omitempty"` AzureEntra *ModelsAzureEntraUserProvider `json:"azureEntra,omitempty"` Bitbucket *ModelsBitbucketUserProvider `json:"bitbucket,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` CreatedBy *string `json:"createdBy,omitempty"` + Deleted *bool `json:"deleted,omitempty"` + DisplayName *string `json:"displayName,omitempty"` Email *string `json:"email,omitempty"` Github *ModelsGitHubUserProvider `json:"github,omitempty"` Gitlab *ModelsGitLabUserProvider `json:"gitlab,omitempty"` GoogleWorkspace *ModelsGoogleWorkspaceUserProvider `json:"googleWorkspace,omitempty"` ID string `json:"id"` IsBot bool `json:"isBot"` + IsRestricted *bool `json:"isRestricted,omitempty"` Jira *ModelsJiraUserProvider `json:"jira,omitempty"` LastUpdatedBy *string `json:"lastUpdatedBy,omitempty"` Linear *ModelsLinearUserProvider `json:"linear,omitempty"` Name string `json:"name"` Okta *ModelsOktaUserProvider `json:"okta,omitempty"` Provider ModelsUserProvider `json:"provider"` + RealName *string `json:"realName,omitempty"` Slack *ModelsSlackUserProvider `json:"slack,omitempty"` Slug string `json:"slug"` Teams *ModelsTeamsUserProvider `json:"teams,omitempty"` diff --git a/internal/api/models/context.go b/internal/api/models/context.go index 81a2314..5e6daa3 100644 --- a/internal/api/models/context.go +++ b/internal/api/models/context.go @@ -3,10 +3,349 @@ package models import "encoding/json" +type DotnetsetupSelection struct { + Command *string `json:"command,omitempty"` + Configuration *string `json:"configuration,omitempty"` + ConfigurationInputs []string `json:"configurationInputs,omitempty"` + Framework *string `json:"framework,omitempty"` + Invocation *string `json:"invocation,omitempty"` + PermittedTestPath *string `json:"permittedTestPath,omitempty"` + Platform *string `json:"platform,omitempty"` + ProductionProject *string `json:"productionProject,omitempty"` + ProjectSdk *string `json:"projectSdk,omitempty"` + RequestedSdk *string `json:"requestedSdk,omitempty"` + SdkAllowPrerelease *string `json:"sdkAllowPrerelease,omitempty"` + SdkRollForward *string `json:"sdkRollForward,omitempty"` + TargetFrameworks []string `json:"targetFrameworks,omitempty"` + TestPlatform *string `json:"testPlatform,omitempty"` + TestProject *string `json:"testProject,omitempty"` + WorkingDir *string `json:"workingDir,omitempty"` +} + +type EndpointsAWSACMDetailsView struct { +} + +type EndpointsAWSALBDetailsView struct { +} + +type EndpointsAWSAPIGatewayDetailsView struct { +} + +type EndpointsAWSAppRunnerDetailsView struct { +} + +type EndpointsAWSAppSyncDetailsView struct { +} + +type EndpointsAWSAthenaDetailsView struct { +} + +type EndpointsAWSAutoscalingGroupDetailsView struct { + AvailabilityZones []string `json:"availabilityZones,omitempty"` + DesiredCapacity *int `json:"desiredCapacity,omitempty"` + HealthCheckType *string `json:"healthCheckType,omitempty"` + LaunchTemplate *string `json:"launchTemplate,omitempty"` + LoadBalancerNames []string `json:"loadBalancerNames,omitempty"` + MaxSize *int `json:"maxSize,omitempty"` + MinSize *int `json:"minSize,omitempty"` + TargetGroupArns []string `json:"targetGroupArns,omitempty"` + TerminationPolicies []string `json:"terminationPolicies,omitempty"` +} + +type EndpointsAWSBackupVaultDetailsView struct { +} + +type EndpointsAWSBedrockModelDetailsView struct { +} + +type EndpointsAWSCLBDetailsView struct { +} + +type EndpointsAWSCloudFrontDetailsView struct { +} + +type EndpointsAWSCloudTrailDetailsView struct { +} + +type EndpointsAWSCloudWatchAlarmDetailsView struct { +} + +type EndpointsAWSCloudWatchDashboardDetailsView struct { +} + +type EndpointsAWSCloudWatchLogGroupDetailsView struct { +} + +type EndpointsAWSCodeArtifactDetailsView struct { +} + +type EndpointsAWSCodeBuildDetailsView struct { +} + +type EndpointsAWSCodeCommitDetailsView struct { +} + +type EndpointsAWSCodeDeployDetailsView struct { +} + +type EndpointsAWSCodePipelineDetailsView struct { +} + +type EndpointsAWSCognitoUserPoolDetailsView struct { +} + +type EndpointsAWSConfigDetailsView struct { +} + +type EndpointsAWSDirectConnectDetailsView struct { +} + +type EndpointsAWSDynamoDBDetailsView struct { +} + +type EndpointsAWSEBSVolumeDetailsView struct { +} + +type EndpointsAWSEC2DetailsView struct { + Architecture *string `json:"architecture,omitempty"` + EbsVolumeIds []string `json:"ebsVolumeIds,omitempty"` + Hypervisor *string `json:"hypervisor,omitempty"` + IamInstanceProfile *string `json:"iamInstanceProfile,omitempty"` + KernelID *string `json:"kernelId,omitempty"` + LaunchTime *string `json:"launchTime,omitempty"` + Monitoring *string `json:"monitoring,omitempty"` + NetworkInterfaceIds []string `json:"networkInterfaceIds,omitempty"` + RootDeviceType *string `json:"rootDeviceType,omitempty"` + SecurityGroupIds []string `json:"securityGroupIds,omitempty"` + Tenancy *string `json:"tenancy,omitempty"` + UserDataSha256 *string `json:"userDataSha256,omitempty"` +} + +type EndpointsAWSECRDetailsView struct { +} + +type EndpointsAWSECSClusterDetailsView struct { +} + +type EndpointsAWSECSServiceDetailsView struct { +} + +type EndpointsAWSECSTaskDefinitionDetailsView struct { +} + +type EndpointsAWSECSTaskDetailsView struct { +} + +type EndpointsAWSEFSDetailsView struct { +} + +type EndpointsAWSEIPDetailsView struct { +} + +type EndpointsAWSEKSClusterDetailsView struct { +} + +type EndpointsAWSEMRDetailsView struct { +} + +type EndpointsAWSElastiCacheDetailsView struct { +} + +type EndpointsAWSEventBridgeDetailsView struct { +} + +type EndpointsAWSGlobalAcceleratorDetailsView struct { +} + +type EndpointsAWSGlueDetailsView struct { +} + +type EndpointsAWSGuardDutyDetailsView struct { +} + +type EndpointsAWSIAMGroupDetailsView struct { +} + +type EndpointsAWSIAMPolicyDetailsView struct { +} + +type EndpointsAWSIAMRoleDetailsView struct { +} + +type EndpointsAWSIAMUserDetailsView struct { +} + +type EndpointsAWSInternetGatewayDetailsView struct { +} + +type EndpointsAWSKMSDetailsView struct { +} + +type EndpointsAWSKinesisDetailsView struct { +} + +type EndpointsAWSLambdaDetailsView struct { +} + +type EndpointsAWSMQDetailsView struct { +} + +type EndpointsAWSMSKDetailsView struct { +} + +type EndpointsAWSMemoryDBDetailsView struct { +} + +type EndpointsAWSNACLDetailsView struct { +} + +type EndpointsAWSNATGatewayDetailsView struct { +} + +type EndpointsAWSNLBDetailsView struct { +} + +type EndpointsAWSNeptuneDetailsView struct { +} + +type EndpointsAWSNetworkFirewallDetailsView struct { +} + +type EndpointsAWSOpenSearchDetailsView struct { +} + +type EndpointsAWSPrivateLinkDetailsView struct { +} + +type EndpointsAWSRDSDetailsView struct { +} + +type EndpointsAWSRedshiftDetailsView struct { +} + +type EndpointsAWSRoute53HostedZoneDetailsView struct { +} + +type EndpointsAWSRouteTableDetailsView struct { +} + +type EndpointsAWSS3BucketDetailsView struct { +} + +type EndpointsAWSSESDetailsView struct { +} + +type EndpointsAWSSNSDetailsView struct { +} + +type EndpointsAWSSQSDetailsView struct { +} + +type EndpointsAWSSSMDetailsView struct { +} + +type EndpointsAWSSageMakerEndpointDetailsView struct { +} + +type EndpointsAWSSecretsManagerDetailsView struct { +} + +type EndpointsAWSSecurityGroupDetailsView struct { +} + +type EndpointsAWSStepFunctionDetailsView struct { +} + +type EndpointsAWSStorageGatewayDetailsView struct { +} + +type EndpointsAWSSubnetDetailsView struct { +} + +type EndpointsAWSTGWAttachmentDetailsView struct { +} + +type EndpointsAWSTargetGroupDetailsView struct { +} + +type EndpointsAWSVPCDetailsView struct { +} + +type EndpointsAWSVPCEndpointDetailsView struct { +} + +type EndpointsAWSVPNConnectionDetailsView struct { +} + +type EndpointsAWSWAFDetailsView struct { +} + +type EndpointsAWSWorkspaceDetailsView struct { + BundleID *string `json:"bundleId,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + DirectoryID *string `json:"directoryId,omitempty"` + RootVolumeSizeGb *int `json:"rootVolumeSizeGb,omitempty"` + RunningMode *string `json:"runningMode,omitempty"` + UserName *string `json:"userName,omitempty"` + UserVolumeSizeGb *int `json:"userVolumeSizeGb,omitempty"` +} + +type EndpointsAWSXRayDetailsView struct { +} + +type EndpointsAcceptSetupPentestAssessmentRecommendationInput struct { + ApplicationID string `json:"applicationId"` +} + +type EndpointsAcceptSetupPentestTargetRecommendationInput struct { + TargetID string `json:"targetId"` +} + type EndpointsActiveDepsSummaryOldest struct { Ecosystem string `json:"ecosystem"` IntroducedAt string `json:"introducedAt"` Name string `json:"name"` + Version *string `json:"version,omitempty"` +} + +type EndpointsAiMlAssetDetailsView struct { + AwsBedrockModel *EndpointsAWSBedrockModelDetailsView `json:"awsBedrockModel,omitempty"` + AwsSageMakerEndpoint *EndpointsAWSSageMakerEndpointDetailsView `json:"awsSageMakerEndpoint,omitempty"` + AzureMachineLearning *EndpointsAzureMachineLearningDetailsView `json:"azureMachineLearning,omitempty"` + AzureMlWorkspace *EndpointsAzureMLWorkspaceDetailsView `json:"azureMlWorkspace,omitempty"` + AzureOpenAiDeployment *EndpointsAzureOpenAIDeploymentDetailsView `json:"azureOpenAiDeployment,omitempty"` + GcpVertexEndpoint *EndpointsGCPVertexEndpointDetailsView `json:"gcpVertexEndpoint,omitempty"` + SubType ModelsAiMlSubType `json:"subType"` +} + +type EndpointsAiMlAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DataSourceRefs []string `json:"dataSourceRefs,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + EndpointVisibility *string `json:"endpointVisibility,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + Framework *string `json:"framework,omitempty"` + GpuType *string `json:"gpuType,omitempty"` + GuardrailsEnabled *bool `json:"guardrailsEnabled,omitempty"` + IamRoleArn *string `json:"iamRoleArn,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + Kind *string `json:"kind,omitempty"` + LastInvocationAt *string `json:"lastInvocationAt,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + ModelName *string `json:"modelName,omitempty"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsAiMlSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` } type EndpointsArtifactDeploymentSummary struct { @@ -39,6 +378,47 @@ type EndpointsArtifactRegistrySummary struct { Type *string `json:"type,omitempty"` } +type EndpointsArtifactRepositoriesAssetDetailsView struct { + AwsCodeArtifact *EndpointsAWSCodeArtifactDetailsView `json:"awsCodeArtifact,omitempty"` + AwsEcr *EndpointsAWSECRDetailsView `json:"awsEcr,omitempty"` + AzureAcr *EndpointsAzureACRDetailsView `json:"azureAcr,omitempty"` + Crates *EndpointsCratesDetailsView `json:"crates,omitempty"` + Dockerhub *EndpointsDockerHubDetailsView `json:"dockerhub,omitempty"` + GcpArtifactRegistry *EndpointsGCPArtifactRegistryDetailsView `json:"gcpArtifactRegistry,omitempty"` + Ghcr *EndpointsGHCRDetailsView `json:"ghcr,omitempty"` + Maven *EndpointsMavenDetailsView `json:"maven,omitempty"` + Npm *EndpointsNPMRegistryDetailsView `json:"npm,omitempty"` + Nuget *EndpointsNuGetDetailsView `json:"nuget,omitempty"` + Other *EndpointsOtherRegistryDetailsView `json:"other,omitempty"` + Pypi *EndpointsPyPIDetailsView `json:"pypi,omitempty"` + Rubygems *EndpointsRubyGemsDetailsView `json:"rubygems,omitempty"` + SubType ModelsArtifactRepositoriesSubType `json:"subType"` +} + +type EndpointsArtifactRepositoriesAssetView struct { + AccountID *string `json:"accountId,omitempty"` + BaseURL *string `json:"baseUrl,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + PathTemplate *string `json:"pathTemplate,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + RegistryKind *string `json:"registryKind,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsArtifactRepositoriesSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + type EndpointsArtifactSummary struct { ArtifactName *string `json:"artifactName,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` @@ -57,478 +437,2896 @@ type EndpointsArtifactSummary struct { UpdatedAt *string `json:"updatedAt,omitempty"` } -type EndpointsCloudReconDiscoveredNodeDTO struct { - Cidr *string `json:"cidr,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - ObjectType *string `json:"objectType,omitempty"` - PortFrom *int `json:"portFrom,omitempty"` - PortTo *int `json:"portTo,omitempty"` - Properties *string `json:"properties,omitempty"` - Protocol *string `json:"protocol,omitempty"` - PublicFlag *bool `json:"publicFlag,omitempty"` - Region *string `json:"region,omitempty"` - Source *string `json:"source,omitempty"` - SubType *string `json:"subType,omitempty"` - SubnetID *string `json:"subnetId,omitempty"` - VpcID *string `json:"vpcId,omitempty"` -} - -type EndpointsCloudReconHotspotDTO struct { - Category *string `json:"category,omitempty"` - Confidence *string `json:"confidence,omitempty"` - Description *string `json:"description,omitempty"` - HotspotID *string `json:"hotspotId,omitempty"` - NodeIds []string `json:"nodeIds,omitempty"` - Severity *string `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` +type EndpointsArtifactsAssetDetailsView struct { + DockerImage *EndpointsDockerImageDetailsView `json:"dockerImage,omitempty"` + Executable *EndpointsExecutableDetailsView `json:"executable,omitempty"` + Jar *EndpointsJARDetailsView `json:"jar,omitempty"` + NpmPackage *EndpointsNPMPackageDetailsView `json:"npmPackage,omitempty"` + Other *EndpointsOtherArtifactDetailsView `json:"other,omitempty"` + SubType ModelsArtifactsSubType `json:"subType"` + Wheel *EndpointsWheelDetailsView `json:"wheel,omitempty"` } -type EndpointsCloudReconScanMetadataDTO struct { +type EndpointsArtifactsAssetView struct { AccountID *string `json:"accountId,omitempty"` - CompletedAt *string `json:"completedAt,omitempty"` - DiscoveredCount *int `json:"discoveredCount,omitempty"` - EdgeCount *int `json:"edgeCount,omitempty"` - HotspotCount *int `json:"hotspotCount,omitempty"` - ModelName *string `json:"modelName,omitempty"` - NodeCount *int `json:"nodeCount,omitempty"` - Provider *string `json:"provider,omitempty"` - S3Bucket *string `json:"s3Bucket,omitempty"` - S3Key *string `json:"s3Key,omitempty"` - ScanID *string `json:"scanId,omitempty"` - SchemaVersion *string `json:"schemaVersion,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` + ArtifactType *string `json:"artifactType,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + ImageDigest *string `json:"imageDigest,omitempty"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + NonProduction *bool `json:"nonProduction,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubArtifactType *string `json:"subArtifactType,omitempty"` + SubType ModelsArtifactsSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` } -type EndpointsCloudReconTenantTrustDTO struct { - ExternalAccountID *string `json:"externalAccountId,omitempty"` - TrustingAccountCount *int `json:"trustingAccountCount,omitempty"` - TrustingAccounts []string `json:"trustingAccounts,omitempty"` +type EndpointsAssessmentContextReadiness struct { + AssessmentVersion *string `json:"assessmentVersion,omitempty"` + CloudState *string `json:"cloudState,omitempty"` + Message *string `json:"message,omitempty"` + NeedsReassessment *bool `json:"needsReassessment,omitempty"` + RunID *string `json:"runId,omitempty"` + SourceVersion *string `json:"sourceVersion,omitempty"` + State *string `json:"state,omitempty"` } -type EndpointsContextGetCloudScanStatusOutput struct { - OverallStatus string `json:"overallStatus"` - Providers []EndpointsProviderScanStatus `json:"providers,omitempty"` - ScanID string `json:"scanId"` +type EndpointsAssetGraphComponent struct { + AccountType *string `json:"accountType,omitempty"` + ComponentType string `json:"componentType"` + DownloadURL string `json:"downloadUrl"` + EdgeCount int `json:"edgeCount"` + ExpiresAt string `json:"expiresAt"` + ID string `json:"id"` + LastUpdated *string `json:"lastUpdated,omitempty"` + Name *string `json:"name,omitempty"` + NodeCount int `json:"nodeCount"` + OwnerID *string `json:"ownerId,omitempty"` + Platform *string `json:"platform,omitempty"` + Services []string `json:"services,omitempty"` } -type EndpointsContextStartCloudScanOutput struct { - ExecutionArn *string `json:"executionArn,omitempty"` +type EndpointsAssetGraphNodeSummary struct { + AccountID *string `json:"accountId,omitempty"` + ChildCounts map[string]int `json:"childCounts,omitempty"` + Name string `json:"name"` + NodeID string `json:"nodeId"` + NodeKind string `json:"nodeKind"` + ObjectType string `json:"objectType"` + Region *string `json:"region,omitempty"` + SubType *string `json:"subType,omitempty"` +} + +type EndpointsAssetGraphRetrievedNode struct { + AccountID *string `json:"accountId,omitempty"` + Name *string `json:"name,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + NodeKind *string `json:"nodeKind,omitempty"` + ObjectType *string `json:"objectType,omitempty"` + Region *string `json:"region,omitempty"` + Score *float64 `json:"score,omitempty"` + SubType *string `json:"subType,omitempty"` + Text *string `json:"text,omitempty"` +} + +type EndpointsAssetGraphSearchResultEntry struct { + AccountID *string `json:"accountId,omitempty"` + Name string `json:"name"` + NodeID string `json:"nodeId"` + ObjectType string `json:"objectType"` + Region *string `json:"region,omitempty"` + SubTitle *string `json:"subTitle,omitempty"` +} + +type EndpointsAssetGraphSyncCoverage struct { + Complete bool `json:"complete"` + Message *string `json:"message,omitempty"` + NodesDroppedNoCanonical int64 `json:"nodesDroppedNoCanonical"` + Status string `json:"status"` + SyncedAt string `json:"syncedAt"` +} + +type EndpointsAssetLinks struct { + Detail *string `json:"detail,omitempty"` + Endpoints *string `json:"endpoints,omitempty"` + Project *string `json:"project,omitempty"` + Repo *string `json:"repo,omitempty"` + Self *string `json:"self,omitempty"` +} + +type EndpointsAttackPathDTO struct { + ComputedAt string `json:"computedAt"` + EdgeTypes []string `json:"edgeTypes,omitempty"` + EntryNodeID string `json:"entryNodeId"` + EntryNodeKind string `json:"entryNodeKind"` + HasCriticalFinding bool `json:"hasCriticalFinding"` + ID string `json:"id"` + MaxFindingSeverity *string `json:"maxFindingSeverity,omitempty"` + PathNodeIds []string `json:"pathNodeIds,omitempty"` + TerminalNodeID string `json:"terminalNodeId"` + TerminalNodeKind string `json:"terminalNodeKind"` +} + +type EndpointsAttackPathTerminalNodeKind string + +const ( + EndpointsAttackPathTerminalNodeKindK8srouting EndpointsAttackPathTerminalNodeKind = "k8sRouting" + EndpointsAttackPathTerminalNodeKindInputsource EndpointsAttackPathTerminalNodeKind = "inputSource" + EndpointsAttackPathTerminalNodeKindBughuntfinding EndpointsAttackPathTerminalNodeKind = "bughuntFinding" + EndpointsAttackPathTerminalNodeKindCspmfinding EndpointsAttackPathTerminalNodeKind = "cspmFinding" + EndpointsAttackPathTerminalNodeKindSensitivedatafinding EndpointsAttackPathTerminalNodeKind = "sensitiveDataFinding" + EndpointsAttackPathTerminalNodeKindApplication EndpointsAttackPathTerminalNodeKind = "application" + EndpointsAttackPathTerminalNodeKindAuthentication EndpointsAttackPathTerminalNodeKind = "authentication" + EndpointsAttackPathTerminalNodeKindAuthorization EndpointsAttackPathTerminalNodeKind = "authorization" + EndpointsAttackPathTerminalNodeKindAutoscalinggroup EndpointsAttackPathTerminalNodeKind = "autoScalingGroup" + EndpointsAttackPathTerminalNodeKindBuildartifact EndpointsAttackPathTerminalNodeKind = "buildArtifact" + EndpointsAttackPathTerminalNodeKindBuildartifactrepository EndpointsAttackPathTerminalNodeKind = "buildArtifactRepository" + EndpointsAttackPathTerminalNodeKindCertificate EndpointsAttackPathTerminalNodeKind = "certificate" + EndpointsAttackPathTerminalNodeKindCicdpipeline EndpointsAttackPathTerminalNodeKind = "cicdPipeline" + EndpointsAttackPathTerminalNodeKindCloudaccount EndpointsAttackPathTerminalNodeKind = "cloudAccount" + EndpointsAttackPathTerminalNodeKindCrossaccountreference EndpointsAttackPathTerminalNodeKind = "crossAccountReference" + EndpointsAttackPathTerminalNodeKindCodeartifact EndpointsAttackPathTerminalNodeKind = "codeArtifact" + EndpointsAttackPathTerminalNodeKindCodelocation EndpointsAttackPathTerminalNodeKind = "codeLocation" + EndpointsAttackPathTerminalNodeKindContainer EndpointsAttackPathTerminalNodeKind = "container" + EndpointsAttackPathTerminalNodeKindContainerfile EndpointsAttackPathTerminalNodeKind = "containerfile" + EndpointsAttackPathTerminalNodeKindCredential EndpointsAttackPathTerminalNodeKind = "credential" + EndpointsAttackPathTerminalNodeKindCve EndpointsAttackPathTerminalNodeKind = "cve" + EndpointsAttackPathTerminalNodeKindDaemonset EndpointsAttackPathTerminalNodeKind = "daemonSet" + EndpointsAttackPathTerminalNodeKindDatabasetable EndpointsAttackPathTerminalNodeKind = "databaseTable" + EndpointsAttackPathTerminalNodeKindDataclassification EndpointsAttackPathTerminalNodeKind = "dataClassification" + EndpointsAttackPathTerminalNodeKindDomain EndpointsAttackPathTerminalNodeKind = "domain" + EndpointsAttackPathTerminalNodeKindEndpoint EndpointsAttackPathTerminalNodeKind = "endpoint" + EndpointsAttackPathTerminalNodeKindExternalservice EndpointsAttackPathTerminalNodeKind = "externalService" + EndpointsAttackPathTerminalNodeKindFunction EndpointsAttackPathTerminalNodeKind = "function" + EndpointsAttackPathTerminalNodeKindGateway EndpointsAttackPathTerminalNodeKind = "gateway" + EndpointsAttackPathTerminalNodeKindHost EndpointsAttackPathTerminalNodeKind = "host" + EndpointsAttackPathTerminalNodeKindIampolicy EndpointsAttackPathTerminalNodeKind = "iamPolicy" + EndpointsAttackPathTerminalNodeKindIamrole EndpointsAttackPathTerminalNodeKind = "iamRole" + EndpointsAttackPathTerminalNodeKindIamuser EndpointsAttackPathTerminalNodeKind = "iamUser" + EndpointsAttackPathTerminalNodeKindIdentity EndpointsAttackPathTerminalNodeKind = "identity" + EndpointsAttackPathTerminalNodeKindIdentityprovider EndpointsAttackPathTerminalNodeKind = "identityProvider" + EndpointsAttackPathTerminalNodeKindInternet EndpointsAttackPathTerminalNodeKind = "internet" + EndpointsAttackPathTerminalNodeKindIpaddress EndpointsAttackPathTerminalNodeKind = "ipAddress" + EndpointsAttackPathTerminalNodeKindK8scluster EndpointsAttackPathTerminalNodeKind = "k8sCluster" + EndpointsAttackPathTerminalNodeKindK8sconfigmap EndpointsAttackPathTerminalNodeKind = "k8sConfigMap" + EndpointsAttackPathTerminalNodeKindK8sdeployment EndpointsAttackPathTerminalNodeKind = "k8sDeployment" + EndpointsAttackPathTerminalNodeKindK8singress EndpointsAttackPathTerminalNodeKind = "k8sIngress" + EndpointsAttackPathTerminalNodeKindK8snamespace EndpointsAttackPathTerminalNodeKind = "k8sNamespace" + EndpointsAttackPathTerminalNodeKindK8snetworkpolicy EndpointsAttackPathTerminalNodeKind = "k8sNetworkPolicy" + EndpointsAttackPathTerminalNodeKindK8spersistentvolumeclaim EndpointsAttackPathTerminalNodeKind = "k8sPersistentVolumeClaim" + EndpointsAttackPathTerminalNodeKindK8ssecret EndpointsAttackPathTerminalNodeKind = "k8sSecret" + EndpointsAttackPathTerminalNodeKindK8sservice EndpointsAttackPathTerminalNodeKind = "k8sService" + EndpointsAttackPathTerminalNodeKindK8sserviceaccount EndpointsAttackPathTerminalNodeKind = "k8sServiceAccount" + EndpointsAttackPathTerminalNodeKindK8svolume EndpointsAttackPathTerminalNodeKind = "k8sVolume" + EndpointsAttackPathTerminalNodeKindK8spod EndpointsAttackPathTerminalNodeKind = "k8sPod" + EndpointsAttackPathTerminalNodeKindK8sreplicaset EndpointsAttackPathTerminalNodeKind = "k8sReplicaSet" + EndpointsAttackPathTerminalNodeKindK8sendpoint EndpointsAttackPathTerminalNodeKind = "k8sEndpoint" + EndpointsAttackPathTerminalNodeKindK8snode EndpointsAttackPathTerminalNodeKind = "k8sNode" + EndpointsAttackPathTerminalNodeKindK8sjob EndpointsAttackPathTerminalNodeKind = "k8sJob" + EndpointsAttackPathTerminalNodeKindK8scronjob EndpointsAttackPathTerminalNodeKind = "k8sCronJob" + EndpointsAttackPathTerminalNodeKindManagedcloudresource EndpointsAttackPathTerminalNodeKind = "managedCloudResource" + EndpointsAttackPathTerminalNodeKindMemory EndpointsAttackPathTerminalNodeKind = "memory" + EndpointsAttackPathTerminalNodeKindNacl EndpointsAttackPathTerminalNodeKind = "nacl" + EndpointsAttackPathTerminalNodeKindNetworkinterface EndpointsAttackPathTerminalNodeKind = "networkInterface" + EndpointsAttackPathTerminalNodeKindNote EndpointsAttackPathTerminalNodeKind = "note" + EndpointsAttackPathTerminalNodeKindPackage EndpointsAttackPathTerminalNodeKind = "package" + EndpointsAttackPathTerminalNodeKindPentestfinding EndpointsAttackPathTerminalNodeKind = "pentestFinding" + EndpointsAttackPathTerminalNodeKindPort EndpointsAttackPathTerminalNodeKind = "port" + EndpointsAttackPathTerminalNodeKindProduct EndpointsAttackPathTerminalNodeKind = "product" + EndpointsAttackPathTerminalNodeKindProject EndpointsAttackPathTerminalNodeKind = "project" + EndpointsAttackPathTerminalNodeKindRepository EndpointsAttackPathTerminalNodeKind = "repository" + EndpointsAttackPathTerminalNodeKindRoutetable EndpointsAttackPathTerminalNodeKind = "routeTable" + EndpointsAttackPathTerminalNodeKindSastfinding EndpointsAttackPathTerminalNodeKind = "sastFinding" + EndpointsAttackPathTerminalNodeKindScpmfinding EndpointsAttackPathTerminalNodeKind = "scpmFinding" + EndpointsAttackPathTerminalNodeKindScacontainerfinding EndpointsAttackPathTerminalNodeKind = "scaContainerFinding" + EndpointsAttackPathTerminalNodeKindScadependencyfinding EndpointsAttackPathTerminalNodeKind = "scaDependencyFinding" + EndpointsAttackPathTerminalNodeKindSecretfinding EndpointsAttackPathTerminalNodeKind = "secretFinding" + EndpointsAttackPathTerminalNodeKindSecuritygroup EndpointsAttackPathTerminalNodeKind = "securityGroup" + EndpointsAttackPathTerminalNodeKindTicket EndpointsAttackPathTerminalNodeKind = "ticket" + EndpointsAttackPathTerminalNodeKindActionitem EndpointsAttackPathTerminalNodeKind = "actionItem" + EndpointsAttackPathTerminalNodeKindStatefulset EndpointsAttackPathTerminalNodeKind = "statefulSet" + EndpointsAttackPathTerminalNodeKindSubnet EndpointsAttackPathTerminalNodeKind = "subnet" + EndpointsAttackPathTerminalNodeKindTeam EndpointsAttackPathTerminalNodeKind = "team" + EndpointsAttackPathTerminalNodeKindThreatactor EndpointsAttackPathTerminalNodeKind = "threatActor" + EndpointsAttackPathTerminalNodeKindUser EndpointsAttackPathTerminalNodeKind = "user" + EndpointsAttackPathTerminalNodeKindVpc EndpointsAttackPathTerminalNodeKind = "vpc" + EndpointsAttackPathTerminalNodeKindPrefixlist EndpointsAttackPathTerminalNodeKind = "prefixList" + EndpointsAttackPathTerminalNodeKindUnknowncloudresource EndpointsAttackPathTerminalNodeKind = "unknownCloudResource" + EndpointsAttackPathTerminalNodeKindHttpendpoint EndpointsAttackPathTerminalNodeKind = "httpEndpoint" + EndpointsAttackPathTerminalNodeKindGraphqlendpoint EndpointsAttackPathTerminalNodeKind = "graphqlEndpoint" + EndpointsAttackPathTerminalNodeKindGrpcendpoint EndpointsAttackPathTerminalNodeKind = "grpcEndpoint" + EndpointsAttackPathTerminalNodeKindWebsocketendpoint EndpointsAttackPathTerminalNodeKind = "websocketEndpoint" + EndpointsAttackPathTerminalNodeKindMessagequeueendpoint EndpointsAttackPathTerminalNodeKind = "messageQueueEndpoint" + EndpointsAttackPathTerminalNodeKindDocument EndpointsAttackPathTerminalNodeKind = "document" + EndpointsAttackPathTerminalNodeKindOrganization EndpointsAttackPathTerminalNodeKind = "organization" + EndpointsAttackPathTerminalNodeKindCampaign EndpointsAttackPathTerminalNodeKind = "campaign" +) + +type EndpointsAzureACIDetailsView struct { +} + +type EndpointsAzureACRDetailsView struct { +} + +type EndpointsAzureADGroupDetailsView struct { +} + +type EndpointsAzureADUserDetailsView struct { +} + +type EndpointsAzureAKSDetailsView struct { +} + +type EndpointsAzureAPIManagementDetailsView struct { +} + +type EndpointsAzureAppGatewayDetailsView struct { +} + +type EndpointsAzureAppServiceDetailsView struct { +} + +type EndpointsAzureApplicationDetailsView struct { +} + +type EndpointsAzureAutomationDetailsView struct { +} + +type EndpointsAzureBatchDetailsView struct { +} + +type EndpointsAzureBlobDetailsView struct { +} + +type EndpointsAzureCDNProfileDetailsView struct { +} + +type EndpointsAzureCosmosDetailsView struct { +} + +type EndpointsAzureDNSZoneDetailsView struct { +} + +type EndpointsAzureDataFactoryDetailsView struct { +} + +type EndpointsAzureDatabricksDetailsView struct { +} + +type EndpointsAzureDefenderDetailsView struct { +} + +type EndpointsAzureDevOpsPipelinesDetailsView struct { +} + +type EndpointsAzureDiskDetailsView struct { +} + +type EndpointsAzureEntraIDDetailsView struct { +} + +type EndpointsAzureEventGridDetailsView struct { +} + +type EndpointsAzureEventHubDetailsView struct { +} + +type EndpointsAzureExpressRouteDetailsView struct { +} + +type EndpointsAzureFilesDetailsView struct { +} + +type EndpointsAzureFirewallDetailsView struct { +} + +type EndpointsAzureFrontDoorDetailsView struct { +} + +type EndpointsAzureFunctionDetailsView struct { +} + +type EndpointsAzureHDInsightDetailsView struct { +} + +type EndpointsAzureIotHubDetailsView struct { +} + +type EndpointsAzureKeyVaultDetailsView struct { +} + +type EndpointsAzureLogicAppsDetailsView struct { +} + +type EndpointsAzureMLWorkspaceDetailsView struct { +} + +type EndpointsAzureMachineLearningDetailsView struct { +} + +type EndpointsAzureManagedIdentityDetailsView struct { +} + +type EndpointsAzureMonitorDetailsView struct { +} + +type EndpointsAzureMySQLDetailsView struct { +} + +type EndpointsAzureNSGDetailsView struct { +} + +type EndpointsAzureOpenAIDeploymentDetailsView struct { +} + +type EndpointsAzurePipelinesDetailsView struct { +} + +type EndpointsAzurePolicyDetailsView struct { +} + +type EndpointsAzurePostgresDetailsView struct { +} + +type EndpointsAzureRedisDetailsView struct { +} + +type EndpointsAzureRepoDetailsView struct { +} + +type EndpointsAzureRoleAssignmentDetailsView struct { +} + +type EndpointsAzureSQLDetailsView struct { +} + +type EndpointsAzureServiceBusDetailsView struct { +} + +type EndpointsAzureServicePrincipalDetailsView struct { +} + +type EndpointsAzureStorageAccountDetailsView struct { +} + +type EndpointsAzureSubnetDetailsView struct { +} + +type EndpointsAzureSynapseDetailsView struct { +} + +type EndpointsAzureVMDetailsView struct { + AdminUsername *string `json:"adminUsername,omitempty"` + AvailabilitySet *string `json:"availabilitySet,omitempty"` + AzureTags map[string]string `json:"azureTags,omitempty"` + DataDisks []string `json:"dataDisks,omitempty"` + NetworkProfile *string `json:"networkProfile,omitempty"` + OsDisk *string `json:"osDisk,omitempty"` + ResourceGroup *string `json:"resourceGroup,omitempty"` + VmSize *string `json:"vmSize,omitempty"` +} + +type EndpointsAzureVMSSDetailsView struct { + Capacity *int `json:"capacity,omitempty"` + OverProvision *bool `json:"overProvision,omitempty"` + ResourceGroup *string `json:"resourceGroup,omitempty"` + SkuName *string `json:"skuName,omitempty"` + SkuTier *string `json:"skuTier,omitempty"` + UpgradePolicy *string `json:"upgradePolicy,omitempty"` +} + +type EndpointsAzureVNetDetailsView struct { +} + +type EndpointsAzureVPNDetailsView struct { +} + +type EndpointsAzureVirtualDesktopDetailsView struct { + AllowNewSession *bool `json:"allowNewSession,omitempty"` + AssignedUser *string `json:"assignedUser,omitempty"` + HostPoolName *string `json:"hostPoolName,omitempty"` + SessionHostStatus *string `json:"sessionHostStatus,omitempty"` + UpdateState *string `json:"updateState,omitempty"` +} + +type EndpointsBitbucketRepoDetailsView struct { +} + +type EndpointsBuildkiteDetailsView struct { +} + +type EndpointsCDNAndDNSAssetDetailsView struct { + AwsApiGateway *EndpointsAWSAPIGatewayDetailsView `json:"awsApiGateway,omitempty"` + AwsAppSync *EndpointsAWSAppSyncDetailsView `json:"awsAppSync,omitempty"` + AwsCloudFront *EndpointsAWSCloudFrontDetailsView `json:"awsCloudFront,omitempty"` + AwsRoute53HostedZone *EndpointsAWSRoute53HostedZoneDetailsView `json:"awsRoute53HostedZone,omitempty"` + AzureApiManagement *EndpointsAzureAPIManagementDetailsView `json:"azureApiManagement,omitempty"` + AzureCdnProfile *EndpointsAzureCDNProfileDetailsView `json:"azureCdnProfile,omitempty"` + AzureDnsZone *EndpointsAzureDNSZoneDetailsView `json:"azureDnsZone,omitempty"` + AzureFrontDoor *EndpointsAzureFrontDoorDetailsView `json:"azureFrontDoor,omitempty"` + CodeDeclaredHost *EndpointsCodeDeclaredHostDetailsView `json:"codeDeclaredHost,omitempty"` + GcpApiGateway *EndpointsGCPAPIGatewayDetailsView `json:"gcpApiGateway,omitempty"` + GcpCloudCdn *EndpointsGCPCloudCDNDetailsView `json:"gcpCloudCdn,omitempty"` + GcpCloudDnsRecord *EndpointsGCPCloudDNSRecordDetailsView `json:"gcpCloudDnsRecord,omitempty"` + GcpCloudDnsZone *EndpointsGCPCloudDNSZoneDetailsView `json:"gcpCloudDnsZone,omitempty"` + SubType ModelsCDNAndDNSSubType `json:"subType"` +} + +type EndpointsCDNAndDNSAssetView struct { + AccountID *string `json:"accountId,omitempty"` + CachePolicy *string `json:"cachePolicy,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + DnssecEnabled *bool `json:"dnssecEnabled,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + GeoRestrictions *string `json:"geoRestrictions,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + Kind *string `json:"kind,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + OriginOrTarget *string `json:"originOrTarget,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + RecordType *string `json:"recordType,omitempty"` + Region *string `json:"region,omitempty"` + SignedUrlsRequired *bool `json:"signedUrlsRequired,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsCDNAndDNSSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` + TlsCertificateArn *string `json:"tlsCertificateArn,omitempty"` +} + +type EndpointsCiCdAssetDetailsView struct { + AwsCodeBuild *EndpointsAWSCodeBuildDetailsView `json:"awsCodeBuild,omitempty"` + AwsCodeCommit *EndpointsAWSCodeCommitDetailsView `json:"awsCodeCommit,omitempty"` + AwsCodeDeploy *EndpointsAWSCodeDeployDetailsView `json:"awsCodeDeploy,omitempty"` + AwsCodePipeline *EndpointsAWSCodePipelineDetailsView `json:"awsCodePipeline,omitempty"` + AzureDevOpsPipelines *EndpointsAzureDevOpsPipelinesDetailsView `json:"azureDevOpsPipelines,omitempty"` + GcpCloudBuild *EndpointsGCPCloudBuildDetailsView `json:"gcpCloudBuild,omitempty"` + SubType ModelsCiCdSubType `json:"subType"` +} + +type EndpointsCiCdAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DefaultBranch *string `json:"defaultBranch,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + IamRoleArn *string `json:"iamRoleArn,omitempty"` + ID string `json:"id"` + ImageScanningEnabled *bool `json:"imageScanningEnabled,omitempty"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + Kind *string `json:"kind,omitempty"` + LastBuildAt *string `json:"lastBuildAt,omitempty"` + LastBuildStatus *string `json:"lastBuildStatus,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + Public *bool `json:"public,omitempty"` + Region *string `json:"region,omitempty"` + SigningEnabled *bool `json:"signingEnabled,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsCiCdSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + +type EndpointsCircleCIDetailsView struct { +} + +type EndpointsCloudConnectorAutomation struct { + Actions []EndpointsCloudConnectorAutomationAction `json:"actions,omitempty"` + Attempt *int32 `json:"attempt,omitempty"` + MaxAttempts *int32 `json:"maxAttempts,omitempty"` + Message *string `json:"message,omitempty"` + NextAttemptAt *string `json:"nextAttemptAt,omitempty"` + OnboardingStarted *bool `json:"onboardingStarted,omitempty"` + Progress *string `json:"progress,omitempty"` + Proposal *EndpointsCloudConnectorAutomationProposal `json:"proposal,omitempty"` + ReasonCode *string `json:"reasonCode,omitempty"` + RunID *string `json:"runId,omitempty"` + SelectionRevision *string `json:"selectionRevision,omitempty"` + State string `json:"state"` +} + +type EndpointsCloudConnectorAutomationAction struct { + Code *string `json:"code,omitempty"` + Label *string `json:"label,omitempty"` + RequiresPermission *string `json:"requiresPermission,omitempty"` +} + +type EndpointsCloudConnectorAutomationProposal struct { + ApprovalAllowed *bool `json:"approvalAllowed,omitempty"` + Digest *string `json:"digest,omitempty"` + ExpiresAt *string `json:"expiresAt,omitempty"` + PreparedAt *string `json:"preparedAt,omitempty"` + RunID *string `json:"runId,omitempty"` + StaleReason *string `json:"staleReason,omitempty"` +} + +type EndpointsCloudConnectorPRRecord struct { + Branch *string `json:"branch,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy string `json:"createdBy"` + IsDraft *bool `json:"isDraft,omitempty"` + PrNumber *int64 `json:"prNumber,omitempty"` + PrURL string `json:"prUrl"` + Repo *string `json:"repo,omitempty"` +} + +type EndpointsCloudConnectorPRRunStatus struct { + CompletedAt *string `json:"completedAt,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + RunID string `json:"runId"` + StartedAt string `json:"startedAt"` + Status string `json:"status"` +} + +type EndpointsCloudConnectorProposal struct { + BaseBranch string `json:"baseBranch"` + BaseSha string `json:"baseSha"` + Body string `json:"body"` + Digest string `json:"digest"` + EgressIps []string `json:"egressIps,omitempty"` + Files []EndpointsCloudConnectorProposalFile `json:"files,omitempty"` + PrURL *string `json:"prUrl,omitempty"` + PreparedExclude []string `json:"preparedExclude,omitempty"` + PreparedInclude []string `json:"preparedInclude,omitempty"` + Repo string `json:"repo"` + RepositoryID string `json:"repositoryId"` + RetiredEgressIps []string `json:"retiredEgressIps,omitempty"` + RunID string `json:"runId"` + Status string `json:"status"` + Title string `json:"title"` +} + +type EndpointsCloudConnectorProposalFile struct { + Action string `json:"action"` + Before string `json:"before"` + Content string `json:"content"` + Path string `json:"path"` +} + +type EndpointsCloudReconAccountOverviewDTO struct { + AccountID *string `json:"accountId,omitempty"` + DiscoveryCompleteness *string `json:"discoveryCompleteness,omitempty"` + ExplorationStatus *string `json:"explorationStatus,omitempty"` + Exposure *EndpointsCloudReconExposureSummaryDTO `json:"exposure,omitempty"` + GraphCoverage *EndpointsCloudReconGraphCoverageDTO `json:"graphCoverage,omitempty"` + GraphGapsBlocking *int `json:"graphGapsBlocking,omitempty"` + HotspotCounts *EndpointsCloudReconSeverityCounts `json:"hotspotCounts,omitempty"` + HotspotTotal *int `json:"hotspotTotal,omitempty"` + IamRedFlags *EndpointsCloudReconIamRedFlagsDTO `json:"iamRedFlags,omitempty"` + InfrastructureSummary *EndpointsCloudReconInfrastructureSummaryDTO `json:"infrastructureSummary,omitempty"` + Metadata *EndpointsCloudReconSynthesisMetadataDTO `json:"metadata,omitempty"` + Provider *string `json:"provider,omitempty"` ScanID *string `json:"scanId,omitempty"` - StatusCode *int `json:"statusCode,omitempty"` + ScanStatus *string `json:"scanStatus,omitempty"` + Summary *string `json:"summary,omitempty"` + TopHotspots []EndpointsCloudReconHotspotSummaryDTO `json:"topHotspots,omitempty"` +} + +type EndpointsCloudReconAccountSummaryDTO struct { + AccountID *string `json:"accountId,omitempty"` + BoundaryCount *int `json:"boundaryCount,omitempty"` + DiscoveryCompleteness *string `json:"discoveryCompleteness,omitempty"` + Environment *string `json:"environment,omitempty"` + ExplorationStatus *string `json:"explorationStatus,omitempty"` + HotspotCounts *EndpointsCloudReconSeverityCounts `json:"hotspotCounts,omitempty"` + HotspotTotal *int `json:"hotspotTotal,omitempty"` + InternetFacingCount *int `json:"internetFacingCount,omitempty"` + Provider *string `json:"provider,omitempty"` + TrustedServiceCount *int `json:"trustedServiceCount,omitempty"` +} + +type EndpointsCloudReconCapabilitiesDTO struct { + HasApiGateway *bool `json:"hasApiGateway,omitempty"` + HasAuditLogging *bool `json:"hasAuditLogging,omitempty"` + HasContainerServices *bool `json:"hasContainerServices,omitempty"` + HasCrossAccountDependencies *bool `json:"hasCrossAccountDependencies,omitempty"` + HasDatabases *bool `json:"hasDatabases,omitempty"` + HasFlowLogs *bool `json:"hasFlowLogs,omitempty"` + HasKubernetes *bool `json:"hasKubernetes,omitempty"` + HasLoadBalancers *bool `json:"hasLoadBalancers,omitempty"` + HasMessageQueues *bool `json:"hasMessageQueues,omitempty"` + HasObjectStorage *bool `json:"hasObjectStorage,omitempty"` + HasServerlessFunctions *bool `json:"hasServerlessFunctions,omitempty"` +} + +type EndpointsCloudReconComputeInventoryDTO struct { + ContainerServices *int `json:"containerServices,omitempty"` + KubernetesWorkloads *int `json:"kubernetesWorkloads,omitempty"` + Other *int `json:"other,omitempty"` + ServerlessFunctions *int `json:"serverlessFunctions,omitempty"` + TotalComputeServices *int `json:"totalComputeServices,omitempty"` + VirtualMachines *int `json:"virtualMachines,omitempty"` +} + +type EndpointsCloudReconCrossAccountRelationshipDTO struct { + Confidence *string `json:"confidence,omitempty"` + Description *string `json:"description,omitempty"` + Direction *string `json:"direction,omitempty"` + ExternalAccountID *string `json:"externalAccountId,omitempty"` + ID *string `json:"id,omitempty"` + IsWideOpen *bool `json:"isWideOpen,omitempty"` + NodeIds []string `json:"nodeIds,omitempty"` + RelationshipType *string `json:"relationshipType,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` +} + +type EndpointsCloudReconDiscoveredNodeDTO struct { + Cidr *string `json:"cidr,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + ObjectType *string `json:"objectType,omitempty"` + PortFrom *int `json:"portFrom,omitempty"` + PortTo *int `json:"portTo,omitempty"` + Properties *string `json:"properties,omitempty"` + Protocol *string `json:"protocol,omitempty"` + PublicFlag *bool `json:"publicFlag,omitempty"` + Region *string `json:"region,omitempty"` + Source *string `json:"source,omitempty"` + SubType *string `json:"subType,omitempty"` + SubnetID *string `json:"subnetId,omitempty"` + VpcID *string `json:"vpcId,omitempty"` +} + +type EndpointsCloudReconExposureSummaryDTO struct { + CriticalNetworkExposureCount *int `json:"criticalNetworkExposureCount,omitempty"` + InternetReachableFlowCount *int `json:"internetReachableFlowCount,omitempty"` + InternetReachableServiceCount *int `json:"internetReachableServiceCount,omitempty"` + PublicDataStoreCount *int `json:"publicDataStoreCount,omitempty"` + WideOpenCrossAccountCount *int `json:"wideOpenCrossAccountCount,omitempty"` +} + +type EndpointsCloudReconGraphCoverageDTO struct { + DiscoveredCount *int `json:"discoveredCount,omitempty"` + EdgeCount *int `json:"edgeCount,omitempty"` + HotspotCount *int `json:"hotspotCount,omitempty"` + NodeCount *int `json:"nodeCount,omitempty"` +} + +type EndpointsCloudReconGraphGapDTO struct { + BlocksAnalysis *bool `json:"blocksAnalysis,omitempty"` + Category *string `json:"category,omitempty"` + Confidence *string `json:"confidence,omitempty"` + Description *string `json:"description,omitempty"` + ID *string `json:"id,omitempty"` + MissingObjectType *string `json:"missingObjectType,omitempty"` + RelatedArtifactIds []string `json:"relatedArtifactIds,omitempty"` + RelatedNodeIds []string `json:"relatedNodeIds,omitempty"` + Severity *string `json:"severity,omitempty"` + SuggestedNextStep *string `json:"suggestedNextStep,omitempty"` +} + +type EndpointsCloudReconHotspotDTO struct { + Category *string `json:"category,omitempty"` + Confidence *string `json:"confidence,omitempty"` + Description *string `json:"description,omitempty"` + HotspotID *string `json:"hotspotId,omitempty"` + NodeIds []string `json:"nodeIds,omitempty"` + Severity *string `json:"severity,omitempty"` + Title *string `json:"title,omitempty"` +} + +type EndpointsCloudReconHotspotSummaryDTO struct { + Category *string `json:"category,omitempty"` + Confidence *string `json:"confidence,omitempty"` + ID *string `json:"id,omitempty"` + InternetFacing *bool `json:"internetFacing,omitempty"` + Severity *string `json:"severity,omitempty"` + Title *string `json:"title,omitempty"` +} + +type EndpointsCloudReconIamFindingDTO struct { + Finding *string `json:"finding,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + Severity *string `json:"severity,omitempty"` +} + +type EndpointsCloudReconIamPostureDTO struct { + Confidence *string `json:"confidence,omitempty"` + CrossAccountRoleCount *int `json:"crossAccountRoleCount,omitempty"` + Findings []EndpointsCloudReconIamFindingDTO `json:"findings,omitempty"` + MfaAdoptionRate *string `json:"mfaAdoptionRate,omitempty"` + OverlyPermissiveRoleCount *int `json:"overlyPermissiveRoleCount,omitempty"` + RootAccountSecured *bool `json:"rootAccountSecured,omitempty"` + ServiceAccountCount *int `json:"serviceAccountCount,omitempty"` + StaleCredentialCount *int `json:"staleCredentialCount,omitempty"` + TotalRoles *int `json:"totalRoles,omitempty"` +} + +type EndpointsCloudReconIamRedFlagsDTO struct { + CriticalFindingCount *int `json:"criticalFindingCount,omitempty"` + CrossAccountRoleCount *int `json:"crossAccountRoleCount,omitempty"` + MfaAdoptionRate *string `json:"mfaAdoptionRate,omitempty"` + OverlyPermissiveRoleCount *int `json:"overlyPermissiveRoleCount,omitempty"` + RootAccountSecured *bool `json:"rootAccountSecured,omitempty"` + StaleCredentialCount *int `json:"staleCredentialCount,omitempty"` + TotalRoles *int `json:"totalRoles,omitempty"` +} + +type EndpointsCloudReconInfrastructureSummaryDTO struct { + Capabilities *EndpointsCloudReconCapabilitiesDTO `json:"capabilities,omitempty"` + ComputeInventory *EndpointsCloudReconComputeInventoryDTO `json:"computeInventory,omitempty"` + Confidence *string `json:"confidence,omitempty"` + CriticalDataStoreCount *int `json:"criticalDataStoreCount,omitempty"` + CrossAccountDependencyCount *int `json:"crossAccountDependencyCount,omitempty"` + Environment *string `json:"environment,omitempty"` + GraphGapCount *int `json:"graphGapCount,omitempty"` + InternetFacingHotspotCount *int `json:"internetFacingHotspotCount,omitempty"` + MajorTrafficFlowCount *int `json:"majorTrafficFlowCount,omitempty"` + Regions []string `json:"regions,omitempty"` + SecurityBoundaryCount *int `json:"securityBoundaryCount,omitempty"` + TrustedServiceCount *int `json:"trustedServiceCount,omitempty"` +} + +type EndpointsCloudReconNetworkExposureDTO struct { + Cidr *string `json:"cidr,omitempty"` + CidrDirection *string `json:"cidrDirection,omitempty"` + Confidence *string `json:"confidence,omitempty"` + Description *string `json:"description,omitempty"` + ExposureType *string `json:"exposureType,omitempty"` + ID *string `json:"id,omitempty"` + NodeIds []string `json:"nodeIds,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + Severity *string `json:"severity,omitempty"` +} + +type EndpointsCloudReconOrgSynthesisDTO struct { + AccountCount *int `json:"accountCount,omitempty"` + AggregateMetadata *json.RawMessage `json:"aggregateMetadata,omitempty"` + CombinedMermaidDiagram *string `json:"combinedMermaidDiagram,omitempty"` + CombinedSummary *string `json:"combinedSummary,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + CrossAccountCorrelations *json.RawMessage `json:"crossAccountCorrelations,omitempty"` + ModelName *string `json:"modelName,omitempty"` + OrganizationID *string `json:"organizationId,omitempty"` + PerAccountSummaries []EndpointsCloudReconAccountSummaryDTO `json:"perAccountSummaries,omitempty"` + Provider *string `json:"provider,omitempty"` + S3Bucket *string `json:"s3Bucket,omitempty"` + S3Key *string `json:"s3Key,omitempty"` + ScanRunID *string `json:"scanRunId,omitempty"` + SchemaVersion *string `json:"schemaVersion,omitempty"` + SourceAccountIds []string `json:"sourceAccountIds,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *string `json:"status,omitempty"` +} + +type EndpointsCloudReconScanMetadataDTO struct { + AccountID *string `json:"accountId,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + DiscoveredCount *int `json:"discoveredCount,omitempty"` + EdgeCount *int `json:"edgeCount,omitempty"` + HotspotCount *int `json:"hotspotCount,omitempty"` + InputGraphHash *string `json:"inputGraphHash,omitempty"` + ModelName *string `json:"modelName,omitempty"` + NodeCount *int `json:"nodeCount,omitempty"` + Provider *string `json:"provider,omitempty"` + S3Bucket *string `json:"s3Bucket,omitempty"` + S3Key *string `json:"s3Key,omitempty"` + ScanID *string `json:"scanId,omitempty"` + SchemaVersion *string `json:"schemaVersion,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *string `json:"status,omitempty"` +} + +type EndpointsCloudReconSecurityBoundaryDTO struct { + Confidence *string `json:"confidence,omitempty"` + DataClassification *string `json:"dataClassification,omitempty"` + Description *string `json:"description,omitempty"` + EgressNodeIds []string `json:"egressNodeIds,omitempty"` + Exposure *string `json:"exposure,omitempty"` + ID *string `json:"id,omitempty"` + IngressNodeIds []string `json:"ingressNodeIds,omitempty"` + Name *string `json:"name,omitempty"` + NodeIds []string `json:"nodeIds,omitempty"` + TrustLevel *string `json:"trustLevel,omitempty"` + Type *string `json:"type,omitempty"` +} + +type EndpointsCloudReconSeverityCounts struct { + Critical *int `json:"critical,omitempty"` + High *int `json:"high,omitempty"` + Low *int `json:"low,omitempty"` + Medium *int `json:"medium,omitempty"` +} + +type EndpointsCloudReconSynthesisMetadataDTO struct { + CompletedAt *string `json:"completedAt,omitempty"` + DurationSeconds *float64 `json:"durationSeconds,omitempty"` + GeneratorModel *string `json:"generatorModel,omitempty"` + GeneratorPromptVersion *string `json:"generatorPromptVersion,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` +} + +type EndpointsCloudReconTenantTrustDTO struct { + ExternalAccountID *string `json:"externalAccountId,omitempty"` + TrustingAccountCount *int `json:"trustingAccountCount,omitempty"` + TrustingAccounts []string `json:"trustingAccounts,omitempty"` +} + +type EndpointsCloudReconTopologyDTO struct { + DiscoveryCompleteness *string `json:"discoveryCompleteness,omitempty"` + EdgeCount *int `json:"edgeCount,omitempty"` + ExplorationStatus *string `json:"explorationStatus,omitempty"` + MermaidDiagram *string `json:"mermaidDiagram,omitempty"` + NodeCount *int `json:"nodeCount,omitempty"` +} + +type EndpointsCloudReconTrafficFlowDTO struct { + BoundaryIds []string `json:"boundaryIds,omitempty"` + Confidence *string `json:"confidence,omitempty"` + DataClassification *string `json:"dataClassification,omitempty"` + Description *string `json:"description,omitempty"` + ID *string `json:"id,omitempty"` + InternetReachable *bool `json:"internetReachable,omitempty"` + PathEdgeTypes []string `json:"pathEdgeTypes,omitempty"` + PathNodeIds []string `json:"pathNodeIds,omitempty"` + Protocol *string `json:"protocol,omitempty"` + SourceNodeID *string `json:"sourceNodeId,omitempty"` + TargetNodeID *string `json:"targetNodeId,omitempty"` + Title *string `json:"title,omitempty"` + TrustedServiceIds []string `json:"trustedServiceIds,omitempty"` +} + +type EndpointsCloudReconTrustedServiceDTO struct { + AccessedByNodeIds []string `json:"accessedByNodeIds,omitempty"` + BoundaryIds []string `json:"boundaryIds,omitempty"` + Category *string `json:"category,omitempty"` + Confidence *string `json:"confidence,omitempty"` + DataClassification *string `json:"dataClassification,omitempty"` + Description *string `json:"description,omitempty"` + EncryptionAtRest *bool `json:"encryptionAtRest,omitempty"` + ID *string `json:"id,omitempty"` + InternetReachable *bool `json:"internetReachable,omitempty"` + Name *string `json:"name,omitempty"` + NodeIds []string `json:"nodeIds,omitempty"` + PublicAccess *string `json:"publicAccess,omitempty"` + ServiceType *string `json:"serviceType,omitempty"` +} + +type EndpointsClusterAssetDetailsView struct { + AwsEcsCluster *EndpointsAWSECSClusterDetailsView `json:"awsEcsCluster,omitempty"` + AwsEksCluster *EndpointsAWSEKSClusterDetailsView `json:"awsEksCluster,omitempty"` + AzureAks *EndpointsAzureAKSDetailsView `json:"azureAks,omitempty"` + GcpGke *EndpointsGCPGKEDetailsView `json:"gcpGke,omitempty"` + K8sCluster *EndpointsK8SClusterDetailsView `json:"k8sCluster,omitempty"` + SubType ModelsClusterSubType `json:"subType"` +} + +type EndpointsClusterAssetView struct { + AccountID *string `json:"accountId,omitempty"` + ControlPlaneLogging *bool `json:"controlPlaneLogging,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + EndpointVisibility *string `json:"endpointVisibility,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + NetworkPlugin *string `json:"networkPlugin,omitempty"` + NodeCount *int `json:"nodeCount,omitempty"` + OidcProviderURL *string `json:"oidcProviderUrl,omitempty"` + PodSecurityStandard *string `json:"podSecurityStandard,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + RbacEnabled *bool `json:"rbacEnabled,omitempty"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsClusterSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + +type EndpointsCodeDeclaredHostDetailsView struct { +} + +type EndpointsComputeAssetDetailsView struct { + AwsAutoscalingGroup *EndpointsAWSAutoscalingGroupDetailsView `json:"awsAutoscalingGroup,omitempty"` + AwsEc2 *EndpointsAWSEC2DetailsView `json:"awsEc2,omitempty"` + AwsWorkspace *EndpointsAWSWorkspaceDetailsView `json:"awsWorkspace,omitempty"` + AzureVirtualDesktop *EndpointsAzureVirtualDesktopDetailsView `json:"azureVirtualDesktop,omitempty"` + AzureVm *EndpointsAzureVMDetailsView `json:"azureVm,omitempty"` + AzureVmss *EndpointsAzureVMSSDetailsView `json:"azureVmss,omitempty"` + GcpGce *EndpointsGCPGCEDetailsView `json:"gcpGce,omitempty"` + GcpMig *EndpointsGCPMIGDetailsView `json:"gcpMig,omitempty"` + K8sNode *EndpointsK8SNodeDetailsView `json:"k8sNode,omitempty"` + SubType ModelsComputeSubType `json:"subType"` +} + +type EndpointsComputeAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + IamRoleArn *string `json:"iamRoleArn,omitempty"` + ID string `json:"id"` + ImageID *string `json:"imageId,omitempty"` + InstanceType *string `json:"instanceType,omitempty"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + OsPlatform *string `json:"osPlatform,omitempty"` + PrivateIp *string `json:"privateIp,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + PublicIp *string `json:"publicIp,omitempty"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsComputeSubType `json:"subType"` + SubnetID *string `json:"subnetId,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + VpcID *string `json:"vpcId,omitempty"` + WorkloadType *ModelsComputeWorkloadType `json:"workloadType,omitempty"` +} + +type EndpointsConnectivityAssetDetailsView struct { + AwsDirectConnect *EndpointsAWSDirectConnectDetailsView `json:"awsDirectConnect,omitempty"` + AwsGlobalAccelerator *EndpointsAWSGlobalAcceleratorDetailsView `json:"awsGlobalAccelerator,omitempty"` + AwsNetworkFirewall *EndpointsAWSNetworkFirewallDetailsView `json:"awsNetworkFirewall,omitempty"` + AwsPrivateLink *EndpointsAWSPrivateLinkDetailsView `json:"awsPrivateLink,omitempty"` + AwsTgwAttachment *EndpointsAWSTGWAttachmentDetailsView `json:"awsTgwAttachment,omitempty"` + AwsVpnConnection *EndpointsAWSVPNConnectionDetailsView `json:"awsVpnConnection,omitempty"` + AzureExpressRoute *EndpointsAzureExpressRouteDetailsView `json:"azureExpressRoute,omitempty"` + AzureFirewall *EndpointsAzureFirewallDetailsView `json:"azureFirewall,omitempty"` + AzureVpn *EndpointsAzureVPNDetailsView `json:"azureVpn,omitempty"` + GcpCloudArmor *EndpointsGCPCloudArmorDetailsView `json:"gcpCloudArmor,omitempty"` + GcpFirewallRule *EndpointsGCPFirewallRuleDetailsView `json:"gcpFirewallRule,omitempty"` + GcpVpcServiceControls *EndpointsGCPVPCServiceControlsDetailsView `json:"gcpVpcServiceControls,omitempty"` + GcpVpnTunnel *EndpointsGCPVPNTunnelDetailsView `json:"gcpVpnTunnel,omitempty"` + SubType ModelsConnectivitySubType `json:"subType"` +} + +type EndpointsConnectivityAssetView struct { + AccountID *string `json:"accountId,omitempty"` + AllowedPrincipalsCount *int `json:"allowedPrincipalsCount,omitempty"` + BandwidthMbps *int `json:"bandwidthMbps,omitempty"` + BgpAsn *int `json:"bgpAsn,omitempty"` + ConnectionType *string `json:"connectionType,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` + EndpointDns *string `json:"endpointDns,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + PeerCidrOrOrg *string `json:"peerCidrOrOrg,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsConnectivitySubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` + TunnelStatus *string `json:"tunnelStatus,omitempty"` +} + +type EndpointsContainerAssetDetailsView struct { + AwsEcsService *EndpointsAWSECSServiceDetailsView `json:"awsEcsService,omitempty"` + AwsEcsTask *EndpointsAWSECSTaskDetailsView `json:"awsEcsTask,omitempty"` + AwsEcsTaskDefinition *EndpointsAWSECSTaskDefinitionDetailsView `json:"awsEcsTaskDefinition,omitempty"` + AzureAci *EndpointsAzureACIDetailsView `json:"azureAci,omitempty"` + AzureAppService *EndpointsAzureAppServiceDetailsView `json:"azureAppService,omitempty"` + GcpCloudRun *EndpointsGCPCloudRunDetailsView `json:"gcpCloudRun,omitempty"` + K8sDaemonSet *EndpointsK8SDaemonSetDetailsView `json:"k8sDaemonSet,omitempty"` + K8sDeployment *EndpointsK8SDeploymentDetailsView `json:"k8sDeployment,omitempty"` + K8sNamespace *EndpointsK8SNamespaceDetailsView `json:"k8sNamespace,omitempty"` + K8sPod *EndpointsK8SPodDetailsView `json:"k8sPod,omitempty"` + K8sStatefulSet *EndpointsK8SStatefulSetDetailsView `json:"k8sStatefulSet,omitempty"` + SubType ModelsContainerSubType `json:"subType"` +} + +type EndpointsContainerAssetView struct { + AccountID *string `json:"accountId,omitempty"` + ClusterID *string `json:"clusterId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + DeployedBy *string `json:"deployedBy,omitempty"` + ExposedPorts []string `json:"exposedPorts,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + ImageDigest *string `json:"imageDigest,omitempty"` + ImageRef *string `json:"imageRef,omitempty"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + Namespace *string `json:"namespace,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + Replicas *int `json:"replicas,omitempty"` + ServiceAccount *string `json:"serviceAccount,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsContainerSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` + WorkloadKind *string `json:"workloadKind,omitempty"` +} + +type EndpointsContextApproveCloudConnectorProposalInput struct { + Digest string `json:"digest"` +} + +type EndpointsContextApproveCloudConnectorProposalOutput struct { + PrURL string `json:"prUrl"` +} + +type EndpointsContextApproveWAFAllowlistProposalInput struct { + Digest string `json:"digest"` +} + +type EndpointsContextGetCloudConnectorPRRunOutput struct { + Pr *EndpointsCloudConnectorPRRecord `json:"pr,omitempty"` + Run EndpointsRunStatus `json:"run"` + Status string `json:"status"` + Version *string `json:"version,omitempty"` +} + +type EndpointsContextGetCloudConnectorPRStatusOutput struct { + Automation *EndpointsCloudConnectorAutomation `json:"automation,omitempty"` + Pr *EndpointsCloudConnectorPRRecord `json:"pr,omitempty"` + PreparationAvailable *bool `json:"preparationAvailable,omitempty"` + Run *EndpointsCloudConnectorPRRunStatus `json:"run,omitempty"` +} + +type EndpointsContextGetCloudConnectorProposalOutput struct { + Proposal EndpointsCloudConnectorProposal `json:"proposal"` +} + +type EndpointsContextGetCloudScanStatusOutput struct { + OverallStatus string `json:"overallStatus"` + Providers []EndpointsProviderScanStatus `json:"providers,omitempty"` + ScanID string `json:"scanId"` +} + +type EndpointsContextRecoverCloudConnectorProposalInput struct { + ConfirmNoPullRequest bool `json:"confirmNoPullRequest"` + Digest string `json:"digest"` +} + +type EndpointsContextRecoverCloudConnectorProposalOutput struct { + PrURL *string `json:"prUrl,omitempty"` + Recovered bool `json:"recovered"` +} + +type EndpointsContextRecoverWAFAllowlistProposalInput struct { + ConfirmNoPullRequest bool `json:"confirmNoPullRequest"` + Digest string `json:"digest"` +} + +type EndpointsContextStartCloudConnectorPRRunInput struct { + Digest *string `json:"digest,omitempty"` + ExpectedRunID *string `json:"expectedRunId,omitempty"` +} + +type EndpointsContextStartCloudConnectorPRRunOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` + RunID *string `json:"runId,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +type EndpointsContextStartCloudScanOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` + RunID *string `json:"runId,omitempty"` + ScanID *string `json:"scanId,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +type EndpointsContextStartRepoScopeScanInput struct { + IncludeArchived *bool `json:"includeArchived,omitempty"` +} + +type EndpointsContextStartRepoScopeScanOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` + ScanID *string `json:"scanId,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +type EndpointsContextStartWAFAllowlistPRRunInput struct { + Digest *string `json:"digest,omitempty"` + ExpectedRunID *string `json:"expectedRunId,omitempty"` +} + +type EndpointsCratesDetailsView struct { +} + +type EndpointsCreateOrganizationInput struct { + Organization *ModelsOrgContext `json:"organization,omitempty"` +} + +type EndpointsCreateOrganizationOutput struct { + Organization *ModelsOrgContext `json:"organization,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsCreateRepoScanInput struct { + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + ProjectsTouched []EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` + RepositoryID string `json:"repositoryId"` + SbomsGenerated []EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` + Status *string `json:"status,omitempty"` + SubagentsRun map[string]EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` +} + +type EndpointsCreateRepoScanOutput struct { + Scan EndpointsRepoScanSummary `json:"scan"` + Version *string `json:"version,omitempty"` +} + +type EndpointsDataPipelineAssetDetailsView struct { + AwsAthena *EndpointsAWSAthenaDetailsView `json:"awsAthena,omitempty"` + AwsEmr *EndpointsAWSEMRDetailsView `json:"awsEmr,omitempty"` + AwsGlue *EndpointsAWSGlueDetailsView `json:"awsGlue,omitempty"` + AzureBatch *EndpointsAzureBatchDetailsView `json:"azureBatch,omitempty"` + AzureDataFactory *EndpointsAzureDataFactoryDetailsView `json:"azureDataFactory,omitempty"` + AzureDatabricks *EndpointsAzureDatabricksDetailsView `json:"azureDatabricks,omitempty"` + AzureHdInsight *EndpointsAzureHDInsightDetailsView `json:"azureHdInsight,omitempty"` + AzureSynapse *EndpointsAzureSynapseDetailsView `json:"azureSynapse,omitempty"` + GcpCloudBatch *EndpointsGCPCloudBatchDetailsView `json:"gcpCloudBatch,omitempty"` + GcpDataflow *EndpointsGCPDataflowDetailsView `json:"gcpDataflow,omitempty"` + GcpDataproc *EndpointsGCPDataprocDetailsView `json:"gcpDataproc,omitempty"` + GcpWorkflows *EndpointsGCPWorkflowsDetailsView `json:"gcpWorkflows,omitempty"` + SubType ModelsDataPipelineSubType `json:"subType"` +} + +type EndpointsDataPipelineAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DataEncryptionEnabled *bool `json:"dataEncryptionEnabled,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + IamRoleArn *string `json:"iamRoleArn,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastRunAt *string `json:"lastRunAt,omitempty"` + LastRunStatus *string `json:"lastRunStatus,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + PipelineKind *string `json:"pipelineKind,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + Schedule *string `json:"schedule,omitempty"` + SinkCount *int `json:"sinkCount,omitempty"` + SourceCount *int `json:"sourceCount,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsDataPipelineSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` + VpcAttached *bool `json:"vpcAttached,omitempty"` +} + +type EndpointsDatabaseAssetDetailsView struct { + AwsDynamoDb *EndpointsAWSDynamoDBDetailsView `json:"awsDynamoDb,omitempty"` + AwsElastiCache *EndpointsAWSElastiCacheDetailsView `json:"awsElastiCache,omitempty"` + AwsMemoryDb *EndpointsAWSMemoryDBDetailsView `json:"awsMemoryDb,omitempty"` + AwsNeptune *EndpointsAWSNeptuneDetailsView `json:"awsNeptune,omitempty"` + AwsOpenSearch *EndpointsAWSOpenSearchDetailsView `json:"awsOpenSearch,omitempty"` + AwsRds *EndpointsAWSRDSDetailsView `json:"awsRds,omitempty"` + AwsRedshift *EndpointsAWSRedshiftDetailsView `json:"awsRedshift,omitempty"` + AzureCosmos *EndpointsAzureCosmosDetailsView `json:"azureCosmos,omitempty"` + AzureMysql *EndpointsAzureMySQLDetailsView `json:"azureMysql,omitempty"` + AzurePostgres *EndpointsAzurePostgresDetailsView `json:"azurePostgres,omitempty"` + AzureRedis *EndpointsAzureRedisDetailsView `json:"azureRedis,omitempty"` + AzureSql *EndpointsAzureSQLDetailsView `json:"azureSql,omitempty"` + GcpAlloyDb *EndpointsGCPAlloyDBDetailsView `json:"gcpAlloyDb,omitempty"` + GcpBigQuery *EndpointsGCPBigQueryDetailsView `json:"gcpBigQuery,omitempty"` + GcpCloudSql *EndpointsGCPCloudSQLDetailsView `json:"gcpCloudSql,omitempty"` + GcpFirestore *EndpointsGCPFirestoreDetailsView `json:"gcpFirestore,omitempty"` + GcpMemorystore *EndpointsGCPMemorystoreDetailsView `json:"gcpMemorystore,omitempty"` + GcpSpanner *EndpointsGCPSpannerDetailsView `json:"gcpSpanner,omitempty"` + SubType ModelsDatabaseSubType `json:"subType"` +} + +type EndpointsDatabaseAssetView struct { + AccountID *string `json:"accountId,omitempty"` + BackupRetentionDays *int `json:"backupRetentionDays,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + EncryptionAtRest *bool `json:"encryptionAtRest,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + Engine *string `json:"engine,omitempty"` + EngineVersion *string `json:"engineVersion,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + InstanceClassOrCapacity *string `json:"instanceClassOrCapacity,omitempty"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + MultiAzOrReplicaCount *int `json:"multiAzOrReplicaCount,omitempty"` + Name string `json:"name"` + Port *int `json:"port,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + PubliclyAccessible *bool `json:"publiclyAccessible,omitempty"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + StorageBytes *int64 `json:"storageBytes,omitempty"` + SubType ModelsDatabaseSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + +type EndpointsDecideSetupPentestAssessmentRecommendationOutput struct { + Recommendation EndpointsSetupPentestAssessmentRecommendation `json:"recommendation"` +} + +type EndpointsDecideSetupPentestTargetRecommendationOutput struct { + Recommendation EndpointsSetupPentestTargetRecommendation `json:"recommendation"` +} + +type EndpointsDeleteArtifactOutput struct { + Message string `json:"message"` + Success bool `json:"success"` +} + +type EndpointsDeleteAssetOutput struct { + Success bool `json:"success"` + Version string `json:"version"` +} + +type EndpointsDeleteContextApplicationOutput struct { + Message string `json:"message"` +} + +type EndpointsDeleteDepsOutput struct { + DeletedCount *int `json:"deletedCount,omitempty"` + Scope *string `json:"scope,omitempty"` + Version string `json:"version"` +} + +type EndpointsDeleteEntrypointOutput struct { + Message string `json:"message"` + Success bool `json:"success"` +} + +type EndpointsDeleteMemoryOutput struct { + Message string `json:"message"` + Success bool `json:"success"` + Version *string `json:"version,omitempty"` +} + +type EndpointsDeletePipelineOutput struct { + Message string `json:"message"` + Success bool `json:"success"` +} + +type EndpointsDeleteProjectOutput struct { + Message string `json:"message"` + Success bool `json:"success"` +} + +type EndpointsDeleteRepositoryOutput struct { + Message string `json:"message"` + Success bool `json:"success"` + Version *string `json:"version,omitempty"` +} + +type EndpointsDeleteSBOMOutput struct { + DeletedKeys []string `json:"deletedKeys,omitempty"` + Repositories []ModelsSBOMRepository `json:"repositories,omitempty"` + TenantID string `json:"tenantId"` + TenantName *string `json:"tenantName,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsDockerHubDetailsView struct { +} + +type EndpointsDockerImageDetailsView struct { +} + +type EndpointsEndpointsAssetView struct { + AwsService *string `json:"awsService,omitempty"` + BodyType *string `json:"bodyType,omitempty"` + CreatedAt string `json:"createdAt"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + HostCategory ModelsAssetInventoryCategory `json:"hostCategory"` + HostID string `json:"hostId"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsAutoGenerated *bool `json:"isAutoGenerated,omitempty"` + IsConfirmedAtRuntime *bool `json:"isConfirmedAtRuntime,omitempty"` + IsConfirmedByUser *bool `json:"isConfirmedByUser,omitempty"` + Method string `json:"method"` + Path string `json:"path"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + UpdatedAt string `json:"updatedAt"` +} + +type EndpointsEntrypointSummary struct { + ApplicationTypes []string `json:"applicationTypes,omitempty"` + ArtifactIds []string `json:"artifactIds,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DeletedAt *string `json:"deletedAt,omitempty"` + Description *string `json:"description,omitempty"` + FrameworkName *string `json:"frameworkName,omitempty"` + ID *string `json:"id,omitempty"` + IsDeleted *bool `json:"isDeleted,omitempty"` + Kind *string `json:"kind,omitempty"` + LineNumber *int `json:"lineNumber,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Ports []int `json:"ports,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type EndpointsExecutableDetailsView struct { +} + +type EndpointsGCPAPIGatewayDetailsView struct { +} + +type EndpointsGCPAlloyDBDetailsView struct { +} + +type EndpointsGCPAppEngineDetailsView struct { +} + +type EndpointsGCPArtifactRegistryDetailsView struct { +} + +type EndpointsGCPBigQueryDetailsView struct { +} + +type EndpointsGCPCloudArmorDetailsView struct { +} + +type EndpointsGCPCloudBatchDetailsView struct { +} + +type EndpointsGCPCloudBuildDetailsView struct { +} + +type EndpointsGCPCloudCDNDetailsView struct { +} + +type EndpointsGCPCloudDNSRecordDetailsView struct { +} + +type EndpointsGCPCloudDNSZoneDetailsView struct { +} + +type EndpointsGCPCloudFunctionDetailsView struct { +} + +type EndpointsGCPCloudNATDetailsView struct { +} + +type EndpointsGCPCloudRunDetailsView struct { +} + +type EndpointsGCPCloudSQLDetailsView struct { +} + +type EndpointsGCPDataflowDetailsView struct { +} + +type EndpointsGCPDataprocDetailsView struct { +} + +type EndpointsGCPFilestoreDetailsView struct { +} + +type EndpointsGCPFirestoreDetailsView struct { +} + +type EndpointsGCPFirewallRuleDetailsView struct { +} + +type EndpointsGCPGCEDetailsView struct { + DiskNames []string `json:"diskNames,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + MachineType *string `json:"machineType,omitempty"` + NetworkTags []string `json:"networkTags,omitempty"` + Preemptible *bool `json:"preemptible,omitempty"` + ServiceAccount *string `json:"serviceAccount,omitempty"` + Zone *string `json:"zone,omitempty"` +} + +type EndpointsGCPGCSBucketDetailsView struct { +} + +type EndpointsGCPGKEDetailsView struct { +} + +type EndpointsGCPKMSDetailsView struct { +} + +type EndpointsGCPLBDetailsView struct { +} + +type EndpointsGCPLoggingDetailsView struct { +} + +type EndpointsGCPMIGDetailsView struct { + AutoHealing *bool `json:"autoHealing,omitempty"` + InstanceTemplate *string `json:"instanceTemplate,omitempty"` + Region *string `json:"region,omitempty"` + TargetSize *int `json:"targetSize,omitempty"` + Zones []string `json:"zones,omitempty"` +} + +type EndpointsGCPMemorystoreDetailsView struct { +} + +type EndpointsGCPOrgPolicyDetailsView struct { +} + +type EndpointsGCPPDDetailsView struct { +} + +type EndpointsGCPPolicyAnalyzerDetailsView struct { +} + +type EndpointsGCPPubSubDetailsView struct { +} + +type EndpointsGCPRoleDetailsView struct { +} + +type EndpointsGCPSecretManagerDetailsView struct { +} + +type EndpointsGCPSecurityCommandCtrDetailsView struct { +} + +type EndpointsGCPServiceAccountDetailsView struct { +} + +type EndpointsGCPSpannerDetailsView struct { +} + +type EndpointsGCPStackdriverDetailsView struct { +} + +type EndpointsGCPVPCDetailsView struct { +} + +type EndpointsGCPVPCServiceControlsDetailsView struct { +} + +type EndpointsGCPVPNTunnelDetailsView struct { +} + +type EndpointsGCPVertexEndpointDetailsView struct { +} + +type EndpointsGCPWorkflowsDetailsView struct { +} + +type EndpointsGHCRDetailsView struct { +} + +type EndpointsGetActiveDepsOutput struct { + Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` + NextCursor string `json:"nextCursor"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetActiveDepsSummaryOutput struct { + DirectCount int64 `json:"directCount"` + Oldest *EndpointsActiveDepsSummaryOldest `json:"oldest,omitempty"` + TotalCount int64 `json:"totalCount"` + TransitiveCount int64 `json:"transitiveCount"` + Version string `json:"version"` +} + +type EndpointsGetAiMlAssetOutput struct { + Asset EndpointsAiMlAssetView `json:"asset"` + Details EndpointsAiMlAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetApplicationExecutionRecipeOutput struct { + Resolution ModelsExecutionRecipeResolution `json:"resolution"` +} + +type EndpointsGetApplicationRebuildOutput struct { + ApplicationCount *int `json:"applicationCount,omitempty"` + Applications []ModelsApplication `json:"applications,omitempty"` + Run EndpointsRunStatus `json:"run"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetApplicationSchemaOutput struct { + Format ModelsSchemaFormat `json:"format"` + Schema string `json:"schema"` + Type ModelsSchemaType `json:"type"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetArtifactDeploymentOutput struct { + Deployment EndpointsArtifactDeploymentSummary `json:"deployment"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetArtifactOutput struct { + Artifact EndpointsArtifactSummary `json:"artifact"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetArtifactRepositoriesAssetOutput struct { + Asset EndpointsArtifactRepositoriesAssetView `json:"asset"` + Details EndpointsArtifactRepositoriesAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetArtifactsAssetOutput struct { + Asset EndpointsArtifactsAssetView `json:"asset"` + Details EndpointsArtifactsAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetAssetGraphAttackPathsOutput struct { + AttackPaths []EndpointsAttackPathDTO `json:"attackPaths,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphLandingOutput struct { + Applications []EndpointsAssetGraphNodeSummary `json:"applications,omitempty"` + CloudAccounts []EndpointsAssetGraphNodeSummary `json:"cloudAccounts,omitempty"` + Counts map[string]int64 `json:"counts,omitempty"` + InternetNodeID *string `json:"internetNodeId,omitempty"` + K8sClusters []EndpointsAssetGraphNodeSummary `json:"k8sClusters,omitempty"` + Repositories []EndpointsAssetGraphNodeSummary `json:"repositories,omitempty"` + SyncCoverage *EndpointsAssetGraphSyncCoverage `json:"syncCoverage,omitempty"` + TotalEdgeCount *int64 `json:"totalEdgeCount,omitempty"` + TotalNodeCount *int64 `json:"totalNodeCount,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphNodeOutput struct { + Node EndpointsAssetGraphNodeSummary `json:"node"` + NodeData *json.RawMessage `json:"nodeData,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphNodesOutput struct { + Nodes []EndpointsAssetGraphNodeSummary `json:"nodes,omitempty"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphReachabilityOutput struct { + IsInternetFacing bool `json:"isInternetFacing"` + Path []EndpointsReachabilityPathDTO `json:"path,omitempty"` + TargetNodeFound bool `json:"targetNodeFound"` + TargetNodeID string `json:"targetNodeId"` + TargetNodeKind *string `json:"targetNodeKind,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphRetrieveOutput struct { + Results []EndpointsAssetGraphRetrievedNode `json:"results,omitempty"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphSearchOutput struct { + Results []EndpointsAssetGraphSearchResultEntry `json:"results,omitempty"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphSubgraphOutput struct { + HierarchyEdges []GraphEdge `json:"hierarchyEdges,omitempty"` + LateralEdges []GraphEdge `json:"lateralEdges,omitempty"` + Nodes []json.RawMessage `json:"nodes,omitempty"` + RootNodeID string `json:"rootNodeId"` + TotalChildren int `json:"totalChildren"` + TotalChildrenByType map[string]int `json:"totalChildrenByType,omitempty"` + Truncated bool `json:"truncated"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetAssetGraphSummaryOutput struct { + AccountCount int `json:"accountCount"` + CombinedGraphExpiresAt *string `json:"combinedGraphExpiresAt,omitempty"` + CombinedGraphURL *string `json:"combinedGraphUrl,omitempty"` + FailedAccounts []string `json:"failedAccounts,omitempty"` + FindingNodeCount *int `json:"findingNodeCount,omitempty"` + GraphInfo *EndpointsInfrastructureGraphInfo `json:"graphInfo,omitempty"` + InfrastructureGraphs []EndpointsAssetGraphComponent `json:"infrastructureGraphs,omitempty"` + InternetFacingNodeCount *int `json:"internetFacingNodeCount,omitempty"` + LastUpdated string `json:"lastUpdated"` + MergedGraphEdgeCount *int `json:"mergedGraphEdgeCount,omitempty"` + MergedGraphExpiresAt *string `json:"mergedGraphExpiresAt,omitempty"` + MergedGraphNodeCount *int `json:"mergedGraphNodeCount,omitempty"` + MergedGraphURL *string `json:"mergedGraphUrl,omitempty"` + RepoContextGraphs []EndpointsAssetGraphComponent `json:"repoContextGraphs,omitempty"` + TotalInfraEdges int `json:"totalInfraEdges"` + TotalInfraNodes int `json:"totalInfraNodes"` + TotalRepoGraphs int `json:"totalRepoGraphs"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetCDNAndDNSAssetOutput struct { + Asset EndpointsCDNAndDNSAssetView `json:"asset"` + Details EndpointsCDNAndDNSAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetCiCdAssetOutput struct { + Asset EndpointsCiCdAssetView `json:"asset"` + Details EndpointsCiCdAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetCloudReconAccountOverviewOutput struct { + Overview *EndpointsCloudReconAccountOverviewDTO `json:"overview,omitempty"` +} + +type EndpointsGetCloudReconAccountSynthesisOutput struct { + ExpiresAt *string `json:"expiresAt,omitempty"` + PresignedURL *string `json:"presignedUrl,omitempty"` + SizeBytes *int64 `json:"sizeBytes,omitempty"` + Synthesis *json.RawMessage `json:"synthesis,omitempty"` +} + +type EndpointsGetCloudReconCrossAccountRelationshipsOutput struct { + CrossAccountRelationships []EndpointsCloudReconCrossAccountRelationshipDTO `json:"crossAccountRelationships,omitempty"` +} + +type EndpointsGetCloudReconDiscoveredNodesOutput struct { + Nodes []EndpointsCloudReconDiscoveredNodeDTO `json:"nodes,omitempty"` +} + +type EndpointsGetCloudReconGraphGapsOutput struct { + GraphGaps []EndpointsCloudReconGraphGapDTO `json:"graphGaps,omitempty"` +} + +type EndpointsGetCloudReconHotspotsOutput struct { + Hotspots []EndpointsCloudReconHotspotDTO `json:"hotspots,omitempty"` +} + +type EndpointsGetCloudReconIamPostureOutput struct { + IamPosture *EndpointsCloudReconIamPostureDTO `json:"iamPosture,omitempty"` +} + +type EndpointsGetCloudReconNetworkExposuresOutput struct { + NetworkExposures []EndpointsCloudReconNetworkExposureDTO `json:"networkExposures,omitempty"` +} + +type EndpointsGetCloudReconOrgSynthesisOutput struct { + Synthesis *EndpointsCloudReconOrgSynthesisDTO `json:"synthesis,omitempty"` +} + +type EndpointsGetCloudReconSecurityBoundariesOutput struct { + SecurityBoundaries []EndpointsCloudReconSecurityBoundaryDTO `json:"securityBoundaries,omitempty"` +} + +type EndpointsGetCloudReconTenantTrustsOutput struct { + Trusts []EndpointsCloudReconTenantTrustDTO `json:"trusts,omitempty"` +} + +type EndpointsGetCloudReconTopologyOutput struct { + Topology *EndpointsCloudReconTopologyDTO `json:"topology,omitempty"` +} + +type EndpointsGetCloudReconTrafficFlowsOutput struct { + TrafficFlows []EndpointsCloudReconTrafficFlowDTO `json:"trafficFlows,omitempty"` +} + +type EndpointsGetCloudReconTrustedServicesOutput struct { + TrustedServices []EndpointsCloudReconTrustedServiceDTO `json:"trustedServices,omitempty"` +} + +type EndpointsGetClusterAssetOutput struct { + Asset EndpointsClusterAssetView `json:"asset"` + Details EndpointsClusterAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetComputeAssetOutput struct { + Asset EndpointsComputeAssetView `json:"asset"` + Details EndpointsComputeAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetConnectivityAssetOutput struct { + Asset EndpointsConnectivityAssetView `json:"asset"` + Details EndpointsConnectivityAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetContainerAssetOutput struct { + Asset EndpointsContainerAssetView `json:"asset"` + Details EndpointsContainerAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetContextApplicationOutput struct { + Application *ModelsApplication `json:"application,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetContextApplicationsOutput struct { + Applications []ModelsApplication `json:"applications,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + TotalCount int `json:"totalCount"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetDataPipelineAssetOutput struct { + Asset EndpointsDataPipelineAssetView `json:"asset"` + Details EndpointsDataPipelineAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetDatabaseAssetOutput struct { + Asset EndpointsDatabaseAssetView `json:"asset"` + Details EndpointsDatabaseAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetDepsAtCommitOutput struct { + CommitTimestamp string `json:"commitTimestamp"` + Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetDepsByBomRefOutput struct { + Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` + NextCursor string `json:"nextCursor"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetDepsDependentsOutput struct { + Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` + NextCursor string `json:"nextCursor"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetDepsDiffOutput struct { + Diff *ModelsDependencyDiff `json:"diff,omitempty"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetDepsHistoryOut struct { + NumItems int `json:"numItems"` + Version string `json:"version"` + Windows []ModelsDependencyWindow `json:"windows,omitempty"` +} + +type EndpointsGetDepsOutput struct { + Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` + NextCursor string `json:"nextCursor"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetDepsWithoutLockfileOutput struct { + Projects []EndpointsProjectWithoutLockfile `json:"projects,omitempty"` + Repositories []EndpointsRepositoryWithoutLockfile `json:"repositories,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetEndpointsAssetOutput struct { + Endpoint EndpointsEndpointsAssetView `json:"endpoint"` + Version string `json:"version"` +} + +type EndpointsGetEntrypointOutput struct { + Entrypoint EndpointsEntrypointSummary `json:"entrypoint"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetExposureOutput struct { + NumItems int `json:"numItems"` + Version string `json:"version"` + Windows []ModelsDependencyWindow `json:"windows,omitempty"` +} + +type EndpointsGetIdentityAssetOutput struct { + Asset EndpointsIdentityAssetView `json:"asset"` + Details EndpointsIdentityAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetInfrastructureGraphDownloadOutput struct { + AccountID string `json:"accountId"` + DownloadURL string `json:"downloadUrl"` + ExpiresAt string `json:"expiresAt"` + GraphVersion *string `json:"graphVersion,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetInfrastructureGraphOutput struct { + Graph *GraphGraph `json:"graph,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetInfrastructureGraphSummaryOutput struct { + AccountCount int `json:"accountCount"` + CombinedGraphExpiresAt string `json:"combinedGraphExpiresAt"` + CombinedGraphURL *string `json:"combinedGraphUrl,omitempty"` + FailedAccounts []string `json:"failedAccounts,omitempty"` + GraphInfo *EndpointsInfrastructureGraphInfo `json:"graphInfo,omitempty"` + Graphs []EndpointsInfrastructureGraphDownloadInfo `json:"graphs,omitempty"` + IntegrationStatus EndpointsIntegrationStatus `json:"integrationStatus"` + LastUpdated string `json:"lastUpdated"` + TotalEdgeCount int `json:"totalEdgeCount"` + TotalNodeCount int `json:"totalNodeCount"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetInfrastructureGraphVersionOutput struct { + Graph *GraphGraph `json:"graph,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetLatestCloudReconScanOutput struct { + Scan *EndpointsCloudReconScanMetadataDTO `json:"scan,omitempty"` +} + +type EndpointsGetLatestSBOMsOutput struct { + Sboms []ModelsCDXGenAtCommit `json:"sboms,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetLoadBalancerAssetOutput struct { + Asset EndpointsLoadBalancerAssetView `json:"asset"` + Details EndpointsLoadBalancerAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetMemoriesByDocumentAndTypeOutput struct { + Count int32 `json:"count"` + Memories []ModelsMemory `json:"memories,omitempty"` + PaginationToken *string `json:"paginationToken,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetMemoriesByDocumentOutput struct { + Count int32 `json:"count"` + Memories []ModelsMemory `json:"memories,omitempty"` + PaginationToken *string `json:"paginationToken,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetMemoriesByTypeOutput struct { + Count int32 `json:"count"` + Memories []ModelsMemory `json:"memories,omitempty"` + PaginationToken *string `json:"paginationToken,omitempty"` + TotalCount int32 `json:"totalCount"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetMemoriesOutput struct { + Count int `json:"count"` + Memories []ModelsMemory `json:"memories,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + TotalCount int `json:"totalCount"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetMemoryFindingsOutput struct { + Findings []EndpointsMemoryFinding `json:"findings,omitempty"` + TotalCount int `json:"totalCount"` + Version *string `json:"version,omitempty"` } -type EndpointsCreateOrganizationInput struct { +type EndpointsGetMemoryOutput struct { + Memory *ModelsMemory `json:"memory,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetMemoryVersionsOutput struct { + Count int32 `json:"count"` + Version *string `json:"version,omitempty"` + Versions []EndpointsMemoryVersion `json:"versions,omitempty"` +} + +type EndpointsGetMessagingAssetOutput struct { + Asset EndpointsMessagingAssetView `json:"asset"` + Details EndpointsMessagingAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetNetworkAssetOutput struct { + Asset EndpointsNetworkAssetView `json:"asset"` + Details EndpointsNetworkAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetObservabilityAssetOutput struct { + Asset EndpointsObservabilityAssetView `json:"asset"` + Details EndpointsObservabilityAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetOrgContextRunOutput struct { + Message *string `json:"message,omitempty"` Organization *ModelsOrgContext `json:"organization,omitempty"` + RunID string `json:"runId"` + State EndpointsRunState `json:"state"` + Version *string `json:"version,omitempty"` } -type EndpointsCreateOrganizationOutput struct { +type EndpointsGetOrganizationOutput struct { + AssessmentContext *EndpointsAssessmentContextReadiness `json:"assessmentContext,omitempty"` Organization *ModelsOrgContext `json:"organization,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsCreateRepoScanInput struct { - Branch *string `json:"branch,omitempty"` - CommitSha string `json:"commitSha"` - ProjectsTouched []EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` - RepositoryID string `json:"repositoryId"` - SbomsGenerated []EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` - Status *string `json:"status,omitempty"` - SubagentsRun map[string]EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` +type EndpointsGetPipelineOutput struct { + Pipeline EndpointsPipelineSummary `json:"pipeline"` + Version *string `json:"version,omitempty"` } -type EndpointsCreateRepoScanOutput struct { - Scan EndpointsRepoScanSummary `json:"scan"` +type EndpointsGetPipelinesAssetOutput struct { + Asset EndpointsPipelinesAssetView `json:"asset"` + Details EndpointsPipelinesAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetProjectActiveDepsOutput struct { + Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetProjectExecutionRecipeOutput struct { + Resolution ModelsExecutionRecipeResolution `json:"resolution"` +} + +type EndpointsGetProjectExposureOutput struct { + NumItems int `json:"numItems"` + Version string `json:"version"` + Windows []ModelsDependencyWindow `json:"windows,omitempty"` +} + +type EndpointsGetProjectOutput struct { + Project *ModelsContextProject `json:"project,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsDeleteArtifactOutput struct { - Message string `json:"message"` - Success bool `json:"success"` +type EndpointsGetProjectSchemaMetadataOutput struct { + DownloadURL string `json:"downloadUrl"` + Format ModelsSchemaFormat `json:"format"` + NumEndpoints int `json:"numEndpoints"` + Provenance *EndpointsSchemaProvenance `json:"provenance,omitempty"` + Size int `json:"size"` + Type ModelsSchemaType `json:"type"` + Version *string `json:"version,omitempty"` } -type EndpointsDeleteContextApplicationOutput struct { - Message string `json:"message"` +type EndpointsGetProjectSchemaOutput struct { + Format ModelsSchemaFormat `json:"format"` + Schema string `json:"schema"` + Type ModelsSchemaType `json:"type"` + Version *string `json:"version,omitempty"` } -type EndpointsDeleteDepsOutput struct { - DeletedCount *int `json:"deletedCount,omitempty"` - Scope *string `json:"scope,omitempty"` +type EndpointsGetProjectSchemaRawOutput struct { + ContentType *string `json:"contentType,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` + FileName *string `json:"fileName,omitempty"` +} + +type EndpointsGetProjectsAssetOutput struct { + Asset EndpointsProjectsAssetView `json:"asset"` + Details EndpointsProjectsAssetDetailsView `json:"details"` Version string `json:"version"` } -type EndpointsDeleteEntrypointOutput struct { - Message string `json:"message"` - Success bool `json:"success"` +type EndpointsGetRepoScanOutput struct { + Run *EndpointsRunStatus `json:"run,omitempty"` + Scan EndpointsRepoScanSummary `json:"scan"` + Version *string `json:"version,omitempty"` } -type EndpointsDeleteMemoryOutput struct { - Message string `json:"message"` - Success bool `json:"success"` +type EndpointsGetRepoScopeScanOutput struct { + GeneratedAt *string `json:"generatedAt,omitempty"` + RecommendedCount *int `json:"recommendedCount,omitempty"` + Run EndpointsRunStatus `json:"run"` + SupersededBy *string `json:"supersededBy,omitempty"` + Uncovered []string `json:"uncovered,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsDeletePipelineOutput struct { - Message string `json:"message"` - Success bool `json:"success"` +type EndpointsGetReportStatusOutput struct { + Error *string `json:"error,omitempty"` + Status *string `json:"status,omitempty"` + URL *string `json:"url,omitempty"` + Version *string `json:"version,omitempty"` } -type EndpointsDeleteProjectOutput struct { - Message string `json:"message"` - Success bool `json:"success"` +type EndpointsGetReposAssetOutput struct { + Asset EndpointsReposAssetView `json:"asset"` + Details EndpointsReposAssetDetailsView `json:"details"` + Version string `json:"version"` } -type EndpointsDeleteRepositoryOutput struct { - Message string `json:"message"` - Success bool `json:"success"` +type EndpointsGetRepositoriesOutput struct { + NextToken string `json:"nextToken"` + NumItems int `json:"numItems"` + Repositories []RepocontextRepoContext `json:"repositories,omitempty"` + RepositoryIds map[string]string `json:"repositoryIds,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsDeleteSBOMOutput struct { - DeletedKeys []string `json:"deletedKeys,omitempty"` +type EndpointsGetRepositoryOutput struct { + Repository RepocontextRepoContext `json:"repository"` + URL *string `json:"url,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetSBOMSOutput struct { + Sboms []ModelsCDXGenAtCommit `json:"sboms,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetSBOMTreeOutput struct { Repositories []ModelsSBOMRepository `json:"repositories,omitempty"` TenantID string `json:"tenantId"` TenantName *string `json:"tenantName,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsEntrypointSummary struct { - ApplicationTypes []string `json:"applicationTypes,omitempty"` - ArtifactIds []string `json:"artifactIds,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - DeletedAt *string `json:"deletedAt,omitempty"` +type EndpointsGetSecurityAssetOutput struct { + Asset EndpointsSecurityAssetView `json:"asset"` + Details EndpointsSecurityAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetServerlessAssetOutput struct { + Asset EndpointsServerlessAssetView `json:"asset"` + Details EndpointsServerlessAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetStorageAndBackupAssetOutput struct { + Asset EndpointsStorageAndBackupAssetView `json:"asset"` + Details EndpointsStorageAndBackupAssetDetailsView `json:"details"` + Version string `json:"version"` +} + +type EndpointsGetVaultDocumentTextOutput struct { Description *string `json:"description,omitempty"` - FrameworkName *string `json:"frameworkName,omitempty"` - ID *string `json:"id,omitempty"` - IsDeleted *bool `json:"isDeleted,omitempty"` - Kind *string `json:"kind,omitempty"` - LineNumber *int `json:"lineNumber,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - Ports []int `json:"ports,omitempty"` - ProjectID *string `json:"projectId,omitempty"` - RepositoryID *string `json:"repositoryId,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` + DocType *string `json:"docType,omitempty"` + DocumentID string `json:"documentId"` + EndPage *int `json:"endPage,omitempty"` + FileName string `json:"fileName"` + NextToken *string `json:"nextToken,omitempty"` + StartPage *int `json:"startPage,omitempty"` + Text string `json:"text"` + TotalChars int `json:"totalChars"` + TotalChunks int `json:"totalChunks"` + Truncated bool `json:"truncated"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetVaultFileOutput struct { + CreatedAt string `json:"createdAt"` + DocumentID *string `json:"documentId,omitempty"` + FileID string `json:"fileId"` + FileName string `json:"fileName"` + FilePresignedURL string `json:"filePresignedUrl"` + UploaderID string `json:"uploaderId"` + UploaderUsername string `json:"uploaderUsername"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetVaultFilesListOutput struct { + Files []EndpointsVaultFileSimple `json:"files,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetVaultFilesOutput struct { + Files []EndpointsVaultFile `json:"files,omitempty"` + TotalCount int `json:"totalCount"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGitHubActionsDetailsView struct { +} + +type EndpointsGitHubRepoDetailsView struct { +} + +type EndpointsGitLabCIDetailsView struct { +} + +type EndpointsGitLabRepoDetailsView struct { +} + +type EndpointsGrepMemoriesInput struct { + Limit *int `json:"limit,omitempty"` + MemoryClass *ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryTypes []ModelsMemoryMemoryType `json:"memoryTypes,omitempty"` + MinTrustTier *int `json:"minTrustTier,omitempty"` + Pattern string `json:"pattern"` + ResourceType *ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *ModelsMemoryScope `json:"scope,omitempty"` +} + +type EndpointsGrepMemoriesOutput struct { + Count int `json:"count"` + Memories []ModelsMemory `json:"memories,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsIdentityAssetDetailsView struct { + AwsCognitoUserPool *EndpointsAWSCognitoUserPoolDetailsView `json:"awsCognitoUserPool,omitempty"` + AwsIamGroup *EndpointsAWSIAMGroupDetailsView `json:"awsIamGroup,omitempty"` + AwsIamPolicy *EndpointsAWSIAMPolicyDetailsView `json:"awsIamPolicy,omitempty"` + AwsIamRole *EndpointsAWSIAMRoleDetailsView `json:"awsIamRole,omitempty"` + AwsIamUser *EndpointsAWSIAMUserDetailsView `json:"awsIamUser,omitempty"` + AzureAdGroup *EndpointsAzureADGroupDetailsView `json:"azureAdGroup,omitempty"` + AzureAdUser *EndpointsAzureADUserDetailsView `json:"azureAdUser,omitempty"` + AzureApplication *EndpointsAzureApplicationDetailsView `json:"azureApplication,omitempty"` + AzureEntraID *EndpointsAzureEntraIDDetailsView `json:"azureEntraId,omitempty"` + AzureManagedIdentity *EndpointsAzureManagedIdentityDetailsView `json:"azureManagedIdentity,omitempty"` + AzureRoleAssignment *EndpointsAzureRoleAssignmentDetailsView `json:"azureRoleAssignment,omitempty"` + AzureServicePrincipal *EndpointsAzureServicePrincipalDetailsView `json:"azureServicePrincipal,omitempty"` + GcpRole *EndpointsGCPRoleDetailsView `json:"gcpRole,omitempty"` + GcpServiceAccount *EndpointsGCPServiceAccountDetailsView `json:"gcpServiceAccount,omitempty"` + K8sRole *EndpointsK8SRoleDetailsView `json:"k8sRole,omitempty"` + K8sRoleBinding *EndpointsK8SRoleBindingDetailsView `json:"k8sRoleBinding,omitempty"` + K8sServiceAccount *EndpointsK8SServiceAccountDetailsView `json:"k8sServiceAccount,omitempty"` + SubType ModelsIdentitySubType `json:"subType"` +} + +type EndpointsIdentityAssetView struct { + AccountID *string `json:"accountId,omitempty"` + AttachedPolicyCount *int `json:"attachedPolicyCount,omitempty"` + ConsoleAccess *bool `json:"consoleAccess,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + Federated *bool `json:"federated,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + HasAdmin *bool `json:"hasAdmin,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + LastUsedAt *string `json:"lastUsedAt,omitempty"` + MfaEnabled *bool `json:"mfaEnabled,omitempty"` + Name string `json:"name"` + PrincipalType *string `json:"principalType,omitempty"` + PrivilegeScore *int `json:"privilegeScore,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsIdentitySubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + +type EndpointsInfrastructureAccountInfo struct { + AccountID string `json:"accountId"` + AccountName *string `json:"accountName,omitempty"` + AccountType string `json:"accountType"` + CloudProvider *string `json:"cloudProvider,omitempty"` + EdgeCount int `json:"edgeCount"` + GraphFilePath *string `json:"graphFilePath,omitempty"` + HasApiGateway bool `json:"hasApiGateway"` + HasCloudFrontCdn bool `json:"hasCloudFrontCdn"` + HasCloudFunctions *bool `json:"hasCloudFunctions,omitempty"` + HasCloudRunServices *bool `json:"hasCloudRunServices,omitempty"` + HasCrossAccountRefs bool `json:"hasCrossAccountRefs"` + HasDatabases bool `json:"hasDatabases"` + HasEcsServices bool `json:"hasEcsServices"` + HasEksClusters bool `json:"hasEksClusters"` + HasGceInstances *bool `json:"hasGceInstances,omitempty"` + HasGkeClusters *bool `json:"hasGkeClusters,omitempty"` + HasK8sClusters *bool `json:"hasK8sClusters,omitempty"` + HasLambdaFunctions bool `json:"hasLambdaFunctions"` + HasPublicAlb bool `json:"hasPublicAlb"` + HasPublicNlb bool `json:"hasPublicNlb"` + HasRoute53Dns bool `json:"hasRoute53Dns"` + HasTransitGateway bool `json:"hasTransitGateway"` + InternalServiceCount int `json:"internalServiceCount"` + NodeCount int `json:"nodeCount"` + PublicEndpointCount int `json:"publicEndpointCount"` + Regions []string `json:"regions,omitempty"` + Services []string `json:"services,omitempty"` +} + +type EndpointsInfrastructureCrossAccountConnection struct { + ConnectionCount int `json:"connectionCount"` + ConnectionType string `json:"connectionType"` + SourceAccountID string `json:"sourceAccountId"` + SourceAccountType *string `json:"sourceAccountType,omitempty"` + TargetAccountID string `json:"targetAccountId"` + TargetAccountType *string `json:"targetAccountType,omitempty"` +} + +type EndpointsInfrastructureCrossAccountStatistics struct { + CrossAccountConnections []EndpointsInfrastructureCrossAccountConnection `json:"crossAccountConnections,omitempty"` + CrossAccountEdgesCreated int `json:"crossAccountEdgesCreated"` + HasCrossAccountReferences bool `json:"hasCrossAccountReferences"` + OrphanedReferences int `json:"orphanedReferences"` + ReferencesByType map[string]int `json:"referencesByType,omitempty"` + TotalReferences int `json:"totalReferences"` + ValidatedReferences int `json:"validatedReferences"` +} + +type EndpointsInfrastructureEdgeStatistics struct { + BidirectionalEdges int `json:"bidirectionalEdges"` + EdgesByType map[string]int `json:"edgesByType,omitempty"` + TotalEdges int `json:"totalEdges"` + UnidirectionalEdges int `json:"unidirectionalEdges"` +} + +type EndpointsInfrastructureGraphDownloadInfo struct { + AccountID string `json:"accountId"` + DownloadURL string `json:"downloadUrl"` + EdgeCount int `json:"edgeCount"` + ExpiresAt string `json:"expiresAt"` + GeneratedAt string `json:"generatedAt"` + GraphID *string `json:"graphId,omitempty"` + GraphType *string `json:"graphType,omitempty"` + NodeCount int `json:"nodeCount"` + Region *string `json:"region,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsInfrastructureGraphInfo struct { + AccountsInfo []EndpointsInfrastructureAccountInfo `json:"accountsInfo,omitempty"` + CrossAccountStatistics EndpointsInfrastructureCrossAccountStatistics `json:"crossAccountStatistics"` + EdgeStatistics EndpointsInfrastructureEdgeStatistics `json:"edgeStatistics"` + Metadata EndpointsInfrastructureGraphInfoMetadata `json:"metadata"` + NodeStatistics EndpointsInfrastructureNodeStatistics `json:"nodeStatistics"` + ValidationResults EndpointsInfrastructureValidationResults `json:"validationResults"` +} + +type EndpointsInfrastructureGraphInfoMetadata struct { + DestinationBucket *string `json:"destinationBucket,omitempty"` + GeneratedAt string `json:"generatedAt"` + GeneratedBy string `json:"generatedBy"` + GraphType string `json:"graphType"` + ID string `json:"id"` + IsCombinedGraph bool `json:"isCombinedGraph"` + ProcessingDuration string `json:"processingDuration"` + SourceBucket string `json:"sourceBucket"` + Version string `json:"version"` +} + +type EndpointsInfrastructureGraphSummary struct { + AccountID string `json:"accountId"` + EdgeCount int `json:"edgeCount"` + GeneratedAt string `json:"generatedAt"` + GeneratedBy string `json:"generatedBy"` + GraphID string `json:"graphId"` + GraphType string `json:"graphType"` + LastModified string `json:"lastModified"` + NodeCount int `json:"nodeCount"` + Region *string `json:"region,omitempty"` + S3Key *string `json:"s3Key,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Version string `json:"version"` +} + +type EndpointsInfrastructureNodeStatistics struct { + NodesByAccount map[string]int `json:"nodesByAccount,omitempty"` + NodesByObjectType map[string]int `json:"nodesByObjectType,omitempty"` + NodesByRegion map[string]int `json:"nodesByRegion,omitempty"` + NodesBySubType map[string]int `json:"nodesBySubType,omitempty"` + NodesByType map[string]int `json:"nodesByType,omitempty"` + TotalNodes int `json:"totalNodes"` +} + +type EndpointsInfrastructureValidationCheck struct { + Details *string `json:"details,omitempty"` + Name string `json:"name"` + Passed bool `json:"passed"` +} + +type EndpointsInfrastructureValidationResults struct { + Checks []EndpointsInfrastructureValidationCheck `json:"checks,omitempty"` + ErrorCount int `json:"errorCount"` + Errors []string `json:"errors,omitempty"` + IsValid bool `json:"isValid"` + WarningCount int `json:"warningCount"` + Warnings []string `json:"warnings,omitempty"` +} + +type EndpointsIntegrationStatus string + +const ( + EndpointsIntegrationStatusPending EndpointsIntegrationStatus = "pending" + EndpointsIntegrationStatusReady EndpointsIntegrationStatus = "ready" +) + +type EndpointsJARDetailsView struct { +} + +type EndpointsJenkinsDetailsView struct { +} + +type EndpointsK8SClusterDetailsView struct { +} + +type EndpointsK8SCollectorClusterView struct { + ClusterName *string `json:"clusterName,omitempty"` + LastCompletedAt string `json:"lastCompletedAt"` + LastScanID string `json:"lastScanId"` + RecordCounts map[string]int `json:"recordCounts,omitempty"` + ScanIdentity string `json:"scanIdentity"` +} + +type EndpointsK8SDaemonSetDetailsView struct { +} + +type EndpointsK8SDeploymentDetailsView struct { + AvailableReplicas *int `json:"availableReplicas,omitempty"` + ClusterID *string `json:"clusterId,omitempty"` + Images []string `json:"images,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ReadyReplicas *int `json:"readyReplicas,omitempty"` + Selector map[string]string `json:"selector,omitempty"` +} + +type EndpointsK8SIngressDetailsView struct { + BackendServices []string `json:"backendServices,omitempty"` + ClusterID *string `json:"clusterId,omitempty"` + Hosts []string `json:"hosts,omitempty"` + IngressClass *string `json:"ingressClass,omitempty"` + Namespace *string `json:"namespace,omitempty"` + TlsHosts []string `json:"tlsHosts,omitempty"` } -type EndpointsGetActiveDepsOutput struct { - Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` - NextCursor string `json:"nextCursor"` - NumItems int `json:"numItems"` - Version string `json:"version"` +type EndpointsK8SNamespaceDetailsView struct { + ClusterID *string `json:"clusterId,omitempty"` + Finalizers []string `json:"finalizers,omitempty"` + Phase *string `json:"phase,omitempty"` } -type EndpointsGetActiveDepsSummaryOutput struct { - DirectCount int64 `json:"directCount"` - Oldest *EndpointsActiveDepsSummaryOldest `json:"oldest,omitempty"` - TotalCount int64 `json:"totalCount"` - TransitiveCount int64 `json:"transitiveCount"` - Version string `json:"version"` +type EndpointsK8SNodeDetailsView struct { + Allocatable map[string]string `json:"allocatable,omitempty"` + Capacity map[string]string `json:"capacity,omitempty"` + ClusterName *string `json:"clusterName,omitempty"` + ContainerRuntime *string `json:"containerRuntime,omitempty"` + KernelVersion *string `json:"kernelVersion,omitempty"` + KubeletVersion *string `json:"kubeletVersion,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + Taints []string `json:"taints,omitempty"` } -type EndpointsGetApplicationSchemaOutput struct { - Format ModelsSchemaFormat `json:"format"` - Schema string `json:"schema"` - Type ModelsSchemaType `json:"type"` - Version *string `json:"version,omitempty"` +type EndpointsK8SPodDetailsView struct { } -type EndpointsGetArtifactDeploymentOutput struct { - Deployment EndpointsArtifactDeploymentSummary `json:"deployment"` - Version *string `json:"version,omitempty"` +type EndpointsK8SRoleBindingDetailsView struct { } -type EndpointsGetArtifactOutput struct { - Artifact EndpointsArtifactSummary `json:"artifact"` - Version *string `json:"version,omitempty"` +type EndpointsK8SRoleDetailsView struct { +} + +type EndpointsK8SServiceAccountDetailsView struct { +} + +type EndpointsK8SServiceDetailsView struct { + ClusterID *string `json:"clusterId,omitempty"` + ClusterIps []string `json:"clusterIps,omitempty"` + ExternalIps []string `json:"externalIps,omitempty"` + ExternalName *string `json:"externalName,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Ports []EndpointsK8SServicePortDetailsView `json:"ports,omitempty"` + Selector map[string]string `json:"selector,omitempty"` +} + +type EndpointsK8SServicePortDetailsView struct { + Name *string `json:"name,omitempty"` + NodePort *int `json:"nodePort,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` + TargetPort *string `json:"targetPort,omitempty"` +} + +type EndpointsK8SStatefulSetDetailsView struct { } -type EndpointsGetAssetInventoryCloudResourcesOutput struct { +type EndpointsListAiMlAssetsOutput struct { + Assets []EndpointsAiMlAssetView `json:"assets,omitempty"` NextToken *string `json:"nextToken,omitempty"` - Resources []ModelsAssetInventoryResource `json:"resources,omitempty"` Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetAssetInventoryResourcesOutput struct { +type EndpointsListArtifactDeploymentsOutput struct { + Deployments []EndpointsArtifactDeploymentSummary `json:"deployments,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsListArtifactRepositoriesAssetsOutput struct { + Assets []EndpointsArtifactRepositoriesAssetView `json:"assets,omitempty"` NextToken *string `json:"nextToken,omitempty"` - Resources []ModelsAssetInventoryHost `json:"resources,omitempty"` Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetCloudAccountRecordsOutput struct { - CloudAccounts []ModelsAssetInventoryCloudAccountRecord `json:"cloudAccounts,omitempty"` +type EndpointsListArtifactsAssetsOutput struct { + Assets []EndpointsArtifactsAssetView `json:"assets,omitempty"` NextToken *string `json:"nextToken,omitempty"` Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetCloudReconDiscoveredNodesOutput struct { - Nodes []EndpointsCloudReconDiscoveredNodeDTO `json:"nodes,omitempty"` +type EndpointsListArtifactsOutput struct { + Artifacts []EndpointsArtifactSummary `json:"artifacts,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + TotalCount int64 `json:"totalCount"` + Version *string `json:"version,omitempty"` } -type EndpointsGetCloudReconHotspotsOutput struct { - Hotspots []EndpointsCloudReconHotspotDTO `json:"hotspots,omitempty"` +type EndpointsListAssetInventoryOutput struct { + Assets []EndpointsUnifiedAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetCloudReconTenantTrustsOutput struct { - Trusts []EndpointsCloudReconTenantTrustDTO `json:"trusts,omitempty"` +type EndpointsListCDNAndDNSAssetsOutput struct { + Assets []EndpointsCDNAndDNSAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetContextApplicationOutput struct { - Application *ModelsApplication `json:"application,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsListCiCdAssetsOutput struct { + Assets []EndpointsCiCdAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetContextApplicationsOutput struct { - Applications []ModelsApplication `json:"applications,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsListClusterAssetsOutput struct { + Assets []EndpointsClusterAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetDepsAtCommitOutput struct { - CommitTimestamp string `json:"commitTimestamp"` - Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` - NumItems int `json:"numItems"` +type EndpointsListComputeAssetsOutput struct { + Assets []EndpointsComputeAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetDepsByBomRefOutput struct { - Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` - NextCursor string `json:"nextCursor"` - NumItems int `json:"numItems"` +type EndpointsListConnectivityAssetsOutput struct { + Assets []EndpointsConnectivityAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetDepsDependentsOutput struct { - Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` - NextCursor string `json:"nextCursor"` - NumItems int `json:"numItems"` +type EndpointsListContainerAssetsOutput struct { + Assets []EndpointsContainerAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetDepsDiffOutput struct { - Diff *ModelsDependencyDiff `json:"diff,omitempty"` - NumItems int `json:"numItems"` +type EndpointsListDataPipelineAssetsOutput struct { + Assets []EndpointsDataPipelineAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetDepsHistoryOut struct { - NumItems int `json:"numItems"` +type EndpointsListDatabaseAssetsOutput struct { + Assets []EndpointsDatabaseAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` Version string `json:"version"` - Windows []ModelsDependencyWindow `json:"windows,omitempty"` } -type EndpointsGetDepsOutput struct { - Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` - NextCursor string `json:"nextCursor"` - NumItems int `json:"numItems"` +type EndpointsListEndpointsAssetsOutput struct { + Endpoints []EndpointsEndpointsAssetView `json:"endpoints,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` Version string `json:"version"` } -type EndpointsGetDepsWithoutLockfileOutput struct { - Projects []EndpointsProjectWithoutLockfile `json:"projects,omitempty"` - Repositories []EndpointsRepositoryWithoutLockfile `json:"repositories,omitempty"` +type EndpointsListEntrypointsOutput struct { + Entrypoints []EndpointsEntrypointSummary `json:"entrypoints,omitempty"` + NextToken *string `json:"nextToken,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsGetEntrypointOutput struct { - Entrypoint EndpointsEntrypointSummary `json:"entrypoint"` +type EndpointsListIdentityAssetsOutput struct { + Assets []EndpointsIdentityAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` +} + +type EndpointsListInfrastructureGraphVersionsOutput struct { + AccountID string `json:"accountId"` + Count int `json:"count"` Version *string `json:"version,omitempty"` + Versions []string `json:"versions,omitempty"` } -type EndpointsGetExposureOutput struct { - NumItems int `json:"numItems"` - Version string `json:"version"` - Windows []ModelsDependencyWindow `json:"windows,omitempty"` +type EndpointsListInfrastructureGraphsOutput struct { + Count int `json:"count"` + Graphs []EndpointsInfrastructureGraphSummary `json:"graphs,omitempty"` + Version *string `json:"version,omitempty"` } -type EndpointsGetLatestCloudReconScanOutput struct { - Scan *EndpointsCloudReconScanMetadataDTO `json:"scan,omitempty"` +type EndpointsListK8SCollectorClustersOutput struct { + Clusters []EndpointsK8SCollectorClusterView `json:"clusters,omitempty"` + Version string `json:"version"` } -type EndpointsGetLatestSBOMsOutput struct { - Sboms []ModelsCDXGenAtCommit `json:"sboms,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsListLoadBalancerAssetsOutput struct { + Assets []EndpointsLoadBalancerAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetMemoriesByTypeOutput struct { - Count int32 `json:"count"` - Memories []ModelsMemory `json:"memories,omitempty"` - PaginationToken *string `json:"paginationToken,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsListMessagingAssetsOutput struct { + Assets []EndpointsMessagingAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetMemoriesOutput struct { - Count int `json:"count"` - Memories []ModelsMemory `json:"memories,omitempty"` +type EndpointsListNetworkAssetsOutput struct { + Assets []EndpointsNetworkAssetView `json:"assets,omitempty"` NextToken *string `json:"nextToken,omitempty"` - Version *string `json:"version,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetMemoryOutput struct { - Memory *ModelsMemory `json:"memory,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsListObservabilityAssetsOutput struct { + Assets []EndpointsObservabilityAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetMemoryVersionsOutput struct { - Count int32 `json:"count"` - Version *string `json:"version,omitempty"` - Versions []ModelsMemory `json:"versions,omitempty"` +type EndpointsListPipelinesAssetsOutput struct { + Assets []EndpointsPipelinesAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetOrganizationOutput struct { - Organization *ModelsOrgContext `json:"organization,omitempty"` +type EndpointsListPipelinesOutput struct { + NextToken *string `json:"nextToken,omitempty"` + Pipelines []EndpointsPipelineSummary `json:"pipelines,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsGetPipelineOutput struct { - Pipeline EndpointsPipelineSummary `json:"pipeline"` - Version *string `json:"version,omitempty"` +type EndpointsListProjectExecutionRecipeValidationsOutput struct { + Limit int `json:"limit"` + Offset int `json:"offset"` + Validations []ModelsExecutionRecipeValidation `json:"validations,omitempty"` } -type EndpointsGetProjectActiveDepsOutput struct { - Dependencies []ModelsDependencyOccurrence `json:"dependencies,omitempty"` - NumItems int `json:"numItems"` - Version string `json:"version"` +type EndpointsListProjectExecutionRecipeVersionsOutput struct { + Limit int `json:"limit"` + Offset int `json:"offset"` + Versions []ModelsExecutionRecipe `json:"versions,omitempty"` } -type EndpointsGetProjectExposureOutput struct { - NumItems int `json:"numItems"` +type EndpointsListProjectsAssetsOutput struct { + Assets []EndpointsProjectsAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` Version string `json:"version"` - Windows []ModelsDependencyWindow `json:"windows,omitempty"` } -type EndpointsGetProjectOutput struct { - Project *ModelsContextProject `json:"project,omitempty"` +type EndpointsListRepoScansOutput struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Scans []EndpointsRepoScanSummary `json:"scans,omitempty"` + Total int `json:"total"` Version *string `json:"version,omitempty"` } -type EndpointsGetProjectSchemaMetadataOutput struct { - DownloadURL string `json:"downloadUrl"` - Format ModelsSchemaFormat `json:"format"` - NumEndpoints int `json:"numEndpoints"` - Size int `json:"size"` - Type ModelsSchemaType `json:"type"` - Version *string `json:"version,omitempty"` +type EndpointsListReposAssetsOutput struct { + Assets []EndpointsReposAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetProjectSchemaOutput struct { - Format ModelsSchemaFormat `json:"format"` - Schema string `json:"schema"` - Type ModelsSchemaType `json:"type"` +type EndpointsListRepositoryProjectsOutput struct { + NextToken *string `json:"nextToken,omitempty"` + Projects []ModelsProjectSummary `json:"projects,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsGetProjectSchemaRawOutput struct { - ContentType *string `json:"contentType,omitempty"` - DownloadURL *string `json:"downloadUrl,omitempty"` - FileName *string `json:"fileName,omitempty"` +type EndpointsListSchemasOutput struct { + Schemas []EndpointsSchemaSummary `json:"schemas,omitempty"` + Version *string `json:"version,omitempty"` } -type EndpointsGetPublicFacingAssetsOutput struct { - Assets []EndpointsPublicAsset `json:"assets,omitempty"` +type EndpointsListSecurityAssetsOutput struct { + Assets []EndpointsSecurityAssetView `json:"assets,omitempty"` NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetRepoScanOutput struct { - Scan EndpointsRepoScanSummary `json:"scan"` - Version *string `json:"version,omitempty"` +type EndpointsListServerlessAssetsOutput struct { + Assets []EndpointsServerlessAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetReportStatusOutput struct { - Error *string `json:"error,omitempty"` - Status *string `json:"status,omitempty"` - URL *string `json:"url,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsListStorageAndBackupAssetsOutput struct { + Assets []EndpointsStorageAndBackupAssetView `json:"assets,omitempty"` + NextToken *string `json:"nextToken,omitempty"` + Total int `json:"total"` + Version string `json:"version"` } -type EndpointsGetRepositoriesOutput struct { - NextToken string `json:"nextToken"` - NumItems int `json:"numItems"` - Repositories []RepocontextRepoContext `json:"repositories,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsLoadBalancerAssetDetailsView struct { + AwsAlb *EndpointsAWSALBDetailsView `json:"awsAlb,omitempty"` + AwsClb *EndpointsAWSCLBDetailsView `json:"awsClb,omitempty"` + AwsNlb *EndpointsAWSNLBDetailsView `json:"awsNlb,omitempty"` + AwsTargetGroup *EndpointsAWSTargetGroupDetailsView `json:"awsTargetGroup,omitempty"` + AzureAppGateway *EndpointsAzureAppGatewayDetailsView `json:"azureAppGateway,omitempty"` + GcpLb *EndpointsGCPLBDetailsView `json:"gcpLb,omitempty"` + K8sIngress *EndpointsK8SIngressDetailsView `json:"k8sIngress,omitempty"` + K8sService *EndpointsK8SServiceDetailsView `json:"k8sService,omitempty"` + SubType ModelsLoadBalancerSubType `json:"subType"` } -type EndpointsGetRepositoryOutput struct { - Repository RepocontextRepoContext `json:"repository"` - Version *string `json:"version,omitempty"` +type EndpointsLoadBalancerAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + DnsName *string `json:"dnsName,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + HealthyTargetCount *int `json:"healthyTargetCount,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + LbType *string `json:"lbType,omitempty"` + ListenerCount *int `json:"listenerCount,omitempty"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + Scheme *string `json:"scheme,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsLoadBalancerSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` + TargetCount *int `json:"targetCount,omitempty"` + TlsPolicy *string `json:"tlsPolicy,omitempty"` + WafAttached *bool `json:"wafAttached,omitempty"` } -type EndpointsGetSBOMSOutput struct { - Sboms []ModelsCDXGenAtCommit `json:"sboms,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsMavenDetailsView struct { } -type EndpointsGetSBOMTreeOutput struct { - Repositories []ModelsSBOMRepository `json:"repositories,omitempty"` - TenantID string `json:"tenantId"` - TenantName *string `json:"tenantName,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsMemoryFinding struct { + Cited bool `json:"cited"` + FindingType string `json:"findingType"` + ID string `json:"id"` + Repository *string `json:"repository,omitempty"` + Severity string `json:"severity"` + Status string `json:"status"` + Title string `json:"title"` } -type EndpointsGetVaultFileOutput struct { +type EndpointsMemoryVersion struct { + ChangeReason string `json:"changeReason"` + ChangedBy *string `json:"changedBy,omitempty"` CreatedAt string `json:"createdAt"` - DocumentID *string `json:"documentId,omitempty"` - FileID string `json:"fileId"` - FileName string `json:"fileName"` - FilePresignedURL string `json:"filePresignedUrl"` - UploaderID string `json:"uploaderId"` - UploaderUsername string `json:"uploaderUsername"` - Version *string `json:"version,omitempty"` + Memory ModelsMemory `json:"memory"` + Status ModelsMemoryStatus `json:"status"` + Version int `json:"version"` +} + +type EndpointsMessagingAssetDetailsView struct { + AwsEventBridge *EndpointsAWSEventBridgeDetailsView `json:"awsEventBridge,omitempty"` + AwsKinesis *EndpointsAWSKinesisDetailsView `json:"awsKinesis,omitempty"` + AwsMq *EndpointsAWSMQDetailsView `json:"awsMq,omitempty"` + AwsMsk *EndpointsAWSMSKDetailsView `json:"awsMsk,omitempty"` + AwsSes *EndpointsAWSSESDetailsView `json:"awsSes,omitempty"` + AwsSns *EndpointsAWSSNSDetailsView `json:"awsSns,omitempty"` + AwsSqs *EndpointsAWSSQSDetailsView `json:"awsSqs,omitempty"` + AzureEventGrid *EndpointsAzureEventGridDetailsView `json:"azureEventGrid,omitempty"` + AzureEventHub *EndpointsAzureEventHubDetailsView `json:"azureEventHub,omitempty"` + AzureIotHub *EndpointsAzureIotHubDetailsView `json:"azureIotHub,omitempty"` + AzureServiceBus *EndpointsAzureServiceBusDetailsView `json:"azureServiceBus,omitempty"` + GcpPubSub *EndpointsGCPPubSubDetailsView `json:"gcpPubSub,omitempty"` + SubType ModelsMessagingSubType `json:"subType"` +} + +type EndpointsMessagingAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + DlqConfigured *bool `json:"dlqConfigured,omitempty"` + EncryptionKmsKeyID *string `json:"encryptionKmsKeyId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + Kind *string `json:"kind,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + MessageRetentionS *int `json:"messageRetentionS,omitempty"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + PubliclyAccessible *bool `json:"publiclyAccessible,omitempty"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsMessagingSubType `json:"subType"` + SubscriberCount *int `json:"subscriberCount,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + ThroughputOrShardCount *int `json:"throughputOrShardCount,omitempty"` } -type EndpointsGetVaultFilesListOutput struct { - Files []EndpointsVaultFileSimple `json:"files,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsNPMPackageDetailsView struct { } -type EndpointsGetVaultFilesOutput struct { - Files []EndpointsVaultFile `json:"files,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsNPMRegistryDetailsView struct { } -type EndpointsListArtifactDeploymentsOutput struct { - Deployments []EndpointsArtifactDeploymentSummary `json:"deployments,omitempty"` - NextToken *string `json:"nextToken,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsNetworkAssetDetailsView struct { + AwsEip *EndpointsAWSEIPDetailsView `json:"awsEip,omitempty"` + AwsInternetGateway *EndpointsAWSInternetGatewayDetailsView `json:"awsInternetGateway,omitempty"` + AwsNatGateway *EndpointsAWSNATGatewayDetailsView `json:"awsNatGateway,omitempty"` + AwsRouteTable *EndpointsAWSRouteTableDetailsView `json:"awsRouteTable,omitempty"` + AwsSubnet *EndpointsAWSSubnetDetailsView `json:"awsSubnet,omitempty"` + AwsVpc *EndpointsAWSVPCDetailsView `json:"awsVpc,omitempty"` + AwsVpcEndpoint *EndpointsAWSVPCEndpointDetailsView `json:"awsVpcEndpoint,omitempty"` + AzureSubnet *EndpointsAzureSubnetDetailsView `json:"azureSubnet,omitempty"` + AzureVnet *EndpointsAzureVNetDetailsView `json:"azureVnet,omitempty"` + GcpCloudNat *EndpointsGCPCloudNATDetailsView `json:"gcpCloudNat,omitempty"` + GcpVpc *EndpointsGCPVPCDetailsView `json:"gcpVpc,omitempty"` + SubType ModelsNetworkSubType `json:"subType"` } -type EndpointsListArtifactsOutput struct { - Artifacts []EndpointsArtifactSummary `json:"artifacts,omitempty"` - NextToken *string `json:"nextToken,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsNetworkAssetView struct { + AccountID *string `json:"accountId,omitempty"` + AttachedGatewayIds []string `json:"attachedGatewayIds,omitempty"` + CidrBlock *string `json:"cidrBlock,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + DnsHostnamesEnabled *bool `json:"dnsHostnamesEnabled,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + FlowLogsEnabled *bool `json:"flowLogsEnabled,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsDefault *bool `json:"isDefault,omitempty"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + IsPublicSubnet *bool `json:"isPublicSubnet,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + PeeringCount *int `json:"peeringCount,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + RouteTableID *string `json:"routeTableId,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsNetworkSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` } -type EndpointsListEntrypointsOutput struct { - Entrypoints []EndpointsEntrypointSummary `json:"entrypoints,omitempty"` - NextToken *string `json:"nextToken,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsNuGetDetailsView struct { } -type EndpointsListPipelinesOutput struct { - NextToken *string `json:"nextToken,omitempty"` - Pipelines []EndpointsPipelineSummary `json:"pipelines,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsObservabilityAssetDetailsView struct { + AwsCloudWatchAlarm *EndpointsAWSCloudWatchAlarmDetailsView `json:"awsCloudWatchAlarm,omitempty"` + AwsCloudWatchDashboard *EndpointsAWSCloudWatchDashboardDetailsView `json:"awsCloudWatchDashboard,omitempty"` + AwsCloudWatchLogGroup *EndpointsAWSCloudWatchLogGroupDetailsView `json:"awsCloudWatchLogGroup,omitempty"` + AwsXRay *EndpointsAWSXRayDetailsView `json:"awsXRay,omitempty"` + AzureAutomation *EndpointsAzureAutomationDetailsView `json:"azureAutomation,omitempty"` + AzureMonitor *EndpointsAzureMonitorDetailsView `json:"azureMonitor,omitempty"` + GcpLogging *EndpointsGCPLoggingDetailsView `json:"gcpLogging,omitempty"` + GcpStackdriver *EndpointsGCPStackdriverDetailsView `json:"gcpStackdriver,omitempty"` + SubType ModelsObservabilitySubType `json:"subType"` } -type EndpointsListRepoScansOutput struct { - Page int `json:"page"` - PageSize int `json:"pageSize"` - Scans []EndpointsRepoScanSummary `json:"scans,omitempty"` - Total int `json:"total"` - Version *string `json:"version,omitempty"` +type EndpointsObservabilityAssetView struct { + AccountID *string `json:"accountId,omitempty"` + AlarmState *string `json:"alarmState,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + Destination *string `json:"destination,omitempty"` + EncryptionKmsKeyID *string `json:"encryptionKmsKeyId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IngestionBytes30d *int64 `json:"ingestionBytes30d,omitempty"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + Kind *string `json:"kind,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + RetentionDays *int `json:"retentionDays,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsObservabilitySubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` } -type EndpointsListRepositoryProjectsOutput struct { - NextToken *string `json:"nextToken,omitempty"` - Projects []ModelsProjectSummary `json:"projects,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsOtherArtifactDetailsView struct { } -type EndpointsListSchemasOutput struct { - Schemas []EndpointsSchemaSummary `json:"schemas,omitempty"` - Version *string `json:"version,omitempty"` +type EndpointsOtherRegistryDetailsView struct { } type EndpointsPackageFilter struct { @@ -537,8 +3335,27 @@ type EndpointsPackageFilter struct { Version string `json:"version"` } +type EndpointsPatchAssetFlagsInput struct { + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` +} + +type EndpointsPatchAssetFlagsOutput struct { + Success bool `json:"success"` + Version string `json:"version"` +} + +type EndpointsPatchAssetTagsInput struct { + Tags map[string]string `json:"tags,omitempty"` +} + +type EndpointsPatchAssetTagsOutput struct { + Success bool `json:"success"` + Version string `json:"version"` +} + type EndpointsPatchContextApplicationInput struct { - Application ModelsAppContextSeed `json:"application"` + Application ModelsAgentAppContextSeed `json:"application"` } type EndpointsPatchContextApplicationOutput struct { @@ -551,11 +3368,11 @@ type EndpointsPatchMemoryInput struct { Citations []ModelsMemoryCitationsElem `json:"citations,omitempty"` Confidence *float64 `json:"confidence,omitempty"` Content *string `json:"content,omitempty"` - CreateNewVersion *bool `json:"createNewVersion,omitempty"` CrossReferences []ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` Metadata *ModelsMemoryMetadata `json:"metadata,omitempty"` ParentNoteID *string `json:"parentNoteId,omitempty"` Priority *ModelsMemoryPriority `json:"priority,omitempty"` + SupersedesMemoryID *string `json:"supersedesMemoryId,omitempty"` Tags []string `json:"tags,omitempty"` Title *string `json:"title,omitempty"` } @@ -629,6 +3446,42 @@ type EndpointsPipelineTriggerSummary struct { Type *string `json:"type,omitempty"` } +type EndpointsPipelinesAssetDetailsView struct { + AzurePipelines *EndpointsAzurePipelinesDetailsView `json:"azurePipelines,omitempty"` + Buildkite *EndpointsBuildkiteDetailsView `json:"buildkite,omitempty"` + Circleci *EndpointsCircleCIDetailsView `json:"circleci,omitempty"` + GithubActions *EndpointsGitHubActionsDetailsView `json:"githubActions,omitempty"` + GitlabCi *EndpointsGitLabCIDetailsView `json:"gitlabCi,omitempty"` + Jenkins *EndpointsJenkinsDetailsView `json:"jenkins,omitempty"` + SubType ModelsPipelinesSubType `json:"subType"` +} + +type EndpointsPipelinesAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FilePath *string `json:"filePath,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + Platform *string `json:"platform,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + RepoID *string `json:"repoId,omitempty"` + RunsOnPr *bool `json:"runsOnPr,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsPipelinesSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + type EndpointsPostCloudReconScanInput struct { AccountID string `json:"accountId"` CompletedAt *string `json:"completedAt,omitempty"` @@ -659,20 +3512,30 @@ type EndpointsPostContextApplicationOutput struct { } type EndpointsPostMemoryInput struct { + Anchors []string `json:"anchors,omitempty"` Citations []ModelsMemoryCitationsElem `json:"citations,omitempty"` + CommentIds []string `json:"commentIds,omitempty"` Confidence *float64 `json:"confidence,omitempty"` Content string `json:"content"` CreatedBy *string `json:"createdBy,omitempty"` CrossReferences []ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` + EventTime *string `json:"eventTime,omitempty"` IsUserCreated *bool `json:"isUserCreated,omitempty"` + MemoryClass *ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryID *string `json:"memoryId,omitempty"` MemoryType ModelsMemoryMemoryType `json:"memoryType"` Metadata *ModelsMemoryMetadata `json:"metadata,omitempty"` ParentNoteID *string `json:"parentNoteId,omitempty"` Priority *ModelsMemoryPriority `json:"priority,omitempty"` + PromptVersion *string `json:"promptVersion,omitempty"` ResourceID *string `json:"resourceId,omitempty"` ResourceType *ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *ModelsMemoryScope `json:"scope,omitempty"` + SourceEvent *string `json:"sourceEvent,omitempty"` + SupersedesMemoryID *string `json:"supersedesMemoryId,omitempty"` Tags []string `json:"tags,omitempty"` Title *string `json:"title,omitempty"` + TrustTier *int `json:"trustTier,omitempty"` } type EndpointsPostMemoryOutput struct { @@ -691,6 +3554,10 @@ type EndpointsPostProjectSchemaOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsPostRAGResyncInput struct { + ConfluenceOnly *bool `json:"confluenceOnly,omitempty"` +} + type EndpointsPostRAGResyncOutput struct { Message string `json:"message"` Success bool `json:"success"` @@ -714,18 +3581,22 @@ type EndpointsPostSBOMGenerateInput struct { } type EndpointsPostSBOMGenerateOutput struct { + CommitSha *string `json:"commitSha,omitempty"` + ExecutionArn *string `json:"executionArn,omitempty"` RepositoryID *string `json:"repositoryId,omitempty"` Status *string `json:"status,omitempty"` Version *string `json:"version,omitempty"` } type EndpointsPostSBOMResolveInput struct { + BaselineOnly *bool `json:"baselineOnly,omitempty"` Branch *string `json:"branch,omitempty"` CdxgenMajor *int `json:"cdxgenMajor,omitempty"` CloneURL *string `json:"cloneURL,omitempty"` CommitSHA *string `json:"commitSHA,omitempty"` IsDefaultBranchPush *bool `json:"isDefaultBranchPush,omitempty"` LockfileSetHash *string `json:"lockfileSetHash,omitempty"` + ManifestOnly *bool `json:"manifestOnly,omitempty"` OwnerProvider *ModelsOwnerProvider `json:"ownerProvider,omitempty"` RepositoryID *string `json:"repositoryID,omitempty"` RepositoryProvider *ModelsGitRepositoryProvider `json:"repositoryProvider,omitempty"` @@ -736,10 +3607,37 @@ type EndpointsPostSBOMResolveInput struct { type EndpointsPostSBOMResolveOutput struct { Components *int `json:"components,omitempty"` + CoverageRegression *bool `json:"coverageRegression,omitempty"` + Exclusions []ModelsSBOMScope `json:"exclusions,omitempty"` + FailedEcosystems []string `json:"failedEcosystems,omitempty"` + FailureClass *string `json:"failureClass,omitempty"` + FailureReason *string `json:"failureReason,omitempty"` + Incomplete *bool `json:"incomplete,omitempty"` + IncompleteScopes []ModelsSBOMScope `json:"incompleteScopes,omitempty"` + PackageAuth []ModelsSBOMPackageAuth `json:"packageAuth,omitempty"` SbomS3Key *string `json:"sbomS3Key,omitempty"` + SbomSha256 *string `json:"sbomSha256,omitempty"` + SbomSizeBytes *int64 `json:"sbomSizeBytes,omitempty"` + SbomURL *string `json:"sbomUrl,omitempty"` + ScanScope *ModelsPathScope `json:"scanScope,omitempty"` Source *string `json:"source,omitempty"` } +type EndpointsPostSBOMRunInput struct { + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + RepositoryID string `json:"repositoryId"` +} + +type EndpointsPostSBOMRunOutput struct { + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + ExecutionArn string `json:"executionArn"` + RepositoryID string `json:"repositoryId"` + RunID string `json:"runId"` + Version *string `json:"version,omitempty"` +} + type EndpointsPostSBOMScanInput struct { CommitSha string `json:"commitSha"` ForceRegenerate *bool `json:"forceRegenerate,omitempty"` @@ -757,6 +3655,7 @@ type EndpointsPostSBOMScanOutput struct { type EndpointsPostVaultFileInput struct { Description *string `json:"description,omitempty"` FileName string `json:"fileName"` + Size *int64 `json:"size,omitempty"` } type EndpointsPostVaultFileOutput struct { @@ -768,118 +3667,547 @@ type EndpointsPostVaultFileOutput struct { Version *string `json:"version,omitempty"` } -type EndpointsPostVaultOnboardInput struct { - FileIDs []string `json:"fileIDs,omitempty"` +type EndpointsPostVaultIndexInput struct { + FileIDs []string `json:"fileIDs,omitempty"` +} + +type EndpointsPostVaultIndexOutput struct { + Message string `json:"message"` + Success bool `json:"success"` +} + +type EndpointsPostVaultOnboardInput struct { + FileIDs []string `json:"fileIDs,omitempty"` + RunID *string `json:"runId,omitempty"` +} + +type EndpointsPostVaultOnboardOutput struct { + Message string `json:"message"` + RunID *string `json:"runId,omitempty"` + Success bool `json:"success"` +} + +type EndpointsProjectWithoutLockfile struct { + Ecosystem *string `json:"ecosystem,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + RepositoryName *string `json:"repositoryName,omitempty"` +} + +type EndpointsProjectsAssetDetailsView struct { + RepoContextProject *EndpointsRepoContextProjectDetailsView `json:"repoContextProject,omitempty"` + SubType ModelsProjectsSubType `json:"subType"` +} + +type EndpointsProjectsAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + Framework *string `json:"framework,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + Languages []string `json:"languages,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + OwnerTeam *string `json:"ownerTeam,omitempty"` + PathPrefix *string `json:"pathPrefix,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + RepoID *string `json:"repoId,omitempty"` + SecurityImportance *RepocontextProjectContextSecurityImportance `json:"securityImportance,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsProjectsSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + +type EndpointsProviderScanStatus struct { + CompletedAt *string `json:"completedAt,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Provider string `json:"provider"` + StartedAt *string `json:"startedAt,omitempty"` + Status string `json:"status"` +} + +type EndpointsPyPIDetailsView struct { +} + +type EndpointsReachabilityPathDTO struct { + Depth int32 `json:"depth"` + NodeIds []string `json:"nodeIds,omitempty"` +} + +type EndpointsRebuildApplicationsInput struct { + Force bool `json:"force"` + ProviderOwnerID string `json:"providerOwnerId"` +} + +type EndpointsRebuildApplicationsOutput struct { + RunID *string `json:"runId,omitempty"` + Status string `json:"status"` + Version *string `json:"version,omitempty"` +} + +type EndpointsRepoContextProjectDetailsView struct { +} + +type EndpointsRepoScanProjectTouched struct { + Path string `json:"path"` + ProjectID string `json:"projectId"` +} + +type EndpointsRepoScanSBOMGenerated struct { + Ecosystem string `json:"ecosystem"` + ProjectID string `json:"projectId"` + S3Key string `json:"s3Key"` +} + +type EndpointsRepoScanSubagent struct { + CompletedAt *string `json:"completedAt,omitempty"` + DurationMs *int `json:"durationMs,omitempty"` + Error *string `json:"error,omitempty"` + Ran *bool `json:"ran,omitempty"` + Reused *bool `json:"reused,omitempty"` + SkipReason *string `json:"skipReason,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status *string `json:"status,omitempty"` +} + +type EndpointsRepoScanSummary struct { + BaseContextVersion *string `json:"baseContextVersion,omitempty"` + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + CompletedAt *string `json:"completedAt,omitempty"` + ContextVersion *string `json:"contextVersion,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + ExecutionArn *string `json:"executionArn,omitempty"` + ID string `json:"id"` + ProjectsTouched []EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` + PublishedAsLatest *bool `json:"publishedAsLatest,omitempty"` + RepositoryID string `json:"repositoryId"` + SbomsGenerated []EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` + ScopePathPrefixes []string `json:"scopePathPrefixes,omitempty"` + Source *string `json:"source,omitempty"` + StartedAt string `json:"startedAt"` + Status string `json:"status"` + SubagentAllowlist []string `json:"subagentAllowlist,omitempty"` + SubagentsRun map[string]EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` + UpdatedAt string `json:"updatedAt"` +} + +type EndpointsReposAssetDetailsView struct { + AzureRepo *EndpointsAzureRepoDetailsView `json:"azureRepo,omitempty"` + BitbucketRepo *EndpointsBitbucketRepoDetailsView `json:"bitbucketRepo,omitempty"` + GithubRepo *EndpointsGitHubRepoDetailsView `json:"githubRepo,omitempty"` + GitlabRepo *EndpointsGitLabRepoDetailsView `json:"gitlabRepo,omitempty"` + SubType ModelsReposSubType `json:"subType"` +} + +type EndpointsReposAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + HeadSha *string `json:"headSha,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublic *bool `json:"isPublic,omitempty"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsReposSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` +} + +type EndpointsRepositoryWithoutLockfile struct { + DepCount *int64 `json:"depCount,omitempty"` + Ecosystems []string `json:"ecosystems,omitempty"` + ProjectCount *int64 `json:"projectCount,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + RepositoryName *string `json:"repositoryName,omitempty"` +} + +type EndpointsRetractMemoryInput struct { + Reason string `json:"reason"` + RetractedBy *string `json:"retractedBy,omitempty"` +} + +type EndpointsRetractMemoryOutput struct { + Memory *ModelsMemory `json:"memory,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsRubyGemsDetailsView struct { +} + +type EndpointsRunStatus struct { + CompletedAt *string `json:"completedAt,omitempty"` + Error *string `json:"error,omitempty"` + RunID string `json:"runId"` + StartedAt *string `json:"startedAt,omitempty"` + State EndpointsRunState `json:"state"` + Terminal *bool `json:"terminal,omitempty"` +} + +type EndpointsSBOMIngestReplayInput struct { + GlobalReplay *bool `json:"globalReplay,omitempty"` + ProjectID *string `json:"projectID,omitempty"` + RepositoryID *string `json:"repositoryID,omitempty"` +} + +type EndpointsSBOMIngestReplayOutput struct { + Message *string `json:"message,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsSchemaProvenance struct { + ExecutionMode *string `json:"executionMode,omitempty"` + MethodUnknownOperations *int `json:"methodUnknownOperations,omitempty"` + Partial *bool `json:"partial,omitempty"` + Unconfirmed *bool `json:"unconfirmed,omitempty"` + UnverifiedOperations *int `json:"unverifiedOperations,omitempty"` + VerifiedAgainstCode *bool `json:"verifiedAgainstCode,omitempty"` +} + +type EndpointsSchemaSummary struct { + DownloadURL *string `json:"downloadUrl,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Provenance *EndpointsSchemaProvenance `json:"provenance,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + SchemaFormat *ModelsSchemaFormat `json:"schemaFormat,omitempty"` + SchemaType *ModelsSchemaType `json:"schemaType,omitempty"` + Size *int `json:"size,omitempty"` +} + +type EndpointsSearchMemoriesInput struct { + Anchors []string `json:"anchors,omitempty"` + IncludeOrgWide *bool `json:"includeOrgWide,omitempty"` + Limit *int `json:"limit,omitempty"` + MemoryClass *ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` + MemoryTypes []ModelsMemoryMemoryType `json:"memoryTypes,omitempty"` + MinTrustTier *int `json:"minTrustTier,omitempty"` + Query string `json:"query"` + ResourceType *ModelsMemoryResourceType `json:"resourceType,omitempty"` + Scope *ModelsMemoryScope `json:"scope,omitempty"` +} + +type EndpointsSearchMemoriesOutput struct { + Count int `json:"count"` + Results []EndpointsSearchMemoryResult `json:"results,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsSearchMemoryResult struct { + Memory ModelsMemory `json:"memory"` + Score float64 `json:"score"` } -type EndpointsPostVaultOnboardOutput struct { - Message string `json:"message"` - Success bool `json:"success"` +type EndpointsSearchVaultInput struct { + DocTypes []string `json:"docTypes,omitempty"` + DocumentIds []string `json:"documentIds,omitempty"` + Limit *int `json:"limit,omitempty"` + Query string `json:"query"` } -type EndpointsProjectWithoutLockfile struct { - Ecosystem *string `json:"ecosystem,omitempty"` - ProjectID *string `json:"projectId,omitempty"` - ProjectName *string `json:"projectName,omitempty"` - RepositoryID *string `json:"repositoryId,omitempty"` - RepositoryName *string `json:"repositoryName,omitempty"` +type EndpointsSearchVaultOutput struct { + Count int `json:"count"` + Results []EndpointsVaultSearchResult `json:"results,omitempty"` + Version *string `json:"version,omitempty"` } -type EndpointsProviderScanStatus struct { - CompletedAt *string `json:"completedAt,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - Provider string `json:"provider"` - StartedAt *string `json:"startedAt,omitempty"` - Status string `json:"status"` +type EndpointsSecurityAssetDetailsView struct { + AwsAcm *EndpointsAWSACMDetailsView `json:"awsAcm,omitempty"` + AwsCloudTrail *EndpointsAWSCloudTrailDetailsView `json:"awsCloudTrail,omitempty"` + AwsConfig *EndpointsAWSConfigDetailsView `json:"awsConfig,omitempty"` + AwsGuardDuty *EndpointsAWSGuardDutyDetailsView `json:"awsGuardDuty,omitempty"` + AwsKms *EndpointsAWSKMSDetailsView `json:"awsKms,omitempty"` + AwsNacl *EndpointsAWSNACLDetailsView `json:"awsNacl,omitempty"` + AwsSecretsManager *EndpointsAWSSecretsManagerDetailsView `json:"awsSecretsManager,omitempty"` + AwsSecurityGroup *EndpointsAWSSecurityGroupDetailsView `json:"awsSecurityGroup,omitempty"` + AwsSsm *EndpointsAWSSSMDetailsView `json:"awsSsm,omitempty"` + AwsWaf *EndpointsAWSWAFDetailsView `json:"awsWaf,omitempty"` + AzureDefender *EndpointsAzureDefenderDetailsView `json:"azureDefender,omitempty"` + AzureKeyVault *EndpointsAzureKeyVaultDetailsView `json:"azureKeyVault,omitempty"` + AzureNsg *EndpointsAzureNSGDetailsView `json:"azureNsg,omitempty"` + AzurePolicy *EndpointsAzurePolicyDetailsView `json:"azurePolicy,omitempty"` + GcpKms *EndpointsGCPKMSDetailsView `json:"gcpKms,omitempty"` + GcpOrgPolicy *EndpointsGCPOrgPolicyDetailsView `json:"gcpOrgPolicy,omitempty"` + GcpPolicyAnalyzer *EndpointsGCPPolicyAnalyzerDetailsView `json:"gcpPolicyAnalyzer,omitempty"` + GcpSecretManager *EndpointsGCPSecretManagerDetailsView `json:"gcpSecretManager,omitempty"` + GcpSecurityCommandCtr *EndpointsGCPSecurityCommandCtrDetailsView `json:"gcpSecurityCommandCtr,omitempty"` + SubType ModelsSecuritySubType `json:"subType"` +} + +type EndpointsSecurityAssetView struct { + AccountID *string `json:"accountId,omitempty"` + AllowsWorldIngress *bool `json:"allowsWorldIngress,omitempty"` + ControlKind *string `json:"controlKind,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExpiresAt *string `json:"expiresAt,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FindingsCountOpen *int `json:"findingsCountOpen,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + RotationEnabled *bool `json:"rotationEnabled,omitempty"` + RuleCount *int `json:"ruleCount,omitempty"` + ScopeRef *string `json:"scopeRef,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsSecuritySubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` } -type EndpointsPublicAsset struct { - AccountID string `json:"accountId"` - AssetID string `json:"assetId"` - CloudProvider string `json:"cloudProvider"` - DnsNames []string `json:"dnsNames,omitempty"` +type EndpointsServerlessAssetDetailsView struct { + AwsAppRunner *EndpointsAWSAppRunnerDetailsView `json:"awsAppRunner,omitempty"` + AwsLambda *EndpointsAWSLambdaDetailsView `json:"awsLambda,omitempty"` + AwsStepFunction *EndpointsAWSStepFunctionDetailsView `json:"awsStepFunction,omitempty"` + AzureFunction *EndpointsAzureFunctionDetailsView `json:"azureFunction,omitempty"` + AzureLogicApps *EndpointsAzureLogicAppsDetailsView `json:"azureLogicApps,omitempty"` + GcpAppEngine *EndpointsGCPAppEngineDetailsView `json:"gcpAppEngine,omitempty"` + GcpCloudFunction *EndpointsGCPCloudFunctionDetailsView `json:"gcpCloudFunction,omitempty"` + GcpCloudRun *EndpointsGCPCloudRunDetailsView `json:"gcpCloudRun,omitempty"` + SubType ModelsServerlessSubType `json:"subType"` +} + +type EndpointsServerlessAssetView struct { + AccountID *string `json:"accountId,omitempty"` + CodeSigningEnabled *bool `json:"codeSigningEnabled,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + Handler *string `json:"handler,omitempty"` + IamRoleArn *string `json:"iamRoleArn,omitempty"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` IsPublicFacing bool `json:"isPublicFacing"` - LastSeenAt *string `json:"lastSeenAt,omitempty"` - PublicIps []string `json:"publicIps,omitempty"` + LastInvocationAt *string `json:"lastInvocationAt,omitempty"` + LastSeenAt string `json:"lastSeenAt"` + MemoryMb *int `json:"memoryMb,omitempty"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` Region *string `json:"region,omitempty"` - ResourceID string `json:"resourceId"` - ResourceType string `json:"resourceType"` + Runtime *string `json:"runtime,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsServerlessSubType `json:"subType"` Tags map[string]string `json:"tags,omitempty"` - TenantID string `json:"tenantId"` + TimeoutS *int `json:"timeoutS,omitempty"` + TriggerSources []string `json:"triggerSources,omitempty"` + UrlEnabled *bool `json:"urlEnabled,omitempty"` + VpcAttached *bool `json:"vpcAttached,omitempty"` } -type EndpointsRebuildApplicationsInput struct { - Force bool `json:"force"` - ProviderOwnerID string `json:"providerOwnerId"` +type EndpointsSetupAssessmentBlocker struct { + Code string `json:"code"` + Message string `json:"message"` } -type EndpointsRebuildApplicationsOutput struct { +type EndpointsSetupAssessmentTarget struct { + AppliedTargetID *string `json:"appliedTargetId,omitempty"` + Confidence string `json:"confidence"` + Environment string `json:"environment"` + Evidence []EndpointsSetupRecommendationEvidence `json:"evidence,omitempty"` + Hostname string `json:"hostname"` + RecommendationID string `json:"recommendationId"` + RepositoryIds []string `json:"repositoryIds,omitempty"` Status string `json:"status"` - Version *string `json:"version,omitempty"` } -type EndpointsRepoScanProjectTouched struct { - Path string `json:"path"` - ProjectID string `json:"projectId"` +type EndpointsSetupAssessmentWebService struct { + ComponentName string `json:"componentName"` + ComponentType *string `json:"componentType,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID string `json:"repositoryId"` + RepositoryName string `json:"repositoryName"` } -type EndpointsRepoScanSBOMGenerated struct { - Ecosystem string `json:"ecosystem"` - ProjectID string `json:"projectId"` - S3Key string `json:"s3Key"` +type EndpointsSetupPentestAssessmentRecommendation struct { + ApplicationName string `json:"applicationName"` + AppliedApplicationID *string `json:"appliedApplicationId,omitempty"` + Blockers []EndpointsSetupAssessmentBlocker `json:"blockers,omitempty"` + Confidence string `json:"confidence"` + ContextApplicationID string `json:"contextApplicationId"` + CreatedAt string `json:"createdAt"` + DecidedAt *string `json:"decidedAt,omitempty"` + DecidedBy *string `json:"decidedBy,omitempty"` + ID string `json:"id"` + Status string `json:"status"` + Targets []EndpointsSetupAssessmentTarget `json:"targets,omitempty"` + UpdatedAt string `json:"updatedAt"` + WebServices []EndpointsSetupAssessmentWebService `json:"webServices,omitempty"` } -type EndpointsRepoScanSubagent struct { - CompletedAt *string `json:"completedAt,omitempty"` - DurationMs *int `json:"durationMs,omitempty"` - Error *string `json:"error,omitempty"` - Ran *bool `json:"ran,omitempty"` - StartedAt *string `json:"startedAt,omitempty"` - Status *string `json:"status,omitempty"` +type EndpointsSetupPentestAssessmentRecommendationsOutput struct { + Recommendations []EndpointsSetupPentestAssessmentRecommendation `json:"recommendations,omitempty"` } -type EndpointsRepoScanSummary struct { - Branch *string `json:"branch,omitempty"` - CommitSha string `json:"commitSha"` - CompletedAt *string `json:"completedAt,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` +type EndpointsSetupPentestTargetRecommendation struct { + AppliedTargetID *string `json:"appliedTargetId,omitempty"` + Confidence string `json:"confidence"` + CreatedAt string `json:"createdAt"` + DecidedAt *string `json:"decidedAt,omitempty"` + DecidedBy *string `json:"decidedBy,omitempty"` + Environment string `json:"environment"` + Evidence []EndpointsSetupRecommendationEvidence `json:"evidence,omitempty"` + Hostname string `json:"hostname"` ID string `json:"id"` - ProjectsTouched []EndpointsRepoScanProjectTouched `json:"projectsTouched,omitempty"` - RepositoryID string `json:"repositoryId"` - SbomsGenerated []EndpointsRepoScanSBOMGenerated `json:"sbomsGenerated,omitempty"` - StartedAt string `json:"startedAt"` Status string `json:"status"` - SubagentsRun map[string]EndpointsRepoScanSubagent `json:"subagentsRun,omitempty"` UpdatedAt string `json:"updatedAt"` } -type EndpointsRepositoryWithoutLockfile struct { - DepCount *int64 `json:"depCount,omitempty"` - Ecosystems []string `json:"ecosystems,omitempty"` - ProjectCount *int64 `json:"projectCount,omitempty"` - RepositoryID *string `json:"repositoryId,omitempty"` - RepositoryName *string `json:"repositoryName,omitempty"` +type EndpointsSetupPentestTargetRecommendationsOutput struct { + Recommendations []EndpointsSetupPentestTargetRecommendation `json:"recommendations,omitempty"` } -type EndpointsSBOMIngestReplayInput struct { - GlobalReplay *bool `json:"globalReplay,omitempty"` - ProjectID *string `json:"projectID,omitempty"` - RepositoryID *string `json:"repositoryID,omitempty"` +type EndpointsSetupRecommendationEvidence struct { + AccountID string `json:"accountId"` + Detail string `json:"detail"` + Reference string `json:"reference"` + Signal string `json:"signal"` + Source string `json:"source"` } -type EndpointsSBOMIngestReplayOutput struct { - Message *string `json:"message,omitempty"` +type EndpointsStartRepositoryExecutionRecipeDiscoveryInput struct { + Branch *string `json:"branch,omitempty"` + ProjectIds []string `json:"projectIds,omitempty"` +} + +type EndpointsStartRepositoryExecutionRecipeDiscoveryOutput struct { + AlreadyStarted *bool `json:"alreadyStarted,omitempty"` + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + ExecutionArn *string `json:"executionArn,omitempty"` + ExecutionName *string `json:"executionName,omitempty"` + Mode string `json:"mode"` + Queued []ModelsExecutionRecipeValidation `json:"queued,omitempty"` + Refused []ModelsExecutionRecipeDiscoveryRefusal `json:"refused,omitempty"` + RunID string `json:"runId"` +} + +type EndpointsStorageAndBackupAssetDetailsView struct { + AwsBackupVault *EndpointsAWSBackupVaultDetailsView `json:"awsBackupVault,omitempty"` + AwsEbsVolume *EndpointsAWSEBSVolumeDetailsView `json:"awsEbsVolume,omitempty"` + AwsEfs *EndpointsAWSEFSDetailsView `json:"awsEfs,omitempty"` + AwsS3Bucket *EndpointsAWSS3BucketDetailsView `json:"awsS3Bucket,omitempty"` + AwsStorageGateway *EndpointsAWSStorageGatewayDetailsView `json:"awsStorageGateway,omitempty"` + AzureBlob *EndpointsAzureBlobDetailsView `json:"azureBlob,omitempty"` + AzureDisk *EndpointsAzureDiskDetailsView `json:"azureDisk,omitempty"` + AzureFiles *EndpointsAzureFilesDetailsView `json:"azureFiles,omitempty"` + AzureStorageAccount *EndpointsAzureStorageAccountDetailsView `json:"azureStorageAccount,omitempty"` + GcpFilestore *EndpointsGCPFilestoreDetailsView `json:"gcpFilestore,omitempty"` + GcpGcsBucket *EndpointsGCPGCSBucketDetailsView `json:"gcpGcsBucket,omitempty"` + GcpPd *EndpointsGCPPDDetailsView `json:"gcpPd,omitempty"` + SubType ModelsStorageAndBackupSubType `json:"subType"` +} + +type EndpointsStorageAndBackupAssetView struct { + AccountID *string `json:"accountId,omitempty"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + EncryptionKmsKeyID *string `json:"encryptionKmsKeyId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + LifecyclePolicyPresent *bool `json:"lifecyclePolicyPresent,omitempty"` + Name string `json:"name"` + ObjectLockEnabled *bool `json:"objectLockEnabled,omitempty"` + Provider ModelsCloudProvider `json:"provider"` + PublicAccessBlockState *string `json:"publicAccessBlockState,omitempty"` + Region *string `json:"region,omitempty"` + ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` + RetentionDays *int `json:"retentionDays,omitempty"` + Role *string `json:"role,omitempty"` + SizeBytes *int64 `json:"sizeBytes,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType ModelsStorageAndBackupSubType `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` + VersioningEnabled *bool `json:"versioningEnabled,omitempty"` +} + +type EndpointsTriggerProjectSchemaInput struct { + Branch *string `json:"branch,omitempty"` +} + +type EndpointsTriggerProjectSchemaOutput struct { + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + ExecutionArn *string `json:"executionArn,omitempty"` + ProjectID string `json:"projectId"` + RepositoryID string `json:"repositoryId"` + RunID string `json:"runId"` Version *string `json:"version,omitempty"` } -type EndpointsSchemaSummary struct { - DownloadURL *string `json:"downloadUrl,omitempty"` - ProjectID *string `json:"projectId,omitempty"` - ProjectName *string `json:"projectName,omitempty"` - RepositoryID *string `json:"repositoryId,omitempty"` - SchemaFormat *string `json:"schemaFormat,omitempty"` - SchemaType *string `json:"schemaType,omitempty"` - Size *int `json:"size,omitempty"` +type EndpointsTriggerRepoContextInput struct { + Branch *string `json:"branch,omitempty"` + Force *bool `json:"force,omitempty"` + PathPrefixes []string `json:"pathPrefixes,omitempty"` + Subagents []string `json:"subagents,omitempty"` +} + +type EndpointsTriggerRepoContextOutput struct { + Branch *string `json:"branch,omitempty"` + CommitSha string `json:"commitSha"` + ExecutionArn *string `json:"executionArn,omitempty"` + RepositoryID string `json:"repositoryId"` + RunID string `json:"runId"` + Version *string `json:"version,omitempty"` +} + +type EndpointsUnifiedAssetView struct { + Links *EndpointsAssetLinks `json:"_links,omitempty"` + AccountID *string `json:"accountId,omitempty"` + Category ModelsAssetInventoryCategory `json:"category"` + DeletedAtScanID *string `json:"deletedAtScanId,omitempty"` + ExternalID *string `json:"externalId,omitempty"` + FirstFoundScanID string `json:"firstFoundScanId"` + FirstSeenAt string `json:"firstSeenAt"` + ID string `json:"id"` + IsActive bool `json:"isActive"` + IsInternetReachable bool `json:"isInternetReachable"` + IsPublicFacing bool `json:"isPublicFacing"` + LastSeenAt string `json:"lastSeenAt"` + Name string `json:"name"` + Provider ModelsCloudProvider `json:"provider"` + Region *string `json:"region,omitempty"` + SourceScanID string `json:"sourceScanId"` + SourceType ModelsEndpointSourceType `json:"sourceType"` + State *string `json:"state,omitempty"` + SubType string `json:"subType"` + Tags map[string]string `json:"tags,omitempty"` } type EndpointsUpdateOrganizationInput struct { @@ -911,6 +4239,7 @@ type EndpointsVaultFile struct { FileID string `json:"fileId"` FileName string `json:"fileName"` FilePresignedURL string `json:"filePresignedUrl"` + Indexed *bool `json:"indexed,omitempty"` UploaderID string `json:"uploaderId"` UploaderUsername string `json:"uploaderUsername"` } @@ -921,6 +4250,23 @@ type EndpointsVaultFileSimple struct { FileName string `json:"fileName"` } +type EndpointsVaultSearchResult struct { + Description *string `json:"description,omitempty"` + DocType *string `json:"docType,omitempty"` + DocumentID string `json:"documentId"` + EndLine *int `json:"endLine,omitempty"` + EndPage *int `json:"endPage,omitempty"` + FileName string `json:"fileName"` + NodeID string `json:"nodeId"` + Score float64 `json:"score"` + StartLine *int `json:"startLine,omitempty"` + StartPage *int `json:"startPage,omitempty"` + Text string `json:"text"` +} + +type EndpointsWheelDetailsView struct { +} + type GraphBuildArtifactRepositoryType string const ( @@ -969,6 +4315,7 @@ const ( GraphCodeArtifactTypeGraphqlApi GraphCodeArtifactType = "GRAPHQL_API" GraphCodeArtifactTypeIotFirmware GraphCodeArtifactType = "IOT_FIRMWARE" GraphCodeArtifactTypeMobileApp GraphCodeArtifactType = "MOBILE_APP" + GraphCodeArtifactTypeMvc GraphCodeArtifactType = "MVC" GraphCodeArtifactTypeOther GraphCodeArtifactType = "OTHER" GraphCodeArtifactTypePipelineNode GraphCodeArtifactType = "PIPELINE_NODE" GraphCodeArtifactTypePlugin GraphCodeArtifactType = "PLUGIN" @@ -981,6 +4328,133 @@ const ( GraphCodeArtifactTypeWebServer GraphCodeArtifactType = "WEB_SERVER" ) +type GraphEdge struct { + Confidence *float64 `json:"confidence,omitempty"` + Explanation *string `json:"explanation,omitempty"` + Properties map[string]json.RawMessage `json:"properties,omitempty"` + SourceID *string `json:"sourceId,omitempty"` + TargetID *string `json:"targetId,omitempty"` + Type *GraphEdgeType `json:"type,omitempty"` +} + +type GraphEdgeType string + +const ( + GraphEdgeTypeAbout GraphEdgeType = "ABOUT" + GraphEdgeTypeAccessedBy GraphEdgeType = "ACCESSED_BY" + GraphEdgeTypeAllowedBy GraphEdgeType = "ALLOWED_BY" + GraphEdgeTypeAllowsEgressTo GraphEdgeType = "ALLOWS_EGRESS_TO" + GraphEdgeTypeAllowsIngressFrom GraphEdgeType = "ALLOWS_INGRESS_FROM" + GraphEdgeTypeAppliesTo GraphEdgeType = "APPLIES_TO" + GraphEdgeTypeAssumes GraphEdgeType = "ASSUMES" + GraphEdgeTypeAssumesRole GraphEdgeType = "ASSUMES_ROLE" + GraphEdgeTypeAttachedTo GraphEdgeType = "ATTACHED_TO" + GraphEdgeTypeAuthenticates GraphEdgeType = "AUTHENTICATES" + GraphEdgeTypeBasedOnContainerfile GraphEdgeType = "BASED_ON_CONTAINERFILE" + GraphEdgeTypeBelongsTo GraphEdgeType = "BELONGS_TO" + GraphEdgeTypeBuilds GraphEdgeType = "BUILDS" + GraphEdgeTypeBuiltFrom GraphEdgeType = "BUILT_FROM" + GraphEdgeTypeCalls GraphEdgeType = "CALLS" + GraphEdgeTypeCanReach GraphEdgeType = "CAN_REACH" + GraphEdgeTypeClaims GraphEdgeType = "CLAIMS" + GraphEdgeTypeContains GraphEdgeType = "CONTAINS" + GraphEdgeTypeContributesTo GraphEdgeType = "CONTRIBUTES_TO" + GraphEdgeTypeContributesToProject GraphEdgeType = "CONTRIBUTES_TO_PROJECT" + GraphEdgeTypeControls GraphEdgeType = "CONTROLS" + GraphEdgeTypeDataFlowsTo GraphEdgeType = "DATA_FLOWS_TO" + GraphEdgeTypeDeployedBy GraphEdgeType = "DEPLOYED_BY" + GraphEdgeTypeDeployedIn GraphEdgeType = "DEPLOYED_IN" + GraphEdgeTypeDeployedTo GraphEdgeType = "DEPLOYED_TO" + GraphEdgeTypeDerivedFrom GraphEdgeType = "DERIVED_FROM" + GraphEdgeTypeEncrypts GraphEdgeType = "ENCRYPTS" + GraphEdgeTypeEnforcedBy GraphEdgeType = "ENFORCED_BY" + GraphEdgeTypeEnforces GraphEdgeType = "ENFORCES" + GraphEdgeTypeEntryPoints GraphEdgeType = "ENTRY_POINTS" + GraphEdgeTypeExecutes GraphEdgeType = "EXECUTES" + GraphEdgeTypeExists GraphEdgeType = "EXISTS" + GraphEdgeTypeExistsIn GraphEdgeType = "EXISTS_IN" + GraphEdgeTypeExposedAt GraphEdgeType = "EXPOSED_AT" + GraphEdgeTypeExposedBy GraphEdgeType = "EXPOSED_BY" + GraphEdgeTypeExposedOn GraphEdgeType = "EXPOSED_ON" + GraphEdgeTypeExposes GraphEdgeType = "EXPOSES" + GraphEdgeTypeFilteredBy GraphEdgeType = "FILTERED_BY" + GraphEdgeTypeForwardsTo GraphEdgeType = "FORWARDS_TO" + GraphEdgeTypeGrantsAccess GraphEdgeType = "GRANTS_ACCESS" + GraphEdgeTypeHasAuth GraphEdgeType = "HAS_AUTH" + GraphEdgeTypeHasContributor GraphEdgeType = "HAS_CONTRIBUTOR" + GraphEdgeTypeHasEndpoint GraphEdgeType = "HAS_ENDPOINT" + GraphEdgeTypeHasEntrypoint GraphEdgeType = "HAS_ENTRYPOINT" + GraphEdgeTypeHasFinding GraphEdgeType = "HAS_FINDING" + GraphEdgeTypeHasHost GraphEdgeType = "HAS_HOST" + GraphEdgeTypeHasMember GraphEdgeType = "HAS_MEMBER" + GraphEdgeTypeHasNote GraphEdgeType = "HAS_NOTE" + GraphEdgeTypeHasRole GraphEdgeType = "HAS_ROLE" + GraphEdgeTypeHasRule GraphEdgeType = "HAS_RULE" + GraphEdgeTypeHasSecurityGroup GraphEdgeType = "HAS_SECURITY_GROUP" + GraphEdgeTypeHosts GraphEdgeType = "HOSTS" + GraphEdgeTypeInProject GraphEdgeType = "IN_PROJECT" + GraphEdgeTypeInRepository GraphEdgeType = "IN_REPOSITORY" + GraphEdgeTypeInSubnet GraphEdgeType = "IN_SUBNET" + GraphEdgeTypeInvokesCallback GraphEdgeType = "INVOKES_CALLBACK" + GraphEdgeTypeInVpc GraphEdgeType = "IN_VPC" + GraphEdgeTypeIssuedTo GraphEdgeType = "ISSUED_TO" + GraphEdgeTypeMemberOf GraphEdgeType = "MEMBER_OF" + GraphEdgeTypeMonitors GraphEdgeType = "MONITORS" + GraphEdgeTypeMountedBy GraphEdgeType = "MOUNTED_BY" + GraphEdgeTypeOpenOn GraphEdgeType = "OPEN_ON" + GraphEdgeTypeOrigin GraphEdgeType = "ORIGIN" + GraphEdgeTypePeeredWith GraphEdgeType = "PEERED_WITH" + GraphEdgeTypeProducedBy GraphEdgeType = "PRODUCED_BY" + GraphEdgeTypeProtectedBy GraphEdgeType = "PROTECTED_BY" + GraphEdgeTypeProvidedBy GraphEdgeType = "PROVIDED_BY" + GraphEdgeTypeProvides GraphEdgeType = "PROVIDES" + GraphEdgeTypePublishesTo GraphEdgeType = "PUBLISHES_TO" + GraphEdgeTypeQueriedBy GraphEdgeType = "QUERIED_BY" + GraphEdgeTypeQueries GraphEdgeType = "QUERIES" + GraphEdgeTypeReferences GraphEdgeType = "REFERENCES" + GraphEdgeTypeRegistersCallback GraphEdgeType = "REGISTERS_CALLBACK" + GraphEdgeTypeRemediates GraphEdgeType = "REMEDIATES" + GraphEdgeTypeResolvesTo GraphEdgeType = "RESOLVES_TO" + GraphEdgeTypeRoutedBy GraphEdgeType = "ROUTED_BY" + GraphEdgeTypeRoutesTo GraphEdgeType = "ROUTES_TO" + GraphEdgeTypeRunsImage GraphEdgeType = "RUNS_IMAGE" + GraphEdgeTypeScales GraphEdgeType = "SCALES" + GraphEdgeTypeSecuredBy GraphEdgeType = "SECURED_BY" + GraphEdgeTypeServes GraphEdgeType = "SERVES" + GraphEdgeTypeSourcedFrom GraphEdgeType = "SOURCED_FROM" + GraphEdgeTypeStoredIn GraphEdgeType = "STORED_IN" + GraphEdgeTypeSubscribesTo GraphEdgeType = "SUBSCRIBES_TO" + GraphEdgeTypeSupersedes GraphEdgeType = "SUPERSEDES" + GraphEdgeTypeTargets GraphEdgeType = "TARGETS" + GraphEdgeTypeTargetWorkload GraphEdgeType = "TARGET_WORKLOAD" + GraphEdgeTypeTracks GraphEdgeType = "TRACKS" + GraphEdgeTypeTriggeredBy GraphEdgeType = "TRIGGERED_BY" + GraphEdgeTypeTriggers GraphEdgeType = "TRIGGERS" + GraphEdgeTypeUploadedTo GraphEdgeType = "UPLOADED_TO" + GraphEdgeTypeUsedBy GraphEdgeType = "USED_BY" + GraphEdgeTypeUses GraphEdgeType = "USES" + GraphEdgeTypeUsesContainer GraphEdgeType = "USES_CONTAINER" + GraphEdgeTypeUsesPod GraphEdgeType = "USES_POD" + GraphEdgeTypeUsesSecurityGroup GraphEdgeType = "USES_SECURITY_GROUP" + GraphEdgeTypeUsesTaskDefinition GraphEdgeType = "USES_TASK_DEFINITION" +) + +type GraphPathAssessment struct { + Explanation *string `json:"explanation,omitempty"` + FindingID *string `json:"findingId,omitempty"` + SourceIds []string `json:"sourceIds,omitempty"` + Status *GraphPathAssessmentStatus `json:"status,omitempty"` + Unknowns []string `json:"unknowns,omitempty"` +} + +type GraphPathAssessmentStatus string + +const ( + GraphPathAssessmentStatusBlocked GraphPathAssessmentStatus = "BLOCKED" + GraphPathAssessmentStatusConfirmed GraphPathAssessmentStatus = "CONFIRMED" + GraphPathAssessmentStatusUnresolved GraphPathAssessmentStatus = "UNRESOLVED" +) + type ModelsAPISpecMetadata struct { BasePath *string `json:"basePath,omitempty"` NumEndpoints int `json:"numEndpoints"` @@ -999,32 +4473,10 @@ type ModelsAPISpecRef struct { } type ModelsAPISurface struct { - AuthenticatedEndpoints int `json:"authenticatedEndpoints"` - Coverage float64 `json:"coverage"` - PublicEndpoints int `json:"publicEndpoints"` - TotalEndpoints int `json:"totalEndpoints"` -} - -type ModelsAWSAccountType string - -const ( - ModelsAWSAccountTypeProduction ModelsAWSAccountType = "Production" - ModelsAWSAccountTypeDevelopment ModelsAWSAccountType = "Development" - ModelsAWSAccountTypeStaging ModelsAWSAccountType = "Staging" - ModelsAWSAccountTypeSandbox ModelsAWSAccountType = "Sandbox" - ModelsAWSAccountTypePreprod ModelsAWSAccountType = "PreProd" - ModelsAWSAccountTypeOther ModelsAWSAccountType = "Other" -) - -type ModelsAWSIntegrationAssetInventoryHost struct { - AccountID string `json:"accountId"` - AccountName string `json:"accountName"` - AccountType ModelsAWSAccountType `json:"accountType"` - Aliases []string `json:"aliases,omitempty"` - Protocol string `json:"protocol"` - Region string `json:"region"` - ResourceID string `json:"resourceId"` - Service string `json:"service"` + AuthenticatedEndpoints *int `json:"authenticatedEndpoints,omitempty"` + Coverage *float64 `json:"coverage,omitempty"` + PublicEndpoints *int `json:"publicEndpoints,omitempty"` + TotalEndpoints *int `json:"totalEndpoints,omitempty"` } type ModelsAgentAppContextSeed struct { @@ -1037,29 +4489,46 @@ type ModelsAgentAppContextSeed struct { Tags []string `json:"tags,omitempty"` } -type ModelsAppContextSeed struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} +type ModelsAiMlSubType string + +const ( + ModelsAiMlSubTypeAwsSagemakerEndpoint ModelsAiMlSubType = "AWS_SAGEMAKER_ENDPOINT" + ModelsAiMlSubTypeAwsBedrockModel ModelsAiMlSubType = "AWS_BEDROCK_MODEL" + ModelsAiMlSubTypeGcpVertexEndpoint ModelsAiMlSubType = "GCP_VERTEX_ENDPOINT" + ModelsAiMlSubTypeAzureOpenaiDeployment ModelsAiMlSubType = "AZURE_OPENAI_DEPLOYMENT" + ModelsAiMlSubTypeAzureMlWorkspace ModelsAiMlSubType = "AZURE_ML_WORKSPACE" + ModelsAiMlSubTypeAzureMachineLearning ModelsAiMlSubType = "AZURE_MACHINE_LEARNING" +) type ModelsApplication struct { Components []ModelsApplicationComponent `json:"components,omitempty"` CreatedAt string `json:"createdAt"` Description string `json:"description"` Discovery ModelsApplicationDiscovery `json:"discovery"` + GenerationID *string `json:"generationId,omitempty"` ID string `json:"id"` Metadata ModelsApplicationMetadata `json:"metadata"` Name string `json:"name"` + Origin *ModelsApplicationOrigin `json:"origin,omitempty"` Tags []string `json:"tags,omitempty"` TenantID string `json:"tenantId"` UpdatedAt string `json:"updatedAt"` + UserDescription *string `json:"userDescription,omitempty"` + UserName *string `json:"userName,omitempty"` + UserTags []string `json:"userTags,omitempty"` Version *string `json:"version,omitempty"` } +type ModelsApplicationAuthModel struct { + Notes *string `json:"notes,omitempty"` + Source string `json:"source"` +} + type ModelsApplicationComponent struct { Discovery ModelsComponentDiscovery `json:"discovery"` ID string `json:"id"` Name string `json:"name"` + Relationships []ModelsComponentRelationship `json:"relationships,omitempty"` Source ModelsComponentSource `json:"source"` Type *string `json:"type,omitempty"` } @@ -1067,99 +4536,107 @@ type ModelsApplicationComponent struct { type ModelsApplicationDiscovery struct { ApiSpecs []ModelsAPISpecRef `json:"apiSpecs,omitempty"` ApiSurface ModelsAPISurface `json:"apiSurface"` + AuthModel *ModelsApplicationAuthModel `json:"authModel,omitempty"` SecurityProfile ModelsSecurityProfile `json:"securityProfile"` + SharedInfrastructure []ModelsSharedInfrastructureRef `json:"sharedInfrastructure,omitempty"` Technologies []string `json:"technologies,omitempty"` } type ModelsApplicationMetadata struct { AgentExecutionID *string `json:"agentExecutionId,omitempty"` CacheKey *string `json:"cacheKey,omitempty"` + CliAppContext *json.RawMessage `json:"cliAppContext,omitempty"` + CliAppContextUpdatedAt *string `json:"cliAppContextUpdatedAt,omitempty"` + CliAppContextVersion *string `json:"cliAppContextVersion,omitempty"` CustomFields map[string]string `json:"customFields,omitempty"` GeneratedByAgentVersion *string `json:"generatedByAgentVersion,omitempty"` + LastAttemptTime *string `json:"lastAttemptTime,omitempty"` LastRebuildTime string `json:"lastRebuildTime"` SourceRepositories []string `json:"sourceRepositories,omitempty"` SourceRepositoryCount *int `json:"sourceRepositoryCount,omitempty"` Status *string `json:"status,omitempty"` } -type ModelsAssetInventoryCloudAccountRecord struct { - AccountID string `json:"accountId"` - AccountName string `json:"accountName"` - Active bool `json:"active"` - CloudProvider string `json:"cloudProvider"` - CreatedAt string `json:"createdAt"` - DeletedAt *string `json:"deletedAt,omitempty"` - ID string `json:"id"` - LastScanAt *string `json:"lastScanAt,omitempty"` - LastScanID *string `json:"lastScanId,omitempty"` - UpdatedAt string `json:"updatedAt"` -} +type ModelsApplicationOrigin string -type ModelsAssetInventoryHost struct { - Active bool `json:"active"` - AwsIntegration ModelsAWSIntegrationAssetInventoryHost `json:"awsIntegration"` - CodeLocation ModelsAssetInventoryHostCodeLocation `json:"codeLocation"` - CreatedAt string `json:"createdAt"` - DnsNames []string `json:"dnsNames,omitempty"` - FirstScanAt string `json:"firstScanAt"` - Host string `json:"host"` - ID string `json:"id"` - IpAddresses []string `json:"ipAddresses,omitempty"` - IsAuthenticated *bool `json:"isAuthenticated,omitempty"` - IsLatest bool `json:"isLatest"` - LastScanAt string `json:"lastScanAt"` - Ports []ModelsAssetInventoryPort `json:"ports,omitempty"` - ResourceCategory string `json:"resourceCategory"` - ResourceType string `json:"resourceType"` - SourceType ModelsHostSourceType `json:"sourceType"` - UpdatedAt string `json:"updatedAt"` -} +const ( + ModelsApplicationOriginAi ModelsApplicationOrigin = "ai" + ModelsApplicationOriginUser ModelsApplicationOrigin = "user" +) -type ModelsAssetInventoryHostCodeLocation struct { - Description string `json:"description"` - OwnerID string `json:"ownerId"` - OwnerName string `json:"ownerName"` - Platform *string `json:"platform,omitempty"` - ProjectName string `json:"projectName"` - RepositoryID string `json:"repositoryId"` - RepositoryName string `json:"repositoryName"` -} +type ModelsArtifactRepositoriesSubType string -type ModelsAssetInventoryPort struct { - Active bool `json:"active"` - CreatedAt *string `json:"createdAt,omitempty"` - Port int `json:"port"` - Protocol *string `json:"protocol,omitempty"` - TransportProtocol string `json:"transportProtocol"` - UpdatedAt *string `json:"updatedAt,omitempty"` -} +const ( + ModelsArtifactRepositoriesSubTypeAwsEcr ModelsArtifactRepositoriesSubType = "AWS_ECR" + ModelsArtifactRepositoriesSubTypeAwsCodeartifact ModelsArtifactRepositoriesSubType = "AWS_CODEARTIFACT" + ModelsArtifactRepositoriesSubTypeAzureAcr ModelsArtifactRepositoriesSubType = "AZURE_ACR" + ModelsArtifactRepositoriesSubTypeGcpArtifactRegistry ModelsArtifactRepositoriesSubType = "GCP_ARTIFACT_REGISTRY" + ModelsArtifactRepositoriesSubTypeDockerhub ModelsArtifactRepositoriesSubType = "DOCKERHUB" + ModelsArtifactRepositoriesSubTypeGhcr ModelsArtifactRepositoriesSubType = "GHCR" + ModelsArtifactRepositoriesSubTypeNpm ModelsArtifactRepositoriesSubType = "NPM" + ModelsArtifactRepositoriesSubTypePypi ModelsArtifactRepositoriesSubType = "PYPI" + ModelsArtifactRepositoriesSubTypeMaven ModelsArtifactRepositoriesSubType = "MAVEN" + ModelsArtifactRepositoriesSubTypeNuget ModelsArtifactRepositoriesSubType = "NUGET" + ModelsArtifactRepositoriesSubTypeRubygems ModelsArtifactRepositoriesSubType = "RUBYGEMS" + ModelsArtifactRepositoriesSubTypeCrates ModelsArtifactRepositoriesSubType = "CRATES" + ModelsArtifactRepositoriesSubTypeOther ModelsArtifactRepositoriesSubType = "OTHER" +) -type ModelsAssetInventoryResource struct { - AccountID string `json:"accountId"` - Active bool `json:"active"` - CloudProvider string `json:"cloudProvider"` - CreatedAt string `json:"createdAt"` - DeletedAt *string `json:"deletedAt,omitempty"` - DnsNames []string `json:"dnsNames,omitempty"` - FirstSeenAt *string `json:"firstSeenAt,omitempty"` - ID string `json:"id"` - IsPublicFacing *bool `json:"isPublicFacing,omitempty"` - LastSeenAt *string `json:"lastSeenAt,omitempty"` - LastSeenScanID *string `json:"lastSeenScanId,omitempty"` - Name string `json:"name"` - PrivateIPs []string `json:"privateIPs,omitempty"` - Properties map[string]json.RawMessage `json:"properties,omitempty"` - ProviderType string `json:"providerType"` - PublicIPs []string `json:"publicIPs,omitempty"` - Region *string `json:"region,omitempty"` - ResourceCategory string `json:"resourceCategory"` - ResourceID string `json:"resourceId"` - ResourceType string `json:"resourceType"` - Subnet *string `json:"subnet,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - UpdatedAt string `json:"updatedAt"` - Vpc *string `json:"vpc,omitempty"` -} +type ModelsArtifactsSubType string + +const ( + ModelsArtifactsSubTypeDockerImage ModelsArtifactsSubType = "DOCKER_IMAGE" + ModelsArtifactsSubTypeJar ModelsArtifactsSubType = "JAR" + ModelsArtifactsSubTypeWheel ModelsArtifactsSubType = "WHEEL" + ModelsArtifactsSubTypeNpmPackage ModelsArtifactsSubType = "NPM_PACKAGE" + ModelsArtifactsSubTypeExecutable ModelsArtifactsSubType = "EXECUTABLE" + ModelsArtifactsSubTypeOther ModelsArtifactsSubType = "OTHER" +) + +type ModelsAssetInventoryCategory string + +const ( + ModelsAssetInventoryCategoryCompute ModelsAssetInventoryCategory = "compute" + ModelsAssetInventoryCategoryContainer ModelsAssetInventoryCategory = "container" + ModelsAssetInventoryCategoryCluster ModelsAssetInventoryCategory = "cluster" + ModelsAssetInventoryCategoryServerless ModelsAssetInventoryCategory = "serverless" + ModelsAssetInventoryCategoryNetwork ModelsAssetInventoryCategory = "network" + ModelsAssetInventoryCategoryConnectivity ModelsAssetInventoryCategory = "connectivity" + ModelsAssetInventoryCategoryLoadBalancer ModelsAssetInventoryCategory = "load_balancer" + ModelsAssetInventoryCategoryCdnAndDns ModelsAssetInventoryCategory = "cdn_and_dns" + ModelsAssetInventoryCategoryStorageAndBackup ModelsAssetInventoryCategory = "storage_and_backup" + ModelsAssetInventoryCategoryDatabase ModelsAssetInventoryCategory = "database" + ModelsAssetInventoryCategoryMessaging ModelsAssetInventoryCategory = "messaging" + ModelsAssetInventoryCategoryDataPipeline ModelsAssetInventoryCategory = "data_pipeline" + ModelsAssetInventoryCategoryIdentity ModelsAssetInventoryCategory = "identity" + ModelsAssetInventoryCategorySecurity ModelsAssetInventoryCategory = "security" + ModelsAssetInventoryCategoryObservability ModelsAssetInventoryCategory = "observability" + ModelsAssetInventoryCategoryCiCd ModelsAssetInventoryCategory = "ci_cd" + ModelsAssetInventoryCategoryAiMl ModelsAssetInventoryCategory = "ai_ml" + ModelsAssetInventoryCategoryRepos ModelsAssetInventoryCategory = "repos" + ModelsAssetInventoryCategoryProjects ModelsAssetInventoryCategory = "projects" + ModelsAssetInventoryCategoryArtifacts ModelsAssetInventoryCategory = "artifacts" + ModelsAssetInventoryCategoryPipelines ModelsAssetInventoryCategory = "pipelines" + ModelsAssetInventoryCategoryArtifactRepositories ModelsAssetInventoryCategory = "artifact_repositories" +) + +type ModelsCDNAndDNSSubType string + +const ( + ModelsCDNAndDNSSubTypeAwsCloudfront ModelsCDNAndDNSSubType = "AWS_CLOUDFRONT" + ModelsCDNAndDNSSubTypeAwsRoute53HostedZone ModelsCDNAndDNSSubType = "AWS_ROUTE53_HOSTED_ZONE" + ModelsCDNAndDNSSubTypeAwsApiGateway ModelsCDNAndDNSSubType = "AWS_API_GATEWAY" + ModelsCDNAndDNSSubTypeAwsAppsync ModelsCDNAndDNSSubType = "AWS_APPSYNC" + ModelsCDNAndDNSSubTypeGcpCloudCdn ModelsCDNAndDNSSubType = "GCP_CLOUD_CDN" + ModelsCDNAndDNSSubTypeGcpCloudDnsZone ModelsCDNAndDNSSubType = "GCP_CLOUD_DNS_ZONE" + ModelsCDNAndDNSSubTypeGcpCloudDnsRecord ModelsCDNAndDNSSubType = "GCP_CLOUD_DNS_RECORD" + ModelsCDNAndDNSSubTypeAzureCdnProfile ModelsCDNAndDNSSubType = "AZURE_CDN_PROFILE" + ModelsCDNAndDNSSubTypeAzureDnsZone ModelsCDNAndDNSSubType = "AZURE_DNS_ZONE" + ModelsCDNAndDNSSubTypeAzureFrontDoor ModelsCDNAndDNSSubType = "AZURE_FRONT_DOOR" + ModelsCDNAndDNSSubTypeAzureApiManagement ModelsCDNAndDNSSubType = "AZURE_API_MANAGEMENT" + ModelsCDNAndDNSSubTypeGcpApiGateway ModelsCDNAndDNSSubType = "GCP_API_GATEWAY" + ModelsCDNAndDNSSubTypeCodeDeclaredHost ModelsCDNAndDNSSubType = "CODE_DECLARED_HOST" +) type ModelsCDXAuthors struct { Email string `json:"email"` @@ -1188,16 +4665,47 @@ type ModelsCDXDeps struct { Ref string `json:"ref"` } +type ModelsCDXGen struct { + BomFormat string `json:"bomFormat"` + Components []ModelsCDXComponents `json:"components,omitempty"` + Dependencies []ModelsCDXDeps `json:"dependencies,omitempty"` + Metadata ModelsCDXMetaData `json:"metadata"` + SerialNumber string `json:"serialNumber"` + Services []ModelsCDXService `json:"services,omitempty"` + SpecVersion string `json:"specVersion"` + Version int `json:"version"` +} + type ModelsCDXGenAtCommit struct { + Authoritative *bool `json:"authoritative,omitempty"` + AuthorityRevision *int64 `json:"authorityRevision,omitempty"` + CarryCount *int `json:"carryCount,omitempty"` CdxGen *ModelsCDXGen `json:"cdxGen,omitempty"` CommitSha string `json:"commitSha"` CommitTimestamp string `json:"commitTimestamp"` + CompletenessRecorded *bool `json:"completenessRecorded,omitempty"` DetectedEcosystems []string `json:"detectedEcosystems,omitempty"` DetectedLockfiles []string `json:"detectedLockfiles,omitempty"` DetectedManifests []string `json:"detectedManifests,omitempty"` + Empty *bool `json:"empty,omitempty"` + Exclusions []ModelsSBOMScope `json:"exclusions,omitempty"` + FailedEcosystems []string `json:"failedEcosystems,omitempty"` + FailureClass *string `json:"failureClass,omitempty"` + FailureReason *string `json:"failureReason,omitempty"` + GeneratedAt *string `json:"generatedAt,omitempty"` + Incomplete *bool `json:"incomplete,omitempty"` + IncompleteScopes []ModelsSBOMScope `json:"incompleteScopes,omitempty"` LockfileClassification *string `json:"lockfileClassification,omitempty"` + LockfileSetHash *string `json:"lockfileSetHash,omitempty"` ManifestRangeSources map[string]ModelsManifestRangeSource `json:"manifestRangeSources,omitempty"` ManifestRanges map[string]string `json:"manifestRanges,omitempty"` + PackageAuth []ModelsSBOMPackageAuth `json:"packageAuth,omitempty"` + Provenance *ModelsSBOMProvenance `json:"provenance,omitempty"` + RepoContextCommitSha *string `json:"repoContextCommitSha,omitempty"` + RepoContextStaleReason *string `json:"repoContextStaleReason,omitempty"` + RepoContextVersion *string `json:"repoContextVersion,omitempty"` + ScanScope *ModelsPathScope `json:"scanScope,omitempty"` + ScannerVersion *string `json:"scannerVersion,omitempty"` } type ModelsCDXHashes struct { @@ -1247,6 +4755,27 @@ type ModelsCDXTool struct { Version string `json:"version"` } +type ModelsCiCdSubType string + +const ( + ModelsCiCdSubTypeAwsCodebuild ModelsCiCdSubType = "AWS_CODEBUILD" + ModelsCiCdSubTypeAwsCodepipeline ModelsCiCdSubType = "AWS_CODEPIPELINE" + ModelsCiCdSubTypeAwsCodecommit ModelsCiCdSubType = "AWS_CODECOMMIT" + ModelsCiCdSubTypeAwsCodedeploy ModelsCiCdSubType = "AWS_CODEDEPLOY" + ModelsCiCdSubTypeGcpCloudBuild ModelsCiCdSubType = "GCP_CLOUD_BUILD" + ModelsCiCdSubTypeAzureDevopsPipelines ModelsCiCdSubType = "AZURE_DEVOPS_PIPELINES" +) + +type ModelsClusterSubType string + +const ( + ModelsClusterSubTypeAwsEksCluster ModelsClusterSubType = "AWS_EKS_CLUSTER" + ModelsClusterSubTypeAwsEcsCluster ModelsClusterSubType = "AWS_ECS_CLUSTER" + ModelsClusterSubTypeGcpGke ModelsClusterSubType = "GCP_GKE" + ModelsClusterSubTypeAzureAks ModelsClusterSubType = "AZURE_AKS" + ModelsClusterSubTypeK8sCluster ModelsClusterSubType = "K8S_CLUSTER" +) + type ModelsComponentDiscovery struct { ApiSpecs []ModelsAPISpecRef `json:"apiSpecs,omitempty"` Endpoints []string `json:"endpoints,omitempty"` @@ -1254,6 +4783,13 @@ type ModelsComponentDiscovery struct { Technologies []string `json:"technologies,omitempty"` } +type ModelsComponentRelationship struct { + Confidence *float64 `json:"confidence,omitempty"` + Evidence *string `json:"evidence,omitempty"` + TargetComponentID string `json:"targetComponentId"` + Type string `json:"type"` +} + type ModelsComponentSource struct { Path *string `json:"path,omitempty"` ProjectID *string `json:"projectId,omitempty"` @@ -1261,6 +4797,63 @@ type ModelsComponentSource struct { Type *string `json:"type,omitempty"` } +type ModelsComputeSubType string + +const ( + ModelsComputeSubTypeAwsEc2 ModelsComputeSubType = "AWS_EC2" + ModelsComputeSubTypeAwsAutoscalingGroup ModelsComputeSubType = "AWS_AUTOSCALING_GROUP" + ModelsComputeSubTypeAwsWorkspace ModelsComputeSubType = "AWS_WORKSPACE" + ModelsComputeSubTypeGcpGce ModelsComputeSubType = "GCP_GCE" + ModelsComputeSubTypeGcpMig ModelsComputeSubType = "GCP_MIG" + ModelsComputeSubTypeAzureVm ModelsComputeSubType = "AZURE_VM" + ModelsComputeSubTypeAzureVmss ModelsComputeSubType = "AZURE_VMSS" + ModelsComputeSubTypeAzureVirtualDesktop ModelsComputeSubType = "AZURE_VIRTUAL_DESKTOP" + ModelsComputeSubTypeK8sNode ModelsComputeSubType = "K8S_NODE" +) + +type ModelsComputeWorkloadType string + +const ( + ModelsComputeWorkloadTypeServer ModelsComputeWorkloadType = "server" + ModelsComputeWorkloadTypeDesktop ModelsComputeWorkloadType = "desktop" + ModelsComputeWorkloadTypeStreaming ModelsComputeWorkloadType = "streaming" + ModelsComputeWorkloadTypeEdge ModelsComputeWorkloadType = "edge" +) + +type ModelsConnectivitySubType string + +const ( + ModelsConnectivitySubTypeAwsVpnConnection ModelsConnectivitySubType = "AWS_VPN_CONNECTION" + ModelsConnectivitySubTypeAwsDirectConnect ModelsConnectivitySubType = "AWS_DIRECT_CONNECT" + ModelsConnectivitySubTypeAwsPrivateLink ModelsConnectivitySubType = "AWS_PRIVATE_LINK" + ModelsConnectivitySubTypeAwsTgwAttachment ModelsConnectivitySubType = "AWS_TGW_ATTACHMENT" + ModelsConnectivitySubTypeAwsGlobalAccelerator ModelsConnectivitySubType = "AWS_GLOBAL_ACCELERATOR" + ModelsConnectivitySubTypeAwsNetworkFirewall ModelsConnectivitySubType = "AWS_NETWORK_FIREWALL" + ModelsConnectivitySubTypeAzureExpressRoute ModelsConnectivitySubType = "AZURE_EXPRESS_ROUTE" + ModelsConnectivitySubTypeAzureVpn ModelsConnectivitySubType = "AZURE_VPN" + ModelsConnectivitySubTypeAzureFirewall ModelsConnectivitySubType = "AZURE_FIREWALL" + ModelsConnectivitySubTypeGcpVpnTunnel ModelsConnectivitySubType = "GCP_VPN_TUNNEL" + ModelsConnectivitySubTypeGcpCloudArmor ModelsConnectivitySubType = "GCP_CLOUD_ARMOR" + ModelsConnectivitySubTypeGcpVpcServiceControls ModelsConnectivitySubType = "GCP_VPC_SERVICE_CONTROLS" + ModelsConnectivitySubTypeGcpFirewallRule ModelsConnectivitySubType = "GCP_FIREWALL_RULE" +) + +type ModelsContainerSubType string + +const ( + ModelsContainerSubTypeAwsEcsService ModelsContainerSubType = "AWS_ECS_SERVICE" + ModelsContainerSubTypeAwsEcsTask ModelsContainerSubType = "AWS_ECS_TASK" + ModelsContainerSubTypeAwsEcsTaskDefinition ModelsContainerSubType = "AWS_ECS_TASK_DEFINITION" + ModelsContainerSubTypeK8sDeployment ModelsContainerSubType = "K8S_DEPLOYMENT" + ModelsContainerSubTypeK8sNamespace ModelsContainerSubType = "K8S_NAMESPACE" + ModelsContainerSubTypeK8sPod ModelsContainerSubType = "K8S_POD" + ModelsContainerSubTypeK8sStatefulset ModelsContainerSubType = "K8S_STATEFULSET" + ModelsContainerSubTypeK8sDaemonset ModelsContainerSubType = "K8S_DAEMONSET" + ModelsContainerSubTypeGcpCloudRun ModelsContainerSubType = "GCP_CLOUD_RUN" + ModelsContainerSubTypeAzureAci ModelsContainerSubType = "AZURE_ACI" + ModelsContainerSubTypeAzureAppService ModelsContainerSubType = "AZURE_APP_SERVICE" +) + type ModelsContentReference struct { Hash string `json:"hash"` Location *string `json:"location,omitempty"` @@ -1271,12 +4864,9 @@ type ModelsContentReference struct { type ModelsContextProject struct { CreatedAt string `json:"createdAt"` DeletedAt *string `json:"deletedAt,omitempty"` - Dependencies []string `json:"dependencies,omitempty"` Description string `json:"description"` - Framework *string `json:"framework,omitempty"` ID string `json:"id"` IsDeleted bool `json:"isDeleted"` - Language *string `json:"language,omitempty"` Metadata map[string]json.RawMessage `json:"metadata,omitempty"` Name string `json:"name"` Path string `json:"path"` @@ -1285,8 +4875,49 @@ type ModelsContextProject struct { UpdatedAt string `json:"updatedAt"` } +type ModelsDataPipelineSubType string + +const ( + ModelsDataPipelineSubTypeAwsGlue ModelsDataPipelineSubType = "AWS_GLUE" + ModelsDataPipelineSubTypeAwsEmr ModelsDataPipelineSubType = "AWS_EMR" + ModelsDataPipelineSubTypeAwsAthena ModelsDataPipelineSubType = "AWS_ATHENA" + ModelsDataPipelineSubTypeGcpDataflow ModelsDataPipelineSubType = "GCP_DATAFLOW" + ModelsDataPipelineSubTypeGcpDataproc ModelsDataPipelineSubType = "GCP_DATAPROC" + ModelsDataPipelineSubTypeAzureDataFactory ModelsDataPipelineSubType = "AZURE_DATA_FACTORY" + ModelsDataPipelineSubTypeAzureDatabricks ModelsDataPipelineSubType = "AZURE_DATABRICKS" + ModelsDataPipelineSubTypeAzureSynapse ModelsDataPipelineSubType = "AZURE_SYNAPSE" + ModelsDataPipelineSubTypeAzureHdinsight ModelsDataPipelineSubType = "AZURE_HDINSIGHT" + ModelsDataPipelineSubTypeAzureBatch ModelsDataPipelineSubType = "AZURE_BATCH" + ModelsDataPipelineSubTypeGcpCloudBatch ModelsDataPipelineSubType = "GCP_CLOUD_BATCH" + ModelsDataPipelineSubTypeGcpWorkflows ModelsDataPipelineSubType = "GCP_WORKFLOWS" +) + +type ModelsDatabaseSubType string + +const ( + ModelsDatabaseSubTypeAwsRds ModelsDatabaseSubType = "AWS_RDS" + ModelsDatabaseSubTypeAwsDynamodb ModelsDatabaseSubType = "AWS_DYNAMODB" + ModelsDatabaseSubTypeAwsRedshift ModelsDatabaseSubType = "AWS_REDSHIFT" + ModelsDatabaseSubTypeAwsNeptune ModelsDatabaseSubType = "AWS_NEPTUNE" + ModelsDatabaseSubTypeAwsElasticache ModelsDatabaseSubType = "AWS_ELASTICACHE" + ModelsDatabaseSubTypeAwsMemorydb ModelsDatabaseSubType = "AWS_MEMORYDB" + ModelsDatabaseSubTypeAwsOpensearch ModelsDatabaseSubType = "AWS_OPENSEARCH" + ModelsDatabaseSubTypeGcpSpanner ModelsDatabaseSubType = "GCP_SPANNER" + ModelsDatabaseSubTypeGcpBigquery ModelsDatabaseSubType = "GCP_BIGQUERY" + ModelsDatabaseSubTypeGcpFirestore ModelsDatabaseSubType = "GCP_FIRESTORE" + ModelsDatabaseSubTypeGcpAlloydb ModelsDatabaseSubType = "GCP_ALLOYDB" + ModelsDatabaseSubTypeGcpCloudSql ModelsDatabaseSubType = "GCP_CLOUD_SQL" + ModelsDatabaseSubTypeGcpMemorystore ModelsDatabaseSubType = "GCP_MEMORYSTORE" + ModelsDatabaseSubTypeAzureSql ModelsDatabaseSubType = "AZURE_SQL" + ModelsDatabaseSubTypeAzureCosmos ModelsDatabaseSubType = "AZURE_COSMOS" + ModelsDatabaseSubTypeAzureMysql ModelsDatabaseSubType = "AZURE_MYSQL" + ModelsDatabaseSubTypeAzurePostgres ModelsDatabaseSubType = "AZURE_POSTGRES" + ModelsDatabaseSubTypeAzureRedis ModelsDatabaseSubType = "AZURE_REDIS" +) + type ModelsDependencyDiff struct { Added []ModelsDependencyOccurrence `json:"added,omitempty"` + Downgraded []ModelsDependencyUpgrade `json:"downgraded,omitempty"` Removed []ModelsDependencyOccurrence `json:"removed,omitempty"` Upgraded []ModelsDependencyUpgrade `json:"upgraded,omitempty"` } @@ -1303,6 +4934,7 @@ type ModelsDependencyOccurrence struct { ProjectID string `json:"projectId"` ProjectName *string `json:"projectName,omitempty"` Purl *string `json:"purl,omitempty"` + RangeUnverified *bool `json:"rangeUnverified,omitempty"` RemovedAt *string `json:"removedAt,omitempty"` RemovedByCommit *string `json:"removedByCommit,omitempty"` RepoID string `json:"repoId"` @@ -1341,6 +4973,18 @@ type ModelsDependencyWindow struct { Version string `json:"version"` } +type ModelsEndpointSourceType string + +const ( + ModelsEndpointSourceTypeUserupload ModelsEndpointSourceType = "UserUpload" + ModelsEndpointSourceTypeCodescan ModelsEndpointSourceType = "CodeScan" + ModelsEndpointSourceTypeAwsintegration ModelsEndpointSourceType = "AWSIntegration" + ModelsEndpointSourceTypeBughunt ModelsEndpointSourceType = "BugHunt" + ModelsEndpointSourceTypeManual ModelsEndpointSourceType = "Manual" + ModelsEndpointSourceTypePentest ModelsEndpointSourceType = "Pentest" + ModelsEndpointSourceTypeDast ModelsEndpointSourceType = "Dast" +) + type ModelsEscalationPolicy struct { Citations []ModelsEscalationPolicyCitationsElem `json:"citations,omitempty"` Description *string `json:"description,omitempty"` @@ -1388,20 +5032,173 @@ const ( ModelsEscalationPolicySeveritySLAsElemSeverityMedium ModelsEscalationPolicySeveritySLAsElemSeverity = "MEDIUM" ) +type ModelsExecutionRecipe struct { + ApplicationID *string `json:"applicationId,omitempty"` + Capabilities map[string]ModelsExecutionRecipeCapability `json:"capabilities,omitempty"` + Components []ModelsExecutionRecipeComponent `json:"components,omitempty"` + ComposePath *string `json:"composePath,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + CpuMillicores *int `json:"cpuMillicores,omitempty"` + DiscoveredAt string `json:"discoveredAt"` + DiskMib *int `json:"diskMib,omitempty"` + DotnetSetup *DotnetsetupSelection `json:"dotnetSetup,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + Edits []ModelsExecutionRecipeFileEdit `json:"edits,omitempty"` + EnvNames []string `json:"envNames,omitempty"` + FailureCode *string `json:"failureCode,omitempty"` + ID string `json:"id"` + InputHash string `json:"inputHash"` + Kind string `json:"kind"` + MemoryMib *int `json:"memoryMib,omitempty"` + PackageManager *string `json:"packageManager,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + ProjectPath *string `json:"projectPath,omitempty"` + Proof string `json:"proof"` + Readiness *ModelsExecutionRecipeReadiness `json:"readiness,omitempty"` + RepositoryID string `json:"repositoryId"` + Requirements []string `json:"requirements,omitempty"` + RunOutcome *string `json:"runOutcome,omitempty"` + SandboxImage *string `json:"sandboxImage,omitempty"` + SandboxImageVersion *string `json:"sandboxImageVersion,omitempty"` + SourceCommit string `json:"sourceCommit"` + StaleAt *string `json:"staleAt,omitempty"` + StaleReason *string `json:"staleReason,omitempty"` + Status string `json:"status"` + Steps []ModelsExecutionRecipeStep `json:"steps,omitempty"` + TestOutcome *string `json:"testOutcome,omitempty"` + ToolchainImageDigest *string `json:"toolchainImageDigest,omitempty"` + ValidatedAt string `json:"validatedAt"` + ValidationID string `json:"validationId"` + Version int `json:"version"` +} + +type ModelsExecutionRecipeCapability struct { + Reason *string `json:"reason,omitempty"` + Status string `json:"status"` + TestOutcome *string `json:"testOutcome,omitempty"` +} + +type ModelsExecutionRecipeComponent struct { + ComponentRecipeID string `json:"componentRecipeId"` + ProjectID *string `json:"projectId,omitempty"` + Proof *string `json:"proof,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + ServiceName string `json:"serviceName"` + Status *string `json:"status,omitempty"` + Version int `json:"version"` +} + +type ModelsExecutionRecipeDiscoveryRefusal struct { + ApplicationID *string `json:"applicationId,omitempty"` + Kind string `json:"kind"` + ProjectID *string `json:"projectId,omitempty"` + Reason string `json:"reason"` + RepositoryID string `json:"repositoryId"` +} + +type ModelsExecutionRecipeFileEdit struct { + Content *string `json:"content,omitempty"` + Operation string `json:"operation"` + Ordinal int `json:"ordinal"` + OriginalSha256 *string `json:"originalSha256,omitempty"` + Path string `json:"path"` + Phase string `json:"phase"` + ReviewReason *string `json:"reviewReason,omitempty"` + ReviewVerdict string `json:"reviewVerdict"` +} + +type ModelsExecutionRecipeReadiness struct { + Path *string `json:"path,omitempty"` + Port int `json:"port"` + TimeoutSeconds int `json:"timeoutSeconds"` +} + +type ModelsExecutionRecipeResolution struct { + CommitSha *string `json:"commitSha,omitempty"` + Compatibility string `json:"compatibility"` + ObservedInputHash *string `json:"observedInputHash,omitempty"` + Reason *string `json:"reason,omitempty"` + Recipe *ModelsExecutionRecipe `json:"recipe,omitempty"` + Status string `json:"status"` + Trust string `json:"trust"` + UnmetRequirements []string `json:"unmetRequirements,omitempty"` +} + +type ModelsExecutionRecipeStep struct { + Background *bool `json:"background,omitempty"` + Command string `json:"command"` + EnvNames []string `json:"envNames,omitempty"` + ExpectedExitCode *int `json:"expectedExitCode,omitempty"` + ID *string `json:"id,omitempty"` + Ordinal int `json:"ordinal"` + Phase string `json:"phase"` + ReadinessProven *bool `json:"readinessProven,omitempty"` + Requirements []string `json:"requirements,omitempty"` + TimeoutSeconds int `json:"timeoutSeconds"` + WorkingDir *string `json:"workingDir,omitempty"` +} + +type ModelsExecutionRecipeValidation struct { + ApplicationID *string `json:"applicationId,omitempty"` + AttemptCount int `json:"attemptCount"` + AuthorityRevision *int64 `json:"authorityRevision,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + CreatedAt string `json:"createdAt"` + DueAt string `json:"dueAt"` + DurationMs *int64 `json:"durationMs,omitempty"` + ExecutionArn *string `json:"executionArn,omitempty"` + FailureCode *string `json:"failureCode,omitempty"` + ID string `json:"id"` + InputHash *string `json:"inputHash,omitempty"` + Kind string `json:"kind"` + LastError *string `json:"lastError,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepositoryID string `json:"repositoryId"` + SourceCommit *string `json:"sourceCommit,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status string `json:"status"` + Trigger string `json:"trigger"` +} + type ModelsFrontendAssets struct { ApiEndpoints []string `json:"apiEndpoints,omitempty"` ExposedValues *int `json:"exposedValues,omitempty"` Routes []string `json:"routes,omitempty"` } -type ModelsHostSourceType string +type ModelsIdentitySubType string + +const ( + ModelsIdentitySubTypeAwsIamUser ModelsIdentitySubType = "AWS_IAM_USER" + ModelsIdentitySubTypeAwsIamRole ModelsIdentitySubType = "AWS_IAM_ROLE" + ModelsIdentitySubTypeAwsIamGroup ModelsIdentitySubType = "AWS_IAM_GROUP" + ModelsIdentitySubTypeAwsIamPolicy ModelsIdentitySubType = "AWS_IAM_POLICY" + ModelsIdentitySubTypeAwsCognitoUserPool ModelsIdentitySubType = "AWS_COGNITO_USER_POOL" + ModelsIdentitySubTypeK8sServiceAccount ModelsIdentitySubType = "K8S_SERVICE_ACCOUNT" + ModelsIdentitySubTypeK8sRole ModelsIdentitySubType = "K8S_ROLE" + ModelsIdentitySubTypeK8sRoleBinding ModelsIdentitySubType = "K8S_ROLE_BINDING" + ModelsIdentitySubTypeAzureEntraId ModelsIdentitySubType = "AZURE_ENTRA_ID" + ModelsIdentitySubTypeAzureRoleAssignment ModelsIdentitySubType = "AZURE_ROLE_ASSIGNMENT" + ModelsIdentitySubTypeAzureManagedIdentity ModelsIdentitySubType = "AZURE_MANAGED_IDENTITY" + ModelsIdentitySubTypeAzureServicePrincipal ModelsIdentitySubType = "AZURE_SERVICE_PRINCIPAL" + ModelsIdentitySubTypeAzureApplication ModelsIdentitySubType = "AZURE_APPLICATION" + ModelsIdentitySubTypeAzureAdUser ModelsIdentitySubType = "AZURE_AD_USER" + ModelsIdentitySubTypeAzureAdGroup ModelsIdentitySubType = "AZURE_AD_GROUP" + ModelsIdentitySubTypeGcpServiceAccount ModelsIdentitySubType = "GCP_SERVICE_ACCOUNT" + ModelsIdentitySubTypeGcpRole ModelsIdentitySubType = "GCP_ROLE" +) + +type ModelsLoadBalancerSubType string const ( - ModelsHostSourceTypeUseruploadhost ModelsHostSourceType = "UserUploadHost" - ModelsHostSourceTypeCodescanhost ModelsHostSourceType = "CodeScanHost" - ModelsHostSourceTypeAwsintegrationhost ModelsHostSourceType = "AWSIntegrationHost" - ModelsHostSourceTypeBughunthost ModelsHostSourceType = "BugHuntHost" - ModelsHostSourceTypeManualhost ModelsHostSourceType = "ManualHost" + ModelsLoadBalancerSubTypeAwsAlb ModelsLoadBalancerSubType = "AWS_ALB" + ModelsLoadBalancerSubTypeAwsNlb ModelsLoadBalancerSubType = "AWS_NLB" + ModelsLoadBalancerSubTypeAwsClb ModelsLoadBalancerSubType = "AWS_CLB" + ModelsLoadBalancerSubTypeAwsTargetGroup ModelsLoadBalancerSubType = "AWS_TARGET_GROUP" + ModelsLoadBalancerSubTypeK8sService ModelsLoadBalancerSubType = "K8S_SERVICE" + ModelsLoadBalancerSubTypeK8sIngress ModelsLoadBalancerSubType = "K8S_INGRESS" + ModelsLoadBalancerSubTypeAzureAppGateway ModelsLoadBalancerSubType = "AZURE_APP_GATEWAY" + ModelsLoadBalancerSubTypeGcpLb ModelsLoadBalancerSubType = "GCP_LB" ) type ModelsManifestRangeSource struct { @@ -1410,6 +5207,7 @@ type ModelsManifestRangeSource struct { } type ModelsMemory struct { + Anchors []string `json:"anchors,omitempty"` Citations []ModelsMemoryCitationsElem `json:"citations,omitempty"` Classification *ModelsMemoryClassification `json:"classification,omitempty"` CommentIds []string `json:"commentIds,omitempty"` @@ -1418,20 +5216,32 @@ type ModelsMemory struct { CreatedAt *string `json:"createdAt,omitempty"` CreatedBy *string `json:"createdBy,omitempty"` CrossReferences []ModelsMemoryCrossReferencesElem `json:"crossReferences,omitempty"` + EventTime *string `json:"eventTime,omitempty"` ID *string `json:"id,omitempty"` + InvalidateWhen *ModelsMemoryInvalidateWhen `json:"invalidateWhen,omitempty"` IsUserCreated *bool `json:"isUserCreated,omitempty"` + MemoryClass *ModelsMemoryMemoryClass `json:"memoryClass,omitempty"` MemoryLineage *ModelsMemoryMemoryLineage `json:"memoryLineage,omitempty"` MemoryType *ModelsMemoryMemoryType `json:"memoryType,omitempty"` Metadata *ModelsMemoryMetadata `json:"metadata,omitempty"` Priority *ModelsMemoryPriority `json:"priority,omitempty"` + PromptVersion *string `json:"promptVersion,omitempty"` QuestionID *string `json:"questionId,omitempty"` ResourceID *string `json:"resourceId,omitempty"` ResourceType *ModelsMemoryResourceType `json:"resourceType,omitempty"` + RetractedAt *string `json:"retractedAt,omitempty"` + RetractionReason *string `json:"retractionReason,omitempty"` Scope *ModelsMemoryScope `json:"scope,omitempty"` ScopeResourceID *string `json:"scopeResourceId,omitempty"` + Searchability *ModelsMemorySearchability `json:"searchability,omitempty"` + SourceEvent *string `json:"sourceEvent,omitempty"` + Status *ModelsMemoryStatus `json:"status,omitempty"` + Support *int `json:"support,omitempty"` Tags []string `json:"tags,omitempty"` Title *string `json:"title,omitempty"` + TrustTier *int `json:"trustTier,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` + Version *int `json:"version,omitempty"` } type ModelsMemoryCitationsElem struct { @@ -1572,6 +5382,27 @@ type ModelsMemoryCrossReferencesElem struct { ID *string `json:"id,omitempty"` } +type ModelsMemoryInvalidateWhen struct { + Anchor *string `json:"anchor,omitempty"` + Kind *ModelsMemoryInvalidateWhenKind `json:"kind,omitempty"` +} + +type ModelsMemoryInvalidateWhenKind string + +const ( + ModelsMemoryInvalidateWhenKindAnchorChanged ModelsMemoryInvalidateWhenKind = "anchor_changed" +) + +type ModelsMemoryMemoryClass string + +const ( + ModelsMemoryMemoryClassEpisodic ModelsMemoryMemoryClass = "episodic" + ModelsMemoryMemoryClassProcedural ModelsMemoryMemoryClass = "procedural" + ModelsMemoryMemoryClassProspective ModelsMemoryMemoryClass = "prospective" + ModelsMemoryMemoryClassRetrieval ModelsMemoryMemoryClass = "retrieval" + ModelsMemoryMemoryClassSemantic ModelsMemoryMemoryClass = "semantic" +) + type ModelsMemoryMemoryLineage struct { AgentVersion *string `json:"agentVersion,omitempty"` GenerationReason *ModelsMemoryMemoryLineageGenerationReason `json:"generationReason,omitempty"` @@ -1579,6 +5410,7 @@ type ModelsMemoryMemoryLineage struct { ParentMemoryID *string `json:"parentMemoryId,omitempty"` ParentSessionID *string `json:"parentSessionId,omitempty"` SessionID *string `json:"sessionId,omitempty"` + SupersededBy *string `json:"supersededBy,omitempty"` Timestamp *string `json:"timestamp,omitempty"` } @@ -1596,6 +5428,7 @@ type ModelsMemoryMemoryType string const ( ModelsMemoryMemoryTypeAnalysis ModelsMemoryMemoryType = "ANALYSIS" ModelsMemoryMemoryTypeAutofix ModelsMemoryMemoryType = "AUTOFIX" + ModelsMemoryMemoryTypeBranchNamingConvention ModelsMemoryMemoryType = "BRANCH_NAMING_CONVENTION" ModelsMemoryMemoryTypeDiscovery ModelsMemoryMemoryType = "DISCOVERY" ModelsMemoryMemoryTypeEscalation ModelsMemoryMemoryType = "ESCALATION" ModelsMemoryMemoryTypeFollowUp ModelsMemoryMemoryType = "FOLLOW_UP" @@ -1689,6 +5522,7 @@ const ( ModelsMemoryResourceTypeRepoContext ModelsMemoryResourceType = "REPO_CONTEXT" ModelsMemoryResourceTypeSchemaReversing ModelsMemoryResourceType = "SCHEMA_REVERSING" ModelsMemoryResourceTypeSecretsTriage ModelsMemoryResourceType = "SECRETS_TRIAGE" + ModelsMemoryResourceTypeSelfHostedIntegration ModelsMemoryResourceType = "SELF_HOSTED_INTEGRATION" ModelsMemoryResourceTypeStandoutAssessment ModelsMemoryResourceType = "STANDOUT_ASSESSMENT" ModelsMemoryResourceTypeTeam ModelsMemoryResourceType = "TEAM" ModelsMemoryResourceTypeUser ModelsMemoryResourceType = "USER" @@ -1704,7 +5538,72 @@ const ( ModelsMemoryScopeRepository ModelsMemoryScope = "REPOSITORY" ) +type ModelsMemorySearchability string + +const ( + ModelsMemorySearchabilityEmbeddingFailed ModelsMemorySearchability = "EMBEDDING_FAILED" + ModelsMemorySearchabilityLexicalOnly ModelsMemorySearchability = "LEXICAL_ONLY" + ModelsMemorySearchabilitySearchable ModelsMemorySearchability = "SEARCHABLE" +) + +type ModelsMemoryStatus string + +const ( + ModelsMemoryStatusActive ModelsMemoryStatus = "active" + ModelsMemoryStatusCancelled ModelsMemoryStatus = "cancelled" + ModelsMemoryStatusCandidate ModelsMemoryStatus = "candidate" + ModelsMemoryStatusCompleted ModelsMemoryStatus = "completed" + ModelsMemoryStatusQuarantined ModelsMemoryStatus = "quarantined" +) + +type ModelsMessagingSubType string + +const ( + ModelsMessagingSubTypeAwsSqs ModelsMessagingSubType = "AWS_SQS" + ModelsMessagingSubTypeAwsSns ModelsMessagingSubType = "AWS_SNS" + ModelsMessagingSubTypeAwsKinesis ModelsMessagingSubType = "AWS_KINESIS" + ModelsMessagingSubTypeAwsEventbridge ModelsMessagingSubType = "AWS_EVENTBRIDGE" + ModelsMessagingSubTypeAwsSes ModelsMessagingSubType = "AWS_SES" + ModelsMessagingSubTypeAwsMsk ModelsMessagingSubType = "AWS_MSK" + ModelsMessagingSubTypeAwsMq ModelsMessagingSubType = "AWS_MQ" + ModelsMessagingSubTypeGcpPubsub ModelsMessagingSubType = "GCP_PUBSUB" + ModelsMessagingSubTypeAzureServiceBus ModelsMessagingSubType = "AZURE_SERVICE_BUS" + ModelsMessagingSubTypeAzureEventHub ModelsMessagingSubType = "AZURE_EVENT_HUB" + ModelsMessagingSubTypeAzureEventGrid ModelsMessagingSubType = "AZURE_EVENT_GRID" + ModelsMessagingSubTypeAzureIotHub ModelsMessagingSubType = "AZURE_IOT_HUB" +) + +type ModelsNetworkSubType string + +const ( + ModelsNetworkSubTypeAwsVpc ModelsNetworkSubType = "AWS_VPC" + ModelsNetworkSubTypeAwsSubnet ModelsNetworkSubType = "AWS_SUBNET" + ModelsNetworkSubTypeAwsNatGateway ModelsNetworkSubType = "AWS_NAT_GATEWAY" + ModelsNetworkSubTypeAwsInternetGateway ModelsNetworkSubType = "AWS_INTERNET_GATEWAY" + ModelsNetworkSubTypeAwsVpcEndpoint ModelsNetworkSubType = "AWS_VPC_ENDPOINT" + ModelsNetworkSubTypeAwsRouteTable ModelsNetworkSubType = "AWS_ROUTE_TABLE" + ModelsNetworkSubTypeAwsEip ModelsNetworkSubType = "AWS_EIP" + ModelsNetworkSubTypeGcpVpc ModelsNetworkSubType = "GCP_VPC" + ModelsNetworkSubTypeGcpCloudNat ModelsNetworkSubType = "GCP_CLOUD_NAT" + ModelsNetworkSubTypeAzureVnet ModelsNetworkSubType = "AZURE_VNET" + ModelsNetworkSubTypeAzureSubnet ModelsNetworkSubType = "AZURE_SUBNET" +) + +type ModelsObservabilitySubType string + +const ( + ModelsObservabilitySubTypeAwsCloudwatchLogGroup ModelsObservabilitySubType = "AWS_CLOUDWATCH_LOG_GROUP" + ModelsObservabilitySubTypeAwsCloudwatchAlarm ModelsObservabilitySubType = "AWS_CLOUDWATCH_ALARM" + ModelsObservabilitySubTypeAwsCloudwatchDashboard ModelsObservabilitySubType = "AWS_CLOUDWATCH_DASHBOARD" + ModelsObservabilitySubTypeAwsXRay ModelsObservabilitySubType = "AWS_X_RAY" + ModelsObservabilitySubTypeGcpStackdriver ModelsObservabilitySubType = "GCP_STACKDRIVER" + ModelsObservabilitySubTypeGcpLogging ModelsObservabilitySubType = "GCP_LOGGING" + ModelsObservabilitySubTypeAzureMonitor ModelsObservabilitySubType = "AZURE_MONITOR" + ModelsObservabilitySubTypeAzureAutomation ModelsObservabilitySubType = "AZURE_AUTOMATION" +) + type ModelsOrgContext struct { + BugBountyProgram *ModelsOrgContextBugBountyProgram `json:"bugBountyProgram,omitempty"` CacheKey *string `json:"cacheKey,omitempty"` ComplianceRequirements []string `json:"complianceRequirements,omitempty"` Description *string `json:"description,omitempty"` @@ -1722,6 +5621,21 @@ type ModelsOrgContext struct { VaultFiles []ModelsOrgContextVaultFilesElem `json:"vaultFiles,omitempty"` } +type ModelsOrgContextBugBountyProgram struct { + Type *ModelsOrgContextBugBountyProgramType `json:"type,omitempty"` + URL *string `json:"url,omitempty"` +} + +type ModelsOrgContextBugBountyProgramType string + +const ( + ModelsOrgContextBugBountyProgramTypeBugcrowd ModelsOrgContextBugBountyProgramType = "bugcrowd" + ModelsOrgContextBugBountyProgramTypeDocument ModelsOrgContextBugBountyProgramType = "document" + ModelsOrgContextBugBountyProgramTypeHackerone ModelsOrgContextBugBountyProgramType = "hackerone" + ModelsOrgContextBugBountyProgramTypeNone ModelsOrgContextBugBountyProgramType = "none" + ModelsOrgContextBugBountyProgramTypeWebsite ModelsOrgContextBugBountyProgramType = "website" +) + type ModelsOrgContextDocumentCitationsElem struct { CitationID *string `json:"citation_id,omitempty"` DocumentID *string `json:"document_id,omitempty"` @@ -1789,29 +5703,68 @@ type ModelsOrgContextVaultFilesElem struct { FileName *string `json:"fileName,omitempty"` } +type ModelsPipelinesSubType string + +const ( + ModelsPipelinesSubTypeGithubActions ModelsPipelinesSubType = "GITHUB_ACTIONS" + ModelsPipelinesSubTypeGitlabCi ModelsPipelinesSubType = "GITLAB_CI" + ModelsPipelinesSubTypeJenkins ModelsPipelinesSubType = "JENKINS" + ModelsPipelinesSubTypeCircleci ModelsPipelinesSubType = "CIRCLECI" + ModelsPipelinesSubTypeBuildkite ModelsPipelinesSubType = "BUILDKITE" + ModelsPipelinesSubTypeAzurePipelines ModelsPipelinesSubType = "AZURE_PIPELINES" +) + type ModelsProjectSummary struct { Description string `json:"description"` - Framework *string `json:"framework,omitempty"` ID string `json:"id"` IsDeleted bool `json:"isDeleted"` - Language *string `json:"language,omitempty"` Name string `json:"name"` Path string `json:"path"` + PathPrefix string `json:"pathPrefix"` RepositoryID string `json:"repositoryId"` } +type ModelsProjectsSubType string + +const ( + ModelsProjectsSubTypeRepoContextProject ModelsProjectsSubType = "REPO_CONTEXT_PROJECT" +) + +type ModelsReposSubType string + +const ( + ModelsReposSubTypeGithubRepo ModelsReposSubType = "GITHUB_REPO" + ModelsReposSubTypeGitlabRepo ModelsReposSubType = "GITLAB_REPO" + ModelsReposSubTypeBitbucketRepo ModelsReposSubType = "BITBUCKET_REPO" + ModelsReposSubTypeAzureRepo ModelsReposSubType = "AZURE_REPO" +) + type ModelsSBOMProject struct { Commits []string `json:"commits,omitempty"` ProjectID string `json:"projectId"` ProjectName *string `json:"projectName,omitempty"` } +type ModelsSBOMProvenance struct { + Backend *string `json:"backend,omitempty"` + CdxgenVersion *string `json:"cdxgenVersion,omitempty"` + ImageDigest *string `json:"imageDigest,omitempty"` + SandboxJobID *string `json:"sandboxJobId,omitempty"` +} + type ModelsSBOMRepository struct { Projects []ModelsSBOMProject `json:"projects,omitempty"` RepositoryID string `json:"repositoryId"` RepositoryName *string `json:"repositoryName,omitempty"` } +type ModelsSBOMScope struct { + Dir *string `json:"dir,omitempty"` + Ecosystems []string `json:"ecosystems,omitempty"` + Path *string `json:"path,omitempty"` + Reason *string `json:"reason,omitempty"` +} + type ModelsSchemaFormat string const ( @@ -1850,11 +5803,72 @@ type ModelsSecurityOnboardingAnswersFilesElem struct { } type ModelsSecurityProfile struct { - ExposedSecrets int `json:"exposedSecrets"` + ExposedSecrets *int `json:"exposedSecrets,omitempty"` Recommendations []string `json:"recommendations,omitempty"` - RiskScore int `json:"riskScore"` + RiskScore *int `json:"riskScore,omitempty"` +} + +type ModelsSecuritySubType string + +const ( + ModelsSecuritySubTypeAwsSecurityGroup ModelsSecuritySubType = "AWS_SECURITY_GROUP" + ModelsSecuritySubTypeAwsNacl ModelsSecuritySubType = "AWS_NACL" + ModelsSecuritySubTypeAwsWaf ModelsSecuritySubType = "AWS_WAF" + ModelsSecuritySubTypeAwsKms ModelsSecuritySubType = "AWS_KMS" + ModelsSecuritySubTypeAwsSecretsManager ModelsSecuritySubType = "AWS_SECRETS_MANAGER" + ModelsSecuritySubTypeAwsAcm ModelsSecuritySubType = "AWS_ACM" + ModelsSecuritySubTypeAwsGuardDuty ModelsSecuritySubType = "AWS_GUARD_DUTY" + ModelsSecuritySubTypeAwsConfig ModelsSecuritySubType = "AWS_CONFIG" + ModelsSecuritySubTypeAwsCloudtrail ModelsSecuritySubType = "AWS_CLOUDTRAIL" + ModelsSecuritySubTypeAwsSsm ModelsSecuritySubType = "AWS_SSM" + ModelsSecuritySubTypeAzureKeyVault ModelsSecuritySubType = "AZURE_KEY_VAULT" + ModelsSecuritySubTypeAzureDefender ModelsSecuritySubType = "AZURE_DEFENDER" + ModelsSecuritySubTypeAzureNsg ModelsSecuritySubType = "AZURE_NSG" + ModelsSecuritySubTypeAzurePolicy ModelsSecuritySubType = "AZURE_POLICY" + ModelsSecuritySubTypeGcpKms ModelsSecuritySubType = "GCP_KMS" + ModelsSecuritySubTypeGcpSecretManager ModelsSecuritySubType = "GCP_SECRET_MANAGER" + ModelsSecuritySubTypeGcpScc ModelsSecuritySubType = "GCP_SCC" + ModelsSecuritySubTypeGcpOrgPolicy ModelsSecuritySubType = "GCP_ORG_POLICY" + ModelsSecuritySubTypeGcpPolicyAnalyzer ModelsSecuritySubType = "GCP_POLICY_ANALYZER" +) + +type ModelsServerlessSubType string + +const ( + ModelsServerlessSubTypeAwsLambda ModelsServerlessSubType = "AWS_LAMBDA" + ModelsServerlessSubTypeAwsStepFunction ModelsServerlessSubType = "AWS_STEP_FUNCTION" + ModelsServerlessSubTypeAwsAppRunner ModelsServerlessSubType = "AWS_APP_RUNNER" + ModelsServerlessSubTypeGcpCloudFunction ModelsServerlessSubType = "GCP_CLOUD_FUNCTION" + ModelsServerlessSubTypeGcpCloudRun ModelsServerlessSubType = "GCP_CLOUD_RUN" + ModelsServerlessSubTypeAzureFunction ModelsServerlessSubType = "AZURE_FUNCTION" + ModelsServerlessSubTypeAzureLogicApps ModelsServerlessSubType = "AZURE_LOGIC_APPS" + ModelsServerlessSubTypeGcpAppEngine ModelsServerlessSubType = "GCP_APP_ENGINE" +) + +type ModelsSharedInfrastructureRef struct { + ComponentID string `json:"componentId"` + Name string `json:"name"` + RepositoryID *string `json:"repositoryId,omitempty"` + Type string `json:"type"` } +type ModelsStorageAndBackupSubType string + +const ( + ModelsStorageAndBackupSubTypeAwsS3Bucket ModelsStorageAndBackupSubType = "AWS_S3_BUCKET" + ModelsStorageAndBackupSubTypeAwsEbsVolume ModelsStorageAndBackupSubType = "AWS_EBS_VOLUME" + ModelsStorageAndBackupSubTypeAwsEfs ModelsStorageAndBackupSubType = "AWS_EFS" + ModelsStorageAndBackupSubTypeAwsBackupVault ModelsStorageAndBackupSubType = "AWS_BACKUP_VAULT" + ModelsStorageAndBackupSubTypeAwsStorageGateway ModelsStorageAndBackupSubType = "AWS_STORAGE_GATEWAY" + ModelsStorageAndBackupSubTypeGcpGcsBucket ModelsStorageAndBackupSubType = "GCP_GCS_BUCKET" + ModelsStorageAndBackupSubTypeGcpPd ModelsStorageAndBackupSubType = "GCP_PD" + ModelsStorageAndBackupSubTypeGcpFilestore ModelsStorageAndBackupSubType = "GCP_FILESTORE" + ModelsStorageAndBackupSubTypeAzureBlob ModelsStorageAndBackupSubType = "AZURE_BLOB" + ModelsStorageAndBackupSubTypeAzureDisk ModelsStorageAndBackupSubType = "AZURE_DISK" + ModelsStorageAndBackupSubTypeAzureFiles ModelsStorageAndBackupSubType = "AZURE_FILES" + ModelsStorageAndBackupSubTypeAzureStorageAccount ModelsStorageAndBackupSubType = "AZURE_STORAGE_ACCOUNT" +) + type RepocontextAPISchema struct { Content *string `json:"content,omitempty"` Format *RepocontextAPISchemaFormat `json:"format,omitempty"` @@ -1956,9 +5970,16 @@ type RepocontextArtifactLink struct { EvidencePaths []string `json:"evidencePaths,omitempty"` MatchMethod *RepocontextArtifactLinkMatchMethod `json:"matchMethod,omitempty"` ProjectID *string `json:"projectId,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` TargetKind *RepocontextArtifactLinkTargetKind `json:"targetKind,omitempty"` TargetNodeID *string `json:"targetNodeId,omitempty"` TargetRef *string `json:"targetRef,omitempty"` + WorkloadFamily *string `json:"workloadFamily,omitempty"` +} + +type RepocontextArtifactLinkCoverage struct { + Projects []RepocontextProjectArtifactLinkCoverage `json:"projects,omitempty"` + UnreadInputs []string `json:"unreadInputs,omitempty"` } type RepocontextArtifactLinkMatchMethod string @@ -1984,11 +6005,85 @@ const ( RepocontextArtifactLinkTargetKindWorkload RepocontextArtifactLinkTargetKind = "workload" ) +type RepocontextAuthenticationGrounding struct { + Coverage *RepocontextAuthenticationGroundingCoverage `json:"coverage,omitempty"` + HeldMethods []string `json:"heldMethods,omitempty"` + Scope *RepocontextAuthenticationGroundingScope `json:"scope,omitempty"` +} + +type RepocontextAuthenticationGroundingCoverage string + +const ( + RepocontextAuthenticationGroundingCoveragePartial RepocontextAuthenticationGroundingCoverage = "partial" + RepocontextAuthenticationGroundingCoverageUnavailable RepocontextAuthenticationGroundingCoverage = "unavailable" + RepocontextAuthenticationGroundingCoverageUnknown RepocontextAuthenticationGroundingCoverage = "unknown" +) + +type RepocontextAuthenticationGroundingScope string + +const ( + RepocontextAuthenticationGroundingScopeDeclaredSource RepocontextAuthenticationGroundingScope = "declared-source" +) + +type RepocontextBuildAssessment struct { + Completion *RepocontextBuildAssessmentCompletion `json:"completion,omitempty"` + Gaps []RepocontextBuildCoverageGap `json:"gaps,omitempty"` +} + +type RepocontextBuildAssessmentCompletion string + +const ( + RepocontextBuildAssessmentCompletionComplete RepocontextBuildAssessmentCompletion = "complete" + RepocontextBuildAssessmentCompletionIncomplete RepocontextBuildAssessmentCompletion = "incomplete" + RepocontextBuildAssessmentCompletionUnknown RepocontextBuildAssessmentCompletion = "unknown" +) + +type RepocontextBuildCoverage struct { + FormatVersion *int `json:"formatVersion,omitempty"` + Projects []RepocontextProjectBuildCoverage `json:"projects,omitempty"` + Repository *RepocontextBuildAssessment `json:"repository,omitempty"` + SourceCommit *string `json:"sourceCommit,omitempty"` +} + +type RepocontextBuildCoverageGap struct { + Path *string `json:"path,omitempty"` + Reason *RepocontextBuildCoverageGapReason `json:"reason,omitempty"` +} + +type RepocontextBuildCoverageGapReason string + +const ( + RepocontextBuildCoverageGapReasonAmbiguousOwner RepocontextBuildCoverageGapReason = "ambiguous_owner" + RepocontextBuildCoverageGapReasonIdentityChanged RepocontextBuildCoverageGapReason = "identity_changed" + RepocontextBuildCoverageGapReasonInvalidSource RepocontextBuildCoverageGapReason = "invalid_source" + RepocontextBuildCoverageGapReasonLimitExceeded RepocontextBuildCoverageGapReason = "limit_exceeded" + RepocontextBuildCoverageGapReasonMissingPublish RepocontextBuildCoverageGapReason = "missing_publish" + RepocontextBuildCoverageGapReasonUnknownPredicate RepocontextBuildCoverageGapReason = "unknown_predicate" + RepocontextBuildCoverageGapReasonUnreadableSource RepocontextBuildCoverageGapReason = "unreadable_source" + RepocontextBuildCoverageGapReasonUnresolvedInput RepocontextBuildCoverageGapReason = "unresolved_input" + RepocontextBuildCoverageGapReasonUnsupportedRoute RepocontextBuildCoverageGapReason = "unsupported_route" +) + +type RepocontextBuildOwnership struct { + BaseImages *RepocontextContainerBaseImages `json:"baseImages,omitempty"` + BuildContext *string `json:"buildContext,omitempty"` + Dockerfile *string `json:"dockerfile,omitempty"` + EvidencePaths []string `json:"evidencePaths,omitempty"` + Image *string `json:"image,omitempty"` + SourcePaths []string `json:"sourcePaths,omitempty"` + SourceRepository *string `json:"sourceRepository,omitempty"` + SupportingContexts []string `json:"supportingContexts,omitempty"` + Target *string `json:"target,omitempty"` + Variant *string `json:"variant,omitempty"` +} + type RepocontextBusinessFunction struct { + Confidence *RepocontextConfidence `json:"confidence,omitempty"` Description *string `json:"description,omitempty"` ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` OwnedPaths []string `json:"ownedPaths,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` } type RepocontextCallEdge struct { @@ -2085,17 +6180,26 @@ const ( type RepocontextComplianceFramework string const ( + RepocontextComplianceFrameworkApraCps234 RepocontextComplianceFramework = "APRA-CPS-234" RepocontextComplianceFrameworkCcpa RepocontextComplianceFramework = "CCPA" RepocontextComplianceFrameworkCis RepocontextComplianceFramework = "CIS" RepocontextComplianceFrameworkFedramp RepocontextComplianceFramework = "FEDRAMP" RepocontextComplianceFrameworkGdpr RepocontextComplianceFramework = "GDPR" RepocontextComplianceFrameworkGlba RepocontextComplianceFramework = "GLBA" RepocontextComplianceFrameworkHipaa RepocontextComplianceFramework = "HIPAA" + RepocontextComplianceFrameworkHitrust RepocontextComplianceFramework = "HITRUST" RepocontextComplianceFrameworkIso27001 RepocontextComplianceFramework = "ISO27001" + RepocontextComplianceFrameworkIso27017 RepocontextComplianceFramework = "ISO27017" + RepocontextComplianceFrameworkIso27018 RepocontextComplianceFramework = "ISO27018" + RepocontextComplianceFrameworkLgpd RepocontextComplianceFramework = "LGPD" RepocontextComplianceFrameworkNist RepocontextComplianceFramework = "NIST" + RepocontextComplianceFrameworkNist80053 RepocontextComplianceFramework = "NIST-800-53" + RepocontextComplianceFrameworkNistCsf RepocontextComplianceFramework = "NIST-CSF" RepocontextComplianceFrameworkOther RepocontextComplianceFramework = "OTHER" RepocontextComplianceFrameworkPciDss RepocontextComplianceFramework = "PCI-DSS" + RepocontextComplianceFrameworkPipeda RepocontextComplianceFramework = "PIPEDA" RepocontextComplianceFrameworkSoc2 RepocontextComplianceFramework = "SOC2" + RepocontextComplianceFrameworkSox RepocontextComplianceFramework = "SOX" ) type RepocontextConfidence string @@ -2108,6 +6212,43 @@ const ( RepocontextConfidenceSpeculative RepocontextConfidence = "speculative" ) +type RepocontextContainerBaseImages struct { + DockerfileSha256 *string `json:"dockerfileSha256,omitempty"` + Images []string `json:"images,omitempty"` +} + +type RepocontextCoverageGap struct { + AccountIds []string `json:"accountIds,omitempty"` + Action *string `json:"action,omitempty"` + Effect *RepocontextCoverageGapEffect `json:"effect,omitempty"` + Image *string `json:"image,omitempty"` + Kind *RepocontextCoverageGapKind `json:"kind,omitempty"` + Missing *string `json:"missing,omitempty"` + PathNodeIds []string `json:"pathNodeIds,omitempty"` + Reason *string `json:"reason,omitempty"` + Region *string `json:"region,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` +} + +type RepocontextCoverageGapEffect string + +const ( + RepocontextCoverageGapEffectInformational RepocontextCoverageGapEffect = "informational" + RepocontextCoverageGapEffectLowersConfidence RepocontextCoverageGapEffect = "lowers_confidence" +) + +type RepocontextCoverageGapKind string + +const ( + RepocontextCoverageGapKindTransitGateway RepocontextCoverageGapKind = "transit_gateway" + RepocontextCoverageGapKindUncollectedResource RepocontextCoverageGapKind = "uncollected_resource" + RepocontextCoverageGapKindUnscannedAccount RepocontextCoverageGapKind = "unscanned_account" + RepocontextCoverageGapKindUnverifiedProxy RepocontextCoverageGapKind = "unverified_proxy" + RepocontextCoverageGapKindVpcPeering RepocontextCoverageGapKind = "vpc_peering" + RepocontextCoverageGapKindVpnOrDirectConnect RepocontextCoverageGapKind = "vpn_or_direct_connect" +) + type RepocontextDataClassification string const ( @@ -2121,12 +6262,15 @@ const ( type RepocontextDataDomain struct { AvailabilityRequirement *RepocontextImpactLevel `json:"availabilityRequirement,omitempty"` ComplianceFrameworks []RepocontextComplianceFramework `json:"complianceFrameworks,omitempty"` + Confidence *RepocontextConfidence `json:"confidence,omitempty"` Description *string `json:"description,omitempty"` + Evidence []RepocontextRepoContextEvidence `json:"evidence,omitempty"` ExamplePaths []string `json:"examplePaths,omitempty"` ID *string `json:"id,omitempty"` IntegrityRequirement *RepocontextImpactLevel `json:"integrityRequirement,omitempty"` Name *string `json:"name,omitempty"` PiiCategories []RepocontextDataDomainPiiCategoriesElem `json:"piiCategories,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` Sensitivity *RepocontextDataDomainSensitivity `json:"sensitivity,omitempty"` } @@ -2273,6 +6417,7 @@ const ( type RepocontextDataflowHop struct { BoundaryID *string `json:"boundaryId,omitempty"` + BoundaryName *string `json:"boundaryName,omitempty"` CallEdgeID *string `json:"callEdgeId,omitempty"` FilePath *string `json:"filePath,omitempty"` Index *int `json:"index,omitempty"` @@ -2294,20 +6439,44 @@ const ( RepocontextDataflowHopRoleTransform RepocontextDataflowHopRole = "transform" ) +type RepocontextDeploymentTargetDetail struct { + Confidence *RepocontextConfidence `json:"confidence,omitempty"` + Evidence []RepocontextRepoContextEvidence `json:"evidence,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` + Source *RepocontextDeploymentTargetDetailSource `json:"source,omitempty"` + Target *string `json:"target,omitempty"` +} + +type RepocontextDeploymentTargetDetailSource string + +const ( + RepocontextDeploymentTargetDetailSourceCi RepocontextDeploymentTargetDetailSource = "ci" + RepocontextDeploymentTargetDetailSourceCloudGraph RepocontextDeploymentTargetDetailSource = "cloud_graph" + RepocontextDeploymentTargetDetailSourceIacResource RepocontextDeploymentTargetDetailSource = "iac_resource" + RepocontextDeploymentTargetDetailSourceManifest RepocontextDeploymentTargetDetailSource = "manifest" +) + type RepocontextEntrypointRoute struct { AuthMethods []RepocontextEntrypointRouteAuthMethodsElem `json:"authMethods,omitempty"` + AuthStatus *RepocontextEntrypointRouteAuthStatus `json:"authStatus,omitempty"` DataDomainIds []string `json:"dataDomainIds,omitempty"` DataFlowIds []string `json:"dataFlowIds,omitempty"` FilePath *string `json:"filePath,omitempty"` + FrameworkName *string `json:"frameworkName,omitempty"` + Handler *string `json:"handler,omitempty"` HandlerSymbolID *string `json:"handlerSymbolId,omitempty"` IsAuthenticated *bool `json:"isAuthenticated,omitempty"` IsInternal *bool `json:"isInternal,omitempty"` + Language *string `json:"language,omitempty"` LineNumber *int `json:"lineNumber,omitempty"` Method *RepocontextEntrypointRouteMethod `json:"method,omitempty"` OperationID *string `json:"operationId,omitempty"` Parameters []RepocontextRouteParameter `json:"parameters,omitempty"` Path *string `json:"path,omitempty"` + PathUnresolved *bool `json:"pathUnresolved,omitempty"` + ProjectPathPrefix *string `json:"projectPathPrefix,omitempty"` RateLimit *bool `json:"rateLimit,omitempty"` + RegistrationCondition *string `json:"registrationCondition,omitempty"` RequestBodyFields []string `json:"requestBodyFields,omitempty"` RequiresPrivilegedAccess *bool `json:"requiresPrivilegedAccess,omitempty"` ResponseStatuses []int `json:"responseStatuses,omitempty"` @@ -2333,6 +6502,14 @@ const ( RepocontextEntrypointRouteAuthMethodsElemSessionCookie RepocontextEntrypointRouteAuthMethodsElem = "SESSION_COOKIE" ) +type RepocontextEntrypointRouteAuthStatus string + +const ( + RepocontextEntrypointRouteAuthStatusAuthenticated RepocontextEntrypointRouteAuthStatus = "authenticated" + RepocontextEntrypointRouteAuthStatusUnauthenticated RepocontextEntrypointRouteAuthStatus = "unauthenticated" + RepocontextEntrypointRouteAuthStatusUnknown RepocontextEntrypointRouteAuthStatus = "unknown" +) + type RepocontextEntrypointRouteMethod string const ( @@ -2382,6 +6559,55 @@ type RepocontextFileSummary struct { Summary *string `json:"summary,omitempty"` } +type RepocontextIaCCloudLink struct { + AccountID *string `json:"accountId,omitempty"` + Address *string `json:"address,omitempty"` + CandidateCount *int `json:"candidateCount,omitempty"` + CloudNodeID *string `json:"cloudNodeId,omitempty"` + CloudSubType *string `json:"cloudSubType,omitempty"` + Confidence *RepocontextConfidence `json:"confidence,omitempty"` + DeclarationID *string `json:"declarationId,omitempty"` + Evidence []RepocontextRepoContextEvidence `json:"evidence,omitempty"` + File *string `json:"file,omitempty"` + Line *int `json:"line,omitempty"` + MatchMethod *RepocontextIaCCloudLinkMatchMethod `json:"matchMethod,omitempty"` + ModuleDir *string `json:"moduleDir,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` + Region *string `json:"region,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + RootDir *string `json:"rootDir,omitempty"` + Source *RepocontextIaCCloudLinkSource `json:"source,omitempty"` + Status *RepocontextIaCCloudLinkStatus `json:"status,omitempty"` +} + +type RepocontextIaCCloudLinkMatchMethod string + +const ( + RepocontextIaCCloudLinkMatchMethodIacIdentifierExact RepocontextIaCCloudLinkMatchMethod = "iac_identifier_exact" + RepocontextIaCCloudLinkMatchMethodIacNameAcrossAccounts RepocontextIaCCloudLinkMatchMethod = "iac_name_across_accounts" + RepocontextIaCCloudLinkMatchMethodIacNameGlobal RepocontextIaCCloudLinkMatchMethod = "iac_name_global" + RepocontextIaCCloudLinkMatchMethodIacNameInAccount RepocontextIaCCloudLinkMatchMethod = "iac_name_in_account" +) + +type RepocontextIaCCloudLinkSource string + +const ( + RepocontextIaCCloudLinkSourceCloudformation RepocontextIaCCloudLinkSource = "cloudformation" + RepocontextIaCCloudLinkSourceTerraform RepocontextIaCCloudLinkSource = "terraform" +) + +type RepocontextIaCCloudLinkStatus string + +const ( + RepocontextIaCCloudLinkStatusAmbiguous RepocontextIaCCloudLinkStatus = "ambiguous" + RepocontextIaCCloudLinkStatusCandidate RepocontextIaCCloudLinkStatus = "candidate" + RepocontextIaCCloudLinkStatusMatched RepocontextIaCCloudLinkStatus = "matched" + RepocontextIaCCloudLinkStatusNotFound RepocontextIaCCloudLinkStatus = "not_found" + RepocontextIaCCloudLinkStatusNotInInventory RepocontextIaCCloudLinkStatus = "not_in_inventory" + RepocontextIaCCloudLinkStatusUnresolved RepocontextIaCCloudLinkStatus = "unresolved" + RepocontextIaCCloudLinkStatusUnscannedAccount RepocontextIaCCloudLinkStatus = "unscanned_account" +) + type RepocontextImpactLevel string const ( @@ -2408,11 +6634,13 @@ type RepocontextInfrastructureMatch struct { AccountType *RepocontextInfrastructureMatchAccountType `json:"accountType,omitempty"` ArtifactName *string `json:"artifactName,omitempty"` ComputeType *RepocontextInfrastructureMatchComputeType `json:"computeType,omitempty"` + Evidence []RepocontextRepoContextEvidence `json:"evidence,omitempty"` IsInternetFacing *bool `json:"isInternetFacing,omitempty"` MatchConfidence *RepocontextConfidence `json:"matchConfidence,omitempty"` MatchDetail *string `json:"matchDetail,omitempty"` MatchMethod *RepocontextInfrastructureMatchMatchMethod `json:"matchMethod,omitempty"` NodeID *string `json:"nodeId,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` Region *string `json:"region,omitempty"` ServiceName *string `json:"serviceName,omitempty"` } @@ -2441,13 +6669,18 @@ type RepocontextInfrastructureMatchMatchMethod string const ( RepocontextInfrastructureMatchMatchMethodAffinityHint RepocontextInfrastructureMatchMatchMethod = "affinity_hint" RepocontextInfrastructureMatchMatchMethodAwsTag RepocontextInfrastructureMatchMatchMethod = "aws_tag" + RepocontextInfrastructureMatchMatchMethodBuildConfig RepocontextInfrastructureMatchMatchMethod = "build_config" + RepocontextInfrastructureMatchMatchMethodCiPipeline RepocontextInfrastructureMatchMatchMethod = "ci_pipeline" RepocontextInfrastructureMatchMatchMethodContainerImageName RepocontextInfrastructureMatchMatchMethod = "container_image_name" RepocontextInfrastructureMatchMatchMethodContainerImageUri RepocontextInfrastructureMatchMatchMethod = "container_image_uri" RepocontextInfrastructureMatchMatchMethodK8sLabel RepocontextInfrastructureMatchMatchMethod = "k8s_label" + RepocontextInfrastructureMatchMatchMethodManualLabel RepocontextInfrastructureMatchMatchMethod = "manual_label" + RepocontextInfrastructureMatchMatchMethodRegistryReference RepocontextInfrastructureMatchMatchMethod = "registry_reference" RepocontextInfrastructureMatchMatchMethodServiceNameMatch RepocontextInfrastructureMatchMatchMethod = "service_name_match" ) type RepocontextMetadata struct { + AuthenticationGrounding *RepocontextAuthenticationGrounding `json:"authenticationGrounding,omitempty"` GeneratedAt *string `json:"generatedAt,omitempty"` GeneratorModel *string `json:"generatorModel,omitempty"` GeneratorPromptVersion *string `json:"generatorPromptVersion,omitempty"` @@ -2474,6 +6707,14 @@ type RepocontextProjectArtifactDeploymentContext struct { IsDeployed *bool `json:"isDeployed,omitempty"` } +type RepocontextProjectArtifactLinkCoverage struct { + FailedProvider *int `json:"failedProvider,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + SkippedBudget *int `json:"skippedBudget,omitempty"` + SkippedTimeout *int `json:"skippedTimeout,omitempty"` + Undecided *int `json:"undecided,omitempty"` +} + type RepocontextProjectArtifactRegistriesElem struct { BaseURL *string `json:"baseUrl,omitempty"` ID *string `json:"id,omitempty"` @@ -2520,11 +6761,21 @@ const ( RepocontextProjectArtifactStoryElemTypeRunScript RepocontextProjectArtifactStoryElemType = "RUN_SCRIPT" ) +type RepocontextProjectBuildCoverage struct { + Assessment *RepocontextBuildAssessment `json:"assessment,omitempty"` + Ownership []RepocontextBuildOwnership `json:"ownership,omitempty"` + PathPrefix *string `json:"pathPrefix,omitempty"` + ProjectID *string `json:"projectId,omitempty"` +} + type RepocontextProjectContext struct { Artifacts []RepocontextProjectContextArtifactsElem `json:"artifacts,omitempty"` BoundaryIds []string `json:"boundaryIds,omitempty"` + BuildArtifacts []map[string]json.RawMessage `json:"buildArtifacts,omitempty"` BusinessFunctionIds []RepocontextProjectContextBusinessFunctionIdsElem `json:"businessFunctionIds,omitempty"` CacheKey *string `json:"cacheKey,omitempty"` + ClassificationConfidence *RepocontextConfidence `json:"classificationConfidence,omitempty"` + ClassificationReasoning *string `json:"classificationReasoning,omitempty"` CodeSymbols []RepocontextCodeSymbol `json:"codeSymbols,omitempty"` DataDomainIds []string `json:"dataDomainIds,omitempty"` DataHandled []RepocontextProjectContextDataHandledElem `json:"dataHandled,omitempty"` @@ -2536,6 +6787,8 @@ type RepocontextProjectContext struct { Entrypoints []RepocontextProjectEntrypoint `json:"entrypoints,omitempty"` FileSummaries []RepocontextFileSummary `json:"fileSummaries,omitempty"` Frameworks []RepocontextProjectContextFrameworksElem `json:"frameworks,omitempty"` + Iac *RepocontextProjectContextIac `json:"iac,omitempty"` + IacPrograms []RepocontextProjectContextIacProgramsElem `json:"iacPrograms,omitempty"` ID *string `json:"id,omitempty"` ImportanceReasoning *string `json:"importanceReasoning,omitempty"` InternalDependencyIds []string `json:"internalDependencyIds,omitempty"` @@ -2551,6 +6804,7 @@ type RepocontextProjectContext struct { RepositoryReferences []RepocontextProjectContextRepositoryReferencesElem `json:"repositoryReferences,omitempty"` Role *RepocontextProjectContextRole `json:"role,omitempty"` SecurityImportance *RepocontextProjectContextSecurityImportance `json:"securityImportance,omitempty"` + ShippedArtifact *RepocontextProjectContextShippedArtifact `json:"shippedArtifact,omitempty"` TestCoverage *RepocontextProjectContextTestCoverage `json:"testCoverage,omitempty"` TrustedServiceIds []string `json:"trustedServiceIds,omitempty"` } @@ -2646,6 +6900,32 @@ type RepocontextProjectContextFrameworksElem struct { Version *string `json:"version,omitempty"` } +type RepocontextProjectContextIac struct { + Backend *string `json:"backend,omitempty"` + Confidence *RepocontextConfidence `json:"confidence,omitempty"` + ConsumedBy []string `json:"consumedBy,omitempty"` + Kind *RepocontextProjectContextIacKind `json:"kind,omitempty"` + Modules []string `json:"modules,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` + Roots []string `json:"roots,omitempty"` + Units []string `json:"units,omitempty"` + Uses []string `json:"uses,omitempty"` +} + +type RepocontextProjectContextIacKind string + +const ( + RepocontextProjectContextIacKindEmbedded RepocontextProjectContextIacKind = "embedded" + RepocontextProjectContextIacKindModule RepocontextProjectContextIacKind = "module" + RepocontextProjectContextIacKindRoot RepocontextProjectContextIacKind = "root" + RepocontextProjectContextIacKindStack RepocontextProjectContextIacKind = "stack" +) + +type RepocontextProjectContextIacProgramsElem struct { + Path *string `json:"path,omitempty"` + ShippedArtifact *RepocontextProjectContextShippedArtifact `json:"shippedArtifact,omitempty"` +} + type RepocontextProjectContextOwnersElem struct { Name *string `json:"name,omitempty"` Source *string `json:"source,omitempty"` @@ -2703,6 +6983,24 @@ const ( RepocontextProjectContextSecurityImportanceMedium RepocontextProjectContextSecurityImportance = "MEDIUM" ) +type RepocontextProjectContextShippedArtifact struct { + DependenciesShipped *bool `json:"dependenciesShipped,omitempty"` + DevDependenciesShipped *bool `json:"devDependenciesShipped,omitempty"` + Evidence []string `json:"evidence,omitempty"` + Kind *RepocontextProjectContextShippedArtifactKind `json:"kind,omitempty"` +} + +type RepocontextProjectContextShippedArtifactKind string + +const ( + RepocontextProjectContextShippedArtifactKindContainerImage RepocontextProjectContextShippedArtifactKind = "container_image" + RepocontextProjectContextShippedArtifactKindFunctionPackage RepocontextProjectContextShippedArtifactKind = "function_package" + RepocontextProjectContextShippedArtifactKindIacTemplate RepocontextProjectContextShippedArtifactKind = "iac_template" + RepocontextProjectContextShippedArtifactKindLibrary RepocontextProjectContextShippedArtifactKind = "library" + RepocontextProjectContextShippedArtifactKindNone RepocontextProjectContextShippedArtifactKind = "none" + RepocontextProjectContextShippedArtifactKindUnknown RepocontextProjectContextShippedArtifactKind = "unknown" +) + type RepocontextProjectContextTestCoverage struct { HasIntegrationTests *bool `json:"hasIntegrationTests,omitempty"` HasTests *bool `json:"hasTests,omitempty"` @@ -2717,7 +7015,13 @@ type RepocontextProjectEntrypoint struct { Artifacts []RepocontextProjectArtifact `json:"artifacts,omitempty"` AuthMethods []RepocontextProjectEntrypointAuthMethodsElem `json:"authMethods,omitempty"` BoundaryIds []string `json:"boundaryIds,omitempty"` + BuildArtifacts []map[string]json.RawMessage `json:"buildArtifacts,omitempty"` + CloudInternetFacing *bool `json:"cloudInternetFacing,omitempty"` + CloudInternetFacingConfidence *RepocontextConfidence `json:"cloudInternetFacingConfidence,omitempty"` + CloudInternetFacingConfidenceReason *string `json:"cloudInternetFacingConfidenceReason,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` DataFlowIds []string `json:"dataFlowIds,omitempty"` + DeploymentTargets []string `json:"deploymentTargets,omitempty"` Description *string `json:"description,omitempty"` DetectionConfidence *RepocontextConfidence `json:"detectionConfidence,omitempty"` FrameworkName *string `json:"frameworkName,omitempty"` @@ -2728,8 +7032,10 @@ type RepocontextProjectEntrypoint struct { NodeID *string `json:"nodeId,omitempty"` Path *string `json:"path,omitempty"` Ports []int `json:"ports,omitempty"` + ProjectPath *string `json:"projectPath,omitempty"` Protocols []RepocontextProjectEntrypointProtocolsElem `json:"protocols,omitempty"` Routes []RepocontextEntrypointRoute `json:"routes,omitempty"` + ServedHostnames []RepocontextProjectEntrypointServedHostnamesElem `json:"servedHostnames,omitempty"` SessionMechanism *RepocontextProjectEntrypointSessionMechanism `json:"sessionMechanism,omitempty"` SymbolID *string `json:"symbolId,omitempty"` TrustedServiceIds []string `json:"trustedServiceIds,omitempty"` @@ -2777,6 +7083,12 @@ const ( RepocontextProjectEntrypointProtocolsElemWebsocket RepocontextProjectEntrypointProtocolsElem = "WEBSOCKET" ) +type RepocontextProjectEntrypointServedHostnamesElem struct { + Evidence *string `json:"evidence,omitempty"` + Hostname *string `json:"hostname,omitempty"` + PathPrefix *string `json:"pathPrefix,omitempty"` +} + type RepocontextProjectEntrypointSessionMechanism string const ( @@ -2789,6 +7101,8 @@ const ( type RepocontextReachabilityPath struct { ArtifactLinkID *string `json:"artifactLinkId,omitempty"` Confidence *RepocontextConfidence `json:"confidence,omitempty"` + ConfidenceReason *string `json:"confidenceReason,omitempty"` + CoverageGaps []RepocontextCoverageGap `json:"coverageGaps,omitempty"` EntrypointIds []string `json:"entrypointIds,omitempty"` ExposureRoot *RepocontextReachabilityPathExposureRoot `json:"exposureRoot,omitempty"` ExposureSummary *string `json:"exposureSummary,omitempty"` @@ -2834,8 +7148,10 @@ const ( ) type RepocontextRepoContext struct { + ArtifactLinkCoverage *RepocontextArtifactLinkCoverage `json:"artifactLinkCoverage,omitempty"` ArtifactLinks []RepocontextArtifactLink `json:"artifactLinks,omitempty"` AuthenticationMethods []string `json:"authenticationMethods,omitempty"` + BuildCoverage *RepocontextBuildCoverage `json:"buildCoverage,omitempty"` BusinessFunctions []RepocontextBusinessFunction `json:"businessFunctions,omitempty"` CacheKey *string `json:"cacheKey,omitempty"` CallEdges []RepocontextCallEdge `json:"callEdges,omitempty"` @@ -2848,10 +7164,14 @@ type RepocontextRepoContext struct { DataDomains []RepocontextDataDomain `json:"dataDomains,omitempty"` DataFlows []RepocontextDataFlow `json:"dataFlows,omitempty"` Databases []RepocontextRepoContextDatabasesElem `json:"databases,omitempty"` + DeploymentTargetDetails []RepocontextDeploymentTargetDetail `json:"deploymentTargetDetails,omitempty"` DeploymentTargets []string `json:"deploymentTargets,omitempty"` Description *string `json:"description,omitempty"` DevelopmentGuidelines *RepocontextRepoContextDevelopmentGuidelines `json:"developmentGuidelines,omitempty"` Graph *GraphGraph `json:"graph,omitempty"` + IacCloudLinkCoverage *RepocontextRepoContextIacCloudLinkCoverage `json:"iacCloudLinkCoverage,omitempty"` + IacCloudLinks []RepocontextIaCCloudLink `json:"iacCloudLinks,omitempty"` + IacCoverageGaps []RepocontextCoverageGap `json:"iacCoverageGaps,omitempty"` ID *string `json:"id,omitempty"` InfrastructureMatches []RepocontextInfrastructureMatch `json:"infrastructureMatches,omitempty"` InputValidationFrameworks []string `json:"inputValidationFrameworks,omitempty"` @@ -2860,10 +7180,12 @@ type RepocontextRepoContext struct { IsMonorepo *bool `json:"isMonorepo,omitempty"` IsOpenAPISpecAvailable *bool `json:"isOpenAPISpecAvailable,omitempty"` IsTruncatedAnalysis *bool `json:"isTruncatedAnalysis,omitempty"` + MermaidDiagram *string `json:"mermaidDiagram,omitempty"` Metadata *RepocontextMetadata `json:"metadata,omitempty"` MonitoringTooling []string `json:"monitoringTooling,omitempty"` Name *string `json:"name,omitempty"` NetworkExposure *RepocontextRepoContextNetworkExposure `json:"networkExposure,omitempty"` + NonSecurityImportantPaths []RepocontextRepoContextNonSecurityImportantPathsElem `json:"nonSecurityImportantPaths,omitempty"` OpenAPISpecPath []string `json:"openAPISpecPath,omitempty"` Projects []RepocontextProjectContext `json:"projects,omitempty"` Public *bool `json:"public,omitempty"` @@ -2928,14 +7250,18 @@ type RepocontextRepoContextContextSummary struct { ComplianceDrivers []string `json:"complianceDrivers,omitempty"` Confidence *RepocontextConfidence `json:"confidence,omitempty"` ExecutiveSummary *string `json:"executiveSummary,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` RecommendedFollowups []string `json:"recommendedFollowups,omitempty"` TechnicalSummary *string `json:"technicalSummary,omitempty"` TopRisks []string `json:"topRisks,omitempty"` } type RepocontextRepoContextDatabasesElem struct { + Confidence *RepocontextConfidence `json:"confidence,omitempty"` DatabaseType *RepocontextRepoContextDatabasesElemDatabaseType `json:"databaseType,omitempty"` + Evidence []RepocontextRepoContextEvidence `json:"evidence,omitempty"` Name *string `json:"name,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` } type RepocontextRepoContextDatabasesElemDatabaseType string @@ -3000,6 +7326,21 @@ const ( RepocontextRepoContextDirectorySummaryKindTests RepocontextRepoContextDirectorySummaryKind = "tests" ) +type RepocontextRepoContextEvidence struct { + Line *int `json:"line,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + Path *string `json:"path,omitempty"` + Quote *string `json:"quote,omitempty"` +} + +type RepocontextRepoContextIacCloudLinkCoverage struct { + Capped *bool `json:"capped,omitempty"` + IndexFailed *bool `json:"indexFailed,omitempty"` + InventoryUnread *bool `json:"inventoryUnread,omitempty"` + Reason *string `json:"reason,omitempty"` + UnreadAccounts []string `json:"unreadAccounts,omitempty"` +} + type RepocontextRepoContextNetworkExposure string const ( @@ -3008,6 +7349,32 @@ const ( RepocontextRepoContextNetworkExposureLibrary RepocontextRepoContextNetworkExposure = "library" ) +type RepocontextRepoContextNonSecurityImportantPathsElem struct { + Confidence *RepocontextRepoContextNonSecurityImportantPathsElemConfidence `json:"confidence,omitempty"` + Evidence []string `json:"evidence,omitempty"` + Path *string `json:"path,omitempty"` + ProjectIds []string `json:"projectIds,omitempty"` + Reason *RepocontextRepoContextNonSecurityImportantPathsElemReason `json:"reason,omitempty"` +} + +type RepocontextRepoContextNonSecurityImportantPathsElemConfidence string + +const ( + RepocontextRepoContextNonSecurityImportantPathsElemConfidenceHigh RepocontextRepoContextNonSecurityImportantPathsElemConfidence = "high" +) + +type RepocontextRepoContextNonSecurityImportantPathsElemReason string + +const ( + RepocontextRepoContextNonSecurityImportantPathsElemReasonDocs RepocontextRepoContextNonSecurityImportantPathsElemReason = "docs" + RepocontextRepoContextNonSecurityImportantPathsElemReasonEval RepocontextRepoContextNonSecurityImportantPathsElemReason = "eval" + RepocontextRepoContextNonSecurityImportantPathsElemReasonFixture RepocontextRepoContextNonSecurityImportantPathsElemReason = "fixture" + RepocontextRepoContextNonSecurityImportantPathsElemReasonGenerated RepocontextRepoContextNonSecurityImportantPathsElemReason = "generated" + RepocontextRepoContextNonSecurityImportantPathsElemReasonSample RepocontextRepoContextNonSecurityImportantPathsElemReason = "sample" + RepocontextRepoContextNonSecurityImportantPathsElemReasonTest RepocontextRepoContextNonSecurityImportantPathsElemReason = "test" + RepocontextRepoContextNonSecurityImportantPathsElemReasonVendored RepocontextRepoContextNonSecurityImportantPathsElemReason = "vendored" +) + type RepocontextRepoContextProjectImportance string const ( @@ -3021,7 +7388,10 @@ type RepocontextRepoContextProjectRole string const ( RepocontextRepoContextProjectRoleAdminSurface RepocontextRepoContextProjectRole = "admin_surface" RepocontextRepoContextProjectRoleBatchJob RepocontextRepoContextProjectRole = "batch_job" + RepocontextRepoContextProjectRoleCiPlugin RepocontextRepoContextProjectRole = "ci_plugin" RepocontextRepoContextProjectRoleCliTool RepocontextRepoContextProjectRole = "cli_tool" + RepocontextRepoContextProjectRoleDataPipeline RepocontextRepoContextProjectRole = "data_pipeline" + RepocontextRepoContextProjectRoleEditorExtension RepocontextRepoContextProjectRole = "editor_extension" RepocontextRepoContextProjectRoleFrontendApp RepocontextRepoContextProjectRole = "frontend_app" RepocontextRepoContextProjectRoleInfrastructure RepocontextRepoContextProjectRole = "infrastructure" RepocontextRepoContextProjectRoleInternalApi RepocontextRepoContextProjectRole = "internal_api" @@ -3206,6 +7576,7 @@ type RepocontextSecurityBoundary struct { MechanismTypes []RepocontextSecurityBoundaryMechanismTypesElem `json:"mechanismTypes,omitempty"` Name *string `json:"name,omitempty"` NodeIds []string `json:"nodeIds,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` RelatedDataDomainIds []string `json:"relatedDataDomainIds,omitempty"` RelatedEntrypointIds []string `json:"relatedEntrypointIds,omitempty"` RelatedProjectIds []string `json:"relatedProjectIds,omitempty"` @@ -3287,6 +7658,7 @@ type RepocontextSourceSink struct { Language *LanguageCodeLanguage `json:"language,omitempty"` ProjectID *string `json:"projectId,omitempty"` QualifiedName *string `json:"qualifiedName,omitempty"` + ResolvedUrls []RepocontextSourceSinkResolvedUrlsElem `json:"resolvedUrls,omitempty"` StartLine *int `json:"startLine,omitempty"` Symbol *string `json:"symbol,omitempty"` SymbolID *string `json:"symbolId,omitempty"` @@ -3335,6 +7707,13 @@ const ( RepocontextSourceSinkKindSource RepocontextSourceSinkKind = "source" ) +type RepocontextSourceSinkResolvedUrlsElem struct { + ConfigKey *string `json:"configKey,omitempty"` + FilePath *string `json:"filePath,omitempty"` + Line *int `json:"line,omitempty"` + URL *string `json:"url,omitempty"` +} + type RepocontextToxicCombination struct { ComponentFindings *RepocontextToxicCombinationComponentFindings `json:"componentFindings,omitempty"` Confidence *RepocontextConfidence `json:"confidence,omitempty"` @@ -3400,6 +7779,7 @@ type RepocontextTrustedService struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` NodeIds []string `json:"nodeIds,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` RelatedDataDomainIds []string `json:"relatedDataDomainIds,omitempty"` RelatedEntrypointIds []string `json:"relatedEntrypointIds,omitempty"` RelatedProjectIds []string `json:"relatedProjectIds,omitempty"` diff --git a/internal/api/models/cspm.go b/internal/api/models/cspm.go index 4b77c9a..e778145 100644 --- a/internal/api/models/cspm.go +++ b/internal/api/models/cspm.go @@ -3,6 +3,13 @@ package models import "encoding/json" +type AgentsGroupedAgentLog struct { + Logs *AgentsAgentLogs `json:"logs,omitempty"` + Summary *string `json:"summary,omitempty"` +} + +type AgentsGroupedAgentLogs = []AgentsGroupedAgentLog + type EndpointsAutofixActivityLogEntry struct { Content *string `json:"content,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` @@ -11,12 +18,49 @@ type EndpointsAutofixActivityLogEntry struct { Metadata *string `json:"metadata,omitempty"` } -type EndpointsGetCSPMFindingAutofixDiffOutput struct { - Commit string `json:"commit"` - Diffs []ModelsDiffFile `json:"diffs,omitempty"` - Explanation string `json:"explanation"` - PullRequestBody string `json:"pullRequestBody"` - PullRequestTitle string `json:"pullRequestTitle"` +type EndpointsAutofixCoordination struct { + Entries []EndpointsAutofixPRCoordination `json:"entries,omitempty"` + Unavailable bool `json:"unavailable"` +} + +type EndpointsAutofixOutcome string + +const ( + // (skipped value "" — no representable Go identifier) + EndpointsAutofixOutcomeDeclined EndpointsAutofixOutcome = "declined" + EndpointsAutofixOutcomeStopped EndpointsAutofixOutcome = "stopped" +) + +type EndpointsAutofixPRCoordination struct { + AttemptID *string `json:"attemptId,omitempty"` + Blocked bool `json:"blocked"` + Message string `json:"message"` + PrIdentifier string `json:"prIdentifier"` + ReasonCode string `json:"reasonCode"` + RepositoryID string `json:"repositoryId"` + RequestID string `json:"requestId"` + RetryAllowed bool `json:"retryAllowed"` + State string `json:"state"` +} + +type EndpointsAvailableAction struct { + Body map[string]json.RawMessage `json:"body,omitempty"` + Confirm *string `json:"confirm,omitempty"` + Href *string `json:"href,omitempty"` + ID string `json:"id"` + Kind EndpointsAvailableActionKind `json:"kind"` + Label string `json:"label"` + Method *string `json:"method,omitempty"` +} + +type EndpointsAvailableActionKind string + +const ( + EndpointsAvailableActionKindCommand EndpointsAvailableActionKind = "command" + EndpointsAvailableActionKindLink EndpointsAvailableActionKind = "link" +) + +type EndpointsDeleteTicketCSPMFindingOutput struct { Version *string `json:"version,omitempty"` } @@ -35,10 +79,17 @@ type EndpointsGetCSPMFindingOutput struct { Version string `json:"version"` } +type EndpointsGetCSPMFindingTriageOutput struct { + Finding *ModelsTriagedCSPMFinding `json:"finding,omitempty"` + Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` +} + type EndpointsGetCSPMFindingsOutput struct { Findings []ModelsCSPMFindingPreview `json:"findings,omitempty"` NextToken *string `json:"nextToken,omitempty"` NumItems int `json:"numItems"` + TotalCount int `json:"totalCount"` Version string `json:"version"` } @@ -51,6 +102,7 @@ type EndpointsGetCSPMScansOutput struct { NextToken *string `json:"nextToken,omitempty"` NumItems int `json:"numItems"` Scans []ModelsCSPMScanPreview `json:"scans,omitempty"` + TotalCount int `json:"totalCount"` Version string `json:"version"` } @@ -63,15 +115,48 @@ type EndpointsIterationSummary struct { TotalOutputTokens int `json:"totalOutputTokens"` } +type EndpointsPatchCSPMFindingInput struct { + ClearPriorityOverride *bool `json:"clearPriorityOverride,omitempty"` + ClearSeverityOverride *bool `json:"clearSeverityOverride,omitempty"` + PriorityOverride *ModelsPriorityLabel `json:"priorityOverride,omitempty"` + SeverityOverride *ModelsSeverity `json:"severityOverride,omitempty"` + UserNotes *string `json:"userNotes,omitempty"` +} + +type EndpointsPatchCSPMFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsPostAllowlistCSPMFindingInput struct { + AllowlistReason string `json:"allowlistReason"` + AllowlistType *ModelsAllowlistType `json:"allowlistType,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostAllowlistCSPMFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsPostArchiveCSPMFindingInput struct { + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostArchiveCSPMFindingOutput struct { + Version *string `json:"version,omitempty"` +} + type EndpointsPostCSPMFindingAutofixInput struct { Force *bool `json:"force,omitempty"` + GitRepositoryProvider *ModelsGitRepositoryProvider `json:"gitRepositoryProvider,omitempty"` Message *string `json:"message,omitempty"` OriginCampaignID *string `json:"originCampaignId,omitempty"` + UseCachedFix *bool `json:"useCachedFix,omitempty"` } type EndpointsPostCSPMFindingAutofixOutput struct { AutoFixState ModelsAutoFixState `json:"autoFixState"` Error *string `json:"error,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } @@ -89,15 +174,107 @@ type EndpointsPostCreateTicketCSPMFindingOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsPostMarkFalsePositiveCSPMFindingInput struct { + FalsePositiveReason string `json:"falsePositiveReason"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostMarkFalsePositiveCSPMFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsPostUnallowlistCSPMFindingInput struct { + UnallowlistReason *string `json:"unallowlistReason,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostUnallowlistCSPMFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsPostUnarchiveCSPMFindingInput struct { + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostUnarchiveCSPMFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsPostUnmarkFalsePositiveCSPMFindingInput struct { + UserCanonicalID *string `json:"userCanonicalId,omitempty"` +} + +type EndpointsPostUnmarkFalsePositiveCSPMFindingOutput struct { + Version *string `json:"version,omitempty"` +} + type EndpointsPullRequestSummary struct { + CiCheckedAt *string `json:"ciCheckedAt,omitempty"` + CiDetailURL *string `json:"ciDetailUrl,omitempty"` + CiState *ModelsPullRequestCIState `json:"ciState,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` Identifier int `json:"identifier"` MergedAt *string `json:"mergedAt,omitempty"` Provider *ModelsProviderID `json:"provider,omitempty"` + RecordID *string `json:"recordId,omitempty"` Status *ModelsPullRequestState `json:"status,omitempty"` URL *string `json:"url,omitempty"` } +type EndpointsStartCSPMScanOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` + ScanID *string `json:"scanId,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +type FrameworksConfidence string + +const ( + FrameworksConfidenceExact FrameworksConfidence = "exact" + FrameworksConfidenceHeuristic FrameworksConfidence = "heuristic" + FrameworksConfidenceDefault FrameworksConfidence = "default" + FrameworksConfidenceNone FrameworksConfidence = "none" +) + +type FrameworksControlRef struct { + Confidence *FrameworksConfidence `json:"confidence,omitempty"` + ID *string `json:"id,omitempty"` + Level *string `json:"level,omitempty"` + Relationship *string `json:"relationship,omitempty"` + Title *string `json:"title,omitempty"` + URL *string `json:"url,omitempty"` +} + +type FrameworksFrameworkID string + +const ( + FrameworksFrameworkIDCvss31 FrameworksFrameworkID = "cvss-3.1" + FrameworksFrameworkIDCvss40 FrameworksFrameworkID = "cvss-4.0" + FrameworksFrameworkIDOwaspTop102021 FrameworksFrameworkID = "owasp-top10-2021" + FrameworksFrameworkIDOwaspAsvs50 FrameworksFrameworkID = "owasp-asvs-5.0" + FrameworksFrameworkIDPciDss401 FrameworksFrameworkID = "pci-dss-4.0.1" + FrameworksFrameworkIDNistCsf20 FrameworksFrameworkID = "nist-csf-2.0" + FrameworksFrameworkIDAuIsm FrameworksFrameworkID = "au-ism" +) + +type FrameworksResult struct { + Controls []FrameworksControlRef `json:"controls,omitempty"` + Framework *FrameworksFrameworkID `json:"framework,omitempty"` + MappingConfidence *FrameworksConfidence `json:"mappingConfidence,omitempty"` + Notes []string `json:"notes,omitempty"` + Rank *string `json:"rank,omitempty"` + Score *FrameworksScore `json:"score,omitempty"` + Version *string `json:"version,omitempty"` +} + +type FrameworksScore struct { + BaseScore *float64 `json:"baseScore,omitempty"` + Nomenclature *string `json:"nomenclature,omitempty"` + Qualitative *string `json:"qualitative,omitempty"` + Synthesized *bool `json:"synthesized,omitempty"` + Vector *string `json:"vector,omitempty"` +} + type ModelsAutofixPhase string const ( @@ -137,7 +314,9 @@ type ModelsCSPMFinding struct { ExploitabilityConfidence *string `json:"exploitabilityConfidence,omitempty"` ExploitabilityLabel *string `json:"exploitabilityLabel,omitempty"` FailedTriage *bool `json:"failedTriage,omitempty"` + FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` FixCommit *string `json:"fixCommit,omitempty"` + FixEvidence *string `json:"fixEvidence,omitempty"` FixSource *string `json:"fixSource,omitempty"` FixedAt *string `json:"fixedAt,omitempty"` ID *string `json:"id,omitempty"` @@ -178,10 +357,10 @@ type ModelsCSPMFinding struct { TicketState *string `json:"ticketState,omitempty"` Title *string `json:"title,omitempty"` TriageAgentVersion *string `json:"triageAgentVersion,omitempty"` + TriageAttempts *int `json:"triageAttempts,omitempty"` + TriageDeferredUntil *string `json:"triageDeferredUntil,omitempty"` TriageDurationSeconds int `json:"triageDurationSeconds"` TriageEnd *string `json:"triageEnd,omitempty"` - TriageLangfuseSessionID *string `json:"triageLangfuseSessionId,omitempty"` - TriageLangfuseTraceID *string `json:"triageLangfuseTraceId,omitempty"` TriageLlmCostUsd *float64 `json:"triageLlmCostUsd,omitempty"` TriageStart *string `json:"triageStart,omitempty"` TriageTokenCount *int `json:"triageTokenCount,omitempty"` @@ -201,10 +380,12 @@ type ModelsCSPMFindingPreview struct { CloudProvider *string `json:"cloudProvider,omitempty"` ComplianceFrames []ModelsComplianceFrame `json:"complianceFrames,omitempty"` CreatedAt string `json:"createdAt"` + FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` ID string `json:"id"` IsAllowlisted *bool `json:"isAllowlisted,omitempty"` IsArchived *bool `json:"isArchived,omitempty"` IsFalsePositive *bool `json:"isFalsePositive,omitempty"` + IsFixed *bool `json:"isFixed,omitempty"` IsLatest *bool `json:"isLatest,omitempty"` IsResolved bool `json:"isResolved"` Message *string `json:"message,omitempty"` @@ -219,12 +400,14 @@ type ModelsCSPMFindingPreview struct { RuleID *string `json:"ruleId,omitempty"` RuleURL *string `json:"ruleUrl,omitempty"` Severity *ModelsSeverity `json:"severity,omitempty"` + SeverityOverride *ModelsSeverity `json:"severityOverride,omitempty"` TenantID string `json:"tenantId"` Ticket *ModelsTicketProvider `json:"ticket,omitempty"` Title string `json:"title"` TriageEnd *string `json:"triageEnd,omitempty"` TriageStart *string `json:"triageStart,omitempty"` UpdatedAt string `json:"updatedAt"` + UserNotes *string `json:"userNotes,omitempty"` } type ModelsCSPMScan struct { @@ -257,6 +440,8 @@ type ModelsCSPMScan struct { Status *ModelsScanStatus `json:"status,omitempty"` Summary ModelsCSPMScanSummary `json:"summary"` TenantID *string `json:"tenantId,omitempty"` + TriageDeferredCount *int `json:"triageDeferredCount,omitempty"` + TriageEligibleCount *int `json:"triageEligibleCount,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` } @@ -272,12 +457,15 @@ type ModelsCSPMScanPreview struct { IsArchived *bool `json:"isArchived,omitempty"` Progress *int `json:"progress,omitempty"` Region *string `json:"region,omitempty"` + RegionsToScan []string `json:"regionsToScan,omitempty"` ScanType *ModelsCSPMScanType `json:"scanType,omitempty"` ScannerVersion *string `json:"scannerVersion,omitempty"` StartedAt string `json:"startedAt"` Status *ModelsScanStatus `json:"status,omitempty"` Summary ModelsCSPMScanSummary `json:"summary"` TenantID *string `json:"tenantId,omitempty"` + TriageDeferredCount *int `json:"triageDeferredCount,omitempty"` + TriageEligibleCount *int `json:"triageEligibleCount,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` } @@ -303,17 +491,874 @@ const ( ModelsCSPMScanTypeScheduledCloudScan ModelsCSPMScanType = "scheduled-cloud-scan" ) -type ModelsCloudProvider string - -const ( - ModelsCloudProviderAws ModelsCloudProvider = "AWS" - ModelsCloudProviderAzure ModelsCloudProvider = "AZURE" - ModelsCloudProviderGcp ModelsCloudProvider = "GCP" - ModelsCloudProviderK8s ModelsCloudProvider = "K8S" -) - type ModelsComplianceFrame struct { Control *string `json:"control,omitempty"` Framework *string `json:"framework,omitempty"` Version *string `json:"version,omitempty"` } + +type ModelsCustomerQuestion struct { + Answer *json.RawMessage `json:"answer,omitempty"` + AnswerMemoryID *string `json:"answerMemoryId,omitempty"` + AnsweredAt *string `json:"answeredAt,omitempty"` + CustomMessage *string `json:"customMessage,omitempty"` + Expiry *ModelsCustomerQuestionExpiry `json:"expiry,omitempty"` + FindingIds []string `json:"findingIds,omitempty"` + GapCategories []string `json:"gapCategories,omitempty"` + ID *string `json:"id,omitempty"` + Options []ModelsCustomerQuestionOptionsElem `json:"options,omitempty"` + QuestionText *string `json:"questionText,omitempty"` + QuestionType *ModelsCustomerQuestionQuestionType `json:"questionType,omitempty"` + RelatedMemoryIds []string `json:"relatedMemoryIds,omitempty"` + Scope *ModelsCustomerQuestionScope `json:"scope,omitempty"` + ScopeResourceID *string `json:"scopeResourceId,omitempty"` + UnknownIds []string `json:"unknownIds,omitempty"` +} + +type ModelsCustomerQuestionExpiry struct { + ExpiresInDays *int `json:"expiresInDays,omitempty"` + FollowUpDays *int `json:"followUpDays,omitempty"` + IfExpired *ModelsCustomerQuestionExpiryIfExpired `json:"ifExpired,omitempty"` + Justification *string `json:"justification,omitempty"` + Mode *ModelsCustomerQuestionExpiryMode `json:"mode,omitempty"` +} + +type ModelsCustomerQuestionExpiryIfExpired string + +const ( + ModelsCustomerQuestionExpiryIfExpiredEscalate ModelsCustomerQuestionExpiryIfExpired = "escalate" + ModelsCustomerQuestionExpiryIfExpiredExpire ModelsCustomerQuestionExpiryIfExpired = "expire" + ModelsCustomerQuestionExpiryIfExpiredReaskOnce ModelsCustomerQuestionExpiryIfExpired = "reask_once" +) + +type ModelsCustomerQuestionExpiryMode string + +const ( + ModelsCustomerQuestionExpiryModeDeadline ModelsCustomerQuestionExpiryMode = "deadline" + ModelsCustomerQuestionExpiryModeUntilResolved ModelsCustomerQuestionExpiryMode = "until_resolved" +) + +type ModelsCustomerQuestionOptionsElem struct { + ID *string `json:"id,omitempty"` + Label *string `json:"label,omitempty"` + Value *string `json:"value,omitempty"` +} + +type ModelsCustomerQuestionQuestionType string + +const ( + ModelsCustomerQuestionQuestionTypeFreeText ModelsCustomerQuestionQuestionType = "FREE_TEXT" + ModelsCustomerQuestionQuestionTypeMultiSelect ModelsCustomerQuestionQuestionType = "MULTI_SELECT" + ModelsCustomerQuestionQuestionTypeSingleSelect ModelsCustomerQuestionQuestionType = "SINGLE_SELECT" + ModelsCustomerQuestionQuestionTypeYesNo ModelsCustomerQuestionQuestionType = "YES_NO" +) + +type ModelsCustomerQuestionScope string + +const ( + ModelsCustomerQuestionScopeCloud ModelsCustomerQuestionScope = "CLOUD" + ModelsCustomerQuestionScopeOrganization ModelsCustomerQuestionScope = "ORGANIZATION" + ModelsCustomerQuestionScopeRepository ModelsCustomerQuestionScope = "REPOSITORY" +) + +type ModelsCustomerQuestionSet struct { + CustomMessage *string `json:"customMessage,omitempty"` + GeneratedMemoryIds []string `json:"generatedMemoryIds,omitempty"` + ID *string `json:"id,omitempty"` + Questions []ModelsCustomerQuestion `json:"questions,omitempty"` +} + +type ModelsTriageAgentConfidence string + +const ( + ModelsTriageAgentConfidenceHigh ModelsTriageAgentConfidence = "HIGH" + ModelsTriageAgentConfidenceLow ModelsTriageAgentConfidence = "LOW" + ModelsTriageAgentConfidenceMedium ModelsTriageAgentConfidence = "MEDIUM" +) + +type ModelsTriageCampaignMetadata struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} + +type ModelsTriageCloudContext struct { + Confidence *float64 `json:"confidence,omitempty"` + Mode *ModelsTriageCloudContextMode `json:"mode,omitempty"` + OwnershipBasis *ModelsTriageCloudContextOwnershipBasis `json:"ownershipBasis,omitempty"` + Repos []string `json:"repos,omitempty"` + Thoughts *string `json:"thoughts,omitempty"` +} + +type ModelsTriageCloudContextMode string + +const ( + ModelsTriageCloudContextModeModea ModelsTriageCloudContextMode = "MODEA" + ModelsTriageCloudContextModeModeb ModelsTriageCloudContextMode = "MODEB" +) + +type ModelsTriageCloudContextOwnershipBasis string + +const ( + ModelsTriageCloudContextOwnershipBasisDeclared ModelsTriageCloudContextOwnershipBasis = "declared" + ModelsTriageCloudContextOwnershipBasisProven ModelsTriageCloudContextOwnershipBasis = "proven" +) + +type ModelsTriageComplianceFramework struct { + Clause *string `json:"clause,omitempty"` + Framework *ModelsTriageComplianceFrameworkFramework `json:"framework,omitempty"` + Obligation *string `json:"obligation,omitempty"` +} + +type ModelsTriageComplianceFrameworkFramework string + +const ( + ModelsTriageComplianceFrameworkFrameworkCcpa ModelsTriageComplianceFrameworkFramework = "CCPA" + ModelsTriageComplianceFrameworkFrameworkCis ModelsTriageComplianceFrameworkFramework = "CIS" + ModelsTriageComplianceFrameworkFrameworkFedramp ModelsTriageComplianceFrameworkFramework = "FEDRAMP" + ModelsTriageComplianceFrameworkFrameworkGdpr ModelsTriageComplianceFrameworkFramework = "GDPR" + ModelsTriageComplianceFrameworkFrameworkGlba ModelsTriageComplianceFrameworkFramework = "GLBA" + ModelsTriageComplianceFrameworkFrameworkHipaa ModelsTriageComplianceFrameworkFramework = "HIPAA" + ModelsTriageComplianceFrameworkFrameworkIso27001 ModelsTriageComplianceFrameworkFramework = "ISO27001" + ModelsTriageComplianceFrameworkFrameworkNist ModelsTriageComplianceFrameworkFramework = "NIST" + ModelsTriageComplianceFrameworkFrameworkOther ModelsTriageComplianceFrameworkFramework = "OTHER" + ModelsTriageComplianceFrameworkFrameworkPciDss ModelsTriageComplianceFrameworkFramework = "PCI-DSS" + ModelsTriageComplianceFrameworkFrameworkSoc2 ModelsTriageComplianceFrameworkFramework = "SOC2" +) + +type ModelsTriageComplianceImpact struct { + Citations []ModelsTriageReference `json:"citations,omitempty"` + Confidence *ModelsTriageComplianceImpactConfidence `json:"confidence,omitempty"` + Frameworks []ModelsTriageComplianceFramework `json:"frameworks,omitempty"` + Rationale *string `json:"rationale,omitempty"` +} + +type ModelsTriageComplianceImpactConfidence string + +const ( + ModelsTriageComplianceImpactConfidenceHigh ModelsTriageComplianceImpactConfidence = "HIGH" + ModelsTriageComplianceImpactConfidenceLow ModelsTriageComplianceImpactConfidence = "LOW" + ModelsTriageComplianceImpactConfidenceMedium ModelsTriageComplianceImpactConfidence = "MEDIUM" +) + +type ModelsTriageContainerAssessmentBatchesElem struct { + CompletedCVEs []string `json:"completedCVEs,omitempty"` + Cves []string `json:"cves,omitempty"` + Reason *string `json:"reason,omitempty"` + Result *string `json:"result,omitempty"` + Status *ModelsTriageContainerAssessmentBatchesElemStatus `json:"status,omitempty"` +} + +type ModelsTriageContainerAssessmentBatchesElemStatus string + +const ( + ModelsTriageContainerAssessmentBatchesElemStatusCompleted ModelsTriageContainerAssessmentBatchesElemStatus = "completed" + ModelsTriageContainerAssessmentBatchesElemStatusFailed ModelsTriageContainerAssessmentBatchesElemStatus = "failed" + ModelsTriageContainerAssessmentBatchesElemStatusIncomplete ModelsTriageContainerAssessmentBatchesElemStatus = "incomplete" +) + +type ModelsTriageContainerAssessmentStatus string + +const ( + ModelsTriageContainerAssessmentStatusCompleted ModelsTriageContainerAssessmentStatus = "completed" + ModelsTriageContainerAssessmentStatusFailed ModelsTriageContainerAssessmentStatus = "failed" + ModelsTriageContainerAssessmentStatusIncomplete ModelsTriageContainerAssessmentStatus = "incomplete" +) + +type ModelsTriageExploitability struct { + AttackComplexity *ModelsTriageExploitabilityAttackComplexity `json:"attackComplexity,omitempty"` + AttackRequirements *ModelsTriageExploitabilityAttackRequirements `json:"attackRequirements,omitempty"` + AttackVector *ModelsTriageExploitabilityAttackVector `json:"attackVector,omitempty"` + Confidence *ModelsTriageExploitabilityConfidence `json:"confidence,omitempty"` + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityLabel `json:"label,omitempty"` + PrivilegesRequired *ModelsTriageExploitabilityPrivilegesRequired `json:"privilegesRequired,omitempty"` + Title *string `json:"title,omitempty"` + Unknowns []string `json:"unknowns,omitempty"` + UserInteraction *ModelsTriageExploitabilityUserInteraction `json:"userInteraction,omitempty"` +} + +type ModelsTriageExploitabilityAttackComplexity struct { + Description *string `json:"description,omitempty"` + ExploitChainRequired *ModelsTriageExploitabilityAttackComplexityExploitChainRequired `json:"exploitChainRequired,omitempty"` + Label *ModelsTriageExploitabilityAttackComplexityLabel `json:"label,omitempty"` + PayloadDifficulty *ModelsTriageExploitabilityAttackComplexityPayloadDifficulty `json:"payloadDifficulty,omitempty"` +} + +type ModelsTriageExploitabilityAttackComplexityExploitChainRequired struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel string + +const ( + ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabelHigh ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel = "HIGH" + ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabelLow ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel = "LOW" + ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabelNone ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel = "NONE" +) + +type ModelsTriageExploitabilityAttackComplexityLabel string + +const ( + ModelsTriageExploitabilityAttackComplexityLabelHigh ModelsTriageExploitabilityAttackComplexityLabel = "HIGH" + ModelsTriageExploitabilityAttackComplexityLabelLow ModelsTriageExploitabilityAttackComplexityLabel = "LOW" +) + +type ModelsTriageExploitabilityAttackComplexityPayloadDifficulty struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel `json:"label,omitempty"` +} + +type ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel string + +const ( + ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabelEasy ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel = "EASY" + ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabelHard ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel = "HARD" + ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabelNone ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel = "NONE" +) + +type ModelsTriageExploitabilityAttackRequirements struct { + Description *string `json:"description,omitempty"` + EnvironmentState *ModelsTriageExploitabilityAttackRequirementsEnvironmentState `json:"environmentState,omitempty"` + Label *ModelsTriageExploitabilityAttackRequirementsLabel `json:"label,omitempty"` + Mitm *ModelsTriageExploitabilityAttackRequirementsMitm `json:"mitm,omitempty"` + RaceCondition *ModelsTriageExploitabilityAttackRequirementsRaceCondition `json:"raceCondition,omitempty"` + TimeWindow *ModelsTriageExploitabilityAttackRequirementsTimeWindow `json:"timeWindow,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageExploitabilityAttackRequirementsEnvironmentState struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel string + +const ( + ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabelHigh ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel = "HIGH" + ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabelLow ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel = "LOW" + ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabelNone ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel = "NONE" +) + +type ModelsTriageExploitabilityAttackRequirementsLabel string + +const ( + ModelsTriageExploitabilityAttackRequirementsLabelHigh ModelsTriageExploitabilityAttackRequirementsLabel = "HIGH" + ModelsTriageExploitabilityAttackRequirementsLabelLow ModelsTriageExploitabilityAttackRequirementsLabel = "LOW" + ModelsTriageExploitabilityAttackRequirementsLabelNone ModelsTriageExploitabilityAttackRequirementsLabel = "NONE" +) + +type ModelsTriageExploitabilityAttackRequirementsMitm struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityAttackRequirementsMitmLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageExploitabilityAttackRequirementsMitmLabel string + +const ( + ModelsTriageExploitabilityAttackRequirementsMitmLabelHigh ModelsTriageExploitabilityAttackRequirementsMitmLabel = "HIGH" + ModelsTriageExploitabilityAttackRequirementsMitmLabelLow ModelsTriageExploitabilityAttackRequirementsMitmLabel = "LOW" + ModelsTriageExploitabilityAttackRequirementsMitmLabelNone ModelsTriageExploitabilityAttackRequirementsMitmLabel = "NONE" +) + +type ModelsTriageExploitabilityAttackRequirementsRaceCondition struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel string + +const ( + ModelsTriageExploitabilityAttackRequirementsRaceConditionLabelHigh ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel = "HIGH" + ModelsTriageExploitabilityAttackRequirementsRaceConditionLabelLow ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel = "LOW" + ModelsTriageExploitabilityAttackRequirementsRaceConditionLabelNone ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel = "NONE" +) + +type ModelsTriageExploitabilityAttackRequirementsTimeWindow struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel string + +const ( + ModelsTriageExploitabilityAttackRequirementsTimeWindowLabelHigh ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel = "HIGH" + ModelsTriageExploitabilityAttackRequirementsTimeWindowLabelLow ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel = "LOW" + ModelsTriageExploitabilityAttackRequirementsTimeWindowLabelNone ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel = "NONE" +) + +type ModelsTriageExploitabilityAttackVector struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityAttackVectorLabel `json:"label,omitempty"` + SubVectors []ModelsTriageExploitabilityAttackVectorSubVectorsElem `json:"subVectors,omitempty"` +} + +type ModelsTriageExploitabilityAttackVectorLabel string + +const ( + ModelsTriageExploitabilityAttackVectorLabelAdjacent ModelsTriageExploitabilityAttackVectorLabel = "ADJACENT" + ModelsTriageExploitabilityAttackVectorLabelLocal ModelsTriageExploitabilityAttackVectorLabel = "LOCAL" + ModelsTriageExploitabilityAttackVectorLabelNetwork ModelsTriageExploitabilityAttackVectorLabel = "NETWORK" + ModelsTriageExploitabilityAttackVectorLabelPhysical ModelsTriageExploitabilityAttackVectorLabel = "PHYSICAL" +) + +type ModelsTriageExploitabilityAttackVectorSubVectorsElem struct { + Description *string `json:"description,omitempty"` + OtherVector *string `json:"otherVector,omitempty"` + Vector *ModelsTriageExploitabilityAttackVectorSubVectorsElemVector `json:"vector,omitempty"` +} + +type ModelsTriageExploitabilityAttackVectorSubVectorsElemVector string + +const ( + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentArpSpoofing ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_ARP_SPOOFING" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentBleAdvertising ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_BLE_ADVERTISING" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentBluetoothClassic ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_BLUETOOTH_CLASSIC" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentBluetoothKnob ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_BLUETOOTH_KNOB" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentIpv6NeighborDiscovery ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_IPV6_NEIGHBOR_DISCOVERY" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentMdns ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_MDNS" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentNetbios ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_NETBIOS" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentNfc ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_NFC" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_OTHER" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentSmb ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_SMB" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentSsdp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_SSDP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentThread ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_THREAD" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentWifiDirect ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_WIFI_DIRECT" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentZigbee ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_ZIGBEE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalCommandLineArgument ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_COMMAND_LINE_ARGUMENT" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalConfigurationFile ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_CONFIGURATION_FILE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalCronJob ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_CRON_JOB" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalDBusMessage ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_D-BUS_MESSAGE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalDockerSocket ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_DOCKER_SOCKET" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalEnvironmentVariable ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_ENVIRONMENT_VARIABLE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalFileContent ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_FILE_CONTENT" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalFileName ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_FILE_NAME" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalFilePath ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_FILE_PATH" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalIpcSocket ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_IPC_SOCKET" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_OTHER" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalScriptPlugin ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SCRIPT_PLUGIN" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalSharedLibraryLoad ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SHARED_LIBRARY_LOAD" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalSharedMemory ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SHARED_MEMORY" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalShellCommand ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SHELL_COMMAND" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalSuidExecutable ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SUID_EXECUTABLE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkDns ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_DNS" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkFtp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_FTP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkGraphqlQuery ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_GRAPHQL_QUERY" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkGre ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_GRE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpBody ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_BODY" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpCookie ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_COOKIE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpFileUpload ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_FILE_UPLOAD" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpHeader ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_HEADER" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpMethod ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_METHOD" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpPathParameter ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_PATH_PARAMETER" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpQueryParameter ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_QUERY_PARAMETER" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkIcmp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_ICMP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkImap ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_IMAP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkIpsec ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_IPSEC" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkL2tp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_L2TP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkLdap ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_LDAP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkMqtt ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_MQTT" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkNtp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_NTP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_OTHER" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkPop3 ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_POP3" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkRdp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_RDP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkRestEndpointhyperlinkClick ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_REST_ENDPOINTHYPERLINK_CLICK" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSctp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SCTP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSip ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SIP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSmb ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SMB" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSmtp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SMTP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSnmp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SNMP" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSoapRequest ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SOAP_REQUEST" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSsh ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SSH" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkTcpPort ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_TCP_PORT" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkUdpPort ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_UDP_PORT" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkWebsocketMessage ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_WEBSOCKET_MESSAGE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalBiosJtag ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_BIOS_JTAG" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalBluetooth ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_BLUETOOTH" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalEvilMaid ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_EVIL_MAID" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalFirewire ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_FIREWIRE" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalIr ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_IR" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalNfc ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_NFC" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_OTHER" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalRfid ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_RFID" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalSdCard ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_SD_CARD" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalSdio ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_SDIO" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalSideChannel ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_SIDE_CHANNEL" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalTempest ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_TEMPEST" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalThunderbolt ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_THUNDERBOLT" + ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalUsb ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_USB" +) + +type ModelsTriageExploitabilityConfidence string + +const ( + ModelsTriageExploitabilityConfidenceHigh ModelsTriageExploitabilityConfidence = "HIGH" + ModelsTriageExploitabilityConfidenceLow ModelsTriageExploitabilityConfidence = "LOW" + ModelsTriageExploitabilityConfidenceMedium ModelsTriageExploitabilityConfidence = "MEDIUM" +) + +type ModelsTriageExploitabilityLabel string + +const ( + ModelsTriageExploitabilityLabelLikely ModelsTriageExploitabilityLabel = "LIKELY" + ModelsTriageExploitabilityLabelNeutral ModelsTriageExploitabilityLabel = "NEUTRAL" + ModelsTriageExploitabilityLabelUnlikely ModelsTriageExploitabilityLabel = "UNLIKELY" +) + +type ModelsTriageExploitabilityPrivilegesRequired struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityPrivilegesRequiredLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` + Types []ModelsTriageExploitabilityPrivilegesRequiredTypesElem `json:"types,omitempty"` +} + +type ModelsTriageExploitabilityPrivilegesRequiredLabel string + +const ( + ModelsTriageExploitabilityPrivilegesRequiredLabelHigh ModelsTriageExploitabilityPrivilegesRequiredLabel = "HIGH" + ModelsTriageExploitabilityPrivilegesRequiredLabelLow ModelsTriageExploitabilityPrivilegesRequiredLabel = "LOW" + ModelsTriageExploitabilityPrivilegesRequiredLabelNone ModelsTriageExploitabilityPrivilegesRequiredLabel = "NONE" +) + +type ModelsTriageExploitabilityPrivilegesRequiredTypesElem string + +const ( + ModelsTriageExploitabilityPrivilegesRequiredTypesElemPrivilegedUser ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "PRIVILEGED_USER" + ModelsTriageExploitabilityPrivilegesRequiredTypesElemUnauthenticated ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "UNAUTHENTICATED" + ModelsTriageExploitabilityPrivilegesRequiredTypesElemUnverifiedUser ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "UNVERIFIED_USER" + ModelsTriageExploitabilityPrivilegesRequiredTypesElemVerifiedUser ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "VERIFIED_USER" +) + +type ModelsTriageExploitabilityUserInteraction struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageExploitabilityUserInteractionLabel `json:"label,omitempty"` + OtherTypes []string `json:"otherTypes,omitempty"` + Title *string `json:"title,omitempty"` + Types []ModelsTriageExploitabilityUserInteractionTypesElem `json:"types,omitempty"` +} + +type ModelsTriageExploitabilityUserInteractionLabel string + +const ( + ModelsTriageExploitabilityUserInteractionLabelActive ModelsTriageExploitabilityUserInteractionLabel = "ACTIVE" + ModelsTriageExploitabilityUserInteractionLabelNone ModelsTriageExploitabilityUserInteractionLabel = "NONE" + ModelsTriageExploitabilityUserInteractionLabelPassive ModelsTriageExploitabilityUserInteractionLabel = "PASSIVE" +) + +type ModelsTriageExploitabilityUserInteractionTypesElem string + +const ( + ModelsTriageExploitabilityUserInteractionTypesElemBrowsing ModelsTriageExploitabilityUserInteractionTypesElem = "BROWSING" + ModelsTriageExploitabilityUserInteractionTypesElemFileDownload ModelsTriageExploitabilityUserInteractionTypesElem = "FILE_DOWNLOAD" + ModelsTriageExploitabilityUserInteractionTypesElemFileUpload ModelsTriageExploitabilityUserInteractionTypesElem = "FILE_UPLOAD" + ModelsTriageExploitabilityUserInteractionTypesElemHyperlinkClick ModelsTriageExploitabilityUserInteractionTypesElem = "HYPERLINK_CLICK" + ModelsTriageExploitabilityUserInteractionTypesElemSocialEngineering ModelsTriageExploitabilityUserInteractionTypesElem = "SOCIAL_ENGINEERING" +) + +type ModelsTriageFixEffort struct { + Confidence *ModelsTriageFixEffortConfidence `json:"confidence,omitempty"` + Description *string `json:"description,omitempty"` + Label *ModelsTriageFixEffortLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` + Unknowns []string `json:"unknowns,omitempty"` +} + +type ModelsTriageFixEffortConfidence string + +const ( + ModelsTriageFixEffortConfidenceHigh ModelsTriageFixEffortConfidence = "HIGH" + ModelsTriageFixEffortConfidenceLow ModelsTriageFixEffortConfidence = "LOW" + ModelsTriageFixEffortConfidenceMedium ModelsTriageFixEffortConfidence = "MEDIUM" +) + +type ModelsTriageFixEffortLabel string + +const ( + ModelsTriageFixEffortLabelEasy ModelsTriageFixEffortLabel = "EASY" + ModelsTriageFixEffortLabelHard ModelsTriageFixEffortLabel = "HARD" + ModelsTriageFixEffortLabelMedium ModelsTriageFixEffortLabel = "MEDIUM" +) + +type ModelsTriageImpact struct { + Availability *ModelsTriageImpactAvailability `json:"availability,omitempty"` + BusinessCriticality *ModelsTriageImpactBusinessCriticality `json:"businessCriticality,omitempty"` + Confidence *ModelsTriageImpactConfidence `json:"confidence,omitempty"` + Confidentiality *ModelsTriageImpactConfidentiality `json:"confidentiality,omitempty"` + Description *string `json:"description,omitempty"` + Integrity *ModelsTriageImpactIntegrity `json:"integrity,omitempty"` + Label *ModelsTriageImpactLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` + Unknowns []string `json:"unknowns,omitempty"` +} + +type ModelsTriageImpactAvailability struct { + Cause []ModelsTriageImpactAvailabilityCauseElem `json:"cause,omitempty"` + Description *string `json:"description,omitempty"` + Label *ModelsTriageImpactAvailabilityLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` + Type []ModelsTriageImpactAvailabilityTypeElem `json:"type,omitempty"` +} + +type ModelsTriageImpactAvailabilityCauseElem string + +const ( + ModelsTriageImpactAvailabilityCauseElemBufferOverflow ModelsTriageImpactAvailabilityCauseElem = "BUFFER_OVERFLOW" + ModelsTriageImpactAvailabilityCauseElemBusinessLogic ModelsTriageImpactAvailabilityCauseElem = "BUSINESS_LOGIC" + ModelsTriageImpactAvailabilityCauseElemInfiniteLoop ModelsTriageImpactAvailabilityCauseElem = "INFINITE_LOOP" + ModelsTriageImpactAvailabilityCauseElemMemoryLeak ModelsTriageImpactAvailabilityCauseElem = "MEMORY_LEAK" + ModelsTriageImpactAvailabilityCauseElemResourceExhaustion ModelsTriageImpactAvailabilityCauseElem = "RESOURCE_EXHAUSTION" +) + +type ModelsTriageImpactAvailabilityLabel string + +const ( + ModelsTriageImpactAvailabilityLabelHigh ModelsTriageImpactAvailabilityLabel = "HIGH" + ModelsTriageImpactAvailabilityLabelLow ModelsTriageImpactAvailabilityLabel = "LOW" + ModelsTriageImpactAvailabilityLabelNone ModelsTriageImpactAvailabilityLabel = "NONE" +) + +type ModelsTriageImpactAvailabilityTypeElem string + +const ( + ModelsTriageImpactAvailabilityTypeElemCompleteServiceOutage ModelsTriageImpactAvailabilityTypeElem = "COMPLETE_SERVICE_OUTAGE" + ModelsTriageImpactAvailabilityTypeElemServiceDegradation ModelsTriageImpactAvailabilityTypeElem = "SERVICE_DEGRADATION" + ModelsTriageImpactAvailabilityTypeElemUserAccessDisruption ModelsTriageImpactAvailabilityTypeElem = "USER_ACCESS_DISRUPTION" +) + +type ModelsTriageImpactBusinessCriticality struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageImpactBusinessCriticalityLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageImpactBusinessCriticalityLabel string + +const ( + ModelsTriageImpactBusinessCriticalityLabelHigh ModelsTriageImpactBusinessCriticalityLabel = "HIGH" + ModelsTriageImpactBusinessCriticalityLabelLow ModelsTriageImpactBusinessCriticalityLabel = "LOW" + ModelsTriageImpactBusinessCriticalityLabelMedium ModelsTriageImpactBusinessCriticalityLabel = "MEDIUM" +) + +type ModelsTriageImpactConfidence string + +const ( + ModelsTriageImpactConfidenceHigh ModelsTriageImpactConfidence = "HIGH" + ModelsTriageImpactConfidenceLow ModelsTriageImpactConfidence = "LOW" + ModelsTriageImpactConfidenceMedium ModelsTriageImpactConfidence = "MEDIUM" +) + +type ModelsTriageImpactConfidentiality struct { + DataLeaked []ModelsTriageImpactConfidentialityDataLeakedElem `json:"dataLeaked,omitempty"` + Label *ModelsTriageImpactConfidentialityLabel `json:"label,omitempty"` +} + +type ModelsTriageImpactConfidentialityDataLeakedElem string + +const ( + ModelsTriageImpactConfidentialityDataLeakedElemAccessToken ModelsTriageImpactConfidentialityDataLeakedElem = "ACCESS_TOKEN" + ModelsTriageImpactConfidentialityDataLeakedElemAddress ModelsTriageImpactConfidentialityDataLeakedElem = "ADDRESS" + ModelsTriageImpactConfidentialityDataLeakedElemAge ModelsTriageImpactConfidentialityDataLeakedElem = "AGE" + ModelsTriageImpactConfidentialityDataLeakedElemApiKey ModelsTriageImpactConfidentialityDataLeakedElem = "API_KEY" + ModelsTriageImpactConfidentialityDataLeakedElemAuthenticationData ModelsTriageImpactConfidentialityDataLeakedElem = "AUTHENTICATION_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemBankAccountInformation ModelsTriageImpactConfidentialityDataLeakedElem = "BANK_ACCOUNT_INFORMATION" + ModelsTriageImpactConfidentialityDataLeakedElemBiometricData ModelsTriageImpactConfidentialityDataLeakedElem = "BIOMETRIC_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemCallLogs ModelsTriageImpactConfidentialityDataLeakedElem = "CALL_LOGS" + ModelsTriageImpactConfidentialityDataLeakedElemCertificate ModelsTriageImpactConfidentialityDataLeakedElem = "CERTIFICATE" + ModelsTriageImpactConfidentialityDataLeakedElemClientAndVendorInformation ModelsTriageImpactConfidentialityDataLeakedElem = "CLIENT_AND_VENDOR_INFORMATION" + ModelsTriageImpactConfidentialityDataLeakedElemComplianceRecords ModelsTriageImpactConfidentialityDataLeakedElem = "COMPLIANCE_RECORDS" + ModelsTriageImpactConfidentialityDataLeakedElemCreditDebitCardDetails ModelsTriageImpactConfidentialityDataLeakedElem = "CREDIT_DEBIT_CARD_DETAILS" + ModelsTriageImpactConfidentialityDataLeakedElemDatabaseCredentials ModelsTriageImpactConfidentialityDataLeakedElem = "DATABASE_CREDENTIALS" + ModelsTriageImpactConfidentialityDataLeakedElemDeviceIdentifiers ModelsTriageImpactConfidentialityDataLeakedElem = "DEVICE_IDENTIFIERS" + ModelsTriageImpactConfidentialityDataLeakedElemDriversLicense ModelsTriageImpactConfidentialityDataLeakedElem = "DRIVERS_LICENSE" + ModelsTriageImpactConfidentialityDataLeakedElemEducationRecords ModelsTriageImpactConfidentialityDataLeakedElem = "EDUCATION_RECORDS" + ModelsTriageImpactConfidentialityDataLeakedElemEmailAddress ModelsTriageImpactConfidentialityDataLeakedElem = "EMAIL_ADDRESS" + ModelsTriageImpactConfidentialityDataLeakedElemEmailsAndMessages ModelsTriageImpactConfidentialityDataLeakedElem = "EMAILS_AND_MESSAGES" + ModelsTriageImpactConfidentialityDataLeakedElemEmploymentHistory ModelsTriageImpactConfidentialityDataLeakedElem = "EMPLOYMENT_HISTORY" + ModelsTriageImpactConfidentialityDataLeakedElemEncryptionKey ModelsTriageImpactConfidentialityDataLeakedElem = "ENCRYPTION_KEY" + ModelsTriageImpactConfidentialityDataLeakedElemGender ModelsTriageImpactConfidentialityDataLeakedElem = "GENDER" + ModelsTriageImpactConfidentialityDataLeakedElemIncomeAndTaxInformation ModelsTriageImpactConfidentialityDataLeakedElem = "INCOME_AND_TAX_INFORMATION" + ModelsTriageImpactConfidentialityDataLeakedElemIntellectualProperty ModelsTriageImpactConfidentialityDataLeakedElem = "INTELLECTUAL_PROPERTY" + ModelsTriageImpactConfidentialityDataLeakedElemInventoryData ModelsTriageImpactConfidentialityDataLeakedElem = "INVENTORY_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemInvestmentInformation ModelsTriageImpactConfidentialityDataLeakedElem = "INVESTMENT_INFORMATION" + ModelsTriageImpactConfidentialityDataLeakedElemIpAddresses ModelsTriageImpactConfidentialityDataLeakedElem = "IP_ADDRESSES" + ModelsTriageImpactConfidentialityDataLeakedElemLegalDocuments ModelsTriageImpactConfidentialityDataLeakedElem = "LEGAL_DOCUMENTS" + ModelsTriageImpactConfidentialityDataLeakedElemMedicalData ModelsTriageImpactConfidentialityDataLeakedElem = "MEDICAL_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemName ModelsTriageImpactConfidentialityDataLeakedElem = "NAME" + ModelsTriageImpactConfidentialityDataLeakedElemOtherPrivateNonSensitiveData ModelsTriageImpactConfidentialityDataLeakedElem = "OTHER_PRIVATE_NON_SENSITIVE_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemOtherPrivateSensitiveData ModelsTriageImpactConfidentialityDataLeakedElem = "OTHER_PRIVATE_SENSITIVE_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemOtherPublicData ModelsTriageImpactConfidentialityDataLeakedElem = "OTHER_PUBLIC_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemPassport ModelsTriageImpactConfidentialityDataLeakedElem = "PASSPORT" + ModelsTriageImpactConfidentialityDataLeakedElemPerformanceReviews ModelsTriageImpactConfidentialityDataLeakedElem = "PERFORMANCE_REVIEWS" + ModelsTriageImpactConfidentialityDataLeakedElemPhoneNumber ModelsTriageImpactConfidentialityDataLeakedElem = "PHONE_NUMBER" + ModelsTriageImpactConfidentialityDataLeakedElemPoliticalOpinions ModelsTriageImpactConfidentialityDataLeakedElem = "POLITICAL_OPINIONS" + ModelsTriageImpactConfidentialityDataLeakedElemRacialOrEthnicOrigin ModelsTriageImpactConfidentialityDataLeakedElem = "RACIAL_OR_ETHNIC_ORIGIN" + ModelsTriageImpactConfidentialityDataLeakedElemReligiousOrPhilosophicalBeliefs ModelsTriageImpactConfidentialityDataLeakedElem = "RELIGIOUS_OR_PHILOSOPHICAL_BELIEFS" + ModelsTriageImpactConfidentialityDataLeakedElemSalaryAndBenefitsInformation ModelsTriageImpactConfidentialityDataLeakedElem = "SALARY_AND_BENEFITS_INFORMATION" + ModelsTriageImpactConfidentialityDataLeakedElemSecretKey ModelsTriageImpactConfidentialityDataLeakedElem = "SECRET_KEY" + ModelsTriageImpactConfidentialityDataLeakedElemSexualOrientation ModelsTriageImpactConfidentialityDataLeakedElem = "SEXUAL_ORIENTATION" + ModelsTriageImpactConfidentialityDataLeakedElemSocialMediaInteractions ModelsTriageImpactConfidentialityDataLeakedElem = "SOCIAL_MEDIA_INTERACTIONS" + ModelsTriageImpactConfidentialityDataLeakedElemSocialSecurityNumber ModelsTriageImpactConfidentialityDataLeakedElem = "SOCIAL_SECURITY_NUMBER" + ModelsTriageImpactConfidentialityDataLeakedElemStrategicPlansAndForecasts ModelsTriageImpactConfidentialityDataLeakedElem = "STRATEGIC_PLANS_AND_FORECASTS" + ModelsTriageImpactConfidentialityDataLeakedElemSystemLogsAndMonitoringData ModelsTriageImpactConfidentialityDataLeakedElem = "SYSTEM_LOGS_AND_MONITORING_DATA" + ModelsTriageImpactConfidentialityDataLeakedElemTradeSecrets ModelsTriageImpactConfidentialityDataLeakedElem = "TRADE_SECRETS" + ModelsTriageImpactConfidentialityDataLeakedElemTransactionHistory ModelsTriageImpactConfidentialityDataLeakedElem = "TRANSACTION_HISTORY" +) + +type ModelsTriageImpactConfidentialityLabel string + +const ( + ModelsTriageImpactConfidentialityLabelHigh ModelsTriageImpactConfidentialityLabel = "HIGH" + ModelsTriageImpactConfidentialityLabelLow ModelsTriageImpactConfidentialityLabel = "LOW" + ModelsTriageImpactConfidentialityLabelNone ModelsTriageImpactConfidentialityLabel = "NONE" +) + +type ModelsTriageImpactIntegrity struct { + Description *string `json:"description,omitempty"` + Label *ModelsTriageImpactIntegrityLabel `json:"label,omitempty"` + Title *string `json:"title,omitempty"` + Type []ModelsTriageImpactIntegrityTypeElem `json:"type,omitempty"` +} + +type ModelsTriageImpactIntegrityLabel string + +const ( + ModelsTriageImpactIntegrityLabelHigh ModelsTriageImpactIntegrityLabel = "HIGH" + ModelsTriageImpactIntegrityLabelLow ModelsTriageImpactIntegrityLabel = "LOW" + ModelsTriageImpactIntegrityLabelNone ModelsTriageImpactIntegrityLabel = "NONE" +) + +type ModelsTriageImpactIntegrityTypeElem string + +const ( + ModelsTriageImpactIntegrityTypeElemDatabaseAltered ModelsTriageImpactIntegrityTypeElem = "DATABASE_ALTERED" + ModelsTriageImpactIntegrityTypeElemMaliciousCodeExecuted ModelsTriageImpactIntegrityTypeElem = "MALICIOUS_CODE_EXECUTED" + ModelsTriageImpactIntegrityTypeElemPrivilegeEscalation ModelsTriageImpactIntegrityTypeElem = "PRIVILEGE_ESCALATION" + ModelsTriageImpactIntegrityTypeElemSystemBehaviourManipulated ModelsTriageImpactIntegrityTypeElem = "SYSTEM_BEHAVIOUR_MANIPULATED" +) + +type ModelsTriageImpactLabel string + +const ( + ModelsTriageImpactLabelCritical ModelsTriageImpactLabel = "CRITICAL" + ModelsTriageImpactLabelHigh ModelsTriageImpactLabel = "HIGH" + ModelsTriageImpactLabelLow ModelsTriageImpactLabel = "LOW" +) + +type ModelsTriageInvestigationConfidence string + +const ( + ModelsTriageInvestigationConfidenceHigh ModelsTriageInvestigationConfidence = "HIGH" + ModelsTriageInvestigationConfidenceLow ModelsTriageInvestigationConfidence = "LOW" + ModelsTriageInvestigationConfidenceMedium ModelsTriageInvestigationConfidence = "MEDIUM" +) + +type ModelsTriagePentest struct { + AttemptedCVEs []string `json:"attemptedCVEs,omitempty"` + BrowserEvidence *ModelsTriagePentestBrowserEvidence `json:"browserEvidence,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Cost *float64 `json:"cost,omitempty"` + Duration *float64 `json:"duration,omitempty"` + ExploitedCVE *string `json:"exploitedCVE,omitempty"` + Logs *AgentsGroupedAgentLogs `json:"logs,omitempty"` + MutationDisclosure *ModelsTriagePentestMutationDisclosure `json:"mutationDisclosure,omitempty"` + NetworkReachability *ModelsTriagePentestNetworkReachability `json:"networkReachability,omitempty"` + Outcome *ModelsTriagePentestOutcome `json:"outcome,omitempty"` + Report *string `json:"report,omitempty"` + ReproductionScript *string `json:"reproductionScript,omitempty"` + SourceAvailability *ModelsTriagePentestSourceAvailability `json:"sourceAvailability,omitempty"` + TestedEndpoints []ModelsTriagePentestTestedEndpointsElem `json:"testedEndpoints,omitempty"` + ValidatedBy *ModelsTriagePentestValidatedBy `json:"validatedBy,omitempty"` +} + +type ModelsTriagePentestBrowserEvidence struct { + Citation *string `json:"citation,omitempty"` + Family *string `json:"family,omitempty"` + Reason *string `json:"reason,omitempty"` + ScreenshotRefs []string `json:"screenshotRefs,omitempty"` + Verdict *string `json:"verdict,omitempty"` +} + +type ModelsTriagePentestMutationDisclosure struct { + Writes []ModelsTriagePentestMutationDisclosureWritesElem `json:"writes,omitempty"` + WritesAttempted *bool `json:"writesAttempted,omitempty"` +} + +type ModelsTriagePentestMutationDisclosureWritesElem struct { + Method *string `json:"method,omitempty"` + Outcome *string `json:"outcome,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` + URL *string `json:"url,omitempty"` +} + +type ModelsTriagePentestNetworkReachability struct { + Citation *string `json:"citation,omitempty"` + ObservedInternetReachable *bool `json:"observedInternetReachable,omitempty"` + PublicHost *string `json:"publicHost,omitempty"` + RequiresAuth *bool `json:"requiresAuth,omitempty"` +} + +type ModelsTriagePentestOutcome string + +const ( + ModelsTriagePentestOutcomeCannotDetermine ModelsTriagePentestOutcome = "CANNOT_DETERMINE" + ModelsTriagePentestOutcomeConfirmed ModelsTriagePentestOutcome = "CONFIRMED" + ModelsTriagePentestOutcomeLikely ModelsTriagePentestOutcome = "LIKELY" + ModelsTriagePentestOutcomeNotExploitable ModelsTriagePentestOutcome = "NOT_EXPLOITABLE" + ModelsTriagePentestOutcomePotential ModelsTriagePentestOutcome = "POTENTIAL" +) + +type ModelsTriagePentestSourceAvailability struct { + ApiSchema *bool `json:"apiSchema,omitempty"` + Checkout *bool `json:"checkout,omitempty"` + CodeSnippets *bool `json:"codeSnippets,omitempty"` +} + +type ModelsTriagePentestTestedEndpointsElem struct { + Method *string `json:"method,omitempty"` + Path *string `json:"path,omitempty"` +} + +type ModelsTriagePentestValidatedBy struct { + Engine *ModelsTriagePentestValidatedByEngine `json:"engine,omitempty"` + RecordedAt *string `json:"recordedAt,omitempty"` + RunID *string `json:"runId,omitempty"` +} + +type ModelsTriagePentestValidatedByEngine string + +const ( + ModelsTriagePentestValidatedByEngineFindingExploitValidation ModelsTriagePentestValidatedByEngine = "FINDING_EXPLOIT_VALIDATION" + ModelsTriagePentestValidatedByEnginePentestExploitAnalysis ModelsTriagePentestValidatedByEngine = "PENTEST_EXPLOIT_ANALYSIS" +) + +type ModelsTriageReference struct { + DocumentID *string `json:"documentId,omitempty"` + EndLine *int `json:"endLine,omitempty"` + FileName *string `json:"fileName,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + Page *int `json:"page,omitempty"` + Quote *string `json:"quote,omitempty"` + Score *float64 `json:"score,omitempty"` + StartLine *int `json:"startLine,omitempty"` + Title *string `json:"title,omitempty"` +} + +type ModelsTriageRetriageComparison struct { + Narrative *string `json:"narrative,omitempty"` + NewInformation *ModelsTriageRetriageComparisonNewInformation `json:"newInformation,omitempty"` + QualityAssessment *ModelsTriageRetriageComparisonQualityAssessment `json:"qualityAssessment,omitempty"` + VerdictChanges []ModelsTriageRetriageComparisonVerdictChangesElem `json:"verdictChanges,omitempty"` +} + +type ModelsTriageRetriageComparisonNewInformation struct { + CloudContextUpdated *bool `json:"cloudContextUpdated,omitempty"` + MemoryChanges []ModelsTriageRetriageComparisonNewInformationMemoryChangesElem `json:"memoryChanges,omitempty"` + PentestResultAdded *bool `json:"pentestResultAdded,omitempty"` + UserComments []ModelsTriageRetriageComparisonNewInformationUserCommentsElem `json:"userComments,omitempty"` +} + +type ModelsTriageRetriageComparisonNewInformationMemoryChangesElem struct { + Description *string `json:"description,omitempty"` + Kind *ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKind `json:"kind,omitempty"` +} + +type ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKind string + +const ( + ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKindAdded ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKind = "ADDED" + ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKindCorrected ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKind = "CORRECTED" + ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKindInvalidated ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKind = "INVALIDATED" +) + +type ModelsTriageRetriageComparisonNewInformationUserCommentsElem struct { + CommentID *string `json:"commentId,omitempty"` + Influence *ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence `json:"influence,omitempty"` + KeyClaim *string `json:"keyClaim,omitempty"` +} + +type ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence string + +const ( + ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluenceChangedVerdict ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence = "changed_verdict" + ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluenceDecreasedConfidence ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence = "decreased_confidence" + ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluenceIncreasedConfidence ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence = "increased_confidence" + ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluenceNoEffect ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence = "no_effect" +) + +type ModelsTriageRetriageComparisonQualityAssessment struct { + RemainingUncertainties []string `json:"remainingUncertainties,omitempty"` + SufficientEvidence *bool `json:"sufficientEvidence,omitempty"` +} + +type ModelsTriageRetriageComparisonVerdictChangesElem struct { + Current *string `json:"current,omitempty"` + Field *string `json:"field,omitempty"` + Previous *string `json:"previous,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type ModelsTriageRetriageMetadata struct { + MemoryChanges []ModelsTriageRetriageMetadataMemoryChangesElem `json:"memoryChanges,omitempty"` + TriggeredAt *string `json:"triggeredAt,omitempty"` +} + +type ModelsTriageRetriageMetadataMemoryChangesElem struct { + MemoryChangeType *ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType `json:"memoryChangeType,omitempty"` + MemoryID *string `json:"memoryId,omitempty"` +} + +type ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType string + +const ( + ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryAdded ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_ADDED" + ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryCorrected ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_CORRECTED" + ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryInvalidated ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_INVALIDATED" + ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryRemoved ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_REMOVED" +) + +type ModelsTriageRetriageStatus string + +const ( + ModelsTriageRetriageStatusNotRetriaged ModelsTriageRetriageStatus = "NOT_RETRIAGED" + ModelsTriageRetriageStatusRetriageCompleted ModelsTriageRetriageStatus = "RETRIAGE_COMPLETED" + ModelsTriageRetriageStatusRetriageFailed ModelsTriageRetriageStatus = "RETRIAGE_FAILED" + ModelsTriageRetriageStatusRetriageInProgress ModelsTriageRetriageStatus = "RETRIAGE_IN_PROGRESS" + ModelsTriageRetriageStatusRetriageRequested ModelsTriageRetriageStatus = "RETRIAGE_REQUESTED" +) + +type ModelsTriageSeverity struct { + Confidence *ModelsTriageSeverityConfidence `json:"confidence,omitempty"` + Label *ModelsSeverityEnum `json:"label,omitempty"` + Score *int `json:"score,omitempty"` + Unknowns []string `json:"unknowns,omitempty"` +} + +type ModelsTriageStopReason string + +const ( + ModelsTriageStopReasonCostCap ModelsTriageStopReason = "cost_cap" + ModelsTriageStopReasonHeldWithoutContext ModelsTriageStopReason = "held_without_context" + ModelsTriageStopReasonNoSubmission ModelsTriageStopReason = "no_submission" + ModelsTriageStopReasonProviderError ModelsTriageStopReason = "provider_error" + ModelsTriageStopReasonReachabilityUnproven ModelsTriageStopReason = "reachability_unproven" + ModelsTriageStopReasonReachabilityUnprovenRetried ModelsTriageStopReason = "reachability_unproven_retried" + ModelsTriageStopReasonRefusal ModelsTriageStopReason = "refusal" + ModelsTriageStopReasonTenantBudget ModelsTriageStopReason = "tenant_budget" + ModelsTriageStopReasonWallTimeout ModelsTriageStopReason = "wall_timeout" +) + +type ModelsTriagedCSPMFinding struct { + AssessmentFactors []ModelsAssessmentFactor `json:"assessmentFactors,omitempty"` + Finding *ModelsCSPMFinding `json:"finding,omitempty"` + InvestigationSteps []ModelsInvestigationStep `json:"investigationSteps,omitempty"` + IsFalsePositive bool `json:"isFalsePositive"` + SourceAgentVersion *string `json:"sourceAgentVersion,omitempty"` + SourceInputHash *string `json:"sourceInputHash,omitempty"` + SourceTriageEnd *string `json:"sourceTriageEnd,omitempty"` + Triage *ModelsTriage `json:"triage,omitempty"` +} diff --git a/internal/api/models/dast.go b/internal/api/models/dast.go index d126051..ed46302 100644 --- a/internal/api/models/dast.go +++ b/internal/api/models/dast.go @@ -3,20 +3,16 @@ package models import "encoding/json" -type AgentsAgentLogs = []json.RawMessage - -type AgentsGroupedAgentLog struct { - Logs *AgentsAgentLogs `json:"logs,omitempty"` - Summary *string `json:"summary,omitempty"` -} - -type AgentsGroupedAgentLogs = []AgentsGroupedAgentLog - type EndpointsBugHuntConfigInput struct { + Cadence *ModelsCadence `json:"cadence,omitempty"` Credentials []ModelsCredentialBinding `json:"credentials,omitempty"` Enabled bool `json:"enabled"` Intensity ModelsBugHuntScanIntensity `json:"intensity"` + OwnershipProof *ModelsOwnershipProof `json:"ownershipProof,omitempty"` + RoeAcknowledged *bool `json:"roeAcknowledged,omitempty"` + RulesOfEngagement *ModelsRulesOfEngagement `json:"rulesOfEngagement,omitempty"` Scope ModelsScopePolicy `json:"scope"` + ScopeProvenance *ModelsScopeProvenance `json:"scopeProvenance,omitempty"` Suites []ModelsTestSuitePolicy `json:"suites,omitempty"` VulnClasses []ModelsVulnClassRule `json:"vulnClasses,omitempty"` } @@ -28,14 +24,191 @@ type EndpointsBugHuntFindingEvent struct { Type string `json:"type"` } +type EndpointsBugHuntScanCostSummary struct { + TotalCost float64 `json:"totalCost"` + TotalInputTokens int `json:"totalInputTokens"` + TotalOutputTokens int `json:"totalOutputTokens"` +} + +type EndpointsBugHuntScanStatusOutput struct { + Cost *EndpointsBugHuntScanCostSummary `json:"cost,omitempty"` + CurrentActivity *string `json:"currentActivity,omitempty"` + FindingsCount int `json:"findingsCount"` + LastActivityAt *string `json:"lastActivityAt,omitempty"` + Phases []EndpointsBugHuntScanStatusPhase `json:"phases,omitempty"` + Progress int `json:"progress"` + Stage ModelsBugHuntScanStage `json:"stage"` + Status ModelsScanStatus `json:"status"` + Terminal bool `json:"terminal"` +} + +type EndpointsBugHuntScanStatusPhase struct { + DurationSeconds *float64 `json:"durationSeconds,omitempty"` + Name string `json:"name"` + Status string `json:"status"` +} + +type EndpointsCreateDASTApplicationFromContextInput struct { + ContextApplicationID string `json:"contextApplicationId"` + Name *string `json:"name,omitempty"` + WebServices []EndpointsDASTAssessmentWebService `json:"webServices,omitempty"` +} + +type EndpointsCreateDASTApplicationFromContextOutput struct { + Application ModelsDASTApplication `json:"application"` + Created bool `json:"created"` + Readiness EndpointsDASTApplicationReadiness `json:"readiness"` + Targets []ModelsDASTTarget `json:"targets,omitempty"` +} + +type EndpointsDASTApplicationReadiness struct { + ApplicationID string `json:"applicationId"` + Blockers []EndpointsDASTReadinessIssue `json:"blockers,omitempty"` + Deployments int `json:"deployments"` + Ready bool `json:"ready"` + Warnings []EndpointsDASTReadinessIssue `json:"warnings,omitempty"` +} + +type EndpointsDASTAssessmentTarget struct { + Hostname string `json:"hostname"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +type EndpointsDASTAssessmentWebService struct { + ApiType *ModelsAPIType `json:"apiType,omitempty"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID string `json:"repositoryId"` + Targets []EndpointsDASTAssessmentTarget `json:"targets,omitempty"` +} + +type EndpointsDASTCredentialValidationRun struct { + ExpiresAt *string `json:"expiresAt,omitempty"` + Outcome *string `json:"outcome,omitempty"` + ReasonCode *string `json:"reasonCode,omitempty"` + RetryAt *string `json:"retryAt,omitempty"` + RunID string `json:"runId"` + RunStatus string `json:"runStatus"` + StartedAt *string `json:"startedAt,omitempty"` + Validation *ModelsDASTValidation `json:"validation,omitempty"` +} + +type EndpointsDASTReadinessCode string + +const ( + EndpointsDASTReadinessCodeDastApplicationMissing EndpointsDASTReadinessCode = "dast_application_missing" + EndpointsDASTReadinessCodeNoWebServices EndpointsDASTReadinessCode = "no_web_services" + EndpointsDASTReadinessCodeWebServiceNoTargets EndpointsDASTReadinessCode = "web_service_no_targets" + EndpointsDASTReadinessCodeTargetMissing EndpointsDASTReadinessCode = "target_missing" + EndpointsDASTReadinessCodeInvalidConfiguration EndpointsDASTReadinessCode = "invalid_configuration" + EndpointsDASTReadinessCodeDeploymentSelectionRequired EndpointsDASTReadinessCode = "deployment_selection_required" + EndpointsDASTReadinessCodeNoCredentials EndpointsDASTReadinessCode = "no_credentials" + EndpointsDASTReadinessCodeCredentialsUnvalidated EndpointsDASTReadinessCode = "credentials_unvalidated" +) + +type EndpointsDASTReadinessIssue struct { + Code EndpointsDASTReadinessCode `json:"code"` + Message string `json:"message"` +} + type EndpointsDeleteCredentialOutput struct { Success bool `json:"success"` } +type EndpointsDeleteDASTApplicationOutput struct { + Success bool `json:"success"` +} + +type EndpointsDeleteDASTExploitValidationPolicyOutput struct { + Deleted bool `json:"deleted"` +} + +type EndpointsDeleteDASTTargetOutput struct { + Success bool `json:"success"` +} + +type EndpointsDeleteDASTWebServiceCredentialOutput struct { + Success bool `json:"success"` +} + +type EndpointsDeleteDASTWebServiceOutput struct { + Success bool `json:"success"` +} + type EndpointsDeletePentestAppConfigOutput struct { Success bool `json:"success"` } +type EndpointsDeleteTicketBugHuntFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsDeleteTicketPentestFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsExploitValidationAttempt struct { + AttemptedCves []string `json:"attemptedCves,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + CostUsd *float64 `json:"costUsd,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DurationSeconds *float64 `json:"durationSeconds,omitempty"` + ExploitedCve *string `json:"exploitedCve,omitempty"` + FindingID string `json:"findingId"` + FindingTitle *string `json:"findingTitle,omitempty"` + FindingType string `json:"findingType"` + HasEndpointProof *bool `json:"hasEndpointProof,omitempty"` + ID string `json:"id"` + Outcome *string `json:"outcome,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status string `json:"status"` + StatusReason *string `json:"statusReason,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type EndpointsExploitValidationConsentOutput struct { + AcceptedAt *string `json:"acceptedAt,omitempty"` + AcceptedBy *string `json:"acceptedBy,omitempty"` + AcceptedByKind *string `json:"acceptedByKind,omitempty"` + AcceptedByName *string `json:"acceptedByName,omitempty"` + AcceptedWarningVersion *string `json:"acceptedWarningVersion,omitempty"` + BlockedReason *string `json:"blockedReason,omitempty"` + CanAccept bool `json:"canAccept"` + Classification string `json:"classification"` + CurrentWarningVersion string `json:"currentWarningVersion"` + EffectiveForNewRuns bool `json:"effectiveForNewRuns"` + Endpoint string `json:"endpoint"` + EvidenceURL *string `json:"evidenceUrl,omitempty"` + OnBehalfOf *string `json:"onBehalfOf,omitempty"` + OnBehalfRequired *bool `json:"onBehalfRequired,omitempty"` + State string `json:"state"` + TargetID string `json:"targetId"` + WarningText string `json:"warningText"` +} + +type EndpointsExploitValidationRunAttempt struct { + CompletedAt *string `json:"completedAt,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + DecidedAt *string `json:"decidedAt,omitempty"` + Decision string `json:"decision"` + Error *string `json:"error,omitempty"` + ExploitedCve *string `json:"exploitedCve,omitempty"` + FindingID string `json:"findingId"` + FindingType string `json:"findingType"` + Outcome *string `json:"outcome,omitempty"` + Reason string `json:"reason"` + Report *string `json:"report,omitempty"` + ReproductionScript *string `json:"reproductionScript,omitempty"` + State EndpointsRunState `json:"state"` + TargetURL *string `json:"targetUrl,omitempty"` + WebServiceID *string `json:"webServiceId,omitempty"` +} + type EndpointsGetAuthMatrixHypothesesOutput struct { Hypotheses []ModelsPentestAuthMatrixHypothesis `json:"hypotheses,omitempty"` Version *string `json:"version,omitempty"` @@ -55,6 +228,7 @@ type EndpointsGetBugHuntFindingOutput struct { type EndpointsGetBugHuntFindingTriageOutput struct { Triage *ModelsTriage `json:"triage,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` } type EndpointsGetBugHuntFindingsOutput struct { @@ -70,6 +244,7 @@ type EndpointsGetBugHuntScanDiffOutput struct { type EndpointsGetBugHuntScanFindingsOutput struct { Findings []ModelsBugHuntFinding `json:"findings,omitempty"` + TotalCount int `json:"totalCount"` } type EndpointsGetBugHuntScanOutput struct { @@ -77,7 +252,9 @@ type EndpointsGetBugHuntScanOutput struct { } type EndpointsGetBugHuntScansOutput struct { + NextToken string `json:"nextToken"` Scans []ModelsBugHuntScan `json:"scans,omitempty"` + TotalCount int `json:"totalCount"` } type EndpointsGetBugHuntSuiteRunsOutput struct { @@ -90,6 +267,28 @@ type EndpointsGetCredentialOutput struct { type EndpointsGetCredentialsOutput struct { Credentials []ModelsCredential `json:"credentials,omitempty"` + TotalCount int `json:"totalCount"` +} + +type EndpointsGetDASTApplicationOutput struct { + Application ModelsDASTApplication `json:"application"` +} + +type EndpointsGetDASTApplicationReadinessInput struct { + ApplicationIds []string `json:"applicationIds,omitempty"` +} + +type EndpointsGetDASTApplicationReadinessOutput struct { + Applications []EndpointsDASTApplicationReadiness `json:"applications,omitempty"` +} + +type EndpointsGetDASTApplicationsOutput struct { + Applications []ModelsDASTApplication `json:"applications,omitempty"` + NextToken string `json:"nextToken"` +} + +type EndpointsGetDASTExploitValidationPoliciesOutput struct { + Policies []ModelsDASTExploitValidationPolicy `json:"policies,omitempty"` } type EndpointsGetDASTFindingAutofixStateOutput struct { @@ -107,8 +306,54 @@ type EndpointsGetDASTLastScanStatusesOutput struct { Bughunt *EndpointsLastScanStatus `json:"bughunt,omitempty"` } +type EndpointsGetDASTTargetOutput struct { + Target ModelsDASTTarget `json:"target"` +} + +type EndpointsGetDASTTargetsOutput struct { + NextToken string `json:"nextToken"` + Targets []ModelsDASTTarget `json:"targets,omitempty"` +} + +type EndpointsGetDASTWebServiceCredentialsOutput struct { + CredentialIds []string `json:"credentialIds,omitempty"` +} + +type EndpointsGetDASTWebServiceOutput struct { + WebService ModelsDASTWebService `json:"webService"` +} + +type EndpointsGetDASTWebServicesOutput struct { + NextToken string `json:"nextToken"` + WebServices []ModelsDASTWebService `json:"webServices,omitempty"` +} + +type EndpointsGetExploitEvidenceOutput struct { + ContentType string `json:"contentType"` + EvidenceID string `json:"evidenceId"` + ExpiresAt string `json:"expiresAt"` + Kind string `json:"kind"` + URL string `json:"url"` +} + +type EndpointsGetExploitValidationRunOutput struct { + Attempts []EndpointsExploitValidationRunAttempt `json:"attempts,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + Error *string `json:"error,omitempty"` + RunID string `json:"runId"` + StartedAt *string `json:"startedAt,omitempty"` + State string `json:"state"` + Terminal *bool `json:"terminal,omitempty"` +} + type EndpointsGetLatestPentestPreflightOutput struct { Preflight *ModelsPentestPreflight `json:"preflight,omitempty"` + Stale *bool `json:"stale,omitempty"` +} + +type EndpointsGetMutationWarningOutput struct { + Text string `json:"text"` + Version string `json:"version"` } type EndpointsGetPentestAppConfigOutput struct { @@ -120,15 +365,37 @@ type EndpointsGetPentestAppConfigsOutput struct { NextToken string `json:"nextToken"` } -type EndpointsGetPentestFindingAutofixDiffOutput struct { - Commit string `json:"commit"` - Diffs []ModelsDiffFile `json:"diffs,omitempty"` - Explanation string `json:"explanation"` - PullRequestBody string `json:"pullRequestBody"` - PullRequestTitle string `json:"pullRequestTitle"` +type EndpointsGetPentestAuthMatrixCasesOutput struct { + Cases []EndpointsPentestAuthMatrixCase `json:"cases,omitempty"` + Limit int `json:"limit"` + Offset int `json:"offset"` + Total int `json:"total"` +} + +type EndpointsGetPentestAuthMatrixEvidenceOutput struct { + Complete bool `json:"complete"` + Diagnostic *string `json:"diagnostic,omitempty"` + Evidence []EndpointsPentestAuthMatrixEvidenceRecord `json:"evidence,omitempty"` + ExcludedUnavailableMetadata *int `json:"excludedUnavailableMetadata,omitempty"` + NextCursor *string `json:"nextCursor,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsGetPentestBudgetOutput struct { + ConsumedUsd float64 `json:"consumedUsd"` + Frozen bool `json:"frozen"` + HeldUsd float64 `json:"heldUsd"` + LimitUsd float64 `json:"limitUsd"` + RemainingUsd float64 `json:"remainingUsd"` + TimeWindow *string `json:"timeWindow,omitempty"` + Unlimited bool `json:"unlimited"` + WindowEnd *string `json:"windowEnd,omitempty"` +} + +type EndpointsGetPentestEstimateOutput struct { + Estimate EndpointsPentestEstimateResult `json:"estimate"` +} + type EndpointsGetPentestFindingEventsOutput struct { Events []ModelsDASTEventInterface `json:"events,omitempty"` Version *string `json:"version,omitempty"` @@ -137,6 +404,7 @@ type EndpointsGetPentestFindingEventsOutput struct { type EndpointsGetPentestFindingFullOutput struct { Finding ModelsPentestFinding `json:"finding"` Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` } type EndpointsGetPentestFindingOutput struct { @@ -146,6 +414,7 @@ type EndpointsGetPentestFindingOutput struct { type EndpointsGetPentestFindingsOutput struct { Findings []ModelsPentestFinding `json:"findings,omitempty"` + Groups []ModelsPentestFindingGroup `json:"groups,omitempty"` NextToken string `json:"nextToken"` NumItems int `json:"numItems"` Version *string `json:"version,omitempty"` @@ -167,34 +436,84 @@ type EndpointsGetPentestPreflightQuotaOutput struct { WindowResetAt string `json:"windowResetAt"` } +type EndpointsGetPentestScanActivityOutput struct { + Entries []EndpointsPentestScanActivityLogEntry `json:"entries,omitempty"` + NextCursor *string `json:"nextCursor,omitempty"` +} + +type EndpointsGetPentestScanEventsOutput struct { + Events []ModelsDASTEventInterface `json:"events,omitempty"` + HighestSeq int64 `json:"highestSeq"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetPentestScanFindingLinksOutput struct { + MappedFindings []ModelsPentestMappedFinding `json:"mappedFindings,omitempty"` + Version *string `json:"version,omitempty"` +} + type EndpointsGetPentestScanFindingsOutput struct { Findings []ModelsPentestFinding `json:"findings,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsGetPentestScanNetworkTransactionsOutput struct { + Attempts []EndpointsPentestCaptureAttempt `json:"attempts,omitempty"` + CaptureState string `json:"captureState"` + Complete bool `json:"complete"` + CorrelationAvailability string `json:"correlationAvailability"` + Diagnostic *string `json:"diagnostic,omitempty"` + ExcludedMissingTime int `json:"excludedMissingTime"` + NextCursor *string `json:"nextCursor,omitempty"` + Phase string `json:"phase"` + RetryLater bool `json:"retryLater"` + Transactions []ModelsNetworkTransaction `json:"transactions,omitempty"` + UnmatchedAttribution string `json:"unmatchedAttribution"` + Version *string `json:"version,omitempty"` +} + type EndpointsGetPentestScanOutput struct { Scan ModelsPentestScan `json:"scan"` Version *string `json:"version,omitempty"` } +type EndpointsGetPentestScanProgressStatusOutput struct { + CurrentActivity *string `json:"currentActivity,omitempty"` + CurrentPhase *string `json:"currentPhase,omitempty"` + LastActivityAt *string `json:"lastActivityAt,omitempty"` + Progress int `json:"progress"` + Status ModelsScanStatus `json:"status"` + Terminal bool `json:"terminal"` +} + type EndpointsGetPentestScanReportDownloadURLOutput struct { DownloadURL string `json:"downloadUrl"` + Partial *bool `json:"partial,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetPentestScanReportExternalPDFOutput struct { + DownloadURL string `json:"downloadUrl"` + Partial *bool `json:"partial,omitempty"` Version *string `json:"version,omitempty"` } type EndpointsGetPentestScanReportOutput struct { + Partial *bool `json:"partial,omitempty"` Report ModelsPentestReport `json:"report"` Version *string `json:"version,omitempty"` } type EndpointsGetPentestScanReportPDFOutput struct { DownloadURL string `json:"downloadUrl"` + Partial *bool `json:"partial,omitempty"` Version *string `json:"version,omitempty"` } type EndpointsGetPentestScansOutput struct { NextToken string `json:"nextToken"` Scans []ModelsPentestScan `json:"scans,omitempty"` + TotalCount int `json:"totalCount"` Version *string `json:"version,omitempty"` } @@ -204,7 +523,7 @@ type EndpointsGetSourceIPsOutput struct { } type EndpointsGetSubAgentNetworkLogOutput struct { - NetworkLog ModelsNetworkLog `json:"networkLog"` + DownloadURL string `json:"downloadUrl"` Version *string `json:"version,omitempty"` } @@ -222,6 +541,17 @@ type EndpointsLastScanStatus struct { Status string `json:"status"` } +type EndpointsListExploitValidationAttemptsOutput struct { + Attempts []EndpointsExploitValidationAttempt `json:"attempts,omitempty"` + NextToken string `json:"nextToken"` + NumItems int `json:"numItems"` +} + +type EndpointsPaginatedValidations struct { + NextToken string `json:"nextToken"` + Validations []ModelsDASTValidation `json:"validations,omitempty"` +} + type EndpointsPatchBugHuntFindingAllowlistInput struct { Allow bool `json:"allow"` Reason string `json:"reason"` @@ -231,6 +561,97 @@ type EndpointsPatchBugHuntFindingAllowlistOutput struct { Success bool `json:"success"` } +type EndpointsPatchPentestAppConfigInput struct { + CredentialIds []string `json:"credentialIds,omitempty"` + Targets []ModelsApplicationPentestTarget `json:"targets,omitempty"` +} + +type EndpointsPatchPentestAppConfigOutput struct { + Application ModelsApplicationPentestConfig `json:"application"` +} + +type EndpointsPentestAuthMatrixCase struct { + CandidateID string `json:"candidateId"` + EndpointID string `json:"endpointId"` + EvidenceRefs []string `json:"evidenceRefs,omitempty"` + Key string `json:"key"` + Lifecycle string `json:"lifecycle"` + Method string `json:"method"` + OperationID string `json:"operationId"` + Outcome string `json:"outcome"` + OwnerID string `json:"ownerId"` + Path string `json:"path"` + Reason string `json:"reason"` + Relationship string `json:"relationship"` +} + +type EndpointsPentestAuthMatrixEvidenceRecord struct { + AssessmentDigest *string `json:"assessmentDigest,omitempty"` + Attempt EndpointsPentestCaptureAttempt `json:"attempt"` + BodyState string `json:"bodyState"` + Bytes int64 `json:"bytes"` + ContentType *string `json:"contentType,omitempty"` + Diagnostic *string `json:"diagnostic,omitempty"` + DownloadHeaders map[string]string `json:"downloadHeaders,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` + Method *string `json:"method,omitempty"` + Path *string `json:"path,omitempty"` + Preview *string `json:"preview,omitempty"` + RedactionVersion *string `json:"redactionVersion,omitempty"` + RepresentationVersion *string `json:"representationVersion,omitempty"` + SelectedResult bool `json:"selectedResult"` + StoredDigest *string `json:"storedDigest,omitempty"` + Truncation *string `json:"truncation,omitempty"` +} + +type EndpointsPentestCaptureAttempt struct { + AttemptEvidenceRef string `json:"attemptEvidenceRef"` + AttemptNumber int32 `json:"attemptNumber"` + CreatedAt string `json:"createdAt"` + ErrorCode string `json:"errorCode"` + FinalEvidenceRef *string `json:"finalEvidenceRef,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + HttpStatus *int `json:"httpStatus,omitempty"` + ID string `json:"id"` + IdentityID string `json:"identityId"` + Outcome string `json:"outcome"` + ReplayID string `json:"replayId"` + SessionGeneration int64 `json:"sessionGeneration"` + TransactionID *string `json:"transactionId,omitempty"` +} + +type EndpointsPentestEstimateResult struct { + BasedOnHistoricalRuns int `json:"basedOnHistoricalRuns"` + Confidence ModelsPentestPreflightConfidence `json:"confidence"` + DurationSeconds int `json:"durationSeconds"` + InputTokens int64 `json:"inputTokens"` + LlmCostUsdCents int64 `json:"llmCostUsdCents"` + OutputTokens int64 `json:"outputTokens"` + Source EndpointsPentestEstimateSource `json:"source"` +} + +type EndpointsPentestEstimateSource string + +const ( + EndpointsPentestEstimateSourcePreflight EndpointsPentestEstimateSource = "preflight" + EndpointsPentestEstimateSourceHeuristic EndpointsPentestEstimateSource = "heuristic" +) + +type EndpointsPentestScanActivityLogEntry struct { + Content *string `json:"content,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + EventType *string `json:"eventType,omitempty"` + ID *string `json:"id,omitempty"` + Metadata *string `json:"metadata,omitempty"` +} + +type EndpointsPentestStartMode string + +const ( + EndpointsPentestStartModeSelfServeStarted EndpointsPentestStartMode = "self_serve_started" + EndpointsPentestStartModeManualRequested EndpointsPentestStartMode = "manual_requested" +) + type EndpointsPostAllowlistPentestFindingInput struct { AllowlistReason string `json:"allowlistReason"` AllowlistType ModelsAllowlistType `json:"allowlistType"` @@ -246,9 +667,21 @@ type EndpointsPostAutofixDASTPentestFindingInput struct { type EndpointsPostAutofixDASTPentestFindingOutput struct { AutoFixState ModelsAutoFixState `json:"autoFixState"` Error *string `json:"error,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsPostBugHuntProgramImportInput struct { + ProgramType string `json:"programType"` + ProgramURL string `json:"programUrl"` +} + +type EndpointsPostBugHuntProgramImportOutput struct { + RulesOfEngagement ModelsRulesOfEngagement `json:"rulesOfEngagement"` + Scope ModelsScopePolicy `json:"scope"` + ScopeProvenance ModelsScopeProvenance `json:"scopeProvenance"` +} + type EndpointsPostBugHuntScanInput struct { Intensity ModelsBugHuntScanIntensity `json:"intensity"` Scope ModelsScopePolicy `json:"scope"` @@ -266,6 +699,17 @@ type EndpointsPostBugHuntSuiteRunNowOutput struct { ScanID string `json:"scanId"` } +type EndpointsPostCreateTicketBugHuntFindingInput struct { + Assignees []ModelsUser `json:"assignees,omitempty"` + Message *string `json:"message,omitempty"` + Project *string `json:"project,omitempty"` +} + +type EndpointsPostCreateTicketBugHuntFindingOutput struct { + Ticket ModelsTicketProvider `json:"ticket"` + Version *string `json:"version,omitempty"` +} + type EndpointsPostCreateTicketPentestFindingInput struct { Assignees []ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` @@ -290,6 +734,107 @@ type EndpointsPostCredentialOutput struct { Credential ModelsCredential `json:"credential"` } +type EndpointsPostDASTApplicationInput struct { + ContextApplicationID *string `json:"contextApplicationId,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ScopeExcludePatterns []string `json:"scopeExcludePatterns,omitempty"` + WebServiceIds []string `json:"webServiceIds,omitempty"` +} + +type EndpointsPostDASTApplicationOutput struct { + Application ModelsDASTApplication `json:"application"` +} + +type EndpointsPostDASTCredentialValidationInput struct { + TestURL *string `json:"testUrl,omitempty"` +} + +type EndpointsPostDASTExploitValidationPolicyArmInput struct { + Capabilities []ModelsDASTExploitValidationCapability `json:"capabilities,omitempty"` + ExpectedUpdatedAt string `json:"expectedUpdatedAt"` + SafetyContractVersion int `json:"safetyContractVersion"` +} + +type EndpointsPostDASTExploitValidationPolicyArmOutput struct { + Policy ModelsDASTExploitValidationPolicy `json:"policy"` +} + +type EndpointsPostDASTExploitValidationPolicyDisarmOutput struct { + Policy ModelsDASTExploitValidationPolicy `json:"policy"` +} + +type EndpointsPostDASTExploitValidationPolicyInput struct { + DaysOfWeek []int `json:"daysOfWeek,omitempty"` + Enabled bool `json:"enabled"` + EndTime string `json:"endTime"` + FindingTypes []ModelsDASTExploitValidationFindingType `json:"findingTypes,omitempty"` + MinimumExploitability string `json:"minimumExploitability"` + MinimumSeverity string `json:"minimumSeverity"` + Name string `json:"name"` + RevalidationCooldownDays int `json:"revalidationCooldownDays"` + StartTime string `json:"startTime"` + Timezone string `json:"timezone"` + WebServiceIds []string `json:"webServiceIds,omitempty"` +} + +type EndpointsPostDASTExploitValidationPolicyOutput struct { + Policy ModelsDASTExploitValidationPolicy `json:"policy"` +} + +type EndpointsPostDASTTargetInput struct { + Description *string `json:"description,omitempty"` + Hostname string `json:"hostname"` + IsProd *bool `json:"isProd,omitempty"` + Name *string `json:"name,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +type EndpointsPostDASTTargetOutput struct { + Target ModelsDASTTarget `json:"target"` +} + +type EndpointsPostDASTTargetValidationOutput struct { + Validation ModelsDASTValidation `json:"validation"` +} + +type EndpointsPostDASTWebServiceAccessValidationInput struct { + CredentialID string `json:"credentialId"` +} + +type EndpointsPostDASTWebServiceAccessValidationOutput struct { + Validation ModelsDASTValidation `json:"validation"` +} + +type EndpointsPostDASTWebServiceCredentialInput struct { + CredentialID string `json:"credentialId"` +} + +type EndpointsPostDASTWebServiceCredentialOutput struct { + Success bool `json:"success"` +} + +type EndpointsPostDASTWebServiceInput struct { + ApiType *ModelsAPIType `json:"apiType,omitempty"` + CredentialIds []string `json:"credentialIds,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + Targets []ModelsDASTWebServiceTarget `json:"targets,omitempty"` +} + +type EndpointsPostDASTWebServiceOutput struct { + CredentialIds []string `json:"credentialIds,omitempty"` + WebService ModelsDASTWebService `json:"webService"` +} + +type EndpointsPostDASTWebServiceStatusValidationOutput struct { + Validation ModelsDASTValidation `json:"validation"` +} + type EndpointsPostPentestAppConfigInput struct { CredentialIds []string `json:"credentialIds,omitempty"` ID *string `json:"id,omitempty"` @@ -312,6 +857,14 @@ type EndpointsPutBugHuntConfigOutput struct { Config ModelsBugHuntScanConfig `json:"config"` } +type EndpointsPutCredentialActiveInput struct { + IsActive bool `json:"isActive"` +} + +type EndpointsPutCredentialActiveOutput struct { + Credential ModelsCredential `json:"credential"` +} + type EndpointsPutCredentialInput struct { Config ModelsCredentialConfig `json:"config"` Description string `json:"description"` @@ -323,6 +876,77 @@ type EndpointsPutCredentialOutput struct { Credential ModelsCredential `json:"credential"` } +type EndpointsPutDASTApplicationInput struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ScopeExcludePatterns []string `json:"scopeExcludePatterns,omitempty"` + WebServiceIds []string `json:"webServiceIds,omitempty"` +} + +type EndpointsPutDASTApplicationOutput struct { + Application ModelsDASTApplication `json:"application"` +} + +type EndpointsPutDASTExploitValidationPolicyInput struct { + DaysOfWeek []int `json:"daysOfWeek,omitempty"` + Enabled bool `json:"enabled"` + EndTime string `json:"endTime"` + FindingTypes []ModelsDASTExploitValidationFindingType `json:"findingTypes,omitempty"` + MinimumExploitability string `json:"minimumExploitability"` + MinimumSeverity string `json:"minimumSeverity"` + Name string `json:"name"` + RevalidationCooldownDays int `json:"revalidationCooldownDays"` + StartTime string `json:"startTime"` + Timezone string `json:"timezone"` + WebServiceIds []string `json:"webServiceIds,omitempty"` +} + +type EndpointsPutDASTExploitValidationPolicyOutput struct { + Policy ModelsDASTExploitValidationPolicy `json:"policy"` +} + +type EndpointsPutDASTTargetInput struct { + Description *string `json:"description,omitempty"` + Hostname string `json:"hostname"` + IsProd *bool `json:"isProd,omitempty"` + Name *string `json:"name,omitempty"` + Port *int `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} + +type EndpointsPutDASTTargetOutput struct { + Target ModelsDASTTarget `json:"target"` +} + +type EndpointsPutDASTWebServiceInput struct { + ApiType *ModelsAPIType `json:"apiType,omitempty"` + CredentialIds []string `json:"credentialIds,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + Targets []ModelsDASTWebServiceTarget `json:"targets,omitempty"` +} + +type EndpointsPutDASTWebServiceOutput struct { + CredentialIds []string `json:"credentialIds,omitempty"` + RemovedCredentialIds []string `json:"removedCredentialIds,omitempty"` + WebService ModelsDASTWebService `json:"webService"` +} + +type EndpointsPutExploitValidationConsentInput struct { + Endpoint string `json:"endpoint"` + Evidence *string `json:"evidence,omitempty"` + OnBehalfOf *string `json:"onBehalfOf,omitempty"` + WarningVersion string `json:"warningVersion"` +} + +type EndpointsPutMutationConsentInput struct { + Enabled bool `json:"enabled"` + WarningVersion *string `json:"warningVersion,omitempty"` +} + type EndpointsPutPentestAppConfigInput struct { CredentialIds []string `json:"credentialIds,omitempty"` Targets []ModelsApplicationPentestTarget `json:"targets,omitempty"` @@ -332,7 +956,21 @@ type EndpointsPutPentestAppConfigOutput struct { Application ModelsApplicationPentestConfig `json:"application"` } +type EndpointsPutTargetClassificationInput struct { + Classification ModelsDASTTargetClassification `json:"classification"` +} + +type EndpointsStartExploitValidationOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` + ExecutionArns []string `json:"executionArns,omitempty"` + Reason *string `json:"reason,omitempty"` + RunID *string `json:"runId,omitempty"` + Started *bool `json:"started,omitempty"` + Version *string `json:"version,omitempty"` +} + type EndpointsStartPentestPreflightInput struct { + Deployment *ModelsPentestDeployment `json:"deployment,omitempty"` TriggeredByScan *bool `json:"triggeredByScan,omitempty"` } @@ -343,9 +981,12 @@ type EndpointsStartPentestPreflightOutput struct { type EndpointsStartPentestScanFromApplicationInput struct { ApplicationID string `json:"applicationId"` ConfigOverrides *ModelsApplicationPentestConfigOverrides `json:"configOverrides,omitempty"` + Deployment *ModelsPentestDeployment `json:"deployment,omitempty"` + OnboardingDispatch *bool `json:"onboardingDispatch,omitempty"` } type EndpointsStartPentestScanFromApplicationOutput struct { + Mode *EndpointsPentestStartMode `json:"mode,omitempty"` Scan ModelsPentestScan `json:"scan"` Version *string `json:"version,omitempty"` } @@ -373,13 +1014,57 @@ type EndpointsValidateBugHuntConfigOutput struct { Errors []ModelsConfigValidationError `json:"errors,omitempty"` } -type EndpointsValidateCredentialOutput struct { - Message *string `json:"message,omitempty"` - Valid bool `json:"valid"` - ValidatedAt string `json:"validatedAt"` - ValidationEvidence ModelsValidationEvidence `json:"validationEvidence"` +type EndpointsValidateCredentialInput struct { + TestURL *string `json:"testUrl,omitempty"` +} + +type EndpointsValidateCredentialOutput struct { + Message *string `json:"message,omitempty"` + Outcome *string `json:"outcome,omitempty"` + ReasonCode *string `json:"reasonCode,omitempty"` + Valid bool `json:"valid"` + ValidatedAt string `json:"validatedAt"` + ValidationEvidence ModelsValidationEvidence `json:"validationEvidence"` + ValidationID *string `json:"validationId,omitempty"` +} + +type EndpointsValidateCredentialResult struct { + CredentialID string `json:"credentialId"` + Message *string `json:"message,omitempty"` + Outcome *string `json:"outcome,omitempty"` + ReasonCode *string `json:"reasonCode,omitempty"` + Valid bool `json:"valid"` + ValidatedAt string `json:"validatedAt"` + ValidationEvidence ModelsValidationEvidence `json:"validationEvidence"` + ValidationID *string `json:"validationId,omitempty"` +} + +type EndpointsValidateCredentialsInput struct { + CredentialIds []string `json:"credentialIds,omitempty"` + TestURL *string `json:"testUrl,omitempty"` +} + +type EndpointsValidateCredentialsOutput struct { + Results []EndpointsValidateCredentialResult `json:"results,omitempty"` +} + +type EndpointsValidateTargetsInput struct { + TargetIds []string `json:"targetIds,omitempty"` +} + +type EndpointsValidateTargetsOutput struct { + Results []ModelsDASTValidation `json:"results,omitempty"` } +type ModelsAPIKeyPlacement string + +const ( + ModelsAPIKeyPlacementHeader ModelsAPIKeyPlacement = "header" + ModelsAPIKeyPlacementBearer ModelsAPIKeyPlacement = "bearer" + ModelsAPIKeyPlacementQuery ModelsAPIKeyPlacement = "query" + ModelsAPIKeyPlacementJsonBody ModelsAPIKeyPlacement = "json_body" +) + type ModelsAPIType string const ( @@ -401,16 +1086,20 @@ type ModelsAppendixAuthMatrixHypothesis struct { } type ModelsApplicationPentestConfig struct { + AllowMutationTesting bool `json:"allowMutationTesting"` CreatedAt string `json:"createdAt"` CredentialIds []string `json:"credentialIds,omitempty"` DefaultScanConfig *ModelsPentestScanConfig `json:"defaultScanConfig,omitempty"` ID *string `json:"id,omitempty"` + MutationAckAt *string `json:"mutationAckAt,omitempty"` + MutationAckBy *string `json:"mutationAckBy,omitempty"` + MutationWarningVersion *string `json:"mutationWarningVersion,omitempty"` Targets []ModelsApplicationPentestTarget `json:"targets,omitempty"` UpdatedAt string `json:"updatedAt"` } type ModelsApplicationPentestConfigOverrides struct { - ApiSchema string `json:"apiSchema"` + ApiSchema *string `json:"apiSchema,omitempty"` Credentials []ModelsCredential `json:"credentials,omitempty"` EnableAuthMatrix bool `json:"enableAuthMatrix"` EnableExploitAnalysis bool `json:"enableExploitAnalysis"` @@ -421,13 +1110,17 @@ type ModelsApplicationPentestConfigOverrides struct { type ModelsApplicationPentestTarget struct { Host *string `json:"host,omitempty"` ID string `json:"id"` + IsProd *bool `json:"isProd,omitempty"` Name string `json:"name"` + NonProductionConfirmedAt *string `json:"nonProductionConfirmedAt,omitempty"` Port *int `json:"port,omitempty"` } type ModelsAssessmentPeriod struct { EndDate *string `json:"endDate,omitempty"` + EndTime *string `json:"endTime,omitempty"` StartDate *string `json:"startDate,omitempty"` + StartTime *string `json:"startTime,omitempty"` } type ModelsAssetID struct { @@ -457,17 +1150,309 @@ const ( ModelsAssetSelectorKindRepository ModelsAssetSelectorKind = "repository" ) +type ModelsAuthMatrixAgentResponseCaseManifest struct { + Cases []ModelsAuthMatrixAgentResponseCaseManifestCasesElem `json:"cases,omitempty"` + Counts *ModelsAuthMatrixCaseCounts `json:"counts,omitempty"` + Digest *string `json:"digest,omitempty"` + Experiments *ModelsAuthMatrixExperimentManifest `json:"experiments,omitempty"` + Version *int `json:"version,omitempty"` +} + +type ModelsAuthMatrixAgentResponseCaseManifestCasesElem struct { + CandidateID *string `json:"candidateId,omitempty"` + EndpointID *string `json:"endpointId,omitempty"` + EvidenceRefs []string `json:"evidenceRefs,omitempty"` + Key *string `json:"key,omitempty"` + Method *string `json:"method,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Outcome *ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome `json:"outcome,omitempty"` + OwnerID *string `json:"ownerId,omitempty"` + Path *string `json:"path,omitempty"` + Reason *string `json:"reason,omitempty"` + Relationship *string `json:"relationship,omitempty"` +} + +type ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome string + +const ( + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomeAccepted ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "accepted" + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomeAuthzDenied ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "authz_denied" + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomeConflict ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "conflict" + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomeNotFound ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "not_found" + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomePolicySkipped ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "policy_skipped" + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomeSchemaRejected ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "schema_rejected" + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomeServerError ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "server_error" + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcomeUnknown ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome = "unknown" +) + +type ModelsAuthMatrixCaseCounts struct { + ByLifecycle map[string]int `json:"byLifecycle,omitempty"` + ByOutcome map[string]int `json:"byOutcome,omitempty"` + Total *int `json:"total,omitempty"` +} + +type ModelsAuthMatrixCredentialContext struct { + CredentialID *string `json:"credentialId,omitempty"` + Facts []ModelsAuthMatrixFact `json:"facts,omitempty"` + SessionVersion *int `json:"sessionVersion,omitempty"` + Unauthenticated *bool `json:"unauthenticated,omitempty"` + Usable *bool `json:"usable,omitempty"` + VerificationEvidenceRefs []string `json:"verificationEvidenceRefs,omitempty"` +} + +type ModelsAuthMatrixDisposableData struct { + AuthorizationRef *string `json:"authorizationRef,omitempty"` + Designation *ModelsAuthMatrixDisposableDataDesignation `json:"designation,omitempty"` + IntendedEffects []string `json:"intendedEffects,omitempty"` + ResourceRefs []string `json:"resourceRefs,omitempty"` + Retention *ModelsAuthMatrixDisposableDataRetention `json:"retention,omitempty"` +} + +type ModelsAuthMatrixDisposableDataDesignation string + +const ( + ModelsAuthMatrixDisposableDataDesignationCreatedFixture ModelsAuthMatrixDisposableDataDesignation = "created_fixture" + ModelsAuthMatrixDisposableDataDesignationExistingDisposable ModelsAuthMatrixDisposableDataDesignation = "existing_disposable" + ModelsAuthMatrixDisposableDataDesignationNone ModelsAuthMatrixDisposableDataDesignation = "none" +) + +type ModelsAuthMatrixDisposableDataRetention string + +const ( + ModelsAuthMatrixDisposableDataRetentionIntentionallyRetain ModelsAuthMatrixDisposableDataRetention = "intentionally_retain" + ModelsAuthMatrixDisposableDataRetentionRestore ModelsAuthMatrixDisposableDataRetention = "restore" +) + +type ModelsAuthMatrixExpectation struct { + Access *ModelsAuthMatrixExpectationAccess `json:"access,omitempty"` + CandidateIds []string `json:"candidateIds,omitempty"` + Facts []ModelsAuthMatrixFact `json:"facts,omitempty"` + ID *string `json:"id,omitempty"` + OperationID *string `json:"operationId,omitempty"` + OwnerIds []string `json:"ownerIds,omitempty"` + Restriction *ModelsAuthMatrixExpectationRestriction `json:"restriction,omitempty"` + StateVersions []ModelsAuthMatrixStateVersion `json:"stateVersions,omitempty"` + Statement *string `json:"statement,omitempty"` +} + +type ModelsAuthMatrixExpectationAccess string + +const ( + ModelsAuthMatrixExpectationAccessAllowed ModelsAuthMatrixExpectationAccess = "allowed" + ModelsAuthMatrixExpectationAccessDenied ModelsAuthMatrixExpectationAccess = "denied" + ModelsAuthMatrixExpectationAccessUnknown ModelsAuthMatrixExpectationAccess = "unknown" +) + +type ModelsAuthMatrixExpectationRestriction string + +const ( + ModelsAuthMatrixExpectationRestrictionAuthentication ModelsAuthMatrixExpectationRestriction = "authentication" + ModelsAuthMatrixExpectationRestrictionFunction ModelsAuthMatrixExpectationRestriction = "function" + ModelsAuthMatrixExpectationRestrictionObject ModelsAuthMatrixExpectationRestriction = "object" +) + +type ModelsAuthMatrixExperiment struct { + CandidateID *string `json:"candidateId,omitempty"` + Cleanup *ModelsAuthMatrixExperimentCleanup `json:"cleanup,omitempty"` + DispatchCount *int `json:"dispatchCount,omitempty"` + DisposableData *ModelsAuthMatrixDisposableData `json:"disposableData,omitempty"` + ExpectationID *string `json:"expectationId,omitempty"` + FindingID *string `json:"findingId,omitempty"` + ID *string `json:"id,omitempty"` + IntendedEffects []string `json:"intendedEffects,omitempty"` + Observations []ModelsAuthMatrixObservation `json:"observations,omitempty"` + ObservedEffects []ModelsAuthMatrixFact `json:"observedEffects,omitempty"` + OperationID *string `json:"operationId,omitempty"` + OwnerID *string `json:"ownerId,omitempty"` + Publication *ModelsAuthMatrixExperimentPublication `json:"publication,omitempty"` + RequestDigest *string `json:"requestDigest,omitempty"` + ResourceRefs []string `json:"resourceRefs,omitempty"` + StateVersions []ModelsAuthMatrixStateVersion `json:"stateVersions,omitempty"` + Status *ModelsAuthMatrixExperimentStatus `json:"status,omitempty"` + TemplateID *string `json:"templateId,omitempty"` + Verdict *ModelsAuthMatrixVerdict `json:"verdict,omitempty"` +} + +type ModelsAuthMatrixExperimentCleanup string + +const ( + ModelsAuthMatrixExperimentCleanupFailed ModelsAuthMatrixExperimentCleanup = "failed" + ModelsAuthMatrixExperimentCleanupIntentionallyRetained ModelsAuthMatrixExperimentCleanup = "intentionally_retained" + ModelsAuthMatrixExperimentCleanupNotRequired ModelsAuthMatrixExperimentCleanup = "not_required" + ModelsAuthMatrixExperimentCleanupPending ModelsAuthMatrixExperimentCleanup = "pending" + ModelsAuthMatrixExperimentCleanupRestored ModelsAuthMatrixExperimentCleanup = "restored" + ModelsAuthMatrixExperimentCleanupUnknown ModelsAuthMatrixExperimentCleanup = "unknown" +) + +type ModelsAuthMatrixExperimentManifest struct { + CoverageGaps []string `json:"coverageGaps,omitempty"` + CredentialContexts []ModelsAuthMatrixCredentialContext `json:"credentialContexts,omitempty"` + Expectations []ModelsAuthMatrixExpectation `json:"expectations,omitempty"` + Experiments []ModelsAuthMatrixExperiment `json:"experiments,omitempty"` + Templates []ModelsAuthMatrixRequestTemplate `json:"templates,omitempty"` + UnfinishedExperimentIds []string `json:"unfinishedExperimentIds,omitempty"` + Version *int `json:"version,omitempty"` + WritesStoppedReason *string `json:"writesStoppedReason,omitempty"` +} + +type ModelsAuthMatrixExperimentPublication string + +const ( + ModelsAuthMatrixExperimentPublicationNone ModelsAuthMatrixExperimentPublication = "none" + ModelsAuthMatrixExperimentPublicationPending ModelsAuthMatrixExperimentPublication = "pending" + ModelsAuthMatrixExperimentPublicationPublished ModelsAuthMatrixExperimentPublication = "published" +) + +type ModelsAuthMatrixExperimentStatus string + +const ( + ModelsAuthMatrixExperimentStatusBlocked ModelsAuthMatrixExperimentStatus = "blocked" + ModelsAuthMatrixExperimentStatusPending ModelsAuthMatrixExperimentStatus = "pending" + ModelsAuthMatrixExperimentStatusRunning ModelsAuthMatrixExperimentStatus = "running" + ModelsAuthMatrixExperimentStatusTerminal ModelsAuthMatrixExperimentStatus = "terminal" +) + +type ModelsAuthMatrixFact struct { + Basis *ModelsAuthMatrixFactBasis `json:"basis,omitempty"` + Name *string `json:"name,omitempty"` + Reference *string `json:"reference,omitempty"` + Source *ModelsAuthMatrixFactSource `json:"source,omitempty"` + StateVersion *int `json:"stateVersion,omitempty"` + Value *string `json:"value,omitempty"` +} + +type ModelsAuthMatrixFactBasis string + +const ( + ModelsAuthMatrixFactBasisAsserted ModelsAuthMatrixFactBasis = "asserted" + ModelsAuthMatrixFactBasisInferred ModelsAuthMatrixFactBasis = "inferred" + ModelsAuthMatrixFactBasisObserved ModelsAuthMatrixFactBasis = "observed" + ModelsAuthMatrixFactBasisUnknown ModelsAuthMatrixFactBasis = "unknown" +) + +type ModelsAuthMatrixFactSource string + +const ( + ModelsAuthMatrixFactSourceCustomer ModelsAuthMatrixFactSource = "customer" + ModelsAuthMatrixFactSourceRuntime ModelsAuthMatrixFactSource = "runtime" + ModelsAuthMatrixFactSourceServedSpec ModelsAuthMatrixFactSource = "served_spec" + ModelsAuthMatrixFactSourceSource ModelsAuthMatrixFactSource = "source" + ModelsAuthMatrixFactSourceUnknown ModelsAuthMatrixFactSource = "unknown" +) + +type ModelsAuthMatrixFailureIdentity struct { + BoundaryID *string `json:"boundaryId,omitempty"` + ControlID *string `json:"controlId,omitempty"` + Restriction *ModelsAuthMatrixFailureIdentityRestriction `json:"restriction,omitempty"` + Version *int `json:"version,omitempty"` +} + +type ModelsAuthMatrixFailureIdentityRestriction string + +const ( + ModelsAuthMatrixFailureIdentityRestrictionAuthentication ModelsAuthMatrixFailureIdentityRestriction = "authentication" + ModelsAuthMatrixFailureIdentityRestrictionFunction ModelsAuthMatrixFailureIdentityRestriction = "function" + ModelsAuthMatrixFailureIdentityRestrictionObject ModelsAuthMatrixFailureIdentityRestriction = "object" +) + +type ModelsAuthMatrixObservation struct { + AttemptID *string `json:"attemptId,omitempty"` + BodyComplete *bool `json:"bodyComplete,omitempty"` + BusinessOutcome *ModelsAuthMatrixObservationBusinessOutcome `json:"businessOutcome,omitempty"` + EvidenceRefs []string `json:"evidenceRefs,omitempty"` + Facts []ModelsAuthMatrixFact `json:"facts,omitempty"` + ID *string `json:"id,omitempty"` + Phase *ModelsAuthMatrixObservationPhase `json:"phase,omitempty"` + PrincipalID *string `json:"principalId,omitempty"` + StateVersions []ModelsAuthMatrixStateVersion `json:"stateVersions,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` + Transport *ModelsAuthMatrixObservationTransport `json:"transport,omitempty"` +} + +type ModelsAuthMatrixObservationBusinessOutcome string + +const ( + ModelsAuthMatrixObservationBusinessOutcomeAccepted ModelsAuthMatrixObservationBusinessOutcome = "accepted" + ModelsAuthMatrixObservationBusinessOutcomeConflict ModelsAuthMatrixObservationBusinessOutcome = "conflict" + ModelsAuthMatrixObservationBusinessOutcomeDenied ModelsAuthMatrixObservationBusinessOutcome = "denied" + ModelsAuthMatrixObservationBusinessOutcomeNotFound ModelsAuthMatrixObservationBusinessOutcome = "not_found" + ModelsAuthMatrixObservationBusinessOutcomeRejected ModelsAuthMatrixObservationBusinessOutcome = "rejected" + ModelsAuthMatrixObservationBusinessOutcomeUnknown ModelsAuthMatrixObservationBusinessOutcome = "unknown" +) + +type ModelsAuthMatrixObservationPhase string + +const ( + ModelsAuthMatrixObservationPhaseCandidate ModelsAuthMatrixObservationPhase = "candidate" + ModelsAuthMatrixObservationPhaseCleanup ModelsAuthMatrixObservationPhase = "cleanup" + ModelsAuthMatrixObservationPhaseControl ModelsAuthMatrixObservationPhase = "control" + ModelsAuthMatrixObservationPhaseEffect ModelsAuthMatrixObservationPhase = "effect" +) + +type ModelsAuthMatrixObservationTransport string + +const ( + ModelsAuthMatrixObservationTransportNetworkError ModelsAuthMatrixObservationTransport = "network_error" + ModelsAuthMatrixObservationTransportNotSent ModelsAuthMatrixObservationTransport = "not_sent" + ModelsAuthMatrixObservationTransportResponse ModelsAuthMatrixObservationTransport = "response" + ModelsAuthMatrixObservationTransportTimeout ModelsAuthMatrixObservationTransport = "timeout" + ModelsAuthMatrixObservationTransportUnknown ModelsAuthMatrixObservationTransport = "unknown" +) + type ModelsAuthMatrixOverride struct { MaxEndpoints *int `json:"maxEndpoints,omitempty"` MaxRoles *int `json:"maxRoles,omitempty"` } +type ModelsAuthMatrixRequestTemplate struct { + Body *string `json:"body,omitempty"` + ContentType *string `json:"contentType,omitempty"` + ControlObservationIds []string `json:"controlObservationIds,omitempty"` + Digest *string `json:"digest,omitempty"` + Facts []ModelsAuthMatrixFact `json:"facts,omitempty"` + ID *string `json:"id,omitempty"` + Method *string `json:"method,omitempty"` + OmittedFieldEffects []string `json:"omittedFieldEffects,omitempty"` + OperationID *string `json:"operationId,omitempty"` + Origin *string `json:"origin,omitempty"` + Path *string `json:"path,omitempty"` + PermittedSubstitutions []string `json:"permittedSubstitutions,omitempty"` + Query map[string]string `json:"query,omitempty"` + ResourceRefs []string `json:"resourceRefs,omitempty"` + WritableFields []string `json:"writableFields,omitempty"` +} + type ModelsAuthMatrixStage struct { Approach string `json:"approach"` Description string `json:"description"` HypothesesGenerated int `json:"hypothesesGenerated"` } +type ModelsAuthMatrixStateVersion struct { + Scope *string `json:"scope,omitempty"` + Version *int `json:"version,omitempty"` +} + +type ModelsAuthMatrixVerdict struct { + ExpectationID *string `json:"expectationId,omitempty"` + FailureIdentity *ModelsAuthMatrixFailureIdentity `json:"failureIdentity,omitempty"` + MissingFacts []string `json:"missingFacts,omitempty"` + ObservationIds []string `json:"observationIds,omitempty"` + Reason *string `json:"reason,omitempty"` + Status *ModelsAuthMatrixVerdictStatus `json:"status,omitempty"` +} + +type ModelsAuthMatrixVerdictStatus string + +const ( + ModelsAuthMatrixVerdictStatusAllowed ModelsAuthMatrixVerdictStatus = "allowed" + ModelsAuthMatrixVerdictStatusCandidate ModelsAuthMatrixVerdictStatus = "candidate" + ModelsAuthMatrixVerdictStatusConfirmed ModelsAuthMatrixVerdictStatus = "confirmed" + ModelsAuthMatrixVerdictStatusDenied ModelsAuthMatrixVerdictStatus = "denied" + ModelsAuthMatrixVerdictStatusInconclusive ModelsAuthMatrixVerdictStatus = "inconclusive" + ModelsAuthMatrixVerdictStatusSkipped ModelsAuthMatrixVerdictStatus = "skipped" +) + type ModelsAuthenticatedWalkOverride struct { MaxDepth *int `json:"maxDepth,omitempty"` MaxMinutes *int `json:"maxMinutes,omitempty"` @@ -488,8 +1473,6 @@ type ModelsBugHuntAssessmentPhase struct { DurationSeconds *float64 `json:"durationSeconds,omitempty"` EndTime *string `json:"endTime,omitempty"` GroupedLogs []ModelsGroupedAgentLog `json:"groupedLogs,omitempty"` - LangfuseTraceID *string `json:"langfuseTraceId,omitempty"` - LangfuseTraceURL *string `json:"langfuseTraceUrl,omitempty"` Logs []json.RawMessage `json:"logs,omitempty"` Name string `json:"name"` StartTime string `json:"startTime"` @@ -527,6 +1510,7 @@ type ModelsBugHuntFinding struct { Severity ModelsSeverity `json:"severity"` SeverityOverride *ModelsSeverity `json:"severityOverride,omitempty"` TenantID string `json:"tenantId"` + Ticket *ModelsTicketProvider `json:"ticket,omitempty"` Title string `json:"title"` Type string `json:"type"` UpdatedAt *string `json:"updatedAt,omitempty"` @@ -556,10 +1540,12 @@ type ModelsBugHuntScan struct { Findings []ModelsBugHuntFinding `json:"findings,omitempty"` ID string `json:"id"` Intensity ModelsBugHuntScanIntensity `json:"intensity"` + LocalImport *bool `json:"localImport,omitempty"` Metrics ModelsBugHuntScanMetrics `json:"metrics"` NetworkLogs []ModelsNetworkLog `json:"networkLogs,omitempty"` Progress int `json:"progress"` Scope ModelsScopePolicy `json:"scope"` + ScopeVersion *int `json:"scopeVersion,omitempty"` Stage ModelsBugHuntScanStage `json:"stage"` StartTime *string `json:"startTime,omitempty"` StartedAt *string `json:"startedAt,omitempty"` @@ -572,15 +1558,21 @@ type ModelsBugHuntScan struct { } type ModelsBugHuntScanConfig struct { - CreatedAt string `json:"createdAt"` + Cadence *ModelsCadence `json:"cadence,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` Credentials []ModelsCredentialBinding `json:"credentials,omitempty"` Enabled bool `json:"enabled"` ID string `json:"id"` Intensity ModelsBugHuntScanIntensity `json:"intensity"` + OwnershipProof *ModelsOwnershipProof `json:"ownershipProof,omitempty"` + RoeAcknowledgedAt *string `json:"roeAcknowledgedAt,omitempty"` + RulesOfEngagement *ModelsRulesOfEngagement `json:"rulesOfEngagement,omitempty"` Scope ModelsScopePolicy `json:"scope"` + ScopeProvenance *ModelsScopeProvenance `json:"scopeProvenance,omitempty"` + ScopeVersion *int `json:"scopeVersion,omitempty"` Suites []ModelsTestSuitePolicy `json:"suites,omitempty"` TenantID string `json:"tenantId"` - UpdatedAt string `json:"updatedAt"` + UpdatedAt *string `json:"updatedAt,omitempty"` VulnClasses []ModelsVulnClassRule `json:"vulnClasses,omitempty"` } @@ -648,12 +1640,14 @@ const ( // (skipped value "" — no representable Go identifier) ModelsCadenceDaily ModelsCadence = "daily" ModelsCadenceWeekly ModelsCadence = "weekly" + ModelsCadenceFortnightly ModelsCadence = "fortnightly" ModelsCadenceMonthly ModelsCadence = "monthly" ModelsCadenceOnChange ModelsCadence = "on_change" ModelsCadenceManual ModelsCadence = "manual" ) type ModelsCodeFinding struct { + AcceptableCwes []int `json:"acceptableCwes,omitempty"` AiGenerated *bool `json:"aiGenerated,omitempty"` Branch *string `json:"branch,omitempty"` CampaignIds []string `json:"campaignIds,omitempty"` @@ -665,7 +1659,10 @@ type ModelsCodeFinding struct { Entrypoint *string `json:"entrypoint,omitempty"` FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` FilePath *string `json:"filePath,omitempty"` + HasCachedFix *bool `json:"hasCachedFix,omitempty"` + HostEffectivePriorityLabel *string `json:"hostEffectivePriorityLabel,omitempty"` ID *string `json:"id,omitempty"` + IsAutoFixable *bool `json:"isAutoFixable,omitempty"` IsCloudTriaged *bool `json:"isCloudTriaged,omitempty"` IsFalsePositive *bool `json:"isFalsePositive,omitempty"` IsResolved *bool `json:"isResolved,omitempty"` @@ -674,8 +1671,17 @@ type ModelsCodeFinding struct { Priority *ModelsCodeFindingPriority `json:"priority,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryID *string `json:"repositoryId,omitempty"` + RuleConfidence *float64 `json:"ruleConfidence,omitempty"` + RuleConfidenceLabel *string `json:"ruleConfidenceLabel,omitempty"` RuleID *string `json:"ruleId,omitempty"` + RuleImpact *float64 `json:"ruleImpact,omitempty"` + RuleImpactLabel *string `json:"ruleImpactLabel,omitempty"` + RuleLikelihood *float64 `json:"ruleLikelihood,omitempty"` + RuleLikelihoodLabel *string `json:"ruleLikelihoodLabel,omitempty"` + RuleSeverity *float64 `json:"ruleSeverity,omitempty"` + RuleSeverityLabel *string `json:"ruleSeverityLabel,omitempty"` Severity *string `json:"severity,omitempty"` + SinkAnchor *ModelsCodeFindingSinkAnchor `json:"sinkAnchor,omitempty"` StartLine *int `json:"startLine,omitempty"` Title *string `json:"title,omitempty"` Triage *ModelsTriage `json:"triage,omitempty"` @@ -893,6 +1899,11 @@ const ( ModelsCodeFindingPrioritySeverityIntegrityTypeElemMalwareImpanted ModelsCodeFindingPrioritySeverityIntegrityTypeElem = "MALWARE_IMPANTED" ) +type ModelsCodeFindingSinkAnchor struct { + EndLine *int `json:"endLine,omitempty"` + SnippetSha256 *string `json:"snippetSha256,omitempty"` +} + type ModelsConfigValidationError struct { Code *ModelsConfigValidationErrorCode `json:"code,omitempty"` Message *string `json:"message,omitempty"` @@ -913,6 +1924,9 @@ const ( ModelsConfigValidationErrorCodeUnsupportedOverride ModelsConfigValidationErrorCode = "unsupported_override" ModelsConfigValidationErrorCodeUnsupportedSelectorKind ModelsConfigValidationErrorCode = "unsupported_selector_kind" ModelsConfigValidationErrorCodeForbiddenScope ModelsConfigValidationErrorCode = "forbidden_scope" + ModelsConfigValidationErrorCodeInvalidCadence ModelsConfigValidationErrorCode = "invalid_cadence" + ModelsConfigValidationErrorCodeScopeChangeInFlight ModelsConfigValidationErrorCode = "scope_change_in_flight" + ModelsConfigValidationErrorCodeRoeNotAcknowledged ModelsConfigValidationErrorCode = "roe_not_acknowledged" ) type ModelsCredential struct { @@ -922,6 +1936,7 @@ type ModelsCredential struct { DeletedBy *string `json:"deletedBy,omitempty"` Description string `json:"description"` ID string `json:"id"` + IsActive *bool `json:"isActive,omitempty"` IsDeleted bool `json:"isDeleted"` LastUsed *string `json:"lastUsed,omitempty"` LastValidatedAt *string `json:"lastValidatedAt,omitempty"` @@ -933,6 +1948,31 @@ type ModelsCredential struct { ValidationEvidence *ModelsValidationEvidence `json:"validationEvidence,omitempty"` } +type ModelsCredentialAppSession struct { + AuthKitOrigin *string `json:"authKitOrigin,omitempty"` + AuthorizationURL *string `json:"authorizationUrl,omitempty"` + BlockedOptionalPosts []string `json:"blockedOptionalPosts,omitempty"` + CallbackURL *string `json:"callbackUrl,omitempty"` + CookieIssuerOrigins []string `json:"cookieIssuerOrigins,omitempty"` + ExpectedOrganization *string `json:"expectedOrganization,omitempty"` + ExpectedSubject *string `json:"expectedSubject,omitempty"` + IdentifierOrigins []string `json:"identifierOrigins,omitempty"` + Mode *string `json:"mode,omitempty"` + OrganizationPath []string `json:"organizationPath,omitempty"` + ProbeURL *string `json:"probeUrl,omitempty"` + ReachabilityOnly *bool `json:"reachabilityOnly,omitempty"` + StartSelector *string `json:"startSelector,omitempty"` + SubjectPath []string `json:"subjectPath,omitempty"` + Version *int `json:"version,omitempty"` +} + +type ModelsCredentialAuthPolicy struct { + CredentialOrigins []string `json:"credentialOrigins,omitempty"` + Mode *string `json:"mode,omitempty"` + NavigationOrigins []string `json:"navigationOrigins,omitempty"` + Version *int `json:"version,omitempty"` +} + type ModelsCredentialBinding struct { CredentialID *string `json:"credentialId,omitempty"` Scope *ModelsCredentialBindingScope `json:"scope,omitempty"` @@ -951,66 +1991,192 @@ const ( type ModelsCredentialConfig struct { ApiKey *string `json:"apiKey,omitempty"` + ApiKeyParamName *string `json:"apiKeyParamName,omitempty"` + ApiKeyPlacement *ModelsAPIKeyPlacement `json:"apiKeyPlacement,omitempty"` + AppSession *ModelsCredentialAppSession `json:"appSession,omitempty"` + Audience *string `json:"audience,omitempty"` + Auth0Tenant *string `json:"auth0Tenant,omitempty"` + AuthPolicy *ModelsCredentialAuthPolicy `json:"authPolicy,omitempty"` AuthURL *string `json:"authUrl,omitempty"` ClientID *string `json:"clientId,omitempty"` ClientSecret *string `json:"clientSecret,omitempty"` + Connection *string `json:"connection,omitempty"` + Discovered *ModelsDiscoveredWiring `json:"discovered,omitempty"` + EnableLoginOptimization *bool `json:"enableLoginOptimization,omitempty"` + Gateway *ModelsCredentialGateway `json:"gateway,omitempty"` Hints *string `json:"hints,omitempty"` + IdpType *string `json:"idpType,omitempty"` + Issuer *string `json:"issuer,omitempty"` + LoginBodyFormat *ModelsLoginBodyFormat `json:"loginBodyFormat,omitempty"` + LoginStrategy *ModelsLoginStrategy `json:"loginStrategy,omitempty"` LoginURL *string `json:"loginUrl,omitempty"` + MfaType *ModelsMFAType `json:"mfaType,omitempty"` + OauthFlow *ModelsOAuthFlow `json:"oauthFlow,omitempty"` Password *string `json:"password,omitempty"` + PasswordField *string `json:"passwordField,omitempty"` + Realm *string `json:"realm,omitempty"` + RedirectURI *string `json:"redirectUri,omitempty"` + RefreshToken *string `json:"refreshToken,omitempty"` + Resource *string `json:"resource,omitempty"` Scope *string `json:"scope,omitempty"` Token *string `json:"token,omitempty"` TokenPath *string `json:"tokenPath,omitempty"` TokenType *string `json:"tokenType,omitempty"` TokenURL *string `json:"tokenUrl,omitempty"` + Totp *ModelsTOTPConfig `json:"totp,omitempty"` + Username *string `json:"username,omitempty"` + UsernameField *string `json:"usernameField,omitempty"` +} + +type ModelsCredentialGateway struct { + Hints *string `json:"hints,omitempty"` + LoginURL *string `json:"loginUrl,omitempty"` + Password *string `json:"password,omitempty"` + Totp *ModelsTOTPConfig `json:"totp,omitempty"` Username *string `json:"username,omitempty"` } type ModelsCredentialType string const ( - ModelsCredentialTypeBasic ModelsCredentialType = "basic" - ModelsCredentialTypeBearer ModelsCredentialType = "bearer" + ModelsCredentialTypeUsernamePassword ModelsCredentialType = "username_password" ModelsCredentialTypeApiKey ModelsCredentialType = "api_key" + ModelsCredentialTypeBasicAuth ModelsCredentialType = "basic_auth" + ModelsCredentialTypeOidc ModelsCredentialType = "oidc" ModelsCredentialTypeOauth2 ModelsCredentialType = "oauth2" + ModelsCredentialTypeBasic ModelsCredentialType = "basic" + ModelsCredentialTypeBearer ModelsCredentialType = "bearer" ModelsCredentialTypeBrowser ModelsCredentialType = "browser" ModelsCredentialTypeCustom ModelsCredentialType = "custom" + ModelsCredentialTypeApplicationLogin ModelsCredentialType = "application_login" + ModelsCredentialTypeApplicationLoginMfa ModelsCredentialType = "application_login_mfa" + ModelsCredentialTypeSso ModelsCredentialType = "sso" ) -type ModelsCustomerQuestionOptionsElem struct { - ID *string `json:"id,omitempty"` - Label *string `json:"label,omitempty"` - Value *string `json:"value,omitempty"` +type ModelsDASTApplication struct { + AllowMutationTesting bool `json:"allowMutationTesting"` + CreatedAt string `json:"createdAt"` + Description *string `json:"description,omitempty"` + ID string `json:"id"` + MutationAckAt *string `json:"mutationAckAt,omitempty"` + MutationAckBy *string `json:"mutationAckBy,omitempty"` + MutationWarningVersion *string `json:"mutationWarningVersion,omitempty"` + Name *string `json:"name,omitempty"` + ScopeExcludePatterns []string `json:"scopeExcludePatterns,omitempty"` + UpdatedAt string `json:"updatedAt"` + WebServices []ModelsDASTWebService `json:"webServices,omitempty"` +} + +type ModelsDASTEventInterface struct { + Data json.RawMessage `json:"data"` + ID string `json:"id"` + Time string `json:"time"` + Type EventsEventType `json:"type"` } -type ModelsCustomerQuestionQuestionType string +type ModelsDASTExploitValidationCapability string const ( - ModelsCustomerQuestionQuestionTypeFreeText ModelsCustomerQuestionQuestionType = "FREE_TEXT" - ModelsCustomerQuestionQuestionTypeMultiSelect ModelsCustomerQuestionQuestionType = "MULTI_SELECT" - ModelsCustomerQuestionQuestionTypeSingleSelect ModelsCustomerQuestionQuestionType = "SINGLE_SELECT" - ModelsCustomerQuestionQuestionTypeYesNo ModelsCustomerQuestionQuestionType = "YES_NO" + ModelsDASTExploitValidationCapabilityAnonymousRead ModelsDASTExploitValidationCapability = "anonymous_read" + ModelsDASTExploitValidationCapabilityAuthenticatedSession ModelsDASTExploitValidationCapability = "authenticated_session" ) -type ModelsCustomerQuestionScope string +type ModelsDASTExploitValidationFindingType string const ( - ModelsCustomerQuestionScopeCloud ModelsCustomerQuestionScope = "CLOUD" - ModelsCustomerQuestionScopeOrganization ModelsCustomerQuestionScope = "ORGANIZATION" - ModelsCustomerQuestionScopeRepository ModelsCustomerQuestionScope = "REPOSITORY" + ModelsDASTExploitValidationFindingTypeSast ModelsDASTExploitValidationFindingType = "sast" + ModelsDASTExploitValidationFindingTypeScaDependencies ModelsDASTExploitValidationFindingType = "sca_dependencies" ) -type ModelsCustomerQuestionSet struct { - CustomMessage *string `json:"customMessage,omitempty"` - GeneratedMemoryIds []string `json:"generatedMemoryIds,omitempty"` - ID *string `json:"id,omitempty"` - Questions []ModelsCustomerQuestion `json:"questions,omitempty"` +type ModelsDASTExploitValidationPolicy struct { + Armed bool `json:"armed"` + ArmedAt *string `json:"armedAt,omitempty"` + ArmedBy *string `json:"armedBy,omitempty"` + CreatedAt string `json:"createdAt"` + DaysOfWeek []int `json:"daysOfWeek,omitempty"` + Enabled bool `json:"enabled"` + EndTime string `json:"endTime"` + FindingTypes []ModelsDASTExploitValidationFindingType `json:"findingTypes,omitempty"` + GrantedCapabilities []string `json:"grantedCapabilities,omitempty"` + ID string `json:"id"` + MinimumExploitability string `json:"minimumExploitability"` + MinimumSeverity string `json:"minimumSeverity"` + Name string `json:"name"` + RevalidationCooldownDays int `json:"revalidationCooldownDays"` + SafetyContractVersion *int `json:"safetyContractVersion,omitempty"` + StartTime string `json:"startTime"` + Timezone string `json:"timezone"` + UpdatedAt string `json:"updatedAt"` + WebServiceIds []string `json:"webServiceIds,omitempty"` } -type ModelsDASTEventInterface struct { - Data json.RawMessage `json:"data"` +type ModelsDASTTarget struct { + CreatedAt string `json:"createdAt"` + Description *string `json:"description,omitempty"` + ExploitValidationRiskAcceptanceEvidenceURL *string `json:"exploitValidationRiskAcceptanceEvidenceUrl,omitempty"` + ExploitValidationRiskAcceptanceVersion *string `json:"exploitValidationRiskAcceptanceVersion,omitempty"` + ExploitValidationRiskAccepted *bool `json:"exploitValidationRiskAccepted,omitempty"` + ExploitValidationRiskAcceptedAt *string `json:"exploitValidationRiskAcceptedAt,omitempty"` + ExploitValidationRiskAcceptedBy *string `json:"exploitValidationRiskAcceptedBy,omitempty"` + ExploitValidationRiskAcceptedByKind *ModelsExploitValidationAcceptorKind `json:"exploitValidationRiskAcceptedByKind,omitempty"` + ExploitValidationRiskAcceptedByName *string `json:"exploitValidationRiskAcceptedByName,omitempty"` + ExploitValidationRiskAcceptedOnBehalfOf *string `json:"exploitValidationRiskAcceptedOnBehalfOf,omitempty"` + Hostname string `json:"hostname"` ID string `json:"id"` - Time string `json:"time"` - Type EventsEventType `json:"type"` + IsProd *bool `json:"isProd,omitempty"` + LastValidatedAt *string `json:"lastValidatedAt,omitempty"` + LastValidationMessage *string `json:"lastValidationMessage,omitempty"` + LastValidationStatus *ModelsValidationStatus `json:"lastValidationStatus,omitempty"` + Name *string `json:"name,omitempty"` + NonProductionConfirmedAt *string `json:"nonProductionConfirmedAt,omitempty"` + Port *int `json:"port,omitempty"` + Protocol string `json:"protocol"` + UpdatedAt string `json:"updatedAt"` +} + +type ModelsDASTTargetClassification string + +const ( + ModelsDASTTargetClassificationProduction ModelsDASTTargetClassification = "production" + ModelsDASTTargetClassificationNonProduction ModelsDASTTargetClassification = "non_production" + ModelsDASTTargetClassificationUnknown ModelsDASTTargetClassification = "unknown" +) + +type ModelsDASTValidation struct { + CredentialID *string `json:"credentialId,omitempty"` + DurationMs *int64 `json:"durationMs,omitempty"` + Error *string `json:"error,omitempty"` + Hint *string `json:"hint,omitempty"` + ID string `json:"id"` + Message *string `json:"message,omitempty"` + ReasonCode *string `json:"reasonCode,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status ModelsValidationStatus `json:"status"` + StatusCode *int `json:"statusCode,omitempty"` + TargetID *string `json:"targetId,omitempty"` + TestURL *string `json:"testUrl,omitempty"` + Trigger ModelsValidationTrigger `json:"trigger"` + ValidatedAt string `json:"validatedAt"` + ValidatedBy *string `json:"validatedBy,omitempty"` + WebServiceID *string `json:"webServiceId,omitempty"` +} + +type ModelsDASTWebService struct { + ApiType *ModelsAPIType `json:"apiType,omitempty"` + CreatedAt string `json:"createdAt"` + Description *string `json:"description,omitempty"` + ID string `json:"id"` + Name *string `json:"name,omitempty"` + ProjectID *string `json:"projectId,omitempty"` + RepoPath *string `json:"repoPath,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + Targets []ModelsDASTWebServiceTarget `json:"targets,omitempty"` + UpdatedAt string `json:"updatedAt"` +} + +type ModelsDASTWebServiceTarget struct { + Path *string `json:"path,omitempty"` + TargetID string `json:"targetId"` } type ModelsDNSEnumerationOverride struct { @@ -1025,7 +2191,9 @@ type ModelsDependencyFinding struct { Dossier *ModelsDependencyFindingDossier `json:"dossier,omitempty"` FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` FilePath *string `json:"filePath,omitempty"` + HasCachedFix *bool `json:"hasCachedFix,omitempty"` HasReachableCVEs *bool `json:"hasReachableCVEs,omitempty"` + HostEffectivePriorityLabel *string `json:"hostEffectivePriorityLabel,omitempty"` ID *string `json:"id,omitempty"` IsAutoFixable *bool `json:"isAutoFixable,omitempty"` IsCloudTriaged *bool `json:"isCloudTriaged,omitempty"` @@ -1036,15 +2204,18 @@ type ModelsDependencyFinding struct { Line *int `json:"line,omitempty"` Package *string `json:"package,omitempty"` PackageFilePath *string `json:"packageFilePath,omitempty"` + PerVersionCVEStatus map[string]map[string]map[string]json.RawMessage `json:"perVersionCVEStatus,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryID *string `json:"repositoryId,omitempty"` ResolvedWithoutLockfile *bool `json:"resolvedWithoutLockfile,omitempty"` Triage *ModelsTriage `json:"triage,omitempty"` Version *string `json:"version,omitempty"` + Versions []string `json:"versions,omitempty"` Vulnerabilities []ModelsDependencyFindingVulnerabilitiesElem `json:"vulnerabilities,omitempty"` } type ModelsDependencyFindingDossier struct { + Coverage *ModelsDependencyFindingDossierCoverage `json:"coverage,omitempty"` Cves []ModelsDependencyFindingDossierCvesElem `json:"cves,omitempty"` Deptree *ModelsDependencyFindingDossierDeptree `json:"deptree,omitempty"` EmittedAt *string `json:"emitted_at,omitempty"` @@ -1058,6 +2229,11 @@ type ModelsDependencyFindingDossier struct { Version *string `json:"version,omitempty"` } +type ModelsDependencyFindingDossierCoverage struct { + Degraded *bool `json:"degraded,omitempty"` + Gaps []string `json:"gaps,omitempty"` +} + type ModelsDependencyFindingDossierCvesElem struct { HasFix *bool `json:"has_fix,omitempty"` ID *string `json:"id,omitempty"` @@ -1126,6 +2302,7 @@ type ModelsDependencyFindingDossierReachabilityMethod string const ( ModelsDependencyFindingDossierReachabilityMethodCombined ModelsDependencyFindingDossierReachabilityMethod = "COMBINED" ModelsDependencyFindingDossierReachabilityMethodOsv ModelsDependencyFindingDossierReachabilityMethod = "OSV" + ModelsDependencyFindingDossierReachabilityMethodSourceParse ModelsDependencyFindingDossierReachabilityMethod = "SOURCE_PARSE" ModelsDependencyFindingDossierReachabilityMethodTimeout ModelsDependencyFindingDossierReachabilityMethod = "TIMEOUT" ModelsDependencyFindingDossierReachabilityMethodTreesitter ModelsDependencyFindingDossierReachabilityMethod = "TREESITTER" ModelsDependencyFindingDossierReachabilityMethodUnsupported ModelsDependencyFindingDossierReachabilityMethod = "UNSUPPORTED" @@ -1145,21 +2322,52 @@ type ModelsDependencyFindingVulnerabilitiesElem struct { type ModelsDependencyFindingVulnerabilitiesElemCvesElem struct { CisaKev *bool `json:"cisaKev,omitempty"` + CisaKevUnknown *bool `json:"cisaKevUnknown,omitempty"` Cvss *float64 `json:"cvss,omitempty"` + Epss *float64 `json:"epss,omitempty"` + EpssPercentile *float64 `json:"epssPercentile,omitempty"` Exploitability *string `json:"exploitability,omitempty"` + ExploitabilityScore *float64 `json:"exploitabilityScore,omitempty"` ID *string `json:"id,omitempty"` + ImpactScore *float64 `json:"impactScore,omitempty"` OsvReachability *ModelsDependencyFindingVulnerabilitiesElemCvesElemOsvReachability `json:"osvReachability,omitempty"` + Priority *string `json:"priority,omitempty"` ReachabilityConfidence *string `json:"reachabilityConfidence,omitempty"` ReachabilityEvidence *string `json:"reachabilityEvidence,omitempty"` ReachabilityMethod *string `json:"reachabilityMethod,omitempty"` Reachable *bool `json:"reachable,omitempty"` + Severity *string `json:"severity,omitempty"` VectorString *string `json:"vectorString,omitempty"` + Version *string `json:"version,omitempty"` } type ModelsDependencyFindingVulnerabilitiesElemCvesElemOsvReachability struct { Called *bool `json:"called,omitempty"` } +type ModelsDiscoveredWiring struct { + AuthorizeURL *string `json:"authorizeUrl,omitempty"` + DiscoveredAt *string `json:"discoveredAt,omitempty"` + FromLoginURL *string `json:"fromLoginUrl,omitempty"` + TokenURL *string `json:"tokenUrl,omitempty"` + TokenUrlSource *string `json:"tokenUrlSource,omitempty"` +} + +type ModelsDisprovenCandidate struct { + ID string `json:"id"` + Outcome string `json:"outcome"` + Reason *string `json:"reason,omitempty"` + Source string `json:"source"` + Title string `json:"title"` +} + +type ModelsExcludedRoute struct { + CountsIncomplete *bool `json:"countsIncomplete,omitempty"` + MatchedNothing *bool `json:"matchedNothing,omitempty"` + Refusals *int `json:"refusals,omitempty"` + Rule string `json:"rule"` +} + type ModelsExecutiveSummary struct { ExecutiveSummaryFirstParagraph string `json:"executiveSummaryFirstParagraph"` ExecutiveSummaryRest string `json:"executiveSummaryRest"` @@ -1173,12 +2381,23 @@ type ModelsExploitAnalysisStage struct { FindingsAnalyzed int `json:"findingsAnalyzed"` } +type ModelsExploitValidationAcceptorKind string + +const ( + ModelsExploitValidationAcceptorKindCustomer ModelsExploitValidationAcceptorKind = "customer" + ModelsExploitValidationAcceptorKindNullifyStaff ModelsExploitValidationAcceptorKind = "nullify_staff" + ModelsExploitValidationAcceptorKindNullifyOperator ModelsExploitValidationAcceptorKind = "nullify_operator" +) + type ModelsFindingSummary struct { AffectedAsset string `json:"affectedAsset"` ID string `json:"id"` + Lineage []string `json:"lineage,omitempty"` + Owner *string `json:"owner,omitempty"` Reference *string `json:"reference,omitempty"` Severity ModelsSeverity `json:"severity"` Source string `json:"source"` + Status *ModelsPentestFindingStatus `json:"status,omitempty"` Title string `json:"title"` } @@ -1197,6 +2416,28 @@ type ModelsLightweightBackendPentestOverride struct { MaxSeconds *int `json:"maxSeconds,omitempty"` } +type ModelsLoginBodyFormat string + +const ( + ModelsLoginBodyFormatForm ModelsLoginBodyFormat = "form" + ModelsLoginBodyFormatJson ModelsLoginBodyFormat = "json" +) + +type ModelsLoginStrategy string + +const ( + ModelsLoginStrategyAuto ModelsLoginStrategy = "auto" + ModelsLoginStrategyAuth0Embedded ModelsLoginStrategy = "auth0_embedded" + ModelsLoginStrategyBrowser ModelsLoginStrategy = "browser" +) + +type ModelsMFAType string + +const ( + ModelsMFATypeTotp ModelsMFAType = "totp" + ModelsMFATypeEmail ModelsMFAType = "email" +) + type ModelsMalwareScanOverride struct { HeuristicOnly *bool `json:"heuristicOnly,omitempty"` MaxArtifacts *int `json:"maxArtifacts,omitempty"` @@ -1255,11 +2496,37 @@ type ModelsNucleiScanOverride struct { SeverityFloor *ModelsSeverityFloor `json:"severityFloor,omitempty"` } +type ModelsOAuthFlow string + +const ( + ModelsOAuthFlowClientCredentials ModelsOAuthFlow = "client_credentials" + ModelsOAuthFlowAuthorizationCode ModelsOAuthFlow = "authorization_code" +) + +type ModelsOwnershipProof struct { + Domains []string `json:"domains,omitempty"` + Method *ModelsOwnershipProofMethod `json:"method,omitempty"` + Token *string `json:"token,omitempty"` + VerifiedAt *string `json:"verifiedAt,omitempty"` +} + +type ModelsOwnershipProofMethod string + +const ( + // (skipped value "" — no representable Go identifier) + ModelsOwnershipProofMethodDnsTxt ModelsOwnershipProofMethod = "dns_txt" + ModelsOwnershipProofMethodHttpFile ModelsOwnershipProofMethod = "http_file" + ModelsOwnershipProofMethodMetaTag ModelsOwnershipProofMethod = "meta_tag" + ModelsOwnershipProofMethodProgramManaged ModelsOwnershipProofMethod = "program_managed" +) + type ModelsPentestAbortCategory string const ( ModelsPentestAbortCategoryConfigError ModelsPentestAbortCategory = "config_error" ModelsPentestAbortCategoryAgentCrash ModelsPentestAbortCategory = "agent_crash" + ModelsPentestAbortCategoryBudgetExhausted ModelsPentestAbortCategory = "budget_exhausted" + ModelsPentestAbortCategoryConcurrencyLimited ModelsPentestAbortCategory = "concurrency_limited" ) type ModelsPentestAbortCode string @@ -1267,6 +2534,7 @@ type ModelsPentestAbortCode string const ( ModelsPentestAbortCodeCredentialsInvalid ModelsPentestAbortCode = "credentials_invalid" ModelsPentestAbortCodeTargetUnreachable ModelsPentestAbortCode = "target_unreachable" + ModelsPentestAbortCodeTargetBlockedInternal ModelsPentestAbortCode = "target_blocked_internal" ModelsPentestAbortCodeMissingAppContext ModelsPentestAbortCode = "missing_app_context" ModelsPentestAbortCodeMissingApiSchema ModelsPentestAbortCode = "missing_api_schema" ModelsPentestAbortCodeAgentCrashPentestTools ModelsPentestAbortCode = "agent_crash_pentest_tools" @@ -1274,6 +2542,9 @@ const ( ModelsPentestAbortCodeAgentCrashExploitAnalysis ModelsPentestAbortCode = "agent_crash_exploit_analysis" ModelsPentestAbortCodeAgentCrashReport ModelsPentestAbortCode = "agent_crash_report" ModelsPentestAbortCodeAgentCrashUnknown ModelsPentestAbortCode = "agent_crash_unknown" + ModelsPentestAbortCodeBudgetExhausted ModelsPentestAbortCode = "budget_exhausted" + ModelsPentestAbortCodeConcurrencyLimited ModelsPentestAbortCode = "concurrency_limited" + ModelsPentestAbortCodeMutationCapabilityInvalid ModelsPentestAbortCode = "mutation_capability_invalid" ) type ModelsPentestAbortReason struct { @@ -1287,19 +2558,34 @@ type ModelsPentestAbortReason struct { } type ModelsPentestAssessmentPhase struct { + Degraded *bool `json:"degraded,omitempty"` DurationSeconds *float64 `json:"durationSeconds,omitempty"` EndTime *string `json:"endTime,omitempty"` GroupedLogs []ModelsGroupedAgentLog `json:"groupedLogs,omitempty"` Hypotheses []ModelsPentestHypothesis `json:"hypotheses,omitempty"` - LangfuseTraceID *string `json:"langfuseTraceId,omitempty"` - LangfuseTraceURL *string `json:"langfuseTraceUrl,omitempty"` Logs []json.RawMessage `json:"logs,omitempty"` Name string `json:"name"` + Reason *string `json:"reason,omitempty"` StartTime string `json:"startTime"` Status *string `json:"status,omitempty"` UsageMetrics *ModelsPentestPhaseUsageMetrics `json:"usageMetrics,omitempty"` } +type ModelsPentestAuthMatrixBatch struct { + Attempts int `json:"attempts"` + Cause *string `json:"cause,omitempty"` + Disposition string `json:"disposition"` + Index int `json:"index"` + StopReason *string `json:"stopReason,omitempty"` +} + +type ModelsPentestAuthMatrixFailureIdentity struct { + BoundaryID string `json:"boundaryId"` + ControlID string `json:"controlId"` + Restriction string `json:"restriction"` + Version int `json:"version"` +} + type ModelsPentestAuthMatrixHypothesis struct { FalseReason *string `json:"falseReason,omitempty"` FindingID *string `json:"findingId,omitempty"` @@ -1308,19 +2594,77 @@ type ModelsPentestAuthMatrixHypothesis struct { Logs *AgentsAgentLogs `json:"logs,omitempty"` } -type ModelsPentestAuthMatrixResult struct { - Findings []ModelsPentestFinding `json:"findings,omitempty"` - Hypotheses []ModelsPentestAuthMatrixHypothesis `json:"hypotheses,omitempty"` +type ModelsPentestAuthMatrixIdentityCoverage struct { + Authenticated int `json:"authenticated"` + DistinctMaterial int `json:"distinctMaterial"` + Duplicate int `json:"duplicate"` + Requested int `json:"requested"` + Unavailable int `json:"unavailable"` +} + +type ModelsPentestAuthMatrixResult struct { + CaseManifest *ModelsAuthMatrixAgentResponseCaseManifest `json:"caseManifest,omitempty"` + Findings []ModelsPentestFinding `json:"findings,omitempty"` + Hypotheses []ModelsPentestAuthMatrixHypothesis `json:"hypotheses,omitempty"` + MutationSnapshot *ModelsPentestMutationSnapshot `json:"mutationSnapshot,omitempty"` + StageOutcome *ModelsPentestAuthMatrixStageOutcome `json:"stageOutcome,omitempty"` +} + +type ModelsPentestAuthMatrixStageOutcome struct { + Assessed int `json:"assessed"` + Batches []ModelsPentestAuthMatrixBatch `json:"batches,omitempty"` + ConsentArmed bool `json:"consentArmed"` + Degraded bool `json:"degraded"` + Excluded int `json:"excluded"` + Identities *ModelsPentestAuthMatrixIdentityCoverage `json:"identities,omitempty"` + Mode string `json:"mode"` + OperationsTotal int `json:"operationsTotal"` + Reason *string `json:"reason,omitempty"` + Unassessed ModelsPentestAuthMatrixUnassessed `json:"unassessed"` + UnauthenticatedTested *bool `json:"unauthenticatedTested,omitempty"` +} + +type ModelsPentestAuthMatrixUnassessed struct { + Degraded int `json:"degraded"` + Failed int `json:"failed"` + Indeterminate int `json:"indeterminate"` + Unresolved int `json:"unresolved"` +} + +type ModelsPentestDeployment struct { + TargetID string `json:"targetId"` + WebServiceID string `json:"webServiceId"` +} + +type ModelsPentestDeploymentSnapshot struct { + CredentialIds []string `json:"credentialIds,omitempty"` + IsProd *bool `json:"isProd,omitempty"` + NonProductionConfirmed *bool `json:"nonProductionConfirmed,omitempty"` + SiblingPaths []string `json:"siblingPaths,omitempty"` + SourceProjectID *string `json:"sourceProjectId,omitempty"` + SourceRepoPath *string `json:"sourceRepoPath,omitempty"` + SourceRepositoryID *string `json:"sourceRepositoryId,omitempty"` + TargetID string `json:"targetId"` + URL *string `json:"url,omitempty"` + WebServiceID string `json:"webServiceId"` } type ModelsPentestEndpointMetrics struct { + Degraded int `json:"degraded"` + Failed int `json:"failed"` Fuzzed int `json:"fuzzed"` + Indeterminate int `json:"indeterminate"` Tested int `json:"tested"` Total int `json:"total"` + Unresolved int `json:"unresolved"` Vulnerable int `json:"vulnerable"` } type ModelsPentestExploitAnalysisResult struct { + EndpointFindingIds []string `json:"endpointFindingIds,omitempty"` + EndpointFindings []ModelsPentestFinding `json:"endpointFindings,omitempty"` + SourceFindingIds []string `json:"sourceFindingIds,omitempty"` + SourceFindings []ModelsPentestFinding `json:"sourceFindings,omitempty"` UpdatedCodeFindings []ModelsCodeFinding `json:"updatedCodeFindings,omitempty"` UpdatedDependencyFindings []ModelsDependencyFinding `json:"updatedDependencyFindings,omitempty"` } @@ -1330,6 +2674,7 @@ type ModelsPentestFinding struct { AllowlistedReason string `json:"allowlistedReason"` API *ModelsPentestFindingAPI `json:"api,omitempty"` AuthMatrix *ModelsPentestFindingAuthMatrix `json:"authMatrix,omitempty"` + AuthMatrixEvidenceUnavailable *bool `json:"authMatrixEvidenceUnavailable,omitempty"` AutoFixCurrentActivity *string `json:"autoFixCurrentActivity,omitempty"` AutoFixEndTime *string `json:"autoFixEndTime,omitempty"` AutoFixStartTime *string `json:"autoFixStartTime,omitempty"` @@ -1344,19 +2689,24 @@ type ModelsPentestFinding struct { CreatedAt string `json:"createdAt"` Cwe int `json:"cwe"` Endpoint ModelsPentestFindingEndpoint `json:"endpoint"` + FixEvidence *ModelsFixEvidence `json:"fixEvidence,omitempty"` Host string `json:"host"` ID string `json:"id"` IsAllowlisted bool `json:"isAllowlisted"` + IsArchived bool `json:"isArchived"` IsAutoFixable bool `json:"isAutoFixable"` IsAutoFixableAgentVerdict *bool `json:"isAutoFixableAgentVerdict,omitempty"` + IsFalsePositive bool `json:"isFalsePositive"` IsFixed bool `json:"isFixed"` IsLatest bool `json:"isLatest"` - PriorityLabel ModelsPriorityEnum `json:"priorityLabel"` + PriorityLabel ModelsPriorityLabel `json:"priorityLabel"` PriorityScore int `json:"priorityScore"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` Repository *string `json:"repository,omitempty"` + RepositoryFullName *string `json:"repositoryFullName,omitempty"` RepositoryID *string `json:"repositoryId,omitempty"` RepositoryName *string `json:"repositoryName,omitempty"` + RepositoryPath *string `json:"repositoryPath,omitempty"` ScanInfo ModelsPentestFindingScanInfo `json:"scanInfo"` Source ModelsPentestFindingSource `json:"source"` Summary string `json:"summary"` @@ -1371,6 +2721,7 @@ type ModelsPentestFinding struct { type ModelsPentestFindingAPI struct { ErrorDescription string `json:"errorDescription"` ErrorType string `json:"errorType"` + FindingScope *ModelsPentestFindingScope `json:"findingScope,omitempty"` HttpVersion string `json:"httpVersion"` Method string `json:"method"` Path string `json:"path"` @@ -1385,13 +2736,26 @@ type ModelsPentestFindingAPI struct { URI string `json:"uri"` VulnerableParameterName string `json:"vulnerableParameterName"` VulnerableParameterValue string `json:"vulnerableParameterValue"` + ZapAlertRef *string `json:"zapAlertRef,omitempty"` + ZapPluginID *string `json:"zapPluginId,omitempty"` } type ModelsPentestFindingAuthMatrix struct { + AffectedPrincipalIds []string `json:"affectedPrincipalIds,omitempty"` + EvidenceRefs []string `json:"evidenceRefs,omitempty"` + ExperimentIds []string `json:"experimentIds,omitempty"` + FailureIdentity *ModelsPentestAuthMatrixFailureIdentity `json:"failureIdentity,omitempty"` Hypothesis string `json:"hypothesis"` + LegacyFindingIds []string `json:"legacyFindingIds,omitempty"` + Principal *ModelsPentestFindingAuthMatrixPrincipal `json:"principal,omitempty"` User *ModelsPentestFindingAuthMatrixUser `json:"user,omitempty"` } +type ModelsPentestFindingAuthMatrixPrincipal struct { + CredentialID *string `json:"credentialId,omitempty"` + Unauthenticated *bool `json:"unauthenticated,omitempty"` +} + type ModelsPentestFindingAuthMatrixUser struct { RoleDescription string `json:"roleDescription"` RoleName string `json:"roleName"` @@ -1403,11 +2767,21 @@ type ModelsPentestFindingEndpoint struct { Path string `json:"path"` } +type ModelsPentestFindingGroup struct { + Cwes []int `json:"cwes,omitempty"` + DuplicateCount int `json:"duplicateCount"` + MemberIds []string `json:"memberIds,omitempty"` + RepresentativeID string `json:"representativeId"` +} + type ModelsPentestFindingMetrics struct { - Fixed int `json:"fixed"` + CarriedForward *int `json:"carriedForward,omitempty"` New int `json:"new"` + Reconciled *bool `json:"reconciled,omitempty"` Total int `json:"total"` + Undetected *int `json:"undetected,omitempty"` Unfixed int `json:"unfixed"` + ValidatedExternal *int `json:"validatedExternal,omitempty"` } type ModelsPentestFindingRESTQueryParameters struct { @@ -1419,6 +2793,9 @@ type ModelsPentestFindingRESTRequestHeader struct { type ModelsPentestFindingRESTResponseHeader struct { } +type ModelsPentestFindingScanCoverage struct { +} + type ModelsPentestFindingScanInfo struct { AppID string `json:"appId"` ScanID string `json:"scanId"` @@ -1431,6 +2808,15 @@ type ModelsPentestFindingScanType string const ( ModelsPentestFindingScanTypeApi ModelsPentestFindingScanType = "API" ModelsPentestFindingScanTypeAuthmatrix ModelsPentestFindingScanType = "AuthMatrix" + ModelsPentestFindingScanTypeSource ModelsPentestFindingScanType = "Source" + ModelsPentestFindingScanTypeEndpoint ModelsPentestFindingScanType = "Endpoint" +) + +type ModelsPentestFindingScope string + +const ( + ModelsPentestFindingScopeEndpoint ModelsPentestFindingScope = "endpoint" + ModelsPentestFindingScopeHost ModelsPentestFindingScope = "host" ) type ModelsPentestFindingSource string @@ -1441,6 +2827,16 @@ const ( ModelsPentestFindingSourceNmap ModelsPentestFindingSource = "Nmap" ModelsPentestFindingSourceZap ModelsPentestFindingSource = "ZAP" ModelsPentestFindingSourceRestler ModelsPentestFindingSource = "RESTler" + ModelsPentestFindingSourceOther ModelsPentestFindingSource = "Other" +) + +type ModelsPentestFindingStatus string + +const ( + ModelsPentestFindingStatusNew ModelsPentestFindingStatus = "new" + ModelsPentestFindingStatusUnfixed ModelsPentestFindingStatus = "unfixed" + ModelsPentestFindingStatusValidatedExternal ModelsPentestFindingStatus = "validated_external" + ModelsPentestFindingStatusValidatedExternalUnconfirmed ModelsPentestFindingStatus = "validated_external_unconfirmed" ) type ModelsPentestHypothesis struct { @@ -1460,9 +2856,14 @@ type ModelsPentestHypothesisEvidence struct { Response *ModelsNetworkResponse `json:"response,omitempty"` } +type ModelsPentestMappedFinding struct { + CreatedAt string `json:"createdAt"` + FindingID string `json:"findingId"` + FindingType ModelsFindingType `json:"findingType"` +} + type ModelsPentestMetadata struct { Description string `json:"description"` - LangfuseTraceIds []string `json:"langfuseTraceIds,omitempty"` } type ModelsPentestMetrics struct { @@ -1473,6 +2874,40 @@ type ModelsPentestMetrics struct { UsageMetrics ModelsPentestUsageMetrics `json:"usageMetrics"` } +type ModelsPentestMutationAttempt struct { + CaseID *string `json:"caseId,omitempty"` + CleanupOperationID *string `json:"cleanupOperationId,omitempty"` + CleanupReason *string `json:"cleanupReason,omitempty"` + DispatchOutcome string `json:"dispatchOutcome"` + DispatchState string `json:"dispatchState"` + EvidenceRefs []string `json:"evidenceRefs,omitempty"` + FixtureCreationID *string `json:"fixtureCreationId,omitempty"` + FixtureSlot *string `json:"fixtureSlot,omitempty"` + ID string `json:"id"` + ItemPath *string `json:"itemPath,omitempty"` + Kind string `json:"kind"` + LogicalOperationID string `json:"logicalOperationId"` + Method string `json:"method"` + ObservedAt *string `json:"observedAt,omitempty"` + Origin *string `json:"origin,omitempty"` + Path string `json:"path"` + Phase string `json:"phase"` + PrincipalID string `json:"principalId"` + Reason *string `json:"reason,omitempty"` + ReservedAt *string `json:"reservedAt,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + UndoKind string `json:"undoKind"` + UndoStatus string `json:"undoStatus"` +} + +type ModelsPentestMutationSnapshot struct { + AsOf string `json:"asOf"` + Attempts []ModelsPentestMutationAttempt `json:"attempts,omitempty"` + Available bool `json:"available"` + Error *string `json:"error,omitempty"` + StageIncomplete bool `json:"stageIncomplete"` +} + type ModelsPentestPhaseUsageMetrics struct { CacheHitCost float64 `json:"cacheHitCost"` CacheHitTokenCount int `json:"cacheHitTokenCount"` @@ -1487,6 +2922,8 @@ type ModelsPentestPhaseUsageMetrics struct { type ModelsPentestPreflight struct { ApplicationID string `json:"applicationId"` + ConfigFingerprint *string `json:"configFingerprint,omitempty"` + Deployment *ModelsPentestDeployment `json:"deployment,omitempty"` EndTime *string `json:"endTime,omitempty"` ExecutionArn *string `json:"executionArn,omitempty"` FailureReason *string `json:"failureReason,omitempty"` @@ -1502,8 +2939,15 @@ type ModelsPentestPreflight struct { type ModelsPentestPreflightAppContextSnapshot struct { ApiEndpointCount *int `json:"apiEndpointCount,omitempty"` ApiEndpointsSample []string `json:"apiEndpointsSample,omitempty"` + ApiSchemaPartial *bool `json:"apiSchemaPartial,omitempty"` ApiSchemaSourceRef *string `json:"apiSchemaSourceRef,omitempty"` + ApiSchemaType *string `json:"apiSchemaType,omitempty"` + ComponentCount *int `json:"componentCount,omitempty"` Components []ModelsPentestPreflightComponentSnapshot `json:"components,omitempty"` + ContextStatus *string `json:"contextStatus,omitempty"` + Coverage *float64 `json:"coverage,omitempty"` + LastContextSyncTime *string `json:"lastContextSyncTime,omitempty"` + Resolved *bool `json:"resolved,omitempty"` } type ModelsPentestPreflightCheck struct { @@ -1614,8 +3058,11 @@ type ModelsPentestReport struct { Appendices *ModelsAppendices `json:"appendices,omitempty"` AssessmentPeriod *ModelsAssessmentPeriod `json:"assessmentPeriod,omitempty"` AuthMatrixResult *ModelsPentestAuthMatrixResult `json:"authMatrixResult,omitempty"` + DeliveredReportStale *bool `json:"deliveredReportStale,omitempty"` + DisprovenCandidates []ModelsDisprovenCandidate `json:"disprovenCandidates,omitempty"` ExecutiveSummary *ModelsExecutiveSummary `json:"executiveSummary,omitempty"` ExploitAnalysisResult *ModelsPentestExploitAnalysisResult `json:"exploitAnalysisResult,omitempty"` + FindingScanCoverage *ModelsPentestFindingScanCoverage `json:"findingScanCoverage,omitempty"` FindingsSummary []ModelsFindingSummary `json:"findingsSummary,omitempty"` Limitations *string `json:"limitations,omitempty"` Metadata ModelsPentestMetadata `json:"metadata"` @@ -1623,6 +3070,7 @@ type ModelsPentestReport struct { Metrics ModelsPentestMetrics `json:"metrics"` NetworkTransactionsSummary *ModelsNetworkTransactionsSummary `json:"networkTransactionsSummary,omitempty"` PentestToolsResult *ModelsPentestToolsResult `json:"pentestToolsResult,omitempty"` + ProducersRan []ModelsPentestFindingSource `json:"producersRan,omitempty"` ReportMetadata *ModelsReportMetadata `json:"reportMetadata,omitempty"` RetestPolicy *string `json:"retestPolicy,omitempty"` ScanID string `json:"scanId"` @@ -1632,6 +3080,8 @@ type ModelsPentestReport struct { type ModelsPentestRequestMetrics struct { Error int `json:"error"` Fail map[string]int `json:"fail,omitempty"` + RefusedHosts []string `json:"refusedHosts,omitempty"` + ScopeRefused *int `json:"scopeRefused,omitempty"` Success int `json:"success"` Timeout int `json:"timeout"` Total int `json:"total"` @@ -1640,7 +3090,14 @@ type ModelsPentestRequestMetrics struct { type ModelsPentestScan struct { AbortReason *ModelsPentestAbortReason `json:"abortReason,omitempty"` AppID string `json:"appId"` + AppName *string `json:"appName,omitempty"` AssessmentPhases []ModelsPentestAssessmentPhase `json:"assessmentPhases,omitempty"` + CaptureBytes *int `json:"captureBytes,omitempty"` + CaptureScrubbed *bool `json:"captureScrubbed,omitempty"` + CaptureStatus *string `json:"captureStatus,omitempty"` + CaptureTransactions *int `json:"captureTransactions,omitempty"` + Deployment *ModelsPentestDeploymentSnapshot `json:"deployment,omitempty"` + DiscoveredCount *int `json:"discoveredCount,omitempty"` EndTime *string `json:"endTime,omitempty"` ExecutionArn string `json:"executionArn"` FailureReason *string `json:"failureReason,omitempty"` @@ -1649,10 +3106,14 @@ type ModelsPentestScan struct { IsExternal bool `json:"isExternal"` NetworkLogs []ModelsNetworkLog `json:"networkLogs,omitempty"` Progress int `json:"progress"` - StartTime string `json:"startTime"` + RefusedHosts []string `json:"refusedHosts,omitempty"` + ReportFindingsCount *int `json:"reportFindingsCount,omitempty"` + ScopePolicy *ModelsPentestScopePolicy `json:"scopePolicy,omitempty"` + StartTime *string `json:"startTime,omitempty"` Status ModelsScanStatus `json:"status"` TenantID string `json:"tenantId"` TotalCost *ModelsPentestScanCostSummary `json:"totalCost,omitempty"` + ValidatedExternalCount *int `json:"validatedExternalCount,omitempty"` } type ModelsPentestScanConfig struct { @@ -1688,8 +3149,19 @@ type ModelsPentestScanCostSummary struct { TotalOutputTokens int `json:"totalOutputTokens"` } +type ModelsPentestScopePolicy struct { + Authority *string `json:"authority,omitempty"` + BasePath *string `json:"basePath,omitempty"` + ExcludePatterns []string `json:"excludePatterns,omitempty"` + Hash *string `json:"hash,omitempty"` +} + type ModelsPentestToolsResult struct { Findings []ModelsPentestFinding `json:"findings,omitempty"` + ProducersRan []ModelsPentestFindingSource `json:"producersRan,omitempty"` + ScanComplete *bool `json:"scanComplete,omitempty"` + ScanDegraded *bool `json:"scanDegraded,omitempty"` + ScopeRefused *bool `json:"scopeRefused,omitempty"` } type ModelsPentestUsageMetrics struct { @@ -1711,15 +3183,6 @@ type ModelsPortScanOverride struct { ThreadCount *int `json:"threadCount,omitempty"` } -type ModelsPriorityEnum string - -const ( - ModelsPriorityEnumFalsePositive ModelsPriorityEnum = "FALSE_POSITIVE" - ModelsPriorityEnumImportant ModelsPriorityEnum = "IMPORTANT" - ModelsPriorityEnumNegligible ModelsPriorityEnum = "NEGLIGIBLE" - ModelsPriorityEnumUrgent ModelsPriorityEnum = "URGENT" -) - type ModelsReportMetadata struct { Authors []ModelsAuthor `json:"authors,omitempty"` Classification string `json:"classification"` @@ -1729,11 +3192,21 @@ type ModelsReportMetadata struct { } type ModelsReportScope struct { + Excluded []ModelsExcludedRoute `json:"excluded,omitempty"` + OutOfScopeHosts []string `json:"outOfScopeHosts,omitempty"` TargetDescription *string `json:"targetDescription,omitempty"` TargetURL string `json:"targetUrl"` Users []ModelsScopeUser `json:"users,omitempty"` } +type ModelsRulesOfEngagement struct { + EligibleForBounty *bool `json:"eligibleForBounty,omitempty"` + PolicyText *string `json:"policyText,omitempty"` + ProgramURL *string `json:"programUrl,omitempty"` + ProhibitedActivities []string `json:"prohibitedActivities,omitempty"` + TestingAllowed *bool `json:"testingAllowed,omitempty"` +} + type ModelsSPACheckOverride struct { CheckLeakedEnv *bool `json:"checkLeakedEnv,omitempty"` CheckSourceMaps *bool `json:"checkSourceMaps,omitempty"` @@ -1744,21 +3217,29 @@ type ModelsScopePolicy struct { Include []ModelsAssetSelector `json:"include,omitempty"` } -type ModelsScopeUser struct { - Name string `json:"name"` - RoleDescription string `json:"roleDescription"` +type ModelsScopeProvenance struct { + ImportedAt *string `json:"importedAt,omitempty"` + ProgramName *string `json:"programName,omitempty"` + ProgramSlug *string `json:"programSlug,omitempty"` + ProgramURL *string `json:"programUrl,omitempty"` + Source *ModelsScopeProvenanceSource `json:"source,omitempty"` } -type ModelsSeverityEnum string +type ModelsScopeProvenanceSource string const ( - ModelsSeverityEnumCritical ModelsSeverityEnum = "CRITICAL" - ModelsSeverityEnumHigh ModelsSeverityEnum = "HIGH" - ModelsSeverityEnumInformational ModelsSeverityEnum = "INFORMATIONAL" - ModelsSeverityEnumLow ModelsSeverityEnum = "LOW" - ModelsSeverityEnumMedium ModelsSeverityEnum = "MEDIUM" + // (skipped value "" — no representable Go identifier) + ModelsScopeProvenanceSourceManual ModelsScopeProvenanceSource = "manual" + ModelsScopeProvenanceSourceHackerone ModelsScopeProvenanceSource = "hackerone" + ModelsScopeProvenanceSourceBugcrowd ModelsScopeProvenanceSource = "bugcrowd" ) +type ModelsScopeUser struct { + CredentialID *string `json:"credentialId,omitempty"` + Name string `json:"name"` + RoleDescription string `json:"roleDescription"` +} + type ModelsSeverityFloor string const ( @@ -1770,6 +3251,13 @@ const ( ModelsSeverityFloorCritical ModelsSeverityFloor = "critical" ) +type ModelsTOTPConfig struct { + Algorithm *string `json:"algorithm,omitempty"` + Digits *int `json:"digits,omitempty"` + Period *int `json:"period,omitempty"` + Secret *string `json:"secret,omitempty"` +} + type ModelsTagQueryAST struct { Children []ModelsTagQueryAST `json:"children,omitempty"` Key *string `json:"key,omitempty"` @@ -1835,586 +3323,11 @@ type ModelsToolsStage struct { ToolsUsed []string `json:"toolsUsed,omitempty"` } -type ModelsTriageCampaignMetadata struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` -} - -type ModelsTriageCloudContext struct { - Confidence *float64 `json:"confidence,omitempty"` - Mode *ModelsTriageCloudContextMode `json:"mode,omitempty"` - Repos []string `json:"repos,omitempty"` - Thoughts *string `json:"thoughts,omitempty"` -} - -type ModelsTriageCloudContextMode string - -const ( - ModelsTriageCloudContextModeModea ModelsTriageCloudContextMode = "MODEA" - ModelsTriageCloudContextModeModeb ModelsTriageCloudContextMode = "MODEB" -) - -type ModelsTriageExploitability struct { - AttackComplexity *ModelsTriageExploitabilityAttackComplexity `json:"attackComplexity,omitempty"` - AttackRequirements *ModelsTriageExploitabilityAttackRequirements `json:"attackRequirements,omitempty"` - AttackVector *ModelsTriageExploitabilityAttackVector `json:"attackVector,omitempty"` - Confidence *ModelsTriageExploitabilityConfidence `json:"confidence,omitempty"` - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityLabel `json:"label,omitempty"` - PrivilegesRequired *ModelsTriageExploitabilityPrivilegesRequired `json:"privilegesRequired,omitempty"` - Title *string `json:"title,omitempty"` - Unknowns []string `json:"unknowns,omitempty"` - UserInteraction *ModelsTriageExploitabilityUserInteraction `json:"userInteraction,omitempty"` -} - -type ModelsTriageExploitabilityAttackComplexity struct { - Description *string `json:"description,omitempty"` - ExploitChainRequired *ModelsTriageExploitabilityAttackComplexityExploitChainRequired `json:"exploitChainRequired,omitempty"` - Label *ModelsTriageExploitabilityAttackComplexityLabel `json:"label,omitempty"` - PayloadDifficulty *ModelsTriageExploitabilityAttackComplexityPayloadDifficulty `json:"payloadDifficulty,omitempty"` -} - -type ModelsTriageExploitabilityAttackComplexityExploitChainRequired struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` -} - -type ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel string - -const ( - ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabelHigh ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel = "HIGH" - ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabelLow ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel = "LOW" - ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabelNone ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel = "NONE" -) - -type ModelsTriageExploitabilityAttackComplexityLabel string - -const ( - ModelsTriageExploitabilityAttackComplexityLabelHigh ModelsTriageExploitabilityAttackComplexityLabel = "HIGH" - ModelsTriageExploitabilityAttackComplexityLabelLow ModelsTriageExploitabilityAttackComplexityLabel = "LOW" -) - -type ModelsTriageExploitabilityAttackComplexityPayloadDifficulty struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel `json:"label,omitempty"` -} - -type ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel string - -const ( - ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabelEasy ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel = "EASY" - ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabelHard ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel = "HARD" - ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabelNone ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel = "NONE" -) - -type ModelsTriageExploitabilityAttackRequirements struct { - Description *string `json:"description,omitempty"` - EnvironmentState *ModelsTriageExploitabilityAttackRequirementsEnvironmentState `json:"environmentState,omitempty"` - Label *ModelsTriageExploitabilityAttackRequirementsLabel `json:"label,omitempty"` - Mitm *ModelsTriageExploitabilityAttackRequirementsMitm `json:"mitm,omitempty"` - RaceCondition *ModelsTriageExploitabilityAttackRequirementsRaceCondition `json:"raceCondition,omitempty"` - TimeWindow *ModelsTriageExploitabilityAttackRequirementsTimeWindow `json:"timeWindow,omitempty"` - Title *string `json:"title,omitempty"` -} - -type ModelsTriageExploitabilityAttackRequirementsEnvironmentState struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` -} - -type ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel string - -const ( - ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabelHigh ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel = "HIGH" - ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabelLow ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel = "LOW" - ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabelNone ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel = "NONE" -) - -type ModelsTriageExploitabilityAttackRequirementsLabel string - -const ( - ModelsTriageExploitabilityAttackRequirementsLabelHigh ModelsTriageExploitabilityAttackRequirementsLabel = "HIGH" - ModelsTriageExploitabilityAttackRequirementsLabelLow ModelsTriageExploitabilityAttackRequirementsLabel = "LOW" - ModelsTriageExploitabilityAttackRequirementsLabelNone ModelsTriageExploitabilityAttackRequirementsLabel = "NONE" -) - -type ModelsTriageExploitabilityAttackRequirementsMitm struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityAttackRequirementsMitmLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` -} - -type ModelsTriageExploitabilityAttackRequirementsMitmLabel string - -const ( - ModelsTriageExploitabilityAttackRequirementsMitmLabelHigh ModelsTriageExploitabilityAttackRequirementsMitmLabel = "HIGH" - ModelsTriageExploitabilityAttackRequirementsMitmLabelLow ModelsTriageExploitabilityAttackRequirementsMitmLabel = "LOW" - ModelsTriageExploitabilityAttackRequirementsMitmLabelNone ModelsTriageExploitabilityAttackRequirementsMitmLabel = "NONE" -) - -type ModelsTriageExploitabilityAttackRequirementsRaceCondition struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` -} - -type ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel string - -const ( - ModelsTriageExploitabilityAttackRequirementsRaceConditionLabelHigh ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel = "HIGH" - ModelsTriageExploitabilityAttackRequirementsRaceConditionLabelLow ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel = "LOW" - ModelsTriageExploitabilityAttackRequirementsRaceConditionLabelNone ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel = "NONE" -) - -type ModelsTriageExploitabilityAttackRequirementsTimeWindow struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` -} - -type ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel string - -const ( - ModelsTriageExploitabilityAttackRequirementsTimeWindowLabelHigh ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel = "HIGH" - ModelsTriageExploitabilityAttackRequirementsTimeWindowLabelLow ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel = "LOW" - ModelsTriageExploitabilityAttackRequirementsTimeWindowLabelNone ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel = "NONE" -) - -type ModelsTriageExploitabilityAttackVector struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityAttackVectorLabel `json:"label,omitempty"` - SubVectors []ModelsTriageExploitabilityAttackVectorSubVectorsElem `json:"subVectors,omitempty"` -} - -type ModelsTriageExploitabilityAttackVectorLabel string - -const ( - ModelsTriageExploitabilityAttackVectorLabelAdjacent ModelsTriageExploitabilityAttackVectorLabel = "ADJACENT" - ModelsTriageExploitabilityAttackVectorLabelLocal ModelsTriageExploitabilityAttackVectorLabel = "LOCAL" - ModelsTriageExploitabilityAttackVectorLabelNetwork ModelsTriageExploitabilityAttackVectorLabel = "NETWORK" - ModelsTriageExploitabilityAttackVectorLabelPhysical ModelsTriageExploitabilityAttackVectorLabel = "PHYSICAL" -) - -type ModelsTriageExploitabilityAttackVectorSubVectorsElem struct { - Description *string `json:"description,omitempty"` - OtherVector *string `json:"otherVector,omitempty"` - Vector *ModelsTriageExploitabilityAttackVectorSubVectorsElemVector `json:"vector,omitempty"` -} - -type ModelsTriageExploitabilityAttackVectorSubVectorsElemVector string - -const ( - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentArpSpoofing ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_ARP_SPOOFING" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentBleAdvertising ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_BLE_ADVERTISING" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentBluetoothClassic ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_BLUETOOTH_CLASSIC" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentBluetoothKnob ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_BLUETOOTH_KNOB" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentIpv6NeighborDiscovery ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_IPV6_NEIGHBOR_DISCOVERY" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentMdns ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_MDNS" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentNetbios ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_NETBIOS" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentNfc ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_NFC" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_OTHER" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentSmb ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_SMB" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentSsdp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_SSDP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentThread ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_THREAD" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentWifiDirect ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_WIFI_DIRECT" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorAdjacentZigbee ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "ADJACENT_ZIGBEE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalCommandLineArgument ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_COMMAND_LINE_ARGUMENT" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalConfigurationFile ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_CONFIGURATION_FILE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalCronJob ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_CRON_JOB" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalDBusMessage ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_D-BUS_MESSAGE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalDockerSocket ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_DOCKER_SOCKET" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalEnvironmentVariable ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_ENVIRONMENT_VARIABLE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalFileContent ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_FILE_CONTENT" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalFileName ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_FILE_NAME" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalFilePath ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_FILE_PATH" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalIpcSocket ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_IPC_SOCKET" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_OTHER" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalScriptPlugin ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SCRIPT_PLUGIN" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalSharedLibraryLoad ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SHARED_LIBRARY_LOAD" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalSharedMemory ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SHARED_MEMORY" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalShellCommand ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SHELL_COMMAND" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorLocalSuidExecutable ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "LOCAL_SUID_EXECUTABLE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkDns ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_DNS" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkFtp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_FTP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkGraphqlQuery ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_GRAPHQL_QUERY" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkGre ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_GRE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpBody ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_BODY" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpCookie ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_COOKIE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpFileUpload ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_FILE_UPLOAD" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpHeader ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_HEADER" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpMethod ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_METHOD" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpPathParameter ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_PATH_PARAMETER" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkHttpQueryParameter ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_HTTP_QUERY_PARAMETER" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkIcmp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_ICMP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkImap ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_IMAP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkIpsec ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_IPSEC" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkL2tp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_L2TP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkLdap ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_LDAP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkMqtt ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_MQTT" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkNtp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_NTP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_OTHER" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkPop3 ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_POP3" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkRdp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_RDP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkRestEndpointhyperlinkClick ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_REST_ENDPOINTHYPERLINK_CLICK" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSctp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SCTP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSip ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SIP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSmb ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SMB" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSmtp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SMTP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSnmp ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SNMP" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSoapRequest ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SOAP_REQUEST" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkSsh ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_SSH" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkTcpPort ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_TCP_PORT" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkUdpPort ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_UDP_PORT" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorNetworkWebsocketMessage ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "NETWORK_WEBSOCKET_MESSAGE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalBiosJtag ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_BIOS_JTAG" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalBluetooth ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_BLUETOOTH" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalEvilMaid ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_EVIL_MAID" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalFirewire ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_FIREWIRE" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalIr ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_IR" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalNfc ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_NFC" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalOther ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_OTHER" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalRfid ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_RFID" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalSdCard ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_SD_CARD" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalSdio ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_SDIO" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalSideChannel ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_SIDE_CHANNEL" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalTempest ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_TEMPEST" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalThunderbolt ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_THUNDERBOLT" - ModelsTriageExploitabilityAttackVectorSubVectorsElemVectorPhysicalUsb ModelsTriageExploitabilityAttackVectorSubVectorsElemVector = "PHYSICAL_USB" -) - -type ModelsTriageExploitabilityConfidence string - -const ( - ModelsTriageExploitabilityConfidenceHigh ModelsTriageExploitabilityConfidence = "HIGH" - ModelsTriageExploitabilityConfidenceLow ModelsTriageExploitabilityConfidence = "LOW" - ModelsTriageExploitabilityConfidenceMedium ModelsTriageExploitabilityConfidence = "MEDIUM" -) - -type ModelsTriageExploitabilityLabel string - -const ( - ModelsTriageExploitabilityLabelLikely ModelsTriageExploitabilityLabel = "LIKELY" - ModelsTriageExploitabilityLabelNeutral ModelsTriageExploitabilityLabel = "NEUTRAL" - ModelsTriageExploitabilityLabelUnlikely ModelsTriageExploitabilityLabel = "UNLIKELY" -) - -type ModelsTriageExploitabilityPrivilegesRequired struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityPrivilegesRequiredLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` - Types []ModelsTriageExploitabilityPrivilegesRequiredTypesElem `json:"types,omitempty"` -} - -type ModelsTriageExploitabilityPrivilegesRequiredLabel string - -const ( - ModelsTriageExploitabilityPrivilegesRequiredLabelHigh ModelsTriageExploitabilityPrivilegesRequiredLabel = "HIGH" - ModelsTriageExploitabilityPrivilegesRequiredLabelLow ModelsTriageExploitabilityPrivilegesRequiredLabel = "LOW" - ModelsTriageExploitabilityPrivilegesRequiredLabelNone ModelsTriageExploitabilityPrivilegesRequiredLabel = "NONE" -) - -type ModelsTriageExploitabilityPrivilegesRequiredTypesElem string - -const ( - ModelsTriageExploitabilityPrivilegesRequiredTypesElemPriviledgedUser ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "PRIVILEDGED_USER" - ModelsTriageExploitabilityPrivilegesRequiredTypesElemUnauthenticated ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "UNAUTHENTICATED" - ModelsTriageExploitabilityPrivilegesRequiredTypesElemUnverifiedUser ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "UNVERIFIED_USER" - ModelsTriageExploitabilityPrivilegesRequiredTypesElemVerifiedUser ModelsTriageExploitabilityPrivilegesRequiredTypesElem = "VERIFIED_USER" -) - -type ModelsTriageExploitabilityUserInteraction struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageExploitabilityUserInteractionLabel `json:"label,omitempty"` - OtherTypes []string `json:"otherTypes,omitempty"` - Title *string `json:"title,omitempty"` - Types []ModelsTriageExploitabilityUserInteractionTypesElem `json:"types,omitempty"` -} - -type ModelsTriageExploitabilityUserInteractionLabel string - -const ( - ModelsTriageExploitabilityUserInteractionLabelActive ModelsTriageExploitabilityUserInteractionLabel = "ACTIVE" - ModelsTriageExploitabilityUserInteractionLabelNone ModelsTriageExploitabilityUserInteractionLabel = "NONE" - ModelsTriageExploitabilityUserInteractionLabelPassive ModelsTriageExploitabilityUserInteractionLabel = "PASSIVE" -) - -type ModelsTriageExploitabilityUserInteractionTypesElem string - -const ( - ModelsTriageExploitabilityUserInteractionTypesElemBrowsing ModelsTriageExploitabilityUserInteractionTypesElem = "BROWSING" - ModelsTriageExploitabilityUserInteractionTypesElemFileDownload ModelsTriageExploitabilityUserInteractionTypesElem = "FILE_DOWNLOAD" - ModelsTriageExploitabilityUserInteractionTypesElemFileUpload ModelsTriageExploitabilityUserInteractionTypesElem = "FILE_UPLOAD" - ModelsTriageExploitabilityUserInteractionTypesElemHyperlinkClick ModelsTriageExploitabilityUserInteractionTypesElem = "HYPERLINK_CLICK" - ModelsTriageExploitabilityUserInteractionTypesElemSocialEngineering ModelsTriageExploitabilityUserInteractionTypesElem = "SOCIAL_ENGINEERING" -) - -type ModelsTriageFixEffort struct { - Confidence *ModelsTriageFixEffortConfidence `json:"confidence,omitempty"` - Description *string `json:"description,omitempty"` - Label *ModelsTriageFixEffortLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` - Unknowns []string `json:"unknowns,omitempty"` -} - -type ModelsTriageFixEffortConfidence string - -const ( - ModelsTriageFixEffortConfidenceHigh ModelsTriageFixEffortConfidence = "HIGH" - ModelsTriageFixEffortConfidenceLow ModelsTriageFixEffortConfidence = "LOW" - ModelsTriageFixEffortConfidenceMedium ModelsTriageFixEffortConfidence = "MEDIUM" -) - -type ModelsTriageFixEffortLabel string - -const ( - ModelsTriageFixEffortLabelEasy ModelsTriageFixEffortLabel = "EASY" - ModelsTriageFixEffortLabelHard ModelsTriageFixEffortLabel = "HARD" - ModelsTriageFixEffortLabelMedium ModelsTriageFixEffortLabel = "MEDIUM" -) - -type ModelsTriageImpact struct { - Availability *ModelsTriageImpactAvailability `json:"availability,omitempty"` - BusinessCriticality *ModelsTriageImpactBusinessCriticality `json:"businessCriticality,omitempty"` - Confidence *ModelsTriageImpactConfidence `json:"confidence,omitempty"` - Confidentiality *ModelsTriageImpactConfidentiality `json:"confidentiality,omitempty"` - Description *string `json:"description,omitempty"` - Integrity *ModelsTriageImpactIntegrity `json:"integrity,omitempty"` - Label *ModelsTriageImpactLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` - Unknowns []string `json:"unknowns,omitempty"` -} - -type ModelsTriageImpactAvailability struct { - Cause []ModelsTriageImpactAvailabilityCauseElem `json:"cause,omitempty"` - Description *string `json:"description,omitempty"` - Label *ModelsTriageImpactAvailabilityLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` - Type []ModelsTriageImpactAvailabilityTypeElem `json:"type,omitempty"` -} - -type ModelsTriageImpactAvailabilityCauseElem string - -const ( - ModelsTriageImpactAvailabilityCauseElemBufferOverflow ModelsTriageImpactAvailabilityCauseElem = "BUFFER_OVERFLOW" - ModelsTriageImpactAvailabilityCauseElemBusinessLogic ModelsTriageImpactAvailabilityCauseElem = "BUSINESS_LOGIC" - ModelsTriageImpactAvailabilityCauseElemInfiniteLoop ModelsTriageImpactAvailabilityCauseElem = "INFINITE_LOOP" - ModelsTriageImpactAvailabilityCauseElemMemoryLeak ModelsTriageImpactAvailabilityCauseElem = "MEMORY_LEAK" - ModelsTriageImpactAvailabilityCauseElemResourceExhaustion ModelsTriageImpactAvailabilityCauseElem = "RESOURCE_EXHAUSTION" -) - -type ModelsTriageImpactAvailabilityLabel string - -const ( - ModelsTriageImpactAvailabilityLabelHigh ModelsTriageImpactAvailabilityLabel = "HIGH" - ModelsTriageImpactAvailabilityLabelLow ModelsTriageImpactAvailabilityLabel = "LOW" - ModelsTriageImpactAvailabilityLabelNone ModelsTriageImpactAvailabilityLabel = "NONE" -) - -type ModelsTriageImpactAvailabilityTypeElem string - -const ( - ModelsTriageImpactAvailabilityTypeElemCompleteServiceOutage ModelsTriageImpactAvailabilityTypeElem = "COMPLETE_SERVICE_OUTAGE" - ModelsTriageImpactAvailabilityTypeElemServiceDegradation ModelsTriageImpactAvailabilityTypeElem = "SERVICE_DEGRADATION" - ModelsTriageImpactAvailabilityTypeElemUserAccessDisruption ModelsTriageImpactAvailabilityTypeElem = "USER_ACCESS_DISRUPTION" -) - -type ModelsTriageImpactBusinessCriticality struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageImpactBusinessCriticalityLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` -} - -type ModelsTriageImpactBusinessCriticalityLabel string - -const ( - ModelsTriageImpactBusinessCriticalityLabelHigh ModelsTriageImpactBusinessCriticalityLabel = "HIGH" - ModelsTriageImpactBusinessCriticalityLabelLow ModelsTriageImpactBusinessCriticalityLabel = "LOW" - ModelsTriageImpactBusinessCriticalityLabelMedium ModelsTriageImpactBusinessCriticalityLabel = "MEDIUM" -) - -type ModelsTriageImpactConfidence string - -const ( - ModelsTriageImpactConfidenceHigh ModelsTriageImpactConfidence = "HIGH" - ModelsTriageImpactConfidenceLow ModelsTriageImpactConfidence = "LOW" - ModelsTriageImpactConfidenceMedium ModelsTriageImpactConfidence = "MEDIUM" -) - -type ModelsTriageImpactConfidentiality struct { - DataLeaked []ModelsTriageImpactConfidentialityDataLeakedElem `json:"dataLeaked,omitempty"` - Label *ModelsTriageImpactConfidentialityLabel `json:"label,omitempty"` -} - -type ModelsTriageImpactConfidentialityDataLeakedElem string - -const ( - ModelsTriageImpactConfidentialityDataLeakedElemAccessToken ModelsTriageImpactConfidentialityDataLeakedElem = "ACCESS_TOKEN" - ModelsTriageImpactConfidentialityDataLeakedElemAddress ModelsTriageImpactConfidentialityDataLeakedElem = "ADDRESS" - ModelsTriageImpactConfidentialityDataLeakedElemAge ModelsTriageImpactConfidentialityDataLeakedElem = "AGE" - ModelsTriageImpactConfidentialityDataLeakedElemApiKey ModelsTriageImpactConfidentialityDataLeakedElem = "API_KEY" - ModelsTriageImpactConfidentialityDataLeakedElemAuthenticationData ModelsTriageImpactConfidentialityDataLeakedElem = "AUTHENTICATION_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemBankAccountInformation ModelsTriageImpactConfidentialityDataLeakedElem = "BANK_ACCOUNT_INFORMATION" - ModelsTriageImpactConfidentialityDataLeakedElemBiometricData ModelsTriageImpactConfidentialityDataLeakedElem = "BIOMETRIC_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemCallLogs ModelsTriageImpactConfidentialityDataLeakedElem = "CALL_LOGS" - ModelsTriageImpactConfidentialityDataLeakedElemCertificate ModelsTriageImpactConfidentialityDataLeakedElem = "CERTIFICATE" - ModelsTriageImpactConfidentialityDataLeakedElemClientAndVendorInformation ModelsTriageImpactConfidentialityDataLeakedElem = "CLIENT_AND_VENDOR_INFORMATION" - ModelsTriageImpactConfidentialityDataLeakedElemComplianceRecords ModelsTriageImpactConfidentialityDataLeakedElem = "COMPLIANCE_RECORDS" - ModelsTriageImpactConfidentialityDataLeakedElemCreditDebitCardDetails ModelsTriageImpactConfidentialityDataLeakedElem = "CREDIT_DEBIT_CARD_DETAILS" - ModelsTriageImpactConfidentialityDataLeakedElemDatabaseCredentials ModelsTriageImpactConfidentialityDataLeakedElem = "DATABASE_CREDENTIALS" - ModelsTriageImpactConfidentialityDataLeakedElemDeviceIdentifiers ModelsTriageImpactConfidentialityDataLeakedElem = "DEVICE_IDENTIFIERS" - ModelsTriageImpactConfidentialityDataLeakedElemDriversLicense ModelsTriageImpactConfidentialityDataLeakedElem = "DRIVERS_LICENSE" - ModelsTriageImpactConfidentialityDataLeakedElemEducationRecords ModelsTriageImpactConfidentialityDataLeakedElem = "EDUCATION_RECORDS" - ModelsTriageImpactConfidentialityDataLeakedElemEmailAddress ModelsTriageImpactConfidentialityDataLeakedElem = "EMAIL_ADDRESS" - ModelsTriageImpactConfidentialityDataLeakedElemEmailsAndMessages ModelsTriageImpactConfidentialityDataLeakedElem = "EMAILS_AND_MESSAGES" - ModelsTriageImpactConfidentialityDataLeakedElemEmploymentHistory ModelsTriageImpactConfidentialityDataLeakedElem = "EMPLOYMENT_HISTORY" - ModelsTriageImpactConfidentialityDataLeakedElemEncryptionKey ModelsTriageImpactConfidentialityDataLeakedElem = "ENCRYPTION_KEY" - ModelsTriageImpactConfidentialityDataLeakedElemGender ModelsTriageImpactConfidentialityDataLeakedElem = "GENDER" - ModelsTriageImpactConfidentialityDataLeakedElemIncomeAndTaxInformation ModelsTriageImpactConfidentialityDataLeakedElem = "INCOME_AND_TAX_INFORMATION" - ModelsTriageImpactConfidentialityDataLeakedElemIntellectualProperty ModelsTriageImpactConfidentialityDataLeakedElem = "INTELLECTUAL_PROPERTY" - ModelsTriageImpactConfidentialityDataLeakedElemInventoryData ModelsTriageImpactConfidentialityDataLeakedElem = "INVENTORY_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemInvestmentInformation ModelsTriageImpactConfidentialityDataLeakedElem = "INVESTMENT_INFORMATION" - ModelsTriageImpactConfidentialityDataLeakedElemIpAddresses ModelsTriageImpactConfidentialityDataLeakedElem = "IP_ADDRESSES" - ModelsTriageImpactConfidentialityDataLeakedElemLegalDocuments ModelsTriageImpactConfidentialityDataLeakedElem = "LEGAL_DOCUMENTS" - ModelsTriageImpactConfidentialityDataLeakedElemMedicalData ModelsTriageImpactConfidentialityDataLeakedElem = "MEDICAL_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemName ModelsTriageImpactConfidentialityDataLeakedElem = "NAME" - ModelsTriageImpactConfidentialityDataLeakedElemOtherPrivateNonSensitiveData ModelsTriageImpactConfidentialityDataLeakedElem = "OTHER_PRIVATE_NON_SENSITIVE_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemOtherPrivateSensitiveData ModelsTriageImpactConfidentialityDataLeakedElem = "OTHER_PRIVATE_SENSITIVE_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemOtherPublicData ModelsTriageImpactConfidentialityDataLeakedElem = "OTHER_PUBLIC_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemPassport ModelsTriageImpactConfidentialityDataLeakedElem = "PASSPORT" - ModelsTriageImpactConfidentialityDataLeakedElemPerformanceReviews ModelsTriageImpactConfidentialityDataLeakedElem = "PERFORMANCE_REVIEWS" - ModelsTriageImpactConfidentialityDataLeakedElemPhoneNumber ModelsTriageImpactConfidentialityDataLeakedElem = "PHONE_NUMBER" - ModelsTriageImpactConfidentialityDataLeakedElemPoliticalOpinions ModelsTriageImpactConfidentialityDataLeakedElem = "POLITICAL_OPINIONS" - ModelsTriageImpactConfidentialityDataLeakedElemRacialOrEthnicOrigin ModelsTriageImpactConfidentialityDataLeakedElem = "RACIAL_OR_ETHNIC_ORIGIN" - ModelsTriageImpactConfidentialityDataLeakedElemReligiousOrPhilosophicalBeliefs ModelsTriageImpactConfidentialityDataLeakedElem = "RELIGIOUS_OR_PHILOSOPHICAL_BELIEFS" - ModelsTriageImpactConfidentialityDataLeakedElemSalaryAndBenefitsInformation ModelsTriageImpactConfidentialityDataLeakedElem = "SALARY_AND_BENEFITS_INFORMATION" - ModelsTriageImpactConfidentialityDataLeakedElemSecretKey ModelsTriageImpactConfidentialityDataLeakedElem = "SECRET_KEY" - ModelsTriageImpactConfidentialityDataLeakedElemSexualOrientation ModelsTriageImpactConfidentialityDataLeakedElem = "SEXUAL_ORIENTATION" - ModelsTriageImpactConfidentialityDataLeakedElemSocialMediaInteractions ModelsTriageImpactConfidentialityDataLeakedElem = "SOCIAL_MEDIA_INTERACTIONS" - ModelsTriageImpactConfidentialityDataLeakedElemSocialSecurityNumber ModelsTriageImpactConfidentialityDataLeakedElem = "SOCIAL_SECURITY_NUMBER" - ModelsTriageImpactConfidentialityDataLeakedElemStrategicPlansAndForecasts ModelsTriageImpactConfidentialityDataLeakedElem = "STRATEGIC_PLANS_AND_FORECASTS" - ModelsTriageImpactConfidentialityDataLeakedElemSystemLogsAndMonitoringData ModelsTriageImpactConfidentialityDataLeakedElem = "SYSTEM_LOGS_AND_MONITORING_DATA" - ModelsTriageImpactConfidentialityDataLeakedElemTradeSecrets ModelsTriageImpactConfidentialityDataLeakedElem = "TRADE_SECRETS" - ModelsTriageImpactConfidentialityDataLeakedElemTransactionHistory ModelsTriageImpactConfidentialityDataLeakedElem = "TRANSACTION_HISTORY" -) - -type ModelsTriageImpactConfidentialityLabel string - -const ( - ModelsTriageImpactConfidentialityLabelHigh ModelsTriageImpactConfidentialityLabel = "HIGH" - ModelsTriageImpactConfidentialityLabelLow ModelsTriageImpactConfidentialityLabel = "LOW" - ModelsTriageImpactConfidentialityLabelNone ModelsTriageImpactConfidentialityLabel = "NONE" -) - -type ModelsTriageImpactIntegrity struct { - Description *string `json:"description,omitempty"` - Label *ModelsTriageImpactIntegrityLabel `json:"label,omitempty"` - Title *string `json:"title,omitempty"` - Type []ModelsTriageImpactIntegrityTypeElem `json:"type,omitempty"` -} - -type ModelsTriageImpactIntegrityLabel string - -const ( - ModelsTriageImpactIntegrityLabelHigh ModelsTriageImpactIntegrityLabel = "HIGH" - ModelsTriageImpactIntegrityLabelLow ModelsTriageImpactIntegrityLabel = "LOW" - ModelsTriageImpactIntegrityLabelNone ModelsTriageImpactIntegrityLabel = "NONE" -) - -type ModelsTriageImpactIntegrityTypeElem string - -const ( - ModelsTriageImpactIntegrityTypeElemDatabaseAltered ModelsTriageImpactIntegrityTypeElem = "DATABASE_ALTERED" - ModelsTriageImpactIntegrityTypeElemMaliciousCodeExecuted ModelsTriageImpactIntegrityTypeElem = "MALICIOUS_CODE_EXECUTED" - ModelsTriageImpactIntegrityTypeElemPriviledgeEscalation ModelsTriageImpactIntegrityTypeElem = "PRIVILEDGE_ESCALATION" - ModelsTriageImpactIntegrityTypeElemSystemBehaviourManipulated ModelsTriageImpactIntegrityTypeElem = "SYSTEM_BEHAVIOUR_MANIPULATED" -) - -type ModelsTriageImpactLabel string - -const ( - ModelsTriageImpactLabelCritical ModelsTriageImpactLabel = "CRITICAL" - ModelsTriageImpactLabelHigh ModelsTriageImpactLabel = "HIGH" - ModelsTriageImpactLabelLow ModelsTriageImpactLabel = "LOW" -) - -type ModelsTriagePentest struct { - AttemptedCVEs []string `json:"attemptedCVEs,omitempty"` - Confidence *float64 `json:"confidence,omitempty"` - Cost *float64 `json:"cost,omitempty"` - Duration *float64 `json:"duration,omitempty"` - ExploitedCVE *string `json:"exploitedCVE,omitempty"` - Logs *AgentsGroupedAgentLogs `json:"logs,omitempty"` - Outcome *ModelsTriagePentestOutcome `json:"outcome,omitempty"` - Report *string `json:"report,omitempty"` - ReproductionScript *string `json:"reproductionScript,omitempty"` - TestedEndpoints []ModelsTriagePentestTestedEndpointsElem `json:"testedEndpoints,omitempty"` -} - -type ModelsTriagePentestOutcome string - -const ( - ModelsTriagePentestOutcomeCannotDetermine ModelsTriagePentestOutcome = "CANNOT_DETERMINE" - ModelsTriagePentestOutcomeConfirmed ModelsTriagePentestOutcome = "CONFIRMED" - ModelsTriagePentestOutcomeLikely ModelsTriagePentestOutcome = "LIKELY" - ModelsTriagePentestOutcomeNotExploitable ModelsTriagePentestOutcome = "NOT_EXPLOITABLE" - ModelsTriagePentestOutcomePotential ModelsTriagePentestOutcome = "POTENTIAL" -) - -type ModelsTriagePentestTestedEndpointsElem struct { - Method *string `json:"method,omitempty"` - Path *string `json:"path,omitempty"` -} - -type ModelsTriageRetriageMetadata struct { - MemoryChanges []ModelsTriageRetriageMetadataMemoryChangesElem `json:"memoryChanges,omitempty"` - TriggeredAt *string `json:"triggeredAt,omitempty"` -} - -type ModelsTriageRetriageMetadataMemoryChangesElem struct { - MemoryChangeType *ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType `json:"memoryChangeType,omitempty"` - MemoryID *string `json:"memoryId,omitempty"` -} - -type ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType string - -const ( - ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryAdded ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_ADDED" - ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryCorrected ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_CORRECTED" - ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryInvalidated ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_INVALIDATED" - ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeTypeMemoryRemoved ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType = "MEMORY_REMOVED" -) - -type ModelsTriageRetriageStatus string - -const ( - ModelsTriageRetriageStatusNotRetriaged ModelsTriageRetriageStatus = "NOT_RETRIAGED" - ModelsTriageRetriageStatusRetriageCompleted ModelsTriageRetriageStatus = "RETRIAGE_COMPLETED" - ModelsTriageRetriageStatusRetriageFailed ModelsTriageRetriageStatus = "RETRIAGE_FAILED" - ModelsTriageRetriageStatusRetriageInProgress ModelsTriageRetriageStatus = "RETRIAGE_IN_PROGRESS" - ModelsTriageRetriageStatusRetriageRequested ModelsTriageRetriageStatus = "RETRIAGE_REQUESTED" -) - -type ModelsTriageSeverity struct { - Confidence *ModelsTriageSeverityConfidence `json:"confidence,omitempty"` - Label *ModelsSeverityEnum `json:"label,omitempty"` - Score *int `json:"score,omitempty"` - Unknowns []string `json:"unknowns,omitempty"` -} - -type ModelsTriageSeverityConfidence string - -const ( - ModelsTriageSeverityConfidenceHigh ModelsTriageSeverityConfidence = "HIGH" - ModelsTriageSeverityConfidenceLow ModelsTriageSeverityConfidence = "LOW" - ModelsTriageSeverityConfidenceMedium ModelsTriageSeverityConfidence = "MEDIUM" -) - type ModelsValidationEvidence struct { Duration *int64 `json:"duration,omitempty"` Error *string `json:"error,omitempty"` Message string `json:"message"` + ReasonCode *string `json:"reasonCode,omitempty"` ResponseHeaders map[string]string `json:"responseHeaders,omitempty"` Status ModelsValidationStatus `json:"status"` StatusCode *int `json:"statusCode,omitempty"` @@ -2430,6 +3343,17 @@ const ( ModelsValidationStatusInvalid ModelsValidationStatus = "invalid" ModelsValidationStatusExpired ModelsValidationStatus = "expired" ModelsValidationStatusError ModelsValidationStatus = "error" + ModelsValidationStatusUnreachable ModelsValidationStatus = "unreachable" + ModelsValidationStatusBlocked ModelsValidationStatus = "blocked" +) + +type ModelsValidationTrigger string + +const ( + ModelsValidationTriggerManual ModelsValidationTrigger = "manual" + ModelsValidationTriggerScheduled ModelsValidationTrigger = "scheduled" + ModelsValidationTriggerPreflight ModelsValidationTrigger = "preflight" + ModelsValidationTriggerScan ModelsValidationTrigger = "scan" ) type ModelsVulnClass string diff --git a/internal/api/models/findings.go b/internal/api/models/findings.go new file mode 100644 index 0000000..c8c0027 --- /dev/null +++ b/internal/api/models/findings.go @@ -0,0 +1,44 @@ +// Code generated by scripts/generate/main.go. DO NOT EDIT. +package models + +type EndpointsFindingFeedbackEntry struct { + Axis string `json:"axis"` + CommentText *string `json:"commentText,omitempty"` + CreatedAt string `json:"createdAt"` + ID string `json:"id"` + RaterKind string `json:"raterKind"` + RaterUserID *string `json:"raterUserId,omitempty"` + Source string `json:"source"` + Verdict EndpointsFindingFeedbackVerdict `json:"verdict"` +} + +type EndpointsFindingFeedbackVerdict string + +const ( + EndpointsFindingFeedbackVerdictUp EndpointsFindingFeedbackVerdict = "up" + EndpointsFindingFeedbackVerdictDown EndpointsFindingFeedbackVerdict = "down" + EndpointsFindingFeedbackVerdictHelpful EndpointsFindingFeedbackVerdict = "helpful" + EndpointsFindingFeedbackVerdictWrong EndpointsFindingFeedbackVerdict = "wrong" + EndpointsFindingFeedbackVerdictNoisy EndpointsFindingFeedbackVerdict = "noisy" + EndpointsFindingFeedbackVerdictFixGood EndpointsFindingFeedbackVerdict = "fix_good" + EndpointsFindingFeedbackVerdictFixBad EndpointsFindingFeedbackVerdict = "fix_bad" + EndpointsFindingFeedbackVerdictWorthFixing EndpointsFindingFeedbackVerdict = "worth_fixing" + EndpointsFindingFeedbackVerdictExplanationClear EndpointsFindingFeedbackVerdict = "explanation_clear" + EndpointsFindingFeedbackVerdictExplanationUnclear EndpointsFindingFeedbackVerdict = "explanation_unclear" + EndpointsFindingFeedbackVerdictSeverityRight EndpointsFindingFeedbackVerdict = "severity_right" + EndpointsFindingFeedbackVerdictSeverityWrong EndpointsFindingFeedbackVerdict = "severity_wrong" +) + +type EndpointsGetFindingFeedbackOutput struct { + Feedback []EndpointsFindingFeedbackEntry `json:"feedback,omitempty"` +} + +type EndpointsPostFindingFeedbackInput struct { + CommentText *string `json:"commentText,omitempty"` + FindingType *string `json:"findingType,omitempty"` + Verdict EndpointsFindingFeedbackVerdict `json:"verdict"` +} + +type EndpointsPostFindingFeedbackOutput struct { + Feedback EndpointsFindingFeedbackEntry `json:"feedback"` +} diff --git a/internal/api/models/infrastructure.go b/internal/api/models/infrastructure.go deleted file mode 100644 index a523323..0000000 --- a/internal/api/models/infrastructure.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by scripts/generate/main.go. DO NOT EDIT. -package models - -type EndpointsGetInfrastructureGraphDownloadOutput struct { - AccountID string `json:"accountId"` - DownloadURL string `json:"downloadUrl"` - ExpiresAt string `json:"expiresAt"` - Version *string `json:"version,omitempty"` -} - -type EndpointsGetInfrastructureGraphOutput struct { - Graph *GraphGraph `json:"graph,omitempty"` - Version *string `json:"version,omitempty"` -} - -type EndpointsGetInfrastructureGraphSummaryOutput struct { - AccountCount int `json:"accountCount"` - CombinedGraphExpiresAt string `json:"combinedGraphExpiresAt"` - CombinedGraphURL *string `json:"combinedGraphUrl,omitempty"` - GraphInfo *EndpointsInfrastructureGraphInfo `json:"graphInfo,omitempty"` - Graphs []EndpointsInfrastructureGraphDownloadInfo `json:"graphs,omitempty"` - IntegrationStatus EndpointsIntegrationStatus `json:"integrationStatus"` - LastUpdated string `json:"lastUpdated"` - TotalEdgeCount int `json:"totalEdgeCount"` - TotalNodeCount int `json:"totalNodeCount"` - Version *string `json:"version,omitempty"` -} - -type EndpointsGetInfrastructureGraphVersionOutput struct { - Graph *GraphGraph `json:"graph,omitempty"` - Version *string `json:"version,omitempty"` -} - -type EndpointsInfrastructureGraphDownloadInfo struct { - AccountID string `json:"accountId"` - DownloadURL string `json:"downloadUrl"` - EdgeCount int `json:"edgeCount"` - ExpiresAt string `json:"expiresAt"` - GeneratedAt string `json:"generatedAt"` - GraphID *string `json:"graphId,omitempty"` - GraphType *string `json:"graphType,omitempty"` - NodeCount int `json:"nodeCount"` - Region *string `json:"region,omitempty"` - Version *string `json:"version,omitempty"` -} - -type EndpointsInfrastructureGraphSummary struct { - AccountID string `json:"accountId"` - EdgeCount int `json:"edgeCount"` - GeneratedAt string `json:"generatedAt"` - GeneratedBy string `json:"generatedBy"` - GraphID string `json:"graphId"` - GraphType string `json:"graphType"` - LastModified string `json:"lastModified"` - NodeCount int `json:"nodeCount"` - Region *string `json:"region,omitempty"` - S3Key *string `json:"s3Key,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - Version string `json:"version"` -} - -type EndpointsIntegrationStatus string - -const ( - EndpointsIntegrationStatusPending EndpointsIntegrationStatus = "pending" - EndpointsIntegrationStatusReady EndpointsIntegrationStatus = "ready" -) - -type EndpointsListInfrastructureGraphVersionsOutput struct { - AccountID string `json:"accountId"` - Count int `json:"count"` - Version *string `json:"version,omitempty"` - Versions []string `json:"versions,omitempty"` -} - -type EndpointsListInfrastructureGraphsOutput struct { - Count int `json:"count"` - Graphs []EndpointsInfrastructureGraphSummary `json:"graphs,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/internal/api/models/manager.go b/internal/api/models/manager.go index 9346074..fbe4665 100644 --- a/internal/api/models/manager.go +++ b/internal/api/models/manager.go @@ -3,14 +3,187 @@ package models import "encoding/json" -type ActionsPendingAction struct { +type ActionitemanswerAnswer struct { + Assignments []ActionitemanswerAssignment `json:"assignments,omitempty"` + DurationDays *int `json:"durationDays,omitempty"` + OptionID *string `json:"optionId,omitempty"` + OptionIds []string `json:"optionIds,omitempty"` + Other *string `json:"other,omitempty"` + Reason *string `json:"reason,omitempty"` + TeamID *string `json:"teamId,omitempty"` + Text *string `json:"text,omitempty"` + UserID *string `json:"userId,omitempty"` + Value *string `json:"value,omitempty"` +} + +type ActionitemanswerAssignment struct { + TargetID string `json:"targetId"` + TeamID string `json:"teamId"` +} + +type ActionitemanswerEffect string + +const ( + // (skipped value "" — no representable Go identifier) + ActionitemanswerEffectApprove ActionitemanswerEffect = "approve" + ActionitemanswerEffectNeedsChanges ActionitemanswerEffect = "needs_changes" + ActionitemanswerEffectFalsePositive ActionitemanswerEffect = "false_positive" + ActionitemanswerEffectSnooze ActionitemanswerEffect = "snooze" + ActionitemanswerEffectDismiss ActionitemanswerEffect = "dismiss" +) + +type ActionitemanswerOption struct { + Consequence *string `json:"consequence,omitempty"` + Description *string `json:"description,omitempty"` + Effect *ActionitemanswerEffect `json:"effect,omitempty"` + Exclusive *bool `json:"exclusive,omitempty"` + ID string `json:"id"` + Label string `json:"label"` + Recommended *bool `json:"recommended,omitempty"` + RequiresReason *bool `json:"requiresReason,omitempty"` + SnoozeDays *int `json:"snoozeDays,omitempty"` + Value *string `json:"value,omitempty"` +} + +type ActionitemanswerSpec struct { + AllowOther *bool `json:"allowOther,omitempty"` + DefaultOption *string `json:"defaultOption,omitempty"` + DurationsDays []int `json:"durationsDays,omitempty"` + IfUnanswered *string `json:"ifUnanswered,omitempty"` + Max *float64 `json:"max,omitempty"` + MaxDate *string `json:"maxDate,omitempty"` + MaxLength *int `json:"maxLength,omitempty"` + MaxSelections *int `json:"maxSelections,omitempty"` + Min *float64 `json:"min,omitempty"` + MinDate *string `json:"minDate,omitempty"` + MinSelections *int `json:"minSelections,omitempty"` + Options []ActionitemanswerOption `json:"options,omitempty"` + PickerKind *string `json:"pickerKind,omitempty"` + Placeholder *string `json:"placeholder,omitempty"` + Statement *string `json:"statement,omitempty"` + Suggested *string `json:"suggested,omitempty"` + Targets []ActionitemanswerTarget `json:"targets,omitempty"` + Unit *string `json:"unit,omitempty"` + ValueType *string `json:"valueType,omitempty"` + WhyItMatters *string `json:"whyItMatters,omitempty"` +} + +type ActionitemanswerTarget struct { + ID string `json:"id"` + Label string `json:"label"` } type AuditToolCallAuditRecord struct { } +type EndpointsActionItem struct { + Answer *ActionitemanswerAnswer `json:"answer,omitempty"` + AnswerMemoryID *string `json:"answerMemoryId,omitempty"` + AnswerSpec *ActionitemanswerSpec `json:"answerSpec,omitempty"` + AnswerType string `json:"answerType"` + Blocked *bool `json:"blocked,omitempty"` + ChatID *string `json:"chatId,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + CreatedAt string `json:"createdAt"` + CreatedBy string `json:"createdBy"` + DedupKey string `json:"dedupKey"` + DependsOnIds []string `json:"dependsOnIds,omitempty"` + DetailedQuestion string `json:"detailedQuestion"` + Disposition *string `json:"disposition,omitempty"` + ExpiresAt *string `json:"expiresAt,omitempty"` + ExpiryReason *string `json:"expiryReason,omitempty"` + Findings []EndpointsActionItemFinding `json:"findings,omitempty"` + GitUser *EndpointsActionItemGitUser `json:"gitUser,omitempty"` + GitUserID *string `json:"gitUserId,omitempty"` + GroupKey *string `json:"groupKey,omitempty"` + ID string `json:"id"` + IfExpired *string `json:"ifExpired,omitempty"` + Kind ModelsActionItemKind `json:"kind"` + LastHumanActivityAt *string `json:"lastHumanActivityAt,omitempty"` + LastNudgedAt *string `json:"lastNudgedAt,omitempty"` + MessageChannelID *string `json:"messageChannelId,omitempty"` + MessageProvider *ModelsProviderID `json:"messageProvider,omitempty"` + MessageThreadRootID *string `json:"messageThreadRootId,omitempty"` + PullRequests []EndpointsActionItemPullRequest `json:"pullRequests,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` + ResolutionMode *ModelsActionItemResolutionMode `json:"resolutionMode,omitempty"` + ResolutionReason *string `json:"resolutionReason,omitempty"` + ResolvedByUserID *string `json:"resolvedByUserId,omitempty"` + Response *string `json:"response,omitempty"` + Severity *string `json:"severity,omitempty"` + SnoozedUntil *string `json:"snoozedUntil,omitempty"` + State string `json:"state"` + Status ModelsActionItemStatus `json:"status"` + TeamID *string `json:"teamId,omitempty"` + TenantID string `json:"tenantId"` + Title string `json:"title"` + UpdatedAt string `json:"updatedAt"` + WaitingSince string `json:"waitingSince"` +} + +type EndpointsActionItemFinding struct { + FindingID string `json:"findingId"` + FindingType ModelsActionItemLinkType `json:"findingType"` + Title *string `json:"title,omitempty"` +} + +type EndpointsActionItemGitUser struct { + AvatarURL *string `json:"avatarUrl,omitempty"` + Email *string `json:"email,omitempty"` + Login string `json:"login"` + Name *string `json:"name,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` +} + +type EndpointsActionItemPullRequest struct { + FindingID string `json:"findingId"` + Status *string `json:"status,omitempty"` + Title *string `json:"title,omitempty"` + URL string `json:"url"` +} + +type EndpointsAnswerActionItemInput struct { + Answer ActionitemanswerAnswer `json:"answer"` +} + +type EndpointsAnswerActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + +type EndpointsAssignRepoActionItemInput struct { + TeamID string `json:"teamId"` +} + +type EndpointsAssignRepoActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + +type EndpointsAssignTeamActionItemInput struct { + TeamID string `json:"teamId"` +} + +type EndpointsAssignTeamActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + +type EndpointsCampaignEventPerson struct { + DisplayName string `json:"displayName"` + Login *string `json:"login,omitempty"` +} + +type EndpointsCampaignEventPullRequest struct { + FirstReviewedAt *string `json:"firstReviewedAt,omitempty"` + MergedAt *string `json:"mergedAt,omitempty"` + Repository *string `json:"repository,omitempty"` + Status string `json:"status"` + Title *string `json:"title,omitempty"` + URL string `json:"url"` +} + type EndpointsCampaignRunDetail struct { - AgentCostCredits *int64 `json:"agentCostCredits,omitempty"` AgentInputTokens *int64 `json:"agentInputTokens,omitempty"` AgentOutputTokens *int64 `json:"agentOutputTokens,omitempty"` CampaignID string `json:"campaignId"` @@ -26,7 +199,6 @@ type EndpointsCampaignRunDetail struct { } type EndpointsCampaignRunSummary struct { - AgentCostCredits *int64 `json:"agentCostCredits,omitempty"` AgentInputTokens *int64 `json:"agentInputTokens,omitempty"` AgentOutputTokens *int64 `json:"agentOutputTokens,omitempty"` CampaignID string `json:"campaignId"` @@ -40,43 +212,115 @@ type EndpointsCampaignRunSummary struct { ToolEventCount *int32 `json:"toolEventCount,omitempty"` } -type EndpointsCustomerQuestionSetResponse struct { - CreatedAt *string `json:"createdAt,omitempty"` - CustomMessage *string `json:"customMessage,omitempty"` - GeneratedMemoryIds []string `json:"generatedMemoryIds,omitempty"` - ID *string `json:"id,omitempty"` - Questions []ModelsCustomerQuestion `json:"questions,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` +type EndpointsChatSessionAction struct { + ActionID string `json:"actionId"` + Description string `json:"description"` + DisplayName string `json:"displayName"` + Executable bool `json:"executable"` + Params map[string]json.RawMessage `json:"params,omitempty"` + ResolvedByUserID *string `json:"resolvedByUserId,omitempty"` + Result string `json:"result"` + Severity string `json:"severity"` + Status string `json:"status"` + ToolName string `json:"toolName"` } -type EndpointsDeleteAllCustomerQuestionSetsOutput struct { - DeletedCount int64 `json:"deletedCount"` - Version *string `json:"version,omitempty"` +type EndpointsClassifyIdentityInput struct { + Decision string `json:"decision"` + Provider ModelsProviderID `json:"provider"` + ProviderUserID string `json:"providerUserId"` + Reason *string `json:"reason,omitempty"` } -type EndpointsDeleteChatSessionOutput struct { - Success *bool `json:"success,omitempty"` +type EndpointsClassifyIdentityOutput struct { + Classification EndpointsIdentityClassification `json:"classification"` + Version string `json:"version"` } -type EndpointsDeleteCustomerQuestionOutput struct { +type EndpointsDeleteActionItemOutput struct { Success bool `json:"success"` - Version *string `json:"version,omitempty"` + Version string `json:"version"` } -type EndpointsDeleteCustomerQuestionSetOutput struct { - Success bool `json:"success"` - Version *string `json:"version,omitempty"` +type EndpointsDeleteChatSessionOutput struct { + Success *bool `json:"success,omitempty"` } type EndpointsDeleteEventOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsDismissActionItemInput struct { + Classify *string `json:"classify,omitempty"` + Disposition *string `json:"disposition,omitempty"` + Reason string `json:"reason"` +} + +type EndpointsDismissActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + +type EndpointsEscalationRecipient struct { + ID string `json:"id"` + Name string `json:"name"` +} + +type EndpointsFixPRNudgeCandidate struct { + Available bool `json:"available"` + GitLogin string `json:"gitLogin"` + Name *string `json:"name,omitempty"` + Reason *string `json:"reason,omitempty"` + UserID *string `json:"userId,omitempty"` +} + +type EndpointsFixPRNudgeResult struct { + Name *string `json:"name,omitempty"` + Outcome string `json:"outcome"` + UserID string `json:"userId"` +} + type EndpointsGenerateDefaultCampaignsOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` Message string `json:"message"` + RunID *string `json:"runId,omitempty"` + Version string `json:"version"` +} + +type EndpointsGetActionItemMessagesOutput struct { + HasMore bool `json:"hasMore"` + Messages []ModelsComment `json:"messages,omitempty"` + ReplayFrames []ModelsChatHistoryFrame `json:"replayFrames,omitempty"` + ReplayTruncated *bool `json:"replayTruncated,omitempty"` + Version string `json:"version"` +} + +type EndpointsGetActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` Version string `json:"version"` } +type EndpointsGetActionItemsOutput struct { + ActionItems []EndpointsActionItem `json:"actionItems,omitempty"` + NumItems int `json:"numItems"` + Version string `json:"version"` +} + +type EndpointsGetActionItemsSummaryOutput struct { + Blocked int `json:"blocked"` + ByAnswerType map[string]int `json:"byAnswerType,omitempty"` + ByKind map[string]int `json:"byKind,omitempty"` + ByStatus map[string]int `json:"byStatus,omitempty"` + ByTeam map[string]int `json:"byTeam,omitempty"` + Snoozed int `json:"snoozed"` + Total int `json:"total"` + TotalOpen int `json:"totalOpen"` + TotalStalled *int `json:"totalStalled,omitempty"` + Unrouted int `json:"unrouted"` + Version string `json:"version"` + Waiting int `json:"waiting"` +} + type EndpointsGetAllCampaignsFindingsOutput struct { Findings []ModelsFindingProgress `json:"findings,omitempty"` NumItems int `json:"numItems"` @@ -87,7 +331,9 @@ type EndpointsGetCampaignEventsOutput struct { Events []ModelsManagerEvent `json:"events,omitempty"` HasNextPage bool `json:"hasNextPage"` NumItems int `json:"numItems"` + People map[string]EndpointsCampaignEventPerson `json:"people,omitempty"` PullRequestTitles map[string]string `json:"pullRequestTitles,omitempty"` + PullRequests map[string]EndpointsCampaignEventPullRequest `json:"pullRequests,omitempty"` Version *string `json:"version,omitempty"` } @@ -99,7 +345,9 @@ type EndpointsGetCampaignFindingsOutput struct { } type EndpointsGetCampaignMetricsRefreshOutput struct { + Refreshed bool `json:"refreshed"` Response string `json:"response"` + SkipReason *string `json:"skipReason,omitempty"` Version *string `json:"version,omitempty"` } @@ -107,6 +355,7 @@ type EndpointsGetCampaignOutput struct { Campaign *ModelsCampaign `json:"campaign,omitempty"` MappedFindingIds []string `json:"mappedFindingIds,omitempty"` MappedFindings []ModelsFindingProgress `json:"mappedFindings,omitempty"` + TouchLedger *ModelsCampaignTouchLedger `json:"touchLedger,omitempty"` Version string `json:"version"` } @@ -120,6 +369,8 @@ type EndpointsGetCampaignPreviewsOutput struct { Campaigns []ModelsCampaignPreview `json:"campaigns,omitempty"` Findings []ModelsFindingProgress `json:"findings,omitempty"` NumItems int `json:"numItems"` + Portfolio *ModelsCampaignPortfolio `json:"portfolio,omitempty"` + Total int `json:"total"` Version string `json:"version"` } @@ -130,6 +381,7 @@ type EndpointsGetCampaignRunOutput struct { type EndpointsGetCampaignRunsOutput struct { NextCursor *string `json:"nextCursor,omitempty"` Runs []EndpointsCampaignRunSummary `json:"runs,omitempty"` + Total int `json:"total"` } type EndpointsGetCampaignSummariesOutput struct { @@ -145,7 +397,7 @@ type EndpointsGetCampaignsOutput struct { } type EndpointsGetChatSessionActionsOutput struct { - Actions []ActionsPendingAction `json:"actions,omitempty"` + Actions []EndpointsChatSessionAction `json:"actions,omitempty"` } type EndpointsGetChatSessionAuditOutput struct { @@ -154,38 +406,30 @@ type EndpointsGetChatSessionAuditOutput struct { } type EndpointsGetChatSessionHistoryOutput struct { + HasMore *bool `json:"hasMore,omitempty"` Messages []ModelsComment `json:"messages,omitempty"` + ReplayFrames []ModelsChatHistoryFrame `json:"replayFrames,omitempty"` + ReplayTruncated *bool `json:"replayTruncated,omitempty"` } type EndpointsGetChatSessionOutput struct { Session *SessionsChatSession `json:"session,omitempty"` } -type EndpointsGetCreditsOutput struct { - Credits ModelsCredits `json:"credits"` - Version string `json:"version"` -} - -type EndpointsGetCustomerQuestionSetOutput struct { - QuestionSet EndpointsCustomerQuestionSetResponse `json:"questionSet"` - Version *string `json:"version,omitempty"` -} - -type EndpointsGetCustomerQuestionSetsOutput struct { - NumItems int `json:"numItems"` - QuestionSets []EndpointsCustomerQuestionSetResponse `json:"questionSets,omitempty"` - Version *string `json:"version,omitempty"` -} - type EndpointsGetDefaultCampaignsOutput struct { Campaigns []ModelsCampaign `json:"campaigns,omitempty"` NumItems int `json:"numItems"` Version string `json:"version"` } -type EndpointsGetEscalationsOutput struct { - Escalations []ModelsEscalation `json:"escalations,omitempty"` - NumItems int `json:"numItems"` +type EndpointsGetEngagementUsersOutput struct { + NextCursor *string `json:"nextCursor,omitempty"` + Users []ModelsDeveloperEngagement `json:"users,omitempty"` + WindowStart string `json:"windowStart"` +} + +type EndpointsGetEscalationRecipientsOutput struct { + Recipients []EndpointsEscalationRecipient `json:"recipients,omitempty"` Version string `json:"version"` } @@ -202,56 +446,75 @@ type EndpointsGetFindingEventsOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsGetFixPRNudgeOutput struct { + Candidates []EndpointsFixPRNudgeCandidate `json:"candidates,omitempty"` + DisabledReason *string `json:"disabledReason,omitempty"` + Draft bool `json:"draft"` + Kind string `json:"kind"` + Message string `json:"message"` + Number int `json:"number"` + PrURL string `json:"prUrl"` + Repository string `json:"repository"` + SendsLeft int `json:"sendsLeft"` + State string `json:"state"` + Variant string `json:"variant"` + Version string `json:"version"` +} + type EndpointsGetManagerConfigOutput struct { Config ModelsManagerConfig `json:"config"` Version *string `json:"version,omitempty"` } +type EndpointsGetManagerEscalationConfigOutput struct { + Escalation *ModelsEscalationRouting `json:"escalation,omitempty"` + Version *string `json:"version,omitempty"` +} + type EndpointsGetManagerGroundRulesOutput struct { GroundRules *ModelsManagerGroundRules `json:"groundRules,omitempty"` Version *string `json:"version,omitempty"` } type EndpointsGetManagerMetricsOutput struct { - AutofixDuration *int `json:"autofixDuration,omitempty"` BacklogSearches *int `json:"backlogSearches,omitempty"` - DetectionDuration *int `json:"detectionDuration,omitempty"` EscalatedFindings *int `json:"escalatedFindings,omitempty"` Escalations *int `json:"escalations,omitempty"` - FindingsInBacklog int `json:"findingsInBacklog"` - FindingsInProgress int `json:"findingsInProgress"` - FindingsResolved int `json:"findingsResolved"` + FindingsAnalysis ModelsFindingsMetrics `json:"findingsAnalysis"` InternetSearchCount *int `json:"internetSearchCount,omitempty"` - MappedFindings []ModelsFindingProgress `json:"mappedFindings,omitempty"` - MeanTimeAutofixToInProgress *int `json:"meanTimeAutofixToInProgress,omitempty"` - MeanTimeInProgressToResolved *int `json:"meanTimeInProgressToResolved,omitempty"` - MeanTimeToAutofix *int `json:"meanTimeToAutofix,omitempty"` - MeanTimeToDetectAndTriage *int `json:"meanTimeToDetectAndTriage,omitempty"` - MeanTimeToResolve int `json:"meanTimeToResolve"` - MeanTimeToTriage *int `json:"meanTimeToTriage,omitempty"` - MedianTimeAutofixToInProgress *int `json:"medianTimeAutofixToInProgress,omitempty"` - MedianTimeInProgressToResolved *int `json:"medianTimeInProgressToResolved,omitempty"` - MedianTimeToAutofix *int `json:"medianTimeToAutofix,omitempty"` - MedianTimeToDetectAndTriage *int `json:"medianTimeToDetectAndTriage,omitempty"` - MedianTimeToTriage *int `json:"medianTimeToTriage,omitempty"` MessageCount *int `json:"messageCount,omitempty"` PlansGenerated *int `json:"plansGenerated,omitempty"` PrCloseCount *int `json:"prCloseCount,omitempty"` PrCommentCount *int `json:"prCommentCount,omitempty"` PrCreateCount *int `json:"prCreateCount,omitempty"` + PrMergedCount *int `json:"prMergedCount,omitempty"` PreviewMessageCount *int `json:"previewMessageCount,omitempty"` StoryPointsConsumed *int `json:"storyPointsConsumed,omitempty"` TasksAssigned *int `json:"tasksAssigned,omitempty"` TicketCloseCount *int `json:"ticketCloseCount,omitempty"` TicketCommentCount *int `json:"ticketCommentCount,omitempty"` TicketCreateCount *int `json:"ticketCreateCount,omitempty"` - TimeSaved *int `json:"timeSaved,omitempty"` + TicketsResolvedCount *int `json:"ticketsResolvedCount,omitempty"` TimeSavedAssigning *int `json:"timeSavedAssigning,omitempty"` - TotalRemediationDuration *int `json:"totalRemediationDuration,omitempty"` - TriageDuration *int `json:"triageDuration,omitempty"` Version string `json:"version"` } +type EndpointsGetManagerRunOutput struct { + CampaignIds []string `json:"campaignIds,omitempty"` + CampaignRunIds []string `json:"campaignRunIds,omitempty"` + CompletedAt *string `json:"completedAt,omitempty"` + Detail *string `json:"detail,omitempty"` + Error *string `json:"error,omitempty"` + ExecutionArn *string `json:"executionArn,omitempty"` + Mode *string `json:"mode,omitempty"` + RunID string `json:"runId"` + StartedAt *string `json:"startedAt,omitempty"` + State string `json:"state"` + StrategyID *string `json:"strategyId,omitempty"` + StrategyVersion *int `json:"strategyVersion,omitempty"` + Terminal *bool `json:"terminal,omitempty"` +} + type EndpointsGetManagerStateOutput struct { CurrentState ModelsManagerState `json:"currentState"` Version string `json:"version"` @@ -268,46 +531,149 @@ type EndpointsGetPlansOutput struct { Version string `json:"version"` } +type EndpointsGetProposalsOutput struct { + Proposals []ModelsProposalView `json:"proposals,omitempty"` +} + +type EndpointsGetSecurityProgramOutput struct { + Program *ModelsSecurityProgram `json:"program,omitempty"` +} + type EndpointsGetStrategyOutput struct { + AcceptedAt *string `json:"acceptedAt,omitempty"` + AcceptedBy *string `json:"acceptedBy,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` + EditSource *string `json:"editSource,omitempty"` + EditedBy *string `json:"editedBy,omitempty"` ID *string `json:"id,omitempty"` Quarters []ModelsStrategyQuarterGoal `json:"quarters,omitempty"` + Status *string `json:"status,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` Version *int `json:"version,omitempty"` } +type EndpointsGetStrategyProposalOutput struct { + Proposal *ModelsStrategy `json:"proposal,omitempty"` +} + +type EndpointsGetThreatCatalogOutput struct { + AppliedFilters []string `json:"appliedFilters,omitempty"` + NumItems int `json:"numItems"` + PageableTotal int `json:"pageableTotal"` + Sort *string `json:"sort,omitempty"` + Threats []EndpointsThreatCatalogEntry `json:"threats,omitempty"` + Total int `json:"total"` + Version *string `json:"version,omitempty"` +} + type EndpointsGetThreatInvestigationOutput struct { Events []ModelsManagerEvent `json:"events,omitempty"` + InvestigationVersions []ModelsThreatInvestigation `json:"investigationVersions,omitempty"` ThreatInvestigation ModelsThreatInvestigation `json:"threatInvestigation"` Version *string `json:"version,omitempty"` } +type EndpointsGetThreatInvestigationProgressOutput struct { + RunID *string `json:"runId,omitempty"` + Stages []EndpointsThreatInvestigationProgressStage `json:"stages,omitempty"` + Terminal bool `json:"terminal"` + Version *string `json:"version,omitempty"` +} + type EndpointsGetThreatInvestigationsOutput struct { + AffectedInvestigations int `json:"affectedInvestigations"` + AffectedRepos int `json:"affectedRepos"` + LinkedFindings int `json:"linkedFindings"` NumItems int `json:"numItems"` ThreatInvestigations []ModelsThreatInvestigation `json:"threatInvestigations,omitempty"` + Total int `json:"total"` Version *string `json:"version,omitempty"` } +type EndpointsIdentityClassification struct { + CreatedAt string `json:"createdAt"` + CreatedBy string `json:"createdBy"` + Decision string `json:"decision"` + Provider ModelsProviderID `json:"provider"` + ProviderUserID string `json:"providerUserId"` + Reason *string `json:"reason,omitempty"` + Username *string `json:"username,omitempty"` +} + type EndpointsListChatSessionsOutput struct { NextToken *string `json:"nextToken,omitempty"` Sessions []SessionsChatSession `json:"sessions,omitempty"` } +type EndpointsListIdentityClassificationsOutput struct { + Classifications []EndpointsIdentityClassification `json:"classifications,omitempty"` + Version string `json:"version"` +} + type EndpointsListStrategyVersionsOutput struct { NumItems *int `json:"numItems,omitempty"` Strategies []ModelsStrategy `json:"strategies,omitempty"` } +type EndpointsListThreatReportsOutput struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Reports []EndpointsThreatReportEntry `json:"reports,omitempty"` + TotalCount int `json:"totalCount"` + Version *string `json:"version,omitempty"` +} + type EndpointsManagerConfigInput struct { EnableActions *bool `json:"enableActions,omitempty"` Initialized bool `json:"initialized"` } +type EndpointsMapUserActionItemInput struct { + MessageUserID *string `json:"messageUserId,omitempty"` + ServiceAccount *bool `json:"serviceAccount,omitempty"` +} + +type EndpointsMapUserActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + +type EndpointsNudgeActionItemInput struct { + Message *string `json:"message,omitempty"` + RecipientUserID *string `json:"recipientUserId,omitempty"` +} + +type EndpointsNudgeActionItemOutput struct { + Sent bool `json:"sent"` + Version string `json:"version"` +} + +type EndpointsNudgeFixPRInput struct { + RecipientUserIds []string `json:"recipientUserIds,omitempty"` +} + +type EndpointsNudgeFixPROutput struct { + Results []EndpointsFixPRNudgeResult `json:"results,omitempty"` + Version string `json:"version"` +} + +type EndpointsPatchActionItemInput struct { + TeamID *string `json:"teamId,omitempty"` +} + +type EndpointsPatchActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + type EndpointsPatchCampaignInput struct { + ClearExploitValidated *bool `json:"clearExploitValidated,omitempty"` + ConfirmWholeBacklog *bool `json:"confirmWholeBacklog,omitempty"` CreatedAfter *string `json:"createdAfter,omitempty"` CreatedBefore *string `json:"createdBefore,omitempty"` Description *string `json:"description,omitempty"` EndDate *string `json:"endDate,omitempty"` + ExploitValidated *bool `json:"exploitValidated,omitempty"` FindingIds []string `json:"findingIds,omitempty"` GeneratedReasoning *string `json:"generatedReasoning,omitempty"` IsActive *bool `json:"isActive,omitempty"` @@ -316,14 +682,15 @@ type EndpointsPatchCampaignInput struct { MinPriority *float64 `json:"minPriority,omitempty"` NoEndDate *bool `json:"noEndDate,omitempty"` Owner *string `json:"owner,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` PriorityLabels []string `json:"priorityLabels,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` SortByColumns *string `json:"sortByColumns,omitempty"` SortByDirection *string `json:"sortByDirection,omitempty"` StartDate *string `json:"startDate,omitempty"` Summary *string `json:"summary,omitempty"` TeamIDs []string `json:"teamIDs,omitempty"` - TeamNames []string `json:"teamNames,omitempty"` Title *string `json:"title,omitempty"` Types []string `json:"types,omitempty"` UserNames []string `json:"userNames,omitempty"` @@ -345,20 +712,6 @@ type EndpointsPatchChatSessionOutput struct { Success *bool `json:"success,omitempty"` } -type EndpointsPatchCustomerQuestionAnswerInput struct { - Answer json.RawMessage `json:"answer"` -} - -type EndpointsPatchCustomerQuestionAnswerOutput struct { - Success bool `json:"success"` - Version *string `json:"version,omitempty"` -} - -type EndpointsPatchEscalationsInput struct { - Reasoning *string `json:"reasoning,omitempty"` - Status *ModelsEscalationStatus `json:"status,omitempty"` -} - type EndpointsPatchGroundRulesInput struct { GroundRules *ModelsManagerGroundRules `json:"groundRules,omitempty"` } @@ -368,14 +721,33 @@ type EndpointsPatchGroundRulesOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsPatchSecurityProgramInput struct { + AnnounceWindowDays int `json:"announceWindowDays"` + Autonomy string `json:"autonomy"` + CapacityPerWeek *int `json:"capacityPerWeek,omitempty"` + DefaultCampaignDays int `json:"defaultCampaignDays"` + MaxConcurrentCampaigns int `json:"maxConcurrentCampaigns"` + MinCoveragePerGoal int `json:"minCoveragePerGoal"` + ReviewCadenceDays int `json:"reviewCadenceDays"` +} + +type EndpointsPatchSecurityProgramOutput struct { + Program *ModelsSecurityProgram `json:"program,omitempty"` +} + type EndpointsPatchStrategyInput struct { Quarters []ModelsStrategyQuarterGoal `json:"quarters,omitempty"` } type EndpointsPatchStrategyOutput struct { + AcceptedAt *string `json:"acceptedAt,omitempty"` + AcceptedBy *string `json:"acceptedBy,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` + EditSource *string `json:"editSource,omitempty"` + EditedBy *string `json:"editedBy,omitempty"` ID *string `json:"id,omitempty"` Quarters []ModelsStrategyQuarterGoal `json:"quarters,omitempty"` + Status *string `json:"status,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` Version *int `json:"version,omitempty"` } @@ -394,6 +766,7 @@ type EndpointsPostCampaignInput struct { CreatedBefore *string `json:"createdBefore,omitempty"` Description *string `json:"description,omitempty"` EndDate *string `json:"endDate,omitempty"` + ExploitValidated *bool `json:"exploitValidated,omitempty"` FindingIds []string `json:"findingIds,omitempty"` GeneratedReasoning *string `json:"generatedReasoning,omitempty"` IsActive *bool `json:"isActive,omitempty"` @@ -402,14 +775,15 @@ type EndpointsPostCampaignInput struct { MinPriority *float64 `json:"minPriority,omitempty"` NoEndDate *bool `json:"noEndDate,omitempty"` Owner *string `json:"owner,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` PriorityLabels []string `json:"priorityLabels,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` SortByColumns *string `json:"sortByColumns,omitempty"` SortByDirection *string `json:"sortByDirection,omitempty"` StartDate *string `json:"startDate,omitempty"` Summary *string `json:"summary,omitempty"` TeamIDs []string `json:"teamIDs,omitempty"` - TeamNames []string `json:"teamNames,omitempty"` Title *string `json:"title,omitempty"` Types []string `json:"types,omitempty"` UserNames []string `json:"userNames,omitempty"` @@ -420,15 +794,7 @@ type EndpointsPostCampaignInput struct { type EndpointsPostCampaignOutput struct { Campaign *ModelsCampaign `json:"campaign,omitempty"` CampaignID string `json:"campaignId"` - Version string `json:"version"` -} - -type EndpointsPostCreditsInput struct { - Credits ModelsCreditsUpdate `json:"credits"` -} - -type EndpointsPostCreditsOutput struct { - Credits ModelsCredits `json:"credits"` + MappedFindingCount int `json:"mappedFindingCount"` Version string `json:"version"` } @@ -448,6 +814,7 @@ type EndpointsPostDeduplicateEventsOutput struct { TotalDeleted *int64 `json:"totalDeleted,omitempty"` TotalDupes *int64 `json:"totalDupes,omitempty"` TotalOmitted *int64 `json:"totalOmitted,omitempty"` + TotalProtected *int64 `json:"totalProtected,omitempty"` TotalScanned *int64 `json:"totalScanned,omitempty"` TotalUnique *int64 `json:"totalUnique,omitempty"` Version *string `json:"version,omitempty"` @@ -463,6 +830,7 @@ type EndpointsPostManagerConfigOutput struct { } type EndpointsPostManagerGroundRulesInput struct { + ExpectedUpdatedAt *string `json:"expectedUpdatedAt,omitempty"` GroundRules *ModelsManagerGroundRules `json:"groundRules,omitempty"` } @@ -471,6 +839,28 @@ type EndpointsPostManagerGroundRulesOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsPostProposalDecisionInput struct { + Decision string `json:"decision"` + ProposalID string `json:"proposalId"` +} + +type EndpointsPostProposalDecisionOutput struct { + Proposal *ModelsProposal `json:"proposal,omitempty"` +} + +type EndpointsPostStrategyProposalDecisionInput struct { + Decision string `json:"decision"` + StrategyID string `json:"strategyId"` +} + +type EndpointsPostStrategyProposalDecisionOutput struct { + Strategy *ModelsStrategy `json:"strategy,omitempty"` +} + +type EndpointsPostThreatCatalogInvestigationInput struct { + Action string `json:"action"` +} + type EndpointsPostThreatInvestigationInput struct { Advice *string `json:"advice,omitempty"` AffectedPackages []ModelsThreatInvestigationAffectedPackage `json:"affectedPackages,omitempty"` @@ -490,19 +880,160 @@ type EndpointsPostThreatInvestigationOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsPostThreatReportInput struct { + AdvisoryURL *string `json:"advisoryUrl,omitempty"` + Campaign *EndpointsThreatReportCampaign `json:"campaign,omitempty"` + CveID *string `json:"cveId,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + PackageName *string `json:"packageName,omitempty"` + RequestID string `json:"requestId"` +} + +type EndpointsPostThreatReportOutput struct { + AdvisoryID string `json:"advisoryId"` + Aliases []string `json:"aliases,omitempty"` + Existing bool `json:"existing"` + InvestigationID *string `json:"investigationId,omitempty"` + ResearchVersion *string `json:"researchVersion,omitempty"` + Resubmittable *bool `json:"resubmittable,omitempty"` + Significance *string `json:"significance,omitempty"` + Status string `json:"status"` + ThreatID string `json:"threatId"` + Verification string `json:"verification"` + VerificationReason *string `json:"verificationReason,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsPutActionItemChatOutput struct { + ChatID *string `json:"chatId,omitempty"` +} + +type EndpointsPutGeneralChatOutput struct { + ChatID *string `json:"chatId,omitempty"` +} + +type EndpointsPutManagerEscalationConfigInput struct { + Escalation ModelsEscalationRouting `json:"escalation"` +} + +type EndpointsPutManagerEscalationConfigOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsReopenActionItemInput struct { + Reason string `json:"reason"` +} + +type EndpointsReopenActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + +type EndpointsRevokeIdentityClassificationOutput struct { + ReopenedActionItemID *string `json:"reopenedActionItemId,omitempty"` + Version string `json:"version"` +} + +type EndpointsSnoozeActionItemInput struct { + DurationDays int `json:"durationDays"` + Reason string `json:"reason"` +} + +type EndpointsSnoozeActionItemOutput struct { + ActionItem EndpointsActionItem `json:"actionItem"` + Version string `json:"version"` +} + +type EndpointsThreatCatalogEntry struct { + FailureCategory *string `json:"failureCategory,omitempty"` + FailureMessage *string `json:"failureMessage,omitempty"` + InventoryFreshness string `json:"inventoryFreshness"` + InvestigationID *string `json:"investigationId,omitempty"` + IsOutdated bool `json:"isOutdated"` + JobStatus *string `json:"jobStatus,omitempty"` + ResearchVersion *string `json:"researchVersion,omitempty"` + RunStatus *string `json:"runStatus,omitempty"` + Status string `json:"status"` + Threat EndpointsVulnDBThreatSummary `json:"threat"` +} + +type EndpointsThreatInvestigationProgressCounts struct { + AffectedRepositories *int `json:"affectedRepositories,omitempty"` + Packages *int `json:"packages,omitempty"` + RepositoriesChecked *int `json:"repositoriesChecked,omitempty"` +} + +type EndpointsThreatInvestigationProgressStage struct { + Attempt *int32 `json:"attempt,omitempty"` + Counts EndpointsThreatInvestigationProgressCounts `json:"counts"` + CreatedAt string `json:"createdAt"` + FailureCategory *string `json:"failureCategory,omitempty"` + FailureMessage *string `json:"failureMessage,omitempty"` + ID string `json:"id"` + RunID string `json:"runId"` + Stage string `json:"stage"` +} + +type EndpointsThreatReportCampaign struct { + CveIds []string `json:"cveIds,omitempty"` + Description string `json:"description"` + Packages []EndpointsThreatReportPackage `json:"packages,omitempty"` + ReferenceUrls []string `json:"referenceUrls,omitempty"` + Title string `json:"title"` +} + +type EndpointsThreatReportEntry struct { + AdvisoryID string `json:"advisoryId"` + AdvisoryURL string `json:"advisoryUrl"` + Aliases []string `json:"aliases,omitempty"` + Existing bool `json:"existing"` + InvestigationID *string `json:"investigationId,omitempty"` + Kind string `json:"kind"` + RequestID string `json:"requestId"` + ResearchVersion string `json:"researchVersion"` + Resubmittable *bool `json:"resubmittable,omitempty"` + Significance *string `json:"significance,omitempty"` + Status string `json:"status"` + SubmittedAt string `json:"submittedAt"` + ThreatID string `json:"threatId"` + Title *string `json:"title,omitempty"` + Verification string `json:"verification"` + VerificationReason *string `json:"verificationReason,omitempty"` +} + +type EndpointsThreatReportPackage struct { + Ecosystem string `json:"ecosystem"` + Name string `json:"name"` + Versions *string `json:"versions,omitempty"` +} + type EndpointsTriggerCampaignsOrchestratorInput struct { CampaignID *string `json:"campaignId,omitempty"` + EvaluationTime *string `json:"evaluationTime,omitempty"` Mode *string `json:"mode,omitempty"` } type EndpointsTriggerCampaignsOrchestratorOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` Message string `json:"message"` Response *string `json:"response,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } +type EndpointsTriggerManagerDailySummaryInput struct { + Audience string `json:"audience"` +} + +type EndpointsTriggerManagerDailySummaryOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` + RunID string `json:"runId"` +} + type EndpointsTriggerStrategyOutput struct { + ExecutionArn *string `json:"executionArn,omitempty"` Message *string `json:"message,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } @@ -511,8 +1042,123 @@ type EndpointsTriggerTacitKnowledgeOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsVulnDBThreatSummary struct { + AdvisoryIds []ModelsAdvisoryReference `json:"advisory_ids,omitempty"` + AliasCveIds []string `json:"alias_cve_ids,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + CveIds []string `json:"cve_ids,omitempty"` + Cvss *float64 `json:"cvss,omitempty"` + DiscoveredAt *string `json:"discovered_at,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + EnrichmentPending *bool `json:"enrichment_pending,omitempty"` + EvidenceComplete *bool `json:"evidence_complete,omitempty"` + EvidenceDegraded *bool `json:"evidence_degraded,omitempty"` + EvidenceQuarantine *string `json:"evidence_quarantine,omitempty"` + ID *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + NullifyAdvisoryID *string `json:"nullify_advisory_id,omitempty"` + ResearchVersion *string `json:"research_version,omitempty"` + Severity *string `json:"severity,omitempty"` + SourceLinks []ModelsThreatSource `json:"source_links,omitempty"` + Title *string `json:"title,omitempty"` + TriggerReason *string `json:"trigger_reason,omitempty"` + Withdrawn *bool `json:"withdrawn,omitempty"` +} + +type EndpointsWizardProgressInput struct { + Detail *string `json:"detail,omitempty"` + Step ModelsOnboardingWizardStep `json:"step"` +} + +type EndpointsWizardProgressOutput struct { + Posted bool `json:"posted"` + SkipReason string `json:"skipReason"` + Version string `json:"version"` +} + +type ModelsActionItemKind string + +const ( + ModelsActionItemKindEscalatedFinding ModelsActionItemKind = "ESCALATED_FINDING" + ModelsActionItemKindTacitKnowledge ModelsActionItemKind = "TACIT_KNOWLEDGE" + ModelsActionItemKindUnmappedUser ModelsActionItemKind = "UNMAPPED_USER" + ModelsActionItemKindUnassignedTeam ModelsActionItemKind = "UNASSIGNED_TEAM" + ModelsActionItemKindContextClarification ModelsActionItemKind = "CONTEXT_CLARIFICATION" + ModelsActionItemKindStrategyProposal ModelsActionItemKind = "STRATEGY_PROPOSAL" + ModelsActionItemKindCampaignProposal ModelsActionItemKind = "CAMPAIGN_PROPOSAL" +) + +type ModelsActionItemLinkType string + +const ( + ModelsActionItemLinkTypeSast ModelsActionItemLinkType = "sast" + ModelsActionItemLinkTypeScaDependency ModelsActionItemLinkType = "sca_dependency" + ModelsActionItemLinkTypeScaContainerfile ModelsActionItemLinkType = "sca_containerfile" + ModelsActionItemLinkTypeSecretsCredentials ModelsActionItemLinkType = "secrets_credentials" + ModelsActionItemLinkTypeSecretsSensitiveData ModelsActionItemLinkType = "secrets_sensitive_data" + ModelsActionItemLinkTypeCspm ModelsActionItemLinkType = "cspm" + ModelsActionItemLinkTypeDastBughunt ModelsActionItemLinkType = "dast_bughunt" + ModelsActionItemLinkTypeDastPentest ModelsActionItemLinkType = "dast_pentest" + ModelsActionItemLinkTypeScpm ModelsActionItemLinkType = "scpm" +) + +type ModelsActionItemResolutionMode string + +const ( + ModelsActionItemResolutionModeChat ModelsActionItemResolutionMode = "CHAT" + ModelsActionItemResolutionModeWidgetTeamPicker ModelsActionItemResolutionMode = "WIDGET_TEAM_PICKER" + ModelsActionItemResolutionModeWidgetUserMapping ModelsActionItemResolutionMode = "WIDGET_USER_MAPPING" +) + +type ModelsActionItemStatus string + +const ( + ModelsActionItemStatusOpen ModelsActionItemStatus = "OPEN" + ModelsActionItemStatusResolving ModelsActionItemStatus = "RESOLVING" + ModelsActionItemStatusCompleted ModelsActionItemStatus = "COMPLETED" + ModelsActionItemStatusDismissed ModelsActionItemStatus = "DISMISSED" +) + +type ModelsActorKind string + +const ( + ModelsActorKindCustomer ModelsActorKind = "customer" + ModelsActorKindNullifyStaff ModelsActorKind = "nullify_staff" + ModelsActorKindAgent ModelsActorKind = "agent" +) + +type ModelsAdvisoryIDSource string + +const ( + ModelsAdvisoryIDSourceNullify ModelsAdvisoryIDSource = "NULLIFY" + ModelsAdvisoryIDSourceCve ModelsAdvisoryIDSource = "CVE" + ModelsAdvisoryIDSourceGhsa ModelsAdvisoryIDSource = "GHSA" + ModelsAdvisoryIDSourceMal ModelsAdvisoryIDSource = "MAL" + ModelsAdvisoryIDSourceOsv ModelsAdvisoryIDSource = "OSV" + ModelsAdvisoryIDSourceVendor ModelsAdvisoryIDSource = "VENDOR" +) + +type ModelsAdvisoryReference struct { + ID string `json:"id"` + Source ModelsAdvisoryIDSource `json:"source"` +} + +type ModelsAsanaCommentProvider struct { + StoryGid string `json:"storyGid"` +} + +type ModelsAutonomyPolicy string + +const ( + ModelsAutonomyPolicyExplicit ModelsAutonomyPolicy = "explicit" + ModelsAutonomyPolicyAnnounceWithWindow ModelsAutonomyPolicy = "announce_with_window" + ModelsAutonomyPolicyAutoWithinBoundaries ModelsAutonomyPolicy = "auto_within_boundaries" +) + type ModelsAzureCommentProvider struct { CommentID int `json:"commentId"` + PullRequestID *int `json:"pullRequestId,omitempty"` + RepositoryID *string `json:"repositoryId,omitempty"` ThreadID int `json:"threadId"` } @@ -527,9 +1173,10 @@ type ModelsCampaign struct { Events []ModelsManagerEvent `json:"events,omitempty"` Generated *bool `json:"generated,omitempty"` GeneratedReasoning *string `json:"generatedReasoning,omitempty"` + Grounding *ModelsCampaignGrounding `json:"grounding,omitempty"` ID *string `json:"id,omitempty"` - ImmediateRemediation *bool `json:"immediateRemediation,omitempty"` IsActive *bool `json:"isActive,omitempty"` + Lifecycle *ModelsCampaignLifecycle `json:"lifecycle,omitempty"` Metrics *ModelsMetrics `json:"metrics,omitempty"` NoEndDate *bool `json:"noEndDate,omitempty"` Owner *string `json:"owner,omitempty"` @@ -541,9 +1188,55 @@ type ModelsCampaign struct { UpdatedAt *string `json:"updatedAt,omitempty"` } +type ModelsCampaignCounts struct { + Accepted int64 `json:"accepted"` + Backlog int64 `json:"backlog"` + ComputedAt string `json:"computedAt"` + Dismissed int64 `json:"dismissed"` + Duplicate int64 `json:"duplicate"` + FindingsWithOpenPullRequest int64 `json:"findingsWithOpenPullRequest"` + FixPendingVerification int64 `json:"fixPendingVerification"` + Fixed int64 `json:"fixed"` + FixedRatio MetricdefsRatio `json:"fixedRatio"` + InProgress int64 `json:"inProgress"` + MatchedAtLastRun int64 `json:"matchedAtLastRun"` + NoLongerDetected int64 `json:"noLongerDetected"` + PullRequests ModelsCampaignPullRequestCounts `json:"pullRequests"` + ResolvedRatio MetricdefsRatio `json:"resolvedRatio"` + Scope int64 `json:"scope"` + TimeToFix ModelsDurationStats `json:"timeToFix"` +} + +type ModelsCampaignGrounding struct { + EvaluatedAt *string `json:"evaluatedAt,omitempty"` + GoalKey *string `json:"goalKey,omitempty"` + StrategyID *string `json:"strategyId,omitempty"` +} + +type ModelsCampaignLifecycle string + +const ( + ModelsCampaignLifecycleDraft ModelsCampaignLifecycle = "DRAFT" + ModelsCampaignLifecycleProposed ModelsCampaignLifecycle = "PROPOSED" + ModelsCampaignLifecycleScheduled ModelsCampaignLifecycle = "SCHEDULED" + ModelsCampaignLifecycleActive ModelsCampaignLifecycle = "ACTIVE" + ModelsCampaignLifecycleCompleted ModelsCampaignLifecycle = "COMPLETED" + ModelsCampaignLifecycleExpired ModelsCampaignLifecycle = "EXPIRED" + ModelsCampaignLifecyclePaused ModelsCampaignLifecycle = "PAUSED" + ModelsCampaignLifecycleCancelled ModelsCampaignLifecycle = "CANCELLED" + ModelsCampaignLifecycleSuperseded ModelsCampaignLifecycle = "SUPERSEDED" +) + +type ModelsCampaignPortfolio struct { + Campaigns int64 `json:"campaigns"` + Counts ModelsCampaignCounts `json:"counts"` + Lifecycles []ModelsCampaignLifecycle `json:"lifecycles,omitempty"` +} + type ModelsCampaignPreview struct { AutofixTimeTotal *int `json:"autofixTimeTotal,omitempty"` BacklogSearches *int `json:"backlogSearches,omitempty"` + Counts *ModelsCampaignCounts `json:"counts,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` Description string `json:"description"` DetectionTimeTotal *int `json:"detectionTimeTotal,omitempty"` @@ -552,38 +1245,32 @@ type ModelsCampaignPreview struct { Escalations *int `json:"escalations,omitempty"` EstimatedBacklogStoryPoints *int `json:"estimatedBacklogStoryPoints,omitempty"` FindingTypes []string `json:"findingTypes,omitempty"` - FindingsAllowlistedCount *int `json:"findingsAllowlistedCount,omitempty"` - FindingsCount *int `json:"findingsCount,omitempty"` - FindingsInBacklogCount *int `json:"findingsInBacklogCount,omitempty"` - FindingsResolvedCount *int `json:"findingsResolvedCount,omitempty"` FindingsWithAllowlistPRCount *int `json:"findingsWithAllowlistPRCount,omitempty"` - FindingsWithOpenAutoFixPRCount *int `json:"findingsWithOpenAutoFixPRCount,omitempty"` FindingsWithOpenTicketCount *int `json:"findingsWithOpenTicketCount,omitempty"` Generated *bool `json:"generated,omitempty"` GeneratedReasoning string `json:"generatedReasoning"` ID *string `json:"id,omitempty"` InternetSearchCount *int `json:"internetSearchCount,omitempty"` IsActive bool `json:"isActive"` + Lifecycle *ModelsCampaignLifecycle `json:"lifecycle,omitempty"` MappedFindingIds []string `json:"mappedFindingIds,omitempty"` MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` MeanTimeToDetectAndTriage *int `json:"meanTimeToDetectAndTriage,omitempty"` MeanTimeToMerge *int `json:"meanTimeToMerge,omitempty"` MeanTimeToPullRequestCreation *int `json:"meanTimeToPullRequestCreation,omitempty"` - MeanTimeToResolve *int `json:"meanTimeToResolve,omitempty"` MeanTimeToReview *int `json:"meanTimeToReview,omitempty"` MedianTimeToDetectAndTriage *int `json:"medianTimeToDetectAndTriage,omitempty"` MedianTimeToMerge *int `json:"medianTimeToMerge,omitempty"` MedianTimeToPullRequestCreation *int `json:"medianTimeToPullRequestCreation,omitempty"` - MedianTimeToResolve *int `json:"medianTimeToResolve,omitempty"` MedianTimeToReview *int `json:"medianTimeToReview,omitempty"` MessageCount *int `json:"messageCount,omitempty"` NoEndDate *bool `json:"noEndDate,omitempty"` PlansGenerated *int `json:"plansGenerated,omitempty"` - PrCloseCount *int `json:"prCloseCount,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` PrCommentCount *int `json:"prCommentCount,omitempty"` - PrCreateCount *int `json:"prCreateCount,omitempty"` PreviewMessageCount *int `json:"previewMessageCount,omitempty"` PriorityLabels []ModelsPriorityLabel `json:"priorityLabels,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` RepositoryNames []string `json:"repositoryNames,omitempty"` StartDate *string `json:"startDate,omitempty"` Status string `json:"status"` @@ -592,7 +1279,6 @@ type ModelsCampaignPreview struct { TicketCloseCount *int `json:"ticketCloseCount,omitempty"` TicketCommentCount *int `json:"ticketCommentCount,omitempty"` TicketCreateCount *int `json:"ticketCreateCount,omitempty"` - TimeSaved *int `json:"timeSaved,omitempty"` TimeSavedAssigning *int `json:"timeSavedAssigning,omitempty"` Title string `json:"title"` TriageTimeTotal *int `json:"triageTimeTotal,omitempty"` @@ -600,83 +1286,66 @@ type ModelsCampaignPreview struct { Users []string `json:"users,omitempty"` } -type ModelsComment struct { - Body string `json:"body"` - CommentProvider *ModelsCommentProvider `json:"commentProvider,omitempty"` - CreatedAt string `json:"createdAt"` - ID *string `json:"id,omitempty"` - IsNullify bool `json:"isNullify"` - UpdatedAt string `json:"updatedAt"` - UserID string `json:"userId"` - UserName string `json:"userName"` -} - -type ModelsCommentProvider struct { - Azure *ModelsAzureCommentProvider `json:"azure,omitempty"` - Bitbucket *ModelsBitbucketCommentProvider `json:"bitbucket,omitempty"` - Github *ModelsGitHubCommentProvider `json:"github,omitempty"` - Gitlab *ModelsGitLabCommentProvider `json:"gitlab,omitempty"` - ID *ModelsProviderID `json:"id,omitempty"` - Jira *ModelsJiraCommentProvider `json:"jira,omitempty"` - Linear *ModelsLinearCommentProvider `json:"linear,omitempty"` - Slack *ModelsSlackCommentProvider `json:"slack,omitempty"` - Teams *ModelsTeamsCommentProvider `json:"teams,omitempty"` -} - -type ModelsCredits struct { - Balance int `json:"balance"` - UpdatedAt *string `json:"updatedAt,omitempty"` +type ModelsCampaignPullRequestCounts struct { + ClosedUnmerged int64 `json:"closedUnmerged"` + MergeRate MetricdefsRatio `json:"mergeRate"` + MergeReady MetricdefsRatio `json:"mergeReady"` + Merged int64 `json:"merged"` + MergedUnclassified int64 `json:"mergedUnclassified"` + Opened int64 `json:"opened"` + StillOpen int64 `json:"stillOpen"` } -type ModelsCreditsUpdate struct { - Increment *int64 `json:"increment,omitempty"` +type ModelsCampaignTouchLedger struct { + GithubCount *int `json:"githubCount,omitempty"` + GlanceCount *int `json:"glanceCount,omitempty"` + HandsOnCount *int `json:"handsOnCount,omitempty"` + MergedCount *int `json:"mergedCount,omitempty"` + MergedReviewedCount *int `json:"mergedReviewedCount,omitempty"` + MergedUnclassifiedCount *int `json:"mergedUnclassifiedCount,omitempty"` + RejectedCount *int `json:"rejectedCount,omitempty"` + ReviewCount *int `json:"reviewCount,omitempty"` + StillOpenCount *int `json:"stillOpenCount,omitempty"` + TotalCount *int `json:"totalCount,omitempty"` + UnresolvedReviewedCount *int `json:"unresolvedReviewedCount,omitempty"` } -type ModelsEscalation struct { - CampaignIds []string `json:"campaignIds,omitempty"` - CreatedAt string `json:"createdAt"` - FindingID string `json:"findingId"` - ID *string `json:"id,omitempty"` - PullRequestIds []string `json:"pullRequestIds,omitempty"` - Reasoning string `json:"reasoning"` - Status ModelsEscalationStatus `json:"status"` - TicketIds []string `json:"ticketIds,omitempty"` - UpdatedAt string `json:"updatedAt"` +type ModelsChatHistoryFrame struct { + MessageID string `json:"messageId"` + Payload string `json:"payload"` +} + +type ModelsDeveloperEngagement struct { + AwaitingReply bool `json:"awaitingReply"` + ClosedItems int64 `json:"closedItems"` + DisplayName string `json:"displayName"` + DmsFailed int64 `json:"dmsFailed"` + DmsSent int64 `json:"dmsSent"` + DmsSuppressed int64 `json:"dmsSuppressed"` + LastInteractionAt *string `json:"lastInteractionAt,omitempty"` + LastReplyAt *string `json:"lastReplyAt,omitempty"` + LastSentAt *string `json:"lastSentAt,omitempty"` + NudgesReceived int64 `json:"nudgesReceived"` + OpenItems int64 `json:"openItems"` + Replies int64 `json:"replies"` + UserID string `json:"userId"` + Username string `json:"username"` } -type ModelsEscalationStatus string +type ModelsEscalationMode string const ( - ModelsEscalationStatusOpen ModelsEscalationStatus = "OPEN" - ModelsEscalationStatusResolved ModelsEscalationStatus = "RESOLVED" + ModelsEscalationModeDm ModelsEscalationMode = "dm" + ModelsEscalationModeChannel ModelsEscalationMode = "channel" + ModelsEscalationModeBoth ModelsEscalationMode = "both" ) -type ModelsFindingProgress struct { - AutofixDuration *int `json:"autofixDuration,omitempty"` - AutofixedAt *string `json:"autofixedAt,omitempty"` - CreatedAt string `json:"createdAt"` - DetectionDuration *int `json:"detectionDuration,omitempty"` - DiscoveredAt *string `json:"discoveredAt,omitempty"` - FindingID string `json:"findingId"` - FindingType ModelsFindingType `json:"findingType"` - InProgressAt *string `json:"inProgressAt,omitempty"` - ResolvedAt *string `json:"resolvedAt,omitempty"` - Status ModelsFindingStatus `json:"status"` - TimeSaved *int `json:"timeSaved,omitempty"` - TotalRemediationDuration *int `json:"totalRemediationDuration,omitempty"` - TriageDuration *int `json:"triageDuration,omitempty"` - TriagedAt *string `json:"triagedAt,omitempty"` - UpdatedAt string `json:"updatedAt"` +type ModelsEscalationRouting struct { + ChannelID *string `json:"channelId,omitempty"` + ChannelName *string `json:"channelName,omitempty"` + Mode *ModelsEscalationMode `json:"mode,omitempty"` } -type ModelsFindingStatus string - -const ( - ModelsFindingStatusBacklog ModelsFindingStatus = "BACKLOG" - ModelsFindingStatusInProgress ModelsFindingStatus = "IN_PROGRESS" - ModelsFindingStatusResolved ModelsFindingStatus = "RESOLVED" -) - type ModelsGitHubCommentProvider struct { CommentID int64 `json:"commentId"` CommentNodeID string `json:"commentNodeId"` @@ -753,15 +1422,42 @@ type ModelsMetrics struct { PrCloseCount *int `json:"prCloseCount,omitempty"` PrCommentCount *int `json:"prCommentCount,omitempty"` PrCreateCount *int `json:"prCreateCount,omitempty"` + PrMergedCount *int `json:"prMergedCount,omitempty"` PreviewMessageCount *int `json:"previewMessageCount,omitempty"` StoryPointsConsumed *int `json:"storyPointsConsumed,omitempty"` TasksAssigned *int `json:"tasksAssigned,omitempty"` TicketCloseCount *int `json:"ticketCloseCount,omitempty"` TicketCommentCount *int `json:"ticketCommentCount,omitempty"` TicketCreateCount *int `json:"ticketCreateCount,omitempty"` + TicketsResolvedCount *int `json:"ticketsResolvedCount,omitempty"` TimeSavedAssigning *int `json:"timeSavedAssigning,omitempty"` } +type ModelsOnboardingWizardStep string + +const ( + ModelsOnboardingWizardStepConnectCodebases ModelsOnboardingWizardStep = "connect-codebases" + ModelsOnboardingWizardStepSelectRepositories ModelsOnboardingWizardStep = "select-repositories" + ModelsOnboardingWizardStepConnectWorkflows ModelsOnboardingWizardStep = "connect-workflows" + ModelsOnboardingWizardStepConfigureCloud ModelsOnboardingWizardStep = "configure-cloud" + ModelsOnboardingWizardStepQuestionnaire ModelsOnboardingWizardStep = "questionnaire" + ModelsOnboardingWizardStepReadyToStart ModelsOnboardingWizardStep = "ready-to-start" +) + +type ModelsPaceEstimate struct { + ObservedPerWeek *float64 `json:"observedPerWeek,omitempty"` + RequiredPerWeek *float64 `json:"requiredPerWeek,omitempty"` + Verdict *ModelsPaceVerdict `json:"verdict,omitempty"` +} + +type ModelsPaceVerdict string + +const ( + ModelsPaceVerdictAchievable ModelsPaceVerdict = "ACHIEVABLE" + ModelsPaceVerdictStretch ModelsPaceVerdict = "STRETCH" + ModelsPaceVerdictUnrealistic ModelsPaceVerdict = "UNREALISTIC" +) + type ModelsPlan struct { CreatedAt string `json:"createdAt"` Events []ModelsManagerEvent `json:"events,omitempty"` @@ -793,6 +1489,7 @@ type ModelsPlanResponseActionsExecuted struct { } type ModelsPlanResponseCampaignSummary struct { + CampaignDeleted *bool `json:"campaignDeleted,omitempty"` CampaignID string `json:"campaignId"` Content string `json:"content"` Status string `json:"status"` @@ -909,34 +1606,122 @@ type ModelsProjectedSendDirectMessage struct { UserID string `json:"userId"` } +type ModelsProposal struct { + ActorKind *ModelsActorKind `json:"actorKind,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + DecidedAt *string `json:"decidedAt,omitempty"` + DecidedBy *string `json:"decidedBy,omitempty"` + DecisionReason *string `json:"decisionReason,omitempty"` + EditSource *string `json:"editSource,omitempty"` + GoalKeys []string `json:"goalKeys,omitempty"` + ID *string `json:"id,omitempty"` + Kind *ModelsProposalKind `json:"kind,omitempty"` + Ordinal *int `json:"ordinal,omitempty"` + Pace *ModelsPaceEstimate `json:"pace,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` + Revision *int `json:"revision,omitempty"` + RunID *string `json:"runId,omitempty"` + Status *ModelsProposalStatus `json:"status,omitempty"` + StrategyID *string `json:"strategyId,omitempty"` + Title *string `json:"title,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type ModelsProposalCampaign struct { + FindingsTotal *int `json:"findingsTotal,omitempty"` + ID *string `json:"id,omitempty"` + Repositories []string `json:"repositories,omitempty"` + Severities []ModelsSeverityCount `json:"severities,omitempty"` +} + +type ModelsProposalGoal struct { + Objective *string `json:"objective,omitempty"` + Quarter *string `json:"quarter,omitempty"` +} + +type ModelsProposalKind string + +const ( + ModelsProposalKindStrategy ModelsProposalKind = "STRATEGY" + ModelsProposalKindCampaign ModelsProposalKind = "CAMPAIGN" +) + +type ModelsProposalStatus string + +const ( + ModelsProposalStatusProposed ModelsProposalStatus = "PROPOSED" + ModelsProposalStatusRevised ModelsProposalStatus = "REVISED" + ModelsProposalStatusAccepted ModelsProposalStatus = "ACCEPTED" + ModelsProposalStatusRejected ModelsProposalStatus = "REJECTED" + ModelsProposalStatusSuperseded ModelsProposalStatus = "SUPERSEDED" + ModelsProposalStatusExpired ModelsProposalStatus = "EXPIRED" +) + +type ModelsProposalView struct { + Campaign *ModelsProposalCampaign `json:"campaign,omitempty"` + Goal *ModelsProposalGoal `json:"goal,omitempty"` + Proposal *ModelsProposal `json:"proposal,omitempty"` +} + +type ModelsSecurityProgram struct { + AcceptedStrategyID *string `json:"acceptedStrategyId,omitempty"` + ActorKind *ModelsActorKind `json:"actorKind,omitempty"` + AnnounceWindowDays *int `json:"announceWindowDays,omitempty"` + Autonomy *ModelsAutonomyPolicy `json:"autonomy,omitempty"` + CapacityPerWeek *int `json:"capacityPerWeek,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + DefaultCampaignDays *int `json:"defaultCampaignDays,omitempty"` + EditSource *string `json:"editSource,omitempty"` + ID *string `json:"id,omitempty"` + MaxConcurrentCampaigns *int `json:"maxConcurrentCampaigns,omitempty"` + MinCoveragePerGoal *int `json:"minCoveragePerGoal,omitempty"` + ReviewCadenceDays *int `json:"reviewCadenceDays,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + type ModelsSelectionCriteria struct { CreatedAfter *string `json:"createdAfter,omitempty"` CreatedBefore *string `json:"createdBefore,omitempty"` + ExploitValidated *bool `json:"exploitValidated,omitempty"` FindingIds []string `json:"findingIds,omitempty"` LimitPerType *int `json:"limitPerType,omitempty"` MaxStoryPoints *int `json:"maxStoryPoints,omitempty"` MinPriority *float64 `json:"minPriority,omitempty"` + PrBudgetPerWeek *int `json:"prBudgetPerWeek,omitempty"` PriorityLabels []ModelsPriorityLabel `json:"priorityLabels,omitempty"` - RepositoryNames []string `json:"repositoryNames,omitempty"` + RepositoryIds []string `json:"repositoryIds,omitempty"` + SeverityConfidence []string `json:"severityConfidence,omitempty"` SortByColumns *string `json:"sortByColumns,omitempty"` SortByDirection *string `json:"sortByDirection,omitempty"` TeamIDs []string `json:"teamIDs,omitempty"` - TeamNames []string `json:"teamNames,omitempty"` Types []ModelsFindingType `json:"types,omitempty"` UserNames []string `json:"userNames,omitempty"` VulnerabilityCVEIds []string `json:"vulnerabilityCVEIds,omitempty"` VulnerabilityCWEIds []string `json:"vulnerabilityCWEIds,omitempty"` } +type ModelsSeverityCount struct { + Count *int `json:"count,omitempty"` + Severity *string `json:"severity,omitempty"` +} + type ModelsSlackCommentProvider struct { ChannelID string `json:"channelId"` EventTs string `json:"eventTs"` } type ModelsStrategy struct { + AcceptedAt *string `json:"acceptedAt,omitempty"` + AcceptedBy *string `json:"acceptedBy,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` + EditSource *string `json:"editSource,omitempty"` + EditedBy *string `json:"editedBy,omitempty"` ID *string `json:"id,omitempty"` Quarters []ModelsStrategyQuarterGoal `json:"quarters,omitempty"` + Status *string `json:"status,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` Version *int `json:"version,omitempty"` } @@ -952,23 +1737,58 @@ type ModelsTeamsCommentProvider struct { MessageID string `json:"messageId"` } +type ModelsThreatCILogCheck struct { + CheckedAt string `json:"checkedAt"` + OmittedRepos *int `json:"omittedRepos,omitempty"` + Repos []ModelsThreatCILogRepo `json:"repos,omitempty"` + Version int `json:"version"` +} + +type ModelsThreatCILogRepo struct { + CiProvider *string `json:"ciProvider,omitempty"` + LogsRead *int `json:"logsRead,omitempty"` + Reasons []string `json:"reasons,omitempty"` + Repository string `json:"repository"` + Runs *int `json:"runs,omitempty"` + Verdict string `json:"verdict"` + WindowFrom *string `json:"windowFrom,omitempty"` + WindowTo *string `json:"windowTo,omitempty"` +} + type ModelsThreatInvestigation struct { Advice *string `json:"advice,omitempty"` ClientImpact *ModelsThreatInvestigationClientImpact `json:"clientImpact,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` + CurrentStage *string `json:"currentStage,omitempty"` + CurrentStageAt *string `json:"currentStageAt,omitempty"` + FailureCategory *string `json:"failureCategory,omitempty"` + FailureMessage *string `json:"failureMessage,omitempty"` GeneralInfo *ModelsThreatInvestigationGeneralInfo `json:"generalInfo,omitempty"` ID *string `json:"id,omitempty"` + InvestigationVersion *string `json:"investigationVersion,omitempty"` Keywords *string `json:"keywords,omitempty"` + LegacyAssessment *bool `json:"legacyAssessment,omitempty"` + LegacyAssessmentID *string `json:"legacyAssessmentId,omitempty"` + LegacyCveInvestigations []ModelsThreatInvestigationLegacyCVE `json:"legacyCveInvestigations,omitempty"` Remediation *ModelsThreatInvestigationRemediation `json:"remediation,omitempty"` Report *ModelsThreatInvestigationReport `json:"report,omitempty"` + RequestedBy *string `json:"requestedBy,omitempty"` + ResearchVersion *string `json:"researchVersion,omitempty"` + RunID *string `json:"runId,omitempty"` + RunQueued *bool `json:"runQueued,omitempty"` + RunRetryAt *string `json:"runRetryAt,omitempty"` + RunStatus *string `json:"runStatus,omitempty"` + SourceVulnDbThreatID *string `json:"sourceVulnDbThreatId,omitempty"` Status string `json:"status"` Timeline *ModelsThreatInvestigationTimeline `json:"timeline,omitempty"` + TriggerReason *string `json:"triggerReason,omitempty"` Type string `json:"type"` UpdatedAt *string `json:"updatedAt,omitempty"` } type ModelsThreatInvestigationAffectedPackage struct { AffectedRange *string `json:"affectedRange,omitempty"` + AttributionProvenance *string `json:"attributionProvenance,omitempty"` AttributionType *string `json:"attributionType,omitempty"` Ecosystem *string `json:"ecosystem,omitempty"` Name *string `json:"name,omitempty"` @@ -979,12 +1799,15 @@ type ModelsThreatInvestigationAffectedPackage struct { type ModelsThreatInvestigationAffectedRepo struct { CiActivity *ModelsThreatInvestigationCIActivity `json:"ciActivity,omitempty"` + EvidenceSource *string `json:"evidenceSource,omitempty"` FindingID *string `json:"findingId,omitempty"` FirstSeen *string `json:"firstSeen,omitempty"` IntroducedCommit *string `json:"introducedCommit,omitempty"` + IsArchived *bool `json:"isArchived,omitempty"` IsAutoFixable *bool `json:"isAutoFixable,omitempty"` IsDirect *bool `json:"isDirect,omitempty"` IsRemediated *bool `json:"isRemediated,omitempty"` + LastScannedAt *string `json:"lastScannedAt,omitempty"` LastSeen *string `json:"lastSeen,omitempty"` ManifestFile *string `json:"manifestFile,omitempty"` ManifestPath *string `json:"manifestPath,omitempty"` @@ -993,6 +1816,7 @@ type ModelsThreatInvestigationAffectedRepo struct { RepositoryID *string `json:"repositoryId,omitempty"` RepositoryName *string `json:"repositoryName,omitempty"` RepositoryOwner *string `json:"repositoryOwner,omitempty"` + ResolvedWithoutLockfile *bool `json:"resolvedWithoutLockfile,omitempty"` Version *string `json:"version,omitempty"` } @@ -1006,12 +1830,24 @@ type ModelsThreatInvestigationCIActivity struct { type ModelsThreatInvestigationClientImpact struct { AffectedRepoCount *int `json:"affectedRepoCount,omitempty"` AffectedRepos []ModelsThreatInvestigationAffectedRepo `json:"affectedRepos,omitempty"` + AssessedRepoCount *int `json:"assessedRepoCount,omitempty"` + CiLogCheck *ModelsThreatCILogCheck `json:"ciLogCheck,omitempty"` FindingIds []string `json:"findingIds,omitempty"` + ImpactIncomplete *bool `json:"impactIncomplete,omitempty"` + ImpactIncompleteReason *string `json:"impactIncompleteReason,omitempty"` + InventoryCheckedAt *string `json:"inventoryCheckedAt,omitempty"` + InventoryFreshUntil *string `json:"inventoryFreshUntil,omitempty"` + InventoryFreshness *string `json:"inventoryFreshness,omitempty"` + OutOfScopeRepoCount *int `json:"outOfScopeRepoCount,omitempty"` + PackageVerdicts []ModelsThreatInvestigationPackageVerdict `json:"packageVerdicts,omitempty"` + PendingFindingRepoCount *int `json:"pendingFindingRepoCount,omitempty"` TotalRepoCount *int `json:"totalRepoCount,omitempty"` UnaffectedRepoCount *int `json:"unaffectedRepoCount,omitempty"` + UnknownRepoCount *int `json:"unknownRepoCount,omitempty"` } type ModelsThreatInvestigationGeneralInfo struct { + AdvisoryIds []ModelsAdvisoryReference `json:"advisoryIds,omitempty"` AffectedPackages []ModelsThreatInvestigationAffectedPackage `json:"affectedPackages,omitempty"` ArticleLinks []string `json:"articleLinks,omitempty"` CveIds []string `json:"cveIds,omitempty"` @@ -1021,8 +1857,27 @@ type ModelsThreatInvestigationGeneralInfo struct { Ecosystem *string `json:"ecosystem,omitempty"` Exploitability *string `json:"exploitability,omitempty"` History *string `json:"history,omitempty"` + NullifyAdvisoryID *string `json:"nullifyAdvisoryId,omitempty"` Severity *ModelsSeverity `json:"severity,omitempty"` Title *string `json:"title,omitempty"` + Withdrawn *bool `json:"withdrawn,omitempty"` +} + +type ModelsThreatInvestigationLegacyCVE struct { + CveID string `json:"cveId"` + FailureCategory *string `json:"failureCategory,omitempty"` + InvestigationID string `json:"investigationId"` + RunStatus *string `json:"runStatus,omitempty"` + Status string `json:"status"` +} + +type ModelsThreatInvestigationPackageVerdict struct { + CheckedAt *string `json:"checkedAt,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + Error *string `json:"error,omitempty"` + PackageName *string `json:"packageName,omitempty"` + UnknownReason *string `json:"unknownReason,omitempty"` + Verdict *string `json:"verdict,omitempty"` } type ModelsThreatInvestigationRemediation struct { @@ -1046,7 +1901,9 @@ type ModelsThreatInvestigationReport struct { } type ModelsThreatInvestigationTimeline struct { + CustomerNotifiedAt *string `json:"customerNotifiedAt,omitempty"` ImpactAssessedAt *string `json:"impactAssessedAt,omitempty"` + InternalNotifiedAt *string `json:"internalNotifiedAt,omitempty"` InvestigationCompletedAt *string `json:"investigationCompletedAt,omitempty"` InvestigationCreatedAt *string `json:"investigationCreatedAt,omitempty"` RemediationStartedAt *string `json:"remediationStartedAt,omitempty"` @@ -1057,5 +1914,21 @@ type ModelsThreatInvestigationTimeline struct { ThreatDiscoveredAt *string `json:"threatDiscoveredAt,omitempty"` } +type ModelsThreatSource struct { + ContentSha256 *string `json:"content_sha256,omitempty"` + Domain *string `json:"domain,omitempty"` + Extraction *string `json:"extraction,omitempty"` + FetchedAt *string `json:"fetched_at,omitempty"` + Title *string `json:"title,omitempty"` + URL *string `json:"url,omitempty"` +} + type SessionsChatSession struct { + CreatedAt string `json:"createdAt"` + ID string `json:"id"` + PlatformID *string `json:"platformId,omitempty"` + TenantID string `json:"tenantId"` + Title *string `json:"title,omitempty"` + UpdatedAt string `json:"updatedAt"` + UserID string `json:"userId"` } diff --git a/internal/api/models/orchestrator.go b/internal/api/models/orchestrator.go index 67b7a16..44f6a6c 100644 --- a/internal/api/models/orchestrator.go +++ b/internal/api/models/orchestrator.go @@ -28,26 +28,72 @@ type EndpointsBatchAutofixStats struct { TotalSucceeded *int `json:"totalSucceeded,omitempty"` } +type EndpointsCheckRunResponse struct { + Branch *string `json:"branch,omitempty"` + CheckName string `json:"checkName"` + CheckRunID *string `json:"checkRunId,omitempty"` + CommitSha string `json:"commitSha"` + CompletedAt *string `json:"completedAt,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + DetailsURL *string `json:"detailsUrl,omitempty"` + DurationSeconds *int `json:"durationSeconds,omitempty"` + HtmlURL *string `json:"htmlUrl,omitempty"` + ID string `json:"id"` + IsDefaultBranch bool `json:"isDefaultBranch"` + Overridable bool `json:"overridable"` + PullRequest *ModelsGitPullRequestProvider `json:"pullRequest,omitempty"` + PullRequestNumber *int64 `json:"pullRequestNumber,omitempty"` + PullRequestTitle *string `json:"pullRequestTitle,omitempty"` + PullRequestURL *string `json:"pullRequestUrl,omitempty"` + Repository ModelsGitRepositoryProvider `json:"repository"` + RepositoryID string `json:"repositoryId"` + RepositoryName string `json:"repositoryName"` + RepositoryOwner *string `json:"repositoryOwner,omitempty"` + Result *string `json:"result,omitempty"` + Service *string `json:"service,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + State string `json:"state"` + Summary *string `json:"summary,omitempty"` +} + type EndpointsCodeReviewsResponse struct { + BlockingFindings *int `json:"blockingFindings,omitempty"` Branch string `json:"branch"` + CheckName *string `json:"checkName,omitempty"` + CheckOverriddenAt *string `json:"checkOverriddenAt,omitempty"` + CheckOverriddenBy *string `json:"checkOverriddenBy,omitempty"` CommitSha string `json:"commitSha"` + CompletedAt *string `json:"completedAt,omitempty"` + GateMode *string `json:"gateMode,omitempty"` + GatePolicy *string `json:"gatePolicy,omitempty"` + GateResult *string `json:"gateResult,omitempty"` ID string `json:"id"` + IncompleteScanners []string `json:"incompleteScanners,omitempty"` IsDefaultBranch bool `json:"isDefaultBranch"` + ProcessedFindings *int `json:"processedFindings,omitempty"` PullRequest *ModelsGitPullRequestProvider `json:"pullRequest,omitempty"` Repository *ModelsGitRepositoryProvider `json:"repository,omitempty"` + RepositoryID string `json:"repositoryId"` + ScanConclusion *string `json:"scanConclusion,omitempty"` + SkippedScanners []string `json:"skippedScanners,omitempty"` + StartedAt string `json:"startedAt"` + Status string `json:"status"` + TotalFindings *int `json:"totalFindings,omitempty"` } -type EndpointsCompleteOnboardingInput struct { - TenantID string `json:"tenantId"` -} +type EndpointsFindingTypeQuery string -type EndpointsCompleteOnboardingOutput struct { - Message string `json:"message"` - Status string `json:"status"` - Success bool `json:"success"` - TenantID string `json:"tenantId"` - Timestamp string `json:"timestamp"` -} +const ( + EndpointsFindingTypeQuerySast EndpointsFindingTypeQuery = "sast" + EndpointsFindingTypeQueryScaDependencies EndpointsFindingTypeQuery = "sca_dependencies" + EndpointsFindingTypeQueryScaContainers EndpointsFindingTypeQuery = "sca_containers" + EndpointsFindingTypeQuerySecretsCredentials EndpointsFindingTypeQuery = "secrets_credentials" + EndpointsFindingTypeQuerySecretsSensitiveData EndpointsFindingTypeQuery = "secrets_sensitive_data" + EndpointsFindingTypeQueryScpm EndpointsFindingTypeQuery = "scpm" + EndpointsFindingTypeQueryCspm EndpointsFindingTypeQuery = "cspm" + EndpointsFindingTypeQueryDastBughunt EndpointsFindingTypeQuery = "dast_bughunt" + EndpointsFindingTypeQueryDastPentest EndpointsFindingTypeQuery = "dast_pentest" +) type EndpointsGetBatchAutofixStatusOutput struct { CompletedAt *string `json:"completedAt,omitempty"` @@ -64,6 +110,15 @@ type EndpointsGetBatchAutofixStatusOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsGetCheckRunsOutput struct { + CheckRuns []EndpointsCheckRunResponse `json:"checkRuns,omitempty"` + Partial bool `json:"partial"` + RepositoriesRead int `json:"repositoriesRead"` + ScopeTruncated bool `json:"scopeTruncated"` + UnreadableRepositories []string `json:"unreadableRepositories,omitempty"` + UnreadableRepositoryIds []string `json:"unreadableRepositoryIds,omitempty"` +} + type EndpointsGetCodeReviewOutput struct { ID string `json:"id"` Review EndpointsCodeReviewsResponse `json:"review"` @@ -71,7 +126,9 @@ type EndpointsGetCodeReviewOutput struct { type EndpointsGetCodeReviewsOutput struct { NextToken *string `json:"nextToken,omitempty"` - Reviews EndpointsCodeReviewsResponse `json:"reviews"` + NumItems int `json:"numItems"` + Reviews []EndpointsCodeReviewsResponse `json:"reviews,omitempty"` + TotalCount int `json:"totalCount"` } type EndpointsGetFindingAutofixIterationsOutput struct { @@ -84,16 +141,82 @@ type EndpointsGetOnboardingStatusOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsGetRepositoryScanOutput struct { + Branch string `json:"branch"` + CommitSha string `json:"commitSha"` + CompletedAt *string `json:"completedAt,omitempty"` + Error *string `json:"error,omitempty"` + IncompleteScanners []string `json:"incompleteScanners,omitempty"` + PullRequestNumber *int `json:"pullRequestNumber,omitempty"` + RepositoryID string `json:"repositoryId"` + RunID string `json:"runId"` + ScanConclusion *string `json:"scanConclusion,omitempty"` + ScanRuns []EndpointsRepositoryScanRun `json:"scanRuns,omitempty"` + Services []EndpointsRepositoryScanService `json:"services,omitempty"` + SkippedScanners []string `json:"skippedScanners,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + State string `json:"state"` + Terminal *bool `json:"terminal,omitempty"` +} + +type EndpointsGetRetriageActivityOutput struct { + ActivityID string `json:"activityId"` + Findings []EndpointsRetriageActivityFinding `json:"findings,omitempty"` + RetryOfActivityID *string `json:"retryOfActivityId,omitempty"` + Status EndpointsRunState `json:"status"` + Terminal *bool `json:"terminal,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetRunControlCapabilitiesOutput struct { + Approve bool `json:"approve"` + Steer bool `json:"steer"` + Stop bool `json:"stop"` + StopVia string `json:"stopVia"` +} + +type EndpointsManualOnboardingCompletion struct { + CompletedAt string `json:"completedAt"` + CompletedBy string `json:"completedBy"` + PreviousCompletionType *string `json:"previousCompletionType,omitempty"` + PreviousStatus string `json:"previousStatus"` + Reason string `json:"reason"` + Source string `json:"source"` +} + +type EndpointsOnboardingRequirementsOutput struct { + Customized bool `json:"customized"` + Required []string `json:"required,omitempty"` + Unmet []string `json:"unmet,omitempty"` +} + +type EndpointsOnboardingStageOutcome struct { + At string `json:"at"` + Counts map[string]int64 `json:"counts,omitempty"` + Detail *string `json:"detail,omitempty"` + Reason *string `json:"reason,omitempty"` + Stage string `json:"stage"` + Status string `json:"status"` +} + type EndpointsOnboardingStatusResponse struct { CompletedAt *string `json:"completedAt,omitempty"` CompletedSteps []string `json:"completedSteps,omitempty"` + CompletionType *string `json:"completionType,omitempty"` CurrentPhase *string `json:"currentPhase,omitempty"` CurrentStep *int `json:"currentStep,omitempty"` ErrorMessage *string `json:"errorMessage,omitempty"` ExecutionArn *string `json:"executionArn,omitempty"` FailedStep *string `json:"failedStep,omitempty"` + IsOnboarded bool `json:"isOnboarded"` + LastCompletedStep *string `json:"lastCompletedStep,omitempty"` + ManualCompletion *EndpointsManualOnboardingCompletion `json:"manualCompletion,omitempty"` + OnboardingApprovalSet bool `json:"onboardingApprovalSet"` ProgressPct *int `json:"progressPct,omitempty"` + RecordMissing bool `json:"recordMissing"` + Repositories []string `json:"repositories,omitempty"` RepositoriesProcessed *int `json:"repositoriesProcessed,omitempty"` + StageOutcomes []EndpointsOnboardingStageOutcome `json:"stageOutcomes,omitempty"` StartedAt string `json:"startedAt"` Status *string `json:"status,omitempty"` StatusMessage *string `json:"statusMessage,omitempty"` @@ -119,23 +242,44 @@ type EndpointsPostBatchAutofixOutput struct { Version *string `json:"version,omitempty"` } -type EndpointsPostRetriageFindingsAggregation struct { - Comments []EndpointsPostRetriageFindingsComment `json:"comments,omitempty"` - RequestCount *int `json:"requestCount,omitempty"` +type EndpointsPostCheckRunOverrideInput struct { + CheckName string `json:"checkName"` + CommitSha string `json:"commitSha"` + Reason *string `json:"reason,omitempty"` + Repository ModelsGitRepositoryProvider `json:"repository"` } -type EndpointsPostRetriageFindingsAuthor struct { - ID *string `json:"id,omitempty"` +type EndpointsPostCheckRunOverrideOutput struct { + AuditRecorded bool `json:"auditRecorded"` + CheckRun EndpointsCheckRunResponse `json:"checkRun"` } -type EndpointsPostRetriageFindingsComment struct { - Content *string `json:"content,omitempty"` - FindingID *string `json:"findingId,omitempty"` - ID *string `json:"id,omitempty"` - MemoryID *string `json:"memoryId,omitempty"` - NodeID *string `json:"nodeId,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - User *EndpointsPostRetriageFindingsUser `json:"user,omitempty"` +type EndpointsPostCloseFindingTicketInput struct { + ActorID *string `json:"actorId,omitempty"` + FindingType EndpointsFindingTypeQuery `json:"findingType"` + Reason *string `json:"reason,omitempty"` + Resolution *string `json:"resolution,omitempty"` +} + +type EndpointsPostCloseFindingTicketOutput struct { + AlreadyClosed *bool `json:"alreadyClosed,omitempty"` + Message *string `json:"message,omitempty"` + Success bool `json:"success"` + TicketIdentifier *string `json:"ticketIdentifier,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsPostIterateAutofixPRInput struct { + OwnerProvider ModelsOwnerProvider `json:"ownerProvider"` + PullRequest ModelsGitPullRequestProvider `json:"pullRequest"` + Reason *string `json:"reason,omitempty"` + Repository ModelsGitRepositoryProvider `json:"repository"` +} + +type EndpointsPostIterateAutofixPROutput struct { + Accepted bool `json:"accepted"` + Message string `json:"message"` + Version *string `json:"version,omitempty"` } type EndpointsPostRetriageFindingsInput struct { @@ -143,30 +287,96 @@ type EndpointsPostRetriageFindingsInput struct { DebounceBypass *bool `json:"debounceBypass,omitempty"` Filters *ModelsRetriageFilters `json:"filters,omitempty"` FindingType string `json:"findingType"` - Message *EndpointsPostRetriageFindingsMessage `json:"message,omitempty"` + Message *ModelsRetriageMessage `json:"message,omitempty"` PlatformProvider *string `json:"platformProvider,omitempty"` + RetryOfActivityID *string `json:"retryOfActivityId,omitempty"` TriggerSource *ModelsRetriageTriggerSource `json:"triggerSource,omitempty"` } -type EndpointsPostRetriageFindingsMessage struct { - Aggregation *EndpointsPostRetriageFindingsAggregation `json:"aggregation,omitempty"` - Author *EndpointsPostRetriageFindingsAuthor `json:"author,omitempty"` - Comment *EndpointsPostRetriageFindingsComment `json:"comment,omitempty"` - GitOwnerProvider *ModelsOwnerProvider `json:"gitOwnerProvider,omitempty"` -} - type EndpointsPostRetriageFindingsOutput struct { + ActivityID *string `json:"activityId,omitempty"` + FailedFindingIds []string `json:"failedFindingIds,omitempty"` Message string `json:"message"` MessageID string `json:"messageId"` Version *string `json:"version,omitempty"` } -type EndpointsPostRetriageFindingsUser struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` +type EndpointsPostRunControlInput struct { + Action string `json:"action"` + ApprovalID *string `json:"approvalId,omitempty"` + IdempotencyKey string `json:"idempotencyKey"` + Message *string `json:"message,omitempty"` +} + +type EndpointsPostRunControlOutput struct { + ControlID string `json:"controlId"` + Duplicate bool `json:"duplicate"` +} + +type EndpointsRepositoryScanRun struct { + CompletedAt *string `json:"completedAt,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + FixedFindingsCount *int `json:"fixedFindingsCount,omitempty"` + LiveFindingsCount *int `json:"liveFindingsCount,omitempty"` + NewFindingsCount *int `json:"newFindingsCount,omitempty"` + ScanRunID string `json:"scanRunId"` + ScanType string `json:"scanType"` + Service EndpointsRepositoryScanService `json:"service"` + Severity *EndpointsScanSeverityCounts `json:"severity,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + Status string `json:"status"` + Terminal *bool `json:"terminal,omitempty"` +} + +type EndpointsRepositoryScanService string + +const ( + EndpointsRepositoryScanServiceSast EndpointsRepositoryScanService = "sast" + EndpointsRepositoryScanServiceSca EndpointsRepositoryScanService = "sca" + EndpointsRepositoryScanServiceSecrets EndpointsRepositoryScanService = "secrets" + EndpointsRepositoryScanServiceScpm EndpointsRepositoryScanService = "scpm" +) + +type EndpointsRepositoryScanTriage string + +const ( + EndpointsRepositoryScanTriageOn EndpointsRepositoryScanTriage = "on" + EndpointsRepositoryScanTriageOff EndpointsRepositoryScanTriage = "off" +) + +type EndpointsRetriageActivityFinding struct { + ExecutionArn *string `json:"executionArn,omitempty"` + FindingID string `json:"findingId"` + FindingType string `json:"findingType"` + Reason *string `json:"reason,omitempty"` + Status EndpointsRetriageFindingStatus `json:"status"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type EndpointsRetriageFindingStatus string + +const ( + EndpointsRetriageFindingStatusQueued EndpointsRetriageFindingStatus = "queued" + EndpointsRetriageFindingStatusDispatched EndpointsRetriageFindingStatus = "dispatched" + EndpointsRetriageFindingStatusCompleted EndpointsRetriageFindingStatus = "completed" + EndpointsRetriageFindingStatusIncomplete EndpointsRetriageFindingStatus = "incomplete" + EndpointsRetriageFindingStatusFailed EndpointsRetriageFindingStatus = "failed" + EndpointsRetriageFindingStatusDenied EndpointsRetriageFindingStatus = "denied" + EndpointsRetriageFindingStatusDeferred EndpointsRetriageFindingStatus = "deferred" + EndpointsRetriageFindingStatusNotNeeded EndpointsRetriageFindingStatus = "not_needed" +) + +type EndpointsScanSeverityCounts struct { + Critical *int `json:"critical,omitempty"` + High *int `json:"high,omitempty"` + Low *int `json:"low,omitempty"` + Medium *int `json:"medium,omitempty"` } type EndpointsStartOnboardingInput struct { + AllRepositories *bool `json:"allRepositories,omitempty"` + BypassRequirements *bool `json:"bypassRequirements,omitempty"` + Force *bool `json:"force,omitempty"` GitOwnerProvider ModelsOwnerProvider `json:"gitOwnerProvider"` RepositoryIds []string `json:"repositoryIds,omitempty"` } @@ -177,6 +387,37 @@ type EndpointsStartOnboardingOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsStartPullRequestReviewOutput struct { + AlreadyRunning *bool `json:"alreadyRunning,omitempty"` + CommitSha string `json:"commitSha"` + PullRequestNumber int `json:"pullRequestNumber"` + RepositoryID string `json:"repositoryId"` + RunID string `json:"runId"` + SourceBranch string `json:"sourceBranch"` + TargetBranch *string `json:"targetBranch,omitempty"` +} + +type EndpointsStartRepositoryScanInput struct { + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + FullHistory *bool `json:"fullHistory,omitempty"` + RegenerateContext *bool `json:"regenerateContext,omitempty"` + ScopeBackfill *bool `json:"scopeBackfill,omitempty"` + Services []EndpointsRepositoryScanService `json:"services,omitempty"` + Triage *EndpointsRepositoryScanTriage `json:"triage,omitempty"` +} + +type EndpointsStartRepositoryScanOutput struct { + AlreadyRunning *bool `json:"alreadyRunning,omitempty"` + Branch string `json:"branch"` + CommitSha string `json:"commitSha"` + Queued *bool `json:"queued,omitempty"` + RepositoryID string `json:"repositoryId"` + RunID string `json:"runId"` + Services []EndpointsRepositoryScanService `json:"services,omitempty"` + SideEffects []string `json:"sideEffects,omitempty"` +} + type ModelsAutofixIteration struct { AgentVersion *string `json:"agentVersion,omitempty"` AutofixID string `json:"autofixID"` @@ -187,8 +428,6 @@ type ModelsAutofixIteration struct { ID string `json:"id"` InputTokenCount *int `json:"inputTokenCount,omitempty"` IterationNumber int `json:"iterationNumber"` - LangfuseSessionID *string `json:"langfuseSessionID,omitempty"` - LangfuseTraceID *string `json:"langfuseTraceID,omitempty"` LlmCostUSD *float64 `json:"llmCostUSD,omitempty"` ModelName *string `json:"modelName,omitempty"` OtelTraceID *string `json:"otelTraceID,omitempty"` @@ -196,6 +435,7 @@ type ModelsAutofixIteration struct { StartedAt string `json:"startedAt"` Status ModelsAutofixIterationStatus `json:"status"` TenantID string `json:"tenantID"` + TerminalReason *string `json:"terminalReason,omitempty"` TriggerEventID *string `json:"triggerEventID,omitempty"` TriggerType ModelsAutofixIterationTriggerType `json:"triggerType"` } @@ -214,6 +454,7 @@ const ( type ModelsAutofixIterationTriggerType string const ( + ModelsAutofixIterationTriggerTypeGeneratePreview ModelsAutofixIterationTriggerType = "generate_preview" ModelsAutofixIterationTriggerTypeCreatePr ModelsAutofixIterationTriggerType = "create_pr" ModelsAutofixIterationTriggerTypeCiFailure ModelsAutofixIterationTriggerType = "ci_failure" ModelsAutofixIterationTriggerTypeCodeReview ModelsAutofixIterationTriggerType = "code_review" @@ -221,6 +462,166 @@ const ( ModelsAutofixIterationTriggerTypeRerun ModelsAutofixIterationTriggerType = "rerun" ) +type ModelsAzureGitBuildProvider struct { + CommitSha string `json:"commitSha"` + Genre *string `json:"genre,omitempty"` + Name *string `json:"name,omitempty"` + PullRequestID *int `json:"pullRequestId,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` +} + +type ModelsBitbucketGitBuildProvider struct { + CheckID string `json:"checkId"` + CommitSha string `json:"commitSha"` +} + +type ModelsBuildkiteGitBuildProvider struct { + BuildNumber int `json:"buildNumber"` + CommitSha string `json:"commitSha"` + CompletedAt string `json:"completedAt"` + JobID *string `json:"jobId,omitempty"` + OrgSlug string `json:"orgSlug"` + PipelineSlug string `json:"pipelineSlug"` + StartedAt string `json:"startedAt"` +} + +type ModelsChatCommentReference struct { + Content string `json:"content"` + FindingID string `json:"findingId"` + ID string `json:"id"` + MemoryID *string `json:"memoryId,omitempty"` + NodeID *string `json:"nodeId,omitempty"` + Timestamp string `json:"timestamp"` + User ModelsUser `json:"user"` +} + +type ModelsCommit struct { + Author ModelsUser `json:"author"` + CoAuthoredByNullify bool `json:"coAuthoredByNullify"` + CommittedAt *string `json:"committedAt,omitempty"` + CreatedAt string `json:"createdAt"` + Message string `json:"message"` + Sha string `json:"sha"` + Timestamp string `json:"timestamp"` +} + +type ModelsGitBuild struct { +} + +type ModelsGitBuildProvider struct { + Azure *ModelsAzureGitBuildProvider `json:"azure,omitempty"` + Bitbucket *ModelsBitbucketGitBuildProvider `json:"bitbucket,omitempty"` + Buildkite *ModelsBuildkiteGitBuildProvider `json:"buildkite,omitempty"` + GitHub *ModelsGitHubGitBuildProvider `json:"gitHub,omitempty"` + GitLab *ModelsGitLabGitBuildProvider `json:"gitLab,omitempty"` + ID *ModelsProviderID `json:"id,omitempty"` + StatusAPI *ModelsStatusAPIGitBuildProvider `json:"statusApi,omitempty"` +} + +type ModelsGitHubGitBuildProvider struct { + BuildID int64 `json:"buildId"` + CheckID int64 `json:"checkId"` + CommitSha string `json:"commitSha"` + CompletedAt string `json:"completedAt"` + ExecutionIdentity *ModelsGitHubExecutionIdentity `json:"executionIdentity,omitempty"` + StartedAt string `json:"startedAt"` +} + +type ModelsGitLabGitBuildProvider struct { + CommitSha string `json:"commitSha"` + JobID int `json:"jobId"` + PipelineID int `json:"pipelineId"` +} + +type ModelsPullRequest struct { + Additions *int `json:"additions,omitempty"` + BranchName string `json:"branchName"` + Builds []ModelsGitBuild `json:"builds,omitempty"` + ChangedFiles *int `json:"changed_files,omitempty"` + ClosedAt *string `json:"closed_at,omitempty"` + Commits []ModelsCommit `json:"commits,omitempty"` + CreationTime string `json:"creationTime"` + Deletions *int `json:"deletions,omitempty"` + Description string `json:"description"` + Diff *string `json:"diff,omitempty"` + DiffThreads []ModelsPullRequestReviewDiffThread `json:"diffThreads,omitempty"` + DiscussionComments []ModelsComment `json:"discussionComments,omitempty"` + GitPullRequestProvider ModelsGitPullRequestProvider `json:"gitPullRequestProvider"` + GitRepositoryProvider ModelsGitRepositoryProvider `json:"gitRepositoryProvider"` + ID int `json:"id"` + IsCreatedByNullify bool `json:"isCreatedByNullify"` + IsDraft bool `json:"isDraft"` + IsMerged bool `json:"isMerged"` + IsOpen bool `json:"isOpen"` + Link string `json:"link"` + MergeCommitSha *string `json:"merge_commit_sha,omitempty"` + Mergeable *bool `json:"mergeable,omitempty"` + MergeableState *string `json:"mergeable_state,omitempty"` + MergedAt *string `json:"merged_at,omitempty"` + MergedBy *ModelsUser `json:"merged_by,omitempty"` + NumCommits int `json:"numCommits"` + OwnerProvider ModelsOwnerProvider `json:"ownerProvider"` + Rebaseable *bool `json:"rebaseable,omitempty"` + Reviewers []ModelsUser `json:"reviewers,omitempty"` + Reviews []ModelsPullRequestReview `json:"reviews,omitempty"` + ReviewsIncomplete *bool `json:"reviewsIncomplete,omitempty"` + SourceBranch string `json:"sourceBranch"` + SourceHead string `json:"sourceHead"` + TargetBranch string `json:"targetBranch"` + TargetHead string `json:"targetHead"` + Title string `json:"title"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +type ModelsPullRequestReview struct { + Body *string `json:"Body,omitempty"` + ID *int64 `json:"ID,omitempty"` + IsBot *bool `json:"IsBot,omitempty"` + IsNullify *bool `json:"IsNullify,omitempty"` + NodeID *string `json:"NodeID,omitempty"` + ReviewerUsername *string `json:"ReviewerUsername,omitempty"` + State *ModelsPullRequestReviewState `json:"State,omitempty"` + SubmittedAt *string `json:"SubmittedAt,omitempty"` + UpdatedAt *string `json:"UpdatedAt,omitempty"` +} + +type ModelsPullRequestReviewDiffThread struct { + CommentHistory []ModelsComment `json:"commentHistory,omitempty"` + DiffHunk string `json:"diffHunk"` + EndLine int `json:"endLine"` + FilePath string `json:"filePath"` + IsNullifyAuthored *bool `json:"isNullifyAuthored,omitempty"` + IsResolved bool `json:"isResolved"` + NewComment *ModelsComment `json:"newComment,omitempty"` + Provider ModelsCommentProvider `json:"provider"` + SnapshotIncomplete *bool `json:"snapshotIncomplete,omitempty"` + StartLine int `json:"startLine"` +} + +type ModelsPullRequestReviewState string + +const ( + ModelsPullRequestReviewStateApproved ModelsPullRequestReviewState = "APPROVED" + ModelsPullRequestReviewStateChangesRequested ModelsPullRequestReviewState = "CHANGES_REQUESTED" + ModelsPullRequestReviewStateDismissed ModelsPullRequestReviewState = "DISMISSED" + ModelsPullRequestReviewStateCommented ModelsPullRequestReviewState = "COMMENTED" +) + +type ModelsPush struct { + After string `json:"after"` + Before string `json:"before"` + Commits []ModelsCommit `json:"commits,omitempty"` + Ref string `json:"ref"` + Repository string `json:"repository"` +} + +type ModelsRetriageAggregationInfo struct { + Comments []ModelsChatCommentReference `json:"comments,omitempty"` + MessageIds []string `json:"messageIds,omitempty"` + RequestCount int `json:"requestCount"` + TriggerSources []ModelsRetriageTriggerSource `json:"triggerSources,omitempty"` +} + type ModelsRetriageFilters struct { Branch *string `json:"branch,omitempty"` FindingIds []string `json:"findingIds,omitempty"` @@ -234,15 +635,56 @@ type ModelsRetriageFilters struct { Silent *bool `json:"silent,omitempty"` } +type ModelsRetriageMessage struct { + ActivityIds []string `json:"activityIds,omitempty"` + Aggregation *ModelsRetriageAggregationInfo `json:"aggregation,omitempty"` + Author *ModelsUser `json:"author,omitempty"` + CloneURL *string `json:"cloneUrl,omitempty"` + Comment *ModelsChatCommentReference `json:"comment,omitempty"` + ContextPresignedURL *string `json:"contextPresignedURL,omitempty"` + Entrypoints map[string][]string `json:"entrypoints,omitempty"` + GitBuildProvider *ModelsGitBuildProvider `json:"gitBuildProvider,omitempty"` + GitOwnerProvider *ModelsOwnerProvider `json:"gitOwnerProvider,omitempty"` + GitRepositoryProvider *ModelsGitRepositoryProvider `json:"gitRepositoryProvider,omitempty"` + HeadCommit ModelsCommit `json:"headCommit"` + PullRequestProvider *ModelsGitPullRequestProvider `json:"pullRequestProvider,omitempty"` + Pullrequest *ModelsPullRequest `json:"pullrequest,omitempty"` + Push *ModelsPush `json:"push,omitempty"` + RepoSizeGiB *int32 `json:"repoSizeGiB,omitempty"` + Requester *ModelsRetriageRequester `json:"requester,omitempty"` + ScanCommitSHA *string `json:"scanCommitSHA,omitempty"` + SkipScanHistory *bool `json:"skipScanHistory,omitempty"` + TicketProvider ModelsTicketProvider `json:"ticketProvider"` + Timestamp *string `json:"timestamp,omitempty"` + Tool *string `json:"tool,omitempty"` + ToolGroup *ModelsFindingType `json:"toolGroup,omitempty"` + TraceAttributes map[string]string `json:"traceAttributes,omitempty"` +} + +type ModelsRetriageRequester string + +const ( + ModelsRetriageRequesterHuman ModelsRetriageRequester = "human" +) + type ModelsRetriageTriggerSource string const ( ModelsRetriageTriggerSourceApi ModelsRetriageTriggerSource = "api" + ModelsRetriageTriggerSourceAdminManual ModelsRetriageTriggerSource = "admin_manual" ModelsRetriageTriggerSourceChatComment ModelsRetriageTriggerSource = "chat_comment" ModelsRetriageTriggerSourceScheduled ModelsRetriageTriggerSource = "scheduled" ModelsRetriageTriggerSourceWebhook ModelsRetriageTriggerSource = "webhook" ModelsRetriageTriggerSourceNodeMemory ModelsRetriageTriggerSource = "node_memory" ModelsRetriageTriggerSourceQaAnswer ModelsRetriageTriggerSource = "qa_answer" + ModelsRetriageTriggerSourceCli ModelsRetriageTriggerSource = "cli" ModelsRetriageTriggerSourceMixed ModelsRetriageTriggerSource = "mixed" ModelsRetriageTriggerSourceOther ModelsRetriageTriggerSource = "other" ) + +type ModelsStatusAPIGitBuildProvider struct { + CommitSha string `json:"commitSha"` + Context *string `json:"context,omitempty"` + CreatedAt string `json:"createdAt"` + TargetURL *string `json:"targetUrl,omitempty"` +} diff --git a/internal/api/models/sast.go b/internal/api/models/sast.go index 45d17e6..779ed26 100644 --- a/internal/api/models/sast.go +++ b/internal/api/models/sast.go @@ -3,6 +3,10 @@ package models import "encoding/json" +type EndpointsDeleteTicketSASTFindingOutput struct { + Version *string `json:"version,omitempty"` +} + type EndpointsGetSASTEventsOutput struct { Events []ModelsSASTEventInterface `json:"events,omitempty"` NextToken string `json:"nextToken"` @@ -22,6 +26,7 @@ type EndpointsGetSASTFindingAutofixStatusOutput struct { type EndpointsGetSASTFindingEventsOutput struct { Events []ModelsSASTEventInterface `json:"events,omitempty"` + NextToken *string `json:"nextToken,omitempty"` NumItems int `json:"numItems"` Version *string `json:"version,omitempty"` } @@ -43,8 +48,12 @@ type EndpointsGetSASTFindingOutput struct { type EndpointsGetSASTFindingTriageOutput struct { Finding *ModelsTriagedSASTFinding `json:"finding,omitempty"` + HasCurrentExploitProof *bool `json:"hasCurrentExploitProof,omitempty"` PresignedURL string `json:"presignedUrl"` + StopReason *string `json:"stopReason,omitempty"` + TriageStatus EndpointsFindingTriageStatus `json:"triageStatus"` Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` } type EndpointsGetSASTFindingUsersOutput struct { @@ -115,6 +124,7 @@ type EndpointsPostAutofixSASTFindingInput struct { type EndpointsPostAutofixSASTFindingOutput struct { AutoFixState ModelsAutoFixState `json:"autoFixState"` Error *string `json:"error,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } @@ -135,6 +145,21 @@ type EndpointsPostUnallowlistSASTFindingInput struct { UnallowlistReason string `json:"unallowlistReason"` } +type EndpointsSCAScanRunOutcome struct { + CoverageGaps []ModelsSCAScanCoverageGap `json:"coverageGaps,omitempty"` + Degraded *bool `json:"degraded,omitempty"` + FailureStage *string `json:"failureStage,omitempty"` + KeptLiveCoverage *int `json:"keptLiveCoverage,omitempty"` + KeptLiveNotSeenInSbom *int `json:"keptLiveNotSeenInSbom,omitempty"` + KeptLivePackageGate *int `json:"keptLivePackageGate,omitempty"` + KeptLiveUnchangedManifests *int `json:"keptLiveUnchangedManifests,omitempty"` + SbomAuthoritative *bool `json:"sbomAuthoritative,omitempty"` + SbomFailureClass *string `json:"sbomFailureClass,omitempty"` + SbomIncomplete *bool `json:"sbomIncomplete,omitempty"` + SbomSource *string `json:"sbomSource,omitempty"` + TicketsReopenSkipped *int `json:"ticketsReopenSkipped,omitempty"` +} + type EndpointsScanRunSummary struct { AllowlistedFindingsCount *int `json:"allowlistedFindingsCount,omitempty"` Branch *string `json:"branch,omitempty"` @@ -146,6 +171,7 @@ type EndpointsScanRunSummary struct { LiveFindingsCount *int `json:"liveFindingsCount,omitempty"` NewFindingsCount *int `json:"newFindingsCount,omitempty"` ReintroducedFindingsCount *int `json:"reintroducedFindingsCount,omitempty"` + ScaOutcome *EndpointsSCAScanRunOutcome `json:"scaOutcome,omitempty"` ScanCompletedAt *string `json:"scanCompletedAt,omitempty"` ScanRunID *string `json:"scanRunId,omitempty"` SeverityCritical *int `json:"severityCritical,omitempty"` @@ -213,10 +239,12 @@ type ModelsSASTFinding struct { ConcurrencyLimit *int `json:"concurrencyLimit,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` Cwe *int `json:"cwe,omitempty"` + CweIds []int `json:"cweIds,omitempty"` DeletedAt *string `json:"deletedAt,omitempty"` Description *string `json:"description,omitempty"` DevDescription *string `json:"devDescription,omitempty"` EndLine *int `json:"endLine,omitempty"` + EndLines []int `json:"endLines,omitempty"` Entrypoint *string `json:"entrypoint,omitempty"` ExploitabilityConfidence *string `json:"exploitabilityConfidence,omitempty"` ExploitabilityLabel *string `json:"exploitabilityLabel,omitempty"` @@ -225,6 +253,7 @@ type ModelsSASTFinding struct { FilePath *string `json:"filePath,omitempty"` FirstSeenCommit *string `json:"firstSeenCommit,omitempty"` FixCommit *string `json:"fixCommit,omitempty"` + FixEvidence *ModelsFixEvidence `json:"fixEvidence,omitempty"` FixSource *ModelsFixSource `json:"fixSource,omitempty"` FixedAt *string `json:"fixedAt,omitempty"` GraphExists *bool `json:"graphExists,omitempty"` @@ -238,6 +267,7 @@ type ModelsSASTFinding struct { IsCloudTriaged *bool `json:"isCloudTriaged,omitempty"` IsFalsePositive *bool `json:"isFalsePositive,omitempty"` IsFixed *bool `json:"isFixed,omitempty"` + IsInternetReachable *bool `json:"isInternetReachable,omitempty"` IsLatest *bool `json:"isLatest,omitempty"` IsResolved bool `json:"isResolved"` Language *LanguageCodeLanguage `json:"language,omitempty"` @@ -252,17 +282,30 @@ type ModelsSASTFinding struct { ProjectName *string `json:"projectName,omitempty"` PullRequestsAllowlist []ModelsPullRequestInfo `json:"pullRequestsAllowlist,omitempty"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` + PureInsertion *bool `json:"pureInsertion,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryID *string `json:"repositoryId,omitempty"` ResolvedAt *string `json:"resolvedAt,omitempty"` + RuleConfidence *float64 `json:"ruleConfidence,omitempty"` + RuleConfidenceLabel *string `json:"ruleConfidenceLabel,omitempty"` + RuleHash *string `json:"ruleHash,omitempty"` RuleID *string `json:"ruleId,omitempty"` + RuleIds []string `json:"ruleIds,omitempty"` + RuleImpact *float64 `json:"ruleImpact,omitempty"` + RuleImpactLabel *string `json:"ruleImpactLabel,omitempty"` + RuleLikelihood *float64 `json:"ruleLikelihood,omitempty"` + RuleLikelihoodLabel *string `json:"ruleLikelihoodLabel,omitempty"` + RuleSeverity *float64 `json:"ruleSeverity,omitempty"` + RuleSeverityLabel *string `json:"ruleSeverityLabel,omitempty"` RuleURL *string `json:"ruleUrl,omitempty"` + RuleUrls []string `json:"ruleUrls,omitempty"` Severity *ModelsSeverity `json:"severity,omitempty"` SeverityConfidence *string `json:"severityConfidence,omitempty"` SeverityLabel *ModelsSeverity `json:"severityLabel,omitempty"` SeverityOverride *ModelsSeverity `json:"severityOverride,omitempty"` SeverityScore *int `json:"severityScore,omitempty"` StartLine *int `json:"startLine,omitempty"` + StartLines []int `json:"startLines,omitempty"` TenantID *string `json:"tenantId,omitempty"` Ticket *ModelsTicketProvider `json:"ticket,omitempty"` TicketState *string `json:"ticketState,omitempty"` @@ -270,11 +313,10 @@ type ModelsSASTFinding struct { TriageAgentVersion *string `json:"triageAgentVersion,omitempty"` TriageDurationSeconds int `json:"triageDurationSeconds"` TriageEnd *string `json:"triageEnd,omitempty"` - TriageLangfuseSessionID *string `json:"triageLangfuseSessionId,omitempty"` - TriageLangfuseTraceID *string `json:"triageLangfuseTraceId,omitempty"` TriageLlmCostUsd *float64 `json:"triageLlmCostUsd,omitempty"` TriageMaxInputTokens *int `json:"triageMaxInputTokens,omitempty"` TriageStart *string `json:"triageStart,omitempty"` + TriageStopReason *string `json:"triageStopReason,omitempty"` TriageTokenCount *int `json:"triageTokenCount,omitempty"` TriageTraceID *string `json:"triageTraceId,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` @@ -297,7 +339,9 @@ type ModelsSASTFindingPreview struct { CommitHash string `json:"commitHash"` CreatedAt string `json:"createdAt"` Cwe int `json:"cwe"` + CweIds []int `json:"cweIds,omitempty"` EndLine int `json:"endLine"` + EndLines []int `json:"endLines,omitempty"` Entrypoint string `json:"entrypoint"` FileOwners []ModelsFileOwner `json:"fileOwners,omitempty"` FilePath string `json:"filePath"` @@ -306,6 +350,7 @@ type ModelsSASTFindingPreview struct { ID string `json:"id"` IsAllowlisted bool `json:"isAllowlisted"` IsArchived bool `json:"isArchived"` + IsAutoFixable *bool `json:"isAutoFixable,omitempty"` IsCloudTriaged bool `json:"isCloudTriaged"` IsFalsePositive bool `json:"isFalsePositive"` IsLatest bool `json:"isLatest"` @@ -322,9 +367,12 @@ type ModelsSASTFindingPreview struct { Repository string `json:"repository"` RepositoryID string `json:"repositoryId"` RuleID string `json:"ruleId"` + RuleIds []string `json:"ruleIds,omitempty"` RuleURL string `json:"ruleUrl"` + RuleUrls []string `json:"ruleUrls,omitempty"` Severity ModelsSeverity `json:"severity"` StartLine int `json:"startLine"` + StartLines []int `json:"startLines,omitempty"` TenantID string `json:"tenantId"` Ticket *ModelsTicketProvider `json:"ticket,omitempty"` Title string `json:"title"` @@ -334,10 +382,30 @@ type ModelsSASTFindingPreview struct { Workflow string `json:"workflow"` } +type ModelsSCAScanCoverageGap struct { + Ecosystems []string `json:"ecosystems,omitempty"` + PackageAuth []ModelsSBOMPackageAuth `json:"packageAuth,omitempty"` + Reason *string `json:"reason,omitempty"` + Scope *string `json:"scope,omitempty"` + Side *string `json:"side,omitempty"` + Source *string `json:"source,omitempty"` + Status *string `json:"status,omitempty"` + Suspect *ModelsSCASuspectSBOM `json:"suspect,omitempty"` + TouchedByChange *bool `json:"touchedByChange,omitempty"` +} + +type ModelsSCASuspectSBOM struct { + FirstSeen *string `json:"firstSeen,omitempty"` + Loss *string `json:"loss,omitempty"` + Sha256 *string `json:"sha256,omitempty"` + Version *int `json:"version,omitempty"` +} + type ModelsTriagedSASTFinding struct { AgentVersion string `json:"agentVersion"` AssessmentFactors []ModelsAssessmentFactor `json:"assessmentFactors,omitempty"` CodeContext *ModelsCodeContext `json:"codeContext,omitempty"` + ExploitEvidence []ModelsExploitEvidenceAttachment `json:"exploitEvidence,omitempty"` FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` Finding *ModelsSASTFinding `json:"finding,omitempty"` FixStoryPointEstimate *int `json:"fixStoryPointEstimate,omitempty"` diff --git a/internal/api/models/sca.go b/internal/api/models/sca.go index 9efc951..d7c55d9 100644 --- a/internal/api/models/sca.go +++ b/internal/api/models/sca.go @@ -3,6 +3,10 @@ package models import "encoding/json" +type EndpointsDeleteTicketSCAFindingOutput struct { + Version *string `json:"version,omitempty"` +} + type EndpointsGetSCAContainerFindingAutofixStateOutput struct { Status EndpointsAutofixStatusOutput `json:"status"` Version *string `json:"version,omitempty"` @@ -15,6 +19,7 @@ type EndpointsGetSCAContainerFindingAutofixStatusOutput struct { type EndpointsGetSCAContainerFindingEventsOutput struct { Events []ModelsSCAEventInterface `json:"events,omitempty"` + NextToken *string `json:"nextToken,omitempty"` NumItems int `json:"numItems"` Version *string `json:"version,omitempty"` } @@ -26,8 +31,13 @@ type EndpointsGetSCAContainerFindingOutput struct { type EndpointsGetSCAContainerFindingTriageOutput struct { Finding *ModelsTriagedContainerFinding `json:"finding,omitempty"` + HistoricalReportURL *string `json:"historicalReportUrl,omitempty"` PresignedURL string `json:"presignedUrl"` + StopReason *string `json:"stopReason,omitempty"` + SupportAssessment *ModelsAssessment `json:"supportAssessment,omitempty"` + TriageStatus EndpointsFindingTriageStatus `json:"triageStatus"` Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` } type EndpointsGetSCAContainerFindingUsersOutput struct { @@ -61,11 +71,13 @@ type EndpointsGetSCADependencyFindingAutofixStatusOutput struct { type EndpointsGetSCADependencyFindingEventsOutput struct { Events []ModelsSCAEventInterface `json:"events,omitempty"` + NextToken *string `json:"nextToken,omitempty"` NumItems int `json:"numItems"` Version *string `json:"version,omitempty"` } type EndpointsGetSCADependencyFindingFixOutput struct { + Commit *string `json:"commit,omitempty"` Diffs []ModelsDiffFile `json:"diffs,omitempty"` Explanation *string `json:"explanation,omitempty"` PullRequestBody *string `json:"pullRequestBody,omitempty"` @@ -80,11 +92,20 @@ type EndpointsGetSCADependencyFindingOutput struct { type EndpointsGetSCADependencyFindingTriageOutput struct { Finding *ModelsTriagedDependencyFinding `json:"finding,omitempty"` + HasCurrentExploitProof *bool `json:"hasCurrentExploitProof,omitempty"` + HistoricalReportURL *string `json:"historicalReportUrl,omitempty"` PresignedURL string `json:"presignedUrl"` + StopReason *string `json:"stopReason,omitempty"` + SupportAssessment *ModelsAssessment `json:"supportAssessment,omitempty"` + TriageStatus EndpointsFindingTriageStatus `json:"triageStatus"` Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` } type EndpointsGetSCADependencyFindingUsersOutput struct { + SourceOwner *ModelsCandidate `json:"sourceOwner,omitempty"` + SourceOwnerCommitSha *string `json:"sourceOwnerCommitSha,omitempty"` + SourceOwnerStatus *string `json:"sourceOwnerStatus,omitempty"` Users []ModelsCandidate `json:"users,omitempty"` Version *string `json:"version,omitempty"` } @@ -122,9 +143,44 @@ type EndpointsGetSCARepositoryOutput struct { Version *string `json:"version,omitempty"` } -type EndpointsGetSCARepositorySBOMOutput struct { - Sbom ModelsCDXGen `json:"sbom"` - Version *string `json:"version,omitempty"` +type EndpointsGetSCAThreatFeedOutput struct { + NextOffset *int `json:"nextOffset,omitempty"` + Threats []EndpointsSCAThreatFeedEntry `json:"threats,omitempty"` +} + +type EndpointsGetSCAThreatFeedThreatOutput struct { + Threat EndpointsSCAThreatFeedThreat `json:"threat"` +} + +type EndpointsGetSCAVulnerabilitiesOutput struct { + EvaluatedAt *string `json:"evaluatedAt,omitempty"` + KevOverlayApplied bool `json:"kevOverlayApplied"` + NextOffset *int `json:"nextOffset,omitempty"` + RepositoriesInScope bool `json:"repositoriesInScope"` + ReviewedRepositoryCount int `json:"reviewedRepositoryCount"` + TotalCount int `json:"totalCount"` + Vulnerabilities []EndpointsSCAVulnerabilityFleetEntry `json:"vulnerabilities,omitempty"` +} + +type EndpointsGetSCAVulnerabilityFindingsOutput struct { + ContainerFindings []ModelsSCAContainerfileFindingPreview `json:"containerFindings,omitempty"` + DependencyFindings []ModelsSCADependencyFindingPreview `json:"dependencyFindings,omitempty"` + NextOffset *int `json:"nextOffset,omitempty"` +} + +type EndpointsGetSCAVulnerabilityOutput struct { + CveID string `json:"cveId"` + Exposure EndpointsSCAVulnerabilityExposure `json:"exposure"` + Intel *EndpointsSCAVulnerabilityIntel `json:"intel,omitempty"` +} + +type EndpointsGetSCAVulnerabilityPackagesOutput struct { + Packages []EndpointsSCAVulnerabilityPackage `json:"packages,omitempty"` +} + +type EndpointsGetTriageActivityLogOutput struct { + Entries []EndpointsTriageActivityLogEntry `json:"entries,omitempty"` + NextCursor *string `json:"nextCursor,omitempty"` } type EndpointsPatchSCAContainerFindingInput struct { @@ -157,6 +213,14 @@ type EndpointsPostAllowlistSCADependencyFindingInput struct { AllowlistType ModelsAllowlistType `json:"allowlistType"` } +type EndpointsPostCreateTicketContainerFindingInput struct { + Assignees []ModelsUser `json:"assignees,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + CampaignTitle *string `json:"campaignTitle,omitempty"` + Message *string `json:"message,omitempty"` + Project *string `json:"project,omitempty"` +} + type EndpointsPostCreateTicketDependencyFindingInput struct { Assignees []ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` @@ -180,6 +244,7 @@ type EndpointsPostSCAContainerFindingFixInput struct { type EndpointsPostSCAContainerFindingFixOutput struct { AutoFixState ModelsAutoFixState `json:"autoFixState"` Error *string `json:"error,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } @@ -193,6 +258,7 @@ type EndpointsPostSCADependencyFindingFixInput struct { type EndpointsPostSCADependencyFindingFixOutput struct { AutoFixState ModelsAutoFixState `json:"autoFixState"` Error *string `json:"error,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } @@ -204,15 +270,194 @@ type EndpointsPostUnallowlistSCADependencyFindingInput struct { UnallowlistReason string `json:"unallowlistReason"` } +type EndpointsSCAThreatFeedAffectedPackage struct { + AffectedRange *string `json:"affectedRange,omitempty"` + Ecosystem string `json:"ecosystem"` + Name string `json:"name"` +} + +type EndpointsSCAThreatFeedEntry struct { + CreatedAt string `json:"createdAt"` + CveIds []string `json:"cveIds,omitempty"` + Cvss *float64 `json:"cvss,omitempty"` + DiscoveredAt *string `json:"discoveredAt,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + ID string `json:"id"` + Severity string `json:"severity"` + Title string `json:"title"` +} + +type EndpointsSCAThreatFeedThreat struct { + AffectedPackages []EndpointsSCAThreatFeedAffectedPackage `json:"affectedPackages,omitempty"` + ArticleLinks []string `json:"articleLinks,omitempty"` + CreatedAt string `json:"createdAt"` + CveIds []string `json:"cveIds,omitempty"` + Cvss *float64 `json:"cvss,omitempty"` + Description *string `json:"description,omitempty"` + DiscoveredAt *string `json:"discoveredAt,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + ID string `json:"id"` + Severity string `json:"severity"` + Title string `json:"title"` +} + +type EndpointsSCAVulnerabilityCVSS struct { + BaseScore float64 `json:"baseScore"` + ExploitabilityScore *float64 `json:"exploitabilityScore,omitempty"` + ImpactScore *float64 `json:"impactScore,omitempty"` + VectorString string `json:"vectorString"` + Version string `json:"version"` +} + +type EndpointsSCAVulnerabilityDataSource string + +const ( + EndpointsSCAVulnerabilityDataSourceNvdMirror EndpointsSCAVulnerabilityDataSource = "nvd_mirror" + EndpointsSCAVulnerabilityDataSourceVulnDatabase EndpointsSCAVulnerabilityDataSource = "vuln_database" + EndpointsSCAVulnerabilityDataSourceFindingSnapshot EndpointsSCAVulnerabilityDataSource = "finding_snapshot" + EndpointsSCAVulnerabilityDataSourceEpssLive EndpointsSCAVulnerabilityDataSource = "epss_live" +) + +type EndpointsSCAVulnerabilityEPSS struct { + Percentile *float64 `json:"percentile,omitempty"` + Score float64 `json:"score"` + ScoredAt *string `json:"scoredAt,omitempty"` + Source EndpointsSCAVulnerabilityDataSource `json:"source"` +} + +type EndpointsSCAVulnerabilityExposure struct { + ContainerFindingCount int `json:"containerFindingCount"` + DependencyFindingCount int `json:"dependencyFindingCount"` + EvaluatedAt *string `json:"evaluatedAt,omitempty"` + FindingCount int `json:"findingCount"` + FirstSeenAt *string `json:"firstSeenAt,omitempty"` + FixableCount int `json:"fixableCount"` + Kev bool `json:"kev"` + KevUnknown *bool `json:"kevUnknown,omitempty"` + MaxCvss *float64 `json:"maxCvss,omitempty"` + MaxEpss *float64 `json:"maxEpss,omitempty"` + MaxSeverity *ModelsSeverity `json:"maxSeverity,omitempty"` + OpenFindingCount int `json:"openFindingCount"` + PackageCount int `json:"packageCount"` + ReachableCount int `json:"reachableCount"` + RepositoryCount int `json:"repositoryCount"` + ResolvedFindingCount int `json:"resolvedFindingCount"` + ReviewedRepositoryCount int `json:"reviewedRepositoryCount"` + TotalRepositoryCount int `json:"totalRepositoryCount"` + Verdict EndpointsSCAVulnerabilityVerdict `json:"verdict"` +} + +type EndpointsSCAVulnerabilityFleetEntry struct { + CveID string `json:"cveId"` + FindingCount int `json:"findingCount"` + FirstSeenAt *string `json:"firstSeenAt,omitempty"` + HasFix bool `json:"hasFix"` + Kev bool `json:"kev"` + KevUnknown *bool `json:"kevUnknown,omitempty"` + MaxCvss *float64 `json:"maxCvss,omitempty"` + MaxEpss *float64 `json:"maxEpss,omitempty"` + MaxSeverity *ModelsSeverity `json:"maxSeverity,omitempty"` + OpenFindingCount int `json:"openFindingCount"` + PackageCount int `json:"packageCount"` + ReachableCount int `json:"reachableCount"` + RepositoryCount int `json:"repositoryCount"` + Title *string `json:"title,omitempty"` +} + +type EndpointsSCAVulnerabilityIntel struct { + Cvss []EndpointsSCAVulnerabilityCVSS `json:"cvss,omitempty"` + Cwes []string `json:"cwes,omitempty"` + Description *string `json:"description,omitempty"` + Epss *EndpointsSCAVulnerabilityEPSS `json:"epss,omitempty"` + Kev *EndpointsSCAVulnerabilityKEV `json:"kev,omitempty"` + ModifiedAt *string `json:"modifiedAt,omitempty"` + PublishedAt *string `json:"publishedAt,omitempty"` + References []EndpointsSCAVulnerabilityReference `json:"references,omitempty"` + Source EndpointsSCAVulnerabilityDataSource `json:"source"` + Title *string `json:"title,omitempty"` +} + +type EndpointsSCAVulnerabilityKEV struct { + DateAdded string `json:"dateAdded"` + DueDate *string `json:"dueDate,omitempty"` + KnownRansomwareUse bool `json:"knownRansomwareUse"` + Product *string `json:"product,omitempty"` + RequiredAction *string `json:"requiredAction,omitempty"` + VendorProject *string `json:"vendorProject,omitempty"` + VulnerabilityName *string `json:"vulnerabilityName,omitempty"` +} + +type EndpointsSCAVulnerabilityPackage struct { + Ecosystem *string `json:"ecosystem,omitempty"` + FindingCount int `json:"findingCount"` + FixedVersions []string `json:"fixedVersions,omitempty"` + Name string `json:"name"` + RepositoryCount int `json:"repositoryCount"` + Type EndpointsSCAVulnerabilityPackageType `json:"type"` + Versions []string `json:"versions,omitempty"` +} + +type EndpointsSCAVulnerabilityPackageType string + +const ( + EndpointsSCAVulnerabilityPackageTypeDependency EndpointsSCAVulnerabilityPackageType = "dependency" + EndpointsSCAVulnerabilityPackageTypeContainerArtifact EndpointsSCAVulnerabilityPackageType = "container_artifact" +) + +type EndpointsSCAVulnerabilityReference struct { + Tags []string `json:"tags,omitempty"` + URL string `json:"url"` +} + +type EndpointsSCAVulnerabilityVerdict string + +const ( + EndpointsSCAVulnerabilityVerdictAffected EndpointsSCAVulnerabilityVerdict = "affected" + EndpointsSCAVulnerabilityVerdictRemediated EndpointsSCAVulnerabilityVerdict = "remediated" + EndpointsSCAVulnerabilityVerdictNoExposureFound EndpointsSCAVulnerabilityVerdict = "no_exposure_found" + EndpointsSCAVulnerabilityVerdictUnknown EndpointsSCAVulnerabilityVerdict = "unknown" +) + +type EndpointsTriageActivityLogEntry struct { + Content *string `json:"content,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + EventType *string `json:"eventType,omitempty"` + ID *string `json:"id,omitempty"` + Metadata *string `json:"metadata,omitempty"` +} + +type EndpointsTriageStatusOutput struct { + CurrentActivity *string `json:"currentActivity,omitempty"` + CurrentPhase *string `json:"currentPhase,omitempty"` + LastActivityAt *string `json:"lastActivityAt,omitempty"` + Status *string `json:"status,omitempty"` + Terminal *bool `json:"terminal,omitempty"` +} + +type ModelsAssessment struct { + Complete *bool `json:"complete,omitempty"` + ContainerCoverage *ModelsTriageContainerAssessment `json:"containerCoverage,omitempty"` + ExecutionFailed *bool `json:"executionFailed,omitempty"` + Recovery *string `json:"recovery,omitempty"` + ReportedUnknowns []string `json:"reportedUnknowns,omitempty"` + RequiredEvidence []string `json:"requiredEvidence,omitempty"` +} + type ModelsCVE struct { CisaKev bool `json:"cisaKev"` + CisaKevUnknown *bool `json:"cisaKevUnknown,omitempty"` Cvss float64 `json:"cvss"` Epss float64 `json:"epss"` EpssPercentile float64 `json:"epssPercentile"` + EpssUnknown *bool `json:"epssUnknown,omitempty"` ExploitabilityScore float64 `json:"exploitabilityScore"` ID string `json:"id"` ImpactScore float64 `json:"impactScore"` OsvReachability ModelsOSVReachability `json:"osvReachability"` + PriorTriageConfidence *float64 `json:"priorTriageConfidence,omitempty"` + PriorTriageExploitability *float64 `json:"priorTriageExploitability,omitempty"` + PriorTriageImpact *float64 `json:"priorTriageImpact,omitempty"` + PriorTriageSeverity *float64 `json:"priorTriageSeverity,omitempty"` Priority ModelsPriorityLabel `json:"priority"` ReachabilityConfidence *ModelsCVEReachConfidence `json:"reachabilityConfidence,omitempty"` ReachabilityEvidence *string `json:"reachabilityEvidence,omitempty"` @@ -224,15 +469,22 @@ type ModelsCVE struct { } type ModelsCVEDigest struct { + Aliases []string `json:"aliases,omitempty"` Cvss *float64 `json:"cvss,omitempty"` + Details *string `json:"details,omitempty"` EpssPct *float64 `json:"epss_pct,omitempty"` FixVersions []string `json:"fix_versions,omitempty"` HasFix *bool `json:"has_fix,omitempty"` ID *string `json:"id,omitempty"` Kev *bool `json:"kev,omitempty"` + KevUnknown *bool `json:"kev_unknown,omitempty"` + Malicious *bool `json:"malicious,omitempty"` + OsvAnalysed *bool `json:"osv_analysed,omitempty"` + OsvCalled *bool `json:"osv_called,omitempty"` PublishedAt *string `json:"published_at,omitempty"` Severity *ModelsSeverity `json:"severity,omitempty"` Title *string `json:"title,omitempty"` + VulnerableImports []ModelsVulnerableImport `json:"vulnerable_imports,omitempty"` } type ModelsCVEReachConfidence string @@ -250,6 +502,8 @@ const ( ModelsCVEReachMethodSymbolGrep ModelsCVEReachMethod = "symbol_grep" ModelsCVEReachMethodPackageOnly ModelsCVEReachMethod = "package_only" ModelsCVEReachMethodAiJudgment ModelsCVEReachMethod = "ai_judgment" + ModelsCVEReachMethodBuildStageExcluded ModelsCVEReachMethod = "build_stage_excluded" + ModelsCVEReachMethodOsvCallAnalysis ModelsCVEReachMethod = "osv_call_analysis" ) type ModelsCallSite struct { @@ -258,6 +512,24 @@ type ModelsCallSite struct { Symbol *string `json:"symbol,omitempty"` } +type ModelsContainerTriageTruncation struct { + OmittedPackageCves *int `json:"omittedPackageCves,omitempty"` + OmittedSuggestionVulnerabilities *int `json:"omittedSuggestionVulnerabilities,omitempty"` + OmittedVulnerabilities *int `json:"omittedVulnerabilities,omitempty"` + OmittedVulnerablePackages *int `json:"omittedVulnerablePackages,omitempty"` + Reason string `json:"reason"` +} + +type ModelsDepOrigin string + +const ( + ModelsDepOriginRegistry ModelsDepOrigin = "REGISTRY" + ModelsDepOriginFirstPartyGit ModelsDepOrigin = "FIRST_PARTY_GIT" + ModelsDepOriginForeignGit ModelsDepOrigin = "FOREIGN_GIT" + ModelsDepOriginLocal ModelsDepOrigin = "LOCAL" + ModelsDepOriginUnknown ModelsDepOrigin = "UNKNOWN" +) + type ModelsDepScope string const ( @@ -269,14 +541,18 @@ const ( ) type ModelsDepTreeFacts struct { + BundledBy *string `json:"bundled_by,omitempty"` Depth *int `json:"depth,omitempty"` Direct *bool `json:"direct,omitempty"` ImportPath []string `json:"import_path,omitempty"` + Origin *ModelsDepOrigin `json:"origin,omitempty"` + OriginRef *string `json:"origin_ref,omitempty"` Scope *ModelsDepScope `json:"scope,omitempty"` } type ModelsDisplayCVE struct { CisaKev bool `json:"cisaKev"` + CisaKevUnknown *bool `json:"cisaKevUnknown,omitempty"` Cvss float64 `json:"cvss"` ExploitabilityScore float64 `json:"exploitabilityScore"` ID string `json:"id"` @@ -292,9 +568,11 @@ type ModelsDistro struct { } type ModelsDossier struct { + Coverage *ModelsDossierCoverage `json:"coverage,omitempty"` Cves []ModelsCVEDigest `json:"cves,omitempty"` Deptree *ModelsDepTreeFacts `json:"deptree,omitempty"` EmittedAt *string `json:"emitted_at,omitempty"` + FrameworkProvided []string `json:"framework_provided,omitempty"` InputHash *string `json:"input_hash,omitempty"` Package *string `json:"package,omitempty"` PackageGroupID *string `json:"package_group_id,omitempty"` @@ -316,6 +594,11 @@ const ( ModelsDossierConfidenceAmbiguous ModelsDossierConfidence = "AMBIGUOUS" ) +type ModelsDossierCoverage struct { + Degraded *bool `json:"degraded,omitempty"` + Gaps []string `json:"gaps,omitempty"` +} + type ModelsDossierTier string const ( @@ -336,7 +619,16 @@ type ModelsImageMetadata struct { Tag string `json:"tag"` } +type ModelsInstanceReachabilityEvidence string + +const ( + ModelsInstanceReachabilityEvidenceReachable ModelsInstanceReachabilityEvidence = "reachable" + ModelsInstanceReachabilityEvidenceNotObserved ModelsInstanceReachabilityEvidence = "not_observed" + ModelsInstanceReachabilityEvidenceUnsupported ModelsInstanceReachabilityEvidence = "unsupported" +) + type ModelsOSVReachability struct { + Analysed *bool `json:"analysed,omitempty"` Called bool `json:"called"` } @@ -378,12 +670,14 @@ type ModelsReachMethod string const ( ModelsReachMethodOsv ModelsReachMethod = "OSV" ModelsReachMethodTreesitter ModelsReachMethod = "TREESITTER" + ModelsReachMethodSourceParse ModelsReachMethod = "SOURCE_PARSE" ModelsReachMethodCombined ModelsReachMethod = "COMBINED" ModelsReachMethodUnsupported ModelsReachMethod = "UNSUPPORTED" ModelsReachMethodTimeout ModelsReachMethod = "TIMEOUT" ) type ModelsSCAContainerfileArtifact struct { + Locations []string `json:"locations,omitempty"` Name string `json:"name"` Purl string `json:"purl"` Type string `json:"type"` @@ -413,6 +707,7 @@ type ModelsSCAContainerfileFinding struct { Dossier *ModelsDossier `json:"dossier,omitempty"` ExploitabilityConfidence string `json:"exploitabilityConfidence"` ExploitabilityLabel string `json:"exploitabilityLabel"` + FailedTriage *bool `json:"failedTriage,omitempty"` FileOwners []ModelsFileOwner `json:"fileOwners,omitempty"` FilePath string `json:"filePath"` FirstSeenCommit *string `json:"firstSeenCommit,omitempty"` @@ -424,6 +719,7 @@ type ModelsSCAContainerfileFinding struct { IsAllowlisted bool `json:"isAllowlisted"` IsArchived bool `json:"isArchived"` IsAutoFixableAgentVerdict *bool `json:"isAutoFixableAgentVerdict,omitempty"` + IsCloudTriaged *bool `json:"isCloudTriaged,omitempty"` IsFalsePositive bool `json:"isFalsePositive"` IsLatest bool `json:"isLatest"` IsResolved bool `json:"isResolved"` @@ -438,6 +734,7 @@ type ModelsSCAContainerfileFinding struct { PriorityLabelReason string `json:"priorityLabelReason"` PriorityOverride ModelsPriorityLabel `json:"priorityOverride"` PriorityScore int `json:"priorityScore"` + PrioritySource *ModelsPrioritySource `json:"prioritySource,omitempty"` ProjectID string `json:"projectId"` ProjectName string `json:"projectName"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` @@ -457,9 +754,8 @@ type ModelsSCAContainerfileFinding struct { TriageDurationSeconds int `json:"triageDurationSeconds"` TriageEnd *string `json:"triageEnd,omitempty"` TriageLLMCostUSD float64 `json:"triageLLMCostUSD"` - TriageLangfuseSessionIds []string `json:"triageLangfuseSessionIds,omitempty"` - TriageLangfuseTraceIds []string `json:"triageLangfuseTraceIds,omitempty"` TriageStart *string `json:"triageStart,omitempty"` + TriageStopReason *string `json:"triageStopReason,omitempty"` TriageTraceIds []string `json:"triageTraceIds,omitempty"` UpdatedAt string `json:"updatedAt"` UserNotes string `json:"userNotes"` @@ -481,6 +777,7 @@ type ModelsSCAContainerfileFindingPreview struct { Branch string `json:"branch"` CommitHash string `json:"commitHash"` CreatedAt string `json:"createdAt"` + FailedTriage *bool `json:"failedTriage,omitempty"` FileOwners []ModelsFileOwner `json:"fileOwners,omitempty"` FilePath string `json:"filePath"` ID string `json:"id"` @@ -501,6 +798,7 @@ type ModelsSCAContainerfileFindingPreview struct { PriorityLabel ModelsPriorityLabel `json:"priorityLabel"` PriorityOverride ModelsPriorityLabel `json:"priorityOverride"` PriorityScore int `json:"priorityScore"` + PrioritySource *ModelsPrioritySource `json:"prioritySource,omitempty"` ProjectID string `json:"projectId"` ProjectName string `json:"projectName"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` @@ -554,12 +852,14 @@ type ModelsSCADependencyFinding struct { BudgetUsed *float64 `json:"budgetUsed,omitempty"` CommitHash string `json:"commitHash"` ConcurrencyLimit *int `json:"concurrencyLimit,omitempty"` + CreatePRRequested *bool `json:"createPRRequested,omitempty"` CreatedAt string `json:"createdAt"` Description string `json:"description"` DevDescription string `json:"devDescription"` Dossier *ModelsDossier `json:"dossier,omitempty"` ExploitabilityConfidence string `json:"exploitabilityConfidence"` ExploitabilityLabel string `json:"exploitabilityLabel"` + FailedTriage *bool `json:"failedTriage,omitempty"` FileOwners []ModelsFileOwner `json:"fileOwners,omitempty"` FilePath string `json:"filePath"` FirstSeenCommit *string `json:"firstSeenCommit,omitempty"` @@ -569,6 +869,8 @@ type ModelsSCADependencyFinding struct { ImpactConfidence string `json:"impactConfidence"` ImpactLabel string `json:"impactLabel"` InstallationID string `json:"installationId"` + InstanceAssessments []ModelsSCADependencyInstanceAssessment `json:"instanceAssessments,omitempty"` + Instances []ModelsSCADependencyInstance `json:"instances,omitempty"` IsAllowlisted bool `json:"isAllowlisted"` IsArchived bool `json:"isArchived"` IsAutoFixableAgentVerdict *bool `json:"isAutoFixableAgentVerdict,omitempty"` @@ -578,6 +880,7 @@ type ModelsSCADependencyFinding struct { IsLatest bool `json:"isLatest"` IsReachabilitySupported bool `json:"isReachabilitySupported"` IsResolved bool `json:"isResolved"` + LatestKnownPatchedVersion *string `json:"latestKnownPatchedVersion,omitempty"` Line int `json:"line"` NonAIPriorityLabel ModelsPriorityLabel `json:"nonAIPriorityLabel"` NumCritical int `json:"numCritical"` @@ -588,13 +891,17 @@ type ModelsSCADependencyFinding struct { Owner string `json:"owner"` Package string `json:"package"` PackageFilePath string `json:"packageFilePath"` + PerVersionCVEStatus map[string]map[string]ModelsVersionCVEStatus `json:"perVersionCVEStatus,omitempty"` PriorityLabel ModelsPriorityLabel `json:"priorityLabel"` PriorityLabelReason string `json:"priorityLabelReason"` PriorityOverride ModelsPriorityLabel `json:"priorityOverride"` PriorityScore int `json:"priorityScore"` + PrioritySource *ModelsPrioritySource `json:"prioritySource,omitempty"` ProjectID string `json:"projectId"` + ProjectKey *string `json:"projectKey,omitempty"` ProjectName string `json:"projectName"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` + ReachableSuggestedVersion *string `json:"reachableSuggestedVersion,omitempty"` Repository string `json:"repository"` RepositoryID string `json:"repositoryId"` ResolvedAt *string `json:"resolvedAt,omitempty"` @@ -603,6 +910,7 @@ type ModelsSCADependencyFinding struct { SeverityLabel ModelsSeverity `json:"severityLabel"` SeverityOverride ModelsSeverity `json:"severityOverride"` SeverityScore int `json:"severityScore"` + SourceFilePaths []string `json:"sourceFilePaths,omitempty"` SuggestedVersion string `json:"suggestedVersion"` TenantID string `json:"tenantId"` Ticket *ModelsTicketProvider `json:"ticket,omitempty"` @@ -611,13 +919,13 @@ type ModelsSCADependencyFinding struct { TriageDurationSeconds int `json:"triageDurationSeconds"` TriageEnd *string `json:"triageEnd,omitempty"` TriageLLMCostUSD float64 `json:"triageLLMCostUSD"` - TriageLangfuseSessionIds []string `json:"triageLangfuseSessionIds,omitempty"` - TriageLangfuseTraceIds []string `json:"triageLangfuseTraceIds,omitempty"` TriageStart *string `json:"triageStart,omitempty"` + TriageStopReason *string `json:"triageStopReason,omitempty"` TriageTraceIds []string `json:"triageTraceIds,omitempty"` UpdatedAt string `json:"updatedAt"` UserNotes string `json:"userNotes"` Version string `json:"version"` + Versions []string `json:"versions,omitempty"` Vulnerabilities []ModelsSCADependencyVulnerability `json:"vulnerabilities,omitempty"` VulnerabilitiesCVEIds []string `json:"vulnerabilitiesCVEIds,omitempty"` VulnerabilitiesCWEIds []string `json:"vulnerabilitiesCWEIds,omitempty"` @@ -638,6 +946,7 @@ type ModelsSCADependencyFindingPreview struct { Branch string `json:"branch"` CommitHash string `json:"commitHash"` CreatedAt string `json:"createdAt"` + FailedTriage *bool `json:"failedTriage,omitempty"` FileOwners []ModelsFileOwner `json:"fileOwners,omitempty"` FilePath string `json:"filePath"` FirstSeenCommit *string `json:"firstSeenCommit,omitempty"` @@ -645,6 +954,7 @@ type ModelsSCADependencyFindingPreview struct { HasReachableCVEs bool `json:"hasReachableCVEs"` ID string `json:"id"` InstallationID string `json:"installationId"` + InstanceScope ModelsSCADependencyInstanceScope `json:"instanceScope"` IsAllowlisted bool `json:"isAllowlisted"` IsArchived bool `json:"isArchived"` IsAutoFixable bool `json:"isAutoFixable"` @@ -667,9 +977,11 @@ type ModelsSCADependencyFindingPreview struct { PriorityLabel ModelsPriorityLabel `json:"priorityLabel"` PriorityOverride ModelsPriorityLabel `json:"priorityOverride"` PriorityScore int `json:"priorityScore"` + PrioritySource *ModelsPrioritySource `json:"prioritySource,omitempty"` ProjectID string `json:"projectId"` ProjectName string `json:"projectName"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` + ReachableSuggestedVersion *string `json:"reachableSuggestedVersion,omitempty"` Repository string `json:"repository"` RepositoryID string `json:"repositoryId"` SuggestedVersion string `json:"suggestedVersion"` @@ -680,12 +992,51 @@ type ModelsSCADependencyFindingPreview struct { TriageStart *string `json:"triageStart,omitempty"` UpdatedAt string `json:"updatedAt"` Version string `json:"version"` + Versions []string `json:"versions,omitempty"` VulnerabilitiesCVEIds []string `json:"vulnerabilitiesCVEIds,omitempty"` VulnerabilitiesCWEIds []string `json:"vulnerabilitiesCWEIds,omitempty"` VulnerabilitiesMaxPriority ModelsPriorityLabel `json:"vulnerabilitiesMaxPriority"` VulnerabilitiesMaxSeverity ModelsSeverity `json:"vulnerabilitiesMaxSeverity"` } +type ModelsSCADependencyInstance struct { + FilePath string `json:"filePath"` + HasReachableCVEs bool `json:"hasReachableCVEs"` + IsDirect bool `json:"isDirect"` + IsReachabilitySupported bool `json:"isReachabilitySupported"` + Line *int `json:"line,omitempty"` + PackageFilePath *string `json:"packageFilePath,omitempty"` + Version string `json:"version"` +} + +type ModelsSCADependencyInstanceAssessment struct { + AdvisoryPriority *ModelsPriorityLabel `json:"advisoryPriority,omitempty"` + Affected bool `json:"affected"` + AffectedAdvisoryIds []string `json:"affectedAdvisoryIds,omitempty"` + AffectedCveIds []string `json:"affectedCveIds,omitempty"` + FilePath string `json:"filePath"` + FixVersion *string `json:"fixVersion,omitempty"` + HasReachableCVEs bool `json:"hasReachableCVEs"` + IsDirect bool `json:"isDirect"` + IsReachabilitySupported bool `json:"isReachabilitySupported"` + Line *int `json:"line,omitempty"` + MaxSeverity *ModelsSeverity `json:"maxSeverity,omitempty"` + PackageFilePath *string `json:"packageFilePath,omitempty"` + ReachabilityEvidence ModelsInstanceReachabilityEvidence `json:"reachabilityEvidence"` + Representative bool `json:"representative"` + SupportsPriority bool `json:"supportsPriority"` + Version string `json:"version"` + VersionUnknown *bool `json:"versionUnknown,omitempty"` +} + +type ModelsSCADependencyInstanceScope struct { + Affected int `json:"affected"` + Files int `json:"files"` + Instances int `json:"instances"` + Reachable int `json:"reachable"` + Versions int `json:"versions"` +} + type ModelsSCADependencyVulnerability struct { Cves []ModelsCVE `json:"cves,omitempty"` Cwes []string `json:"cwes,omitempty"` @@ -698,6 +1049,7 @@ type ModelsSCADependencyVulnerability struct { Severity ModelsSeverity `json:"severity"` Title string `json:"title"` Version string `json:"version"` + VulnerableImports []ModelsVulnerableImport `json:"vulnerableImports,omitempty"` } type ModelsSCAEventInterface struct { @@ -714,7 +1066,9 @@ type ModelsSCARepositoryPublic struct { } type ModelsSCAVulnerableContainerPackage struct { + ArtifactType *string `json:"artifactType,omitempty"` Cves []ModelsDisplayCVE `json:"cves,omitempty"` + Locations []string `json:"locations,omitempty"` Name string `json:"name"` Namespace string `json:"namespace"` Purl string `json:"purl"` @@ -725,6 +1079,7 @@ type ModelsSCAVulnerableContainerPackage struct { type ModelsTriagedContainerFinding struct { AgentVersion string `json:"agentVersion"` CodeContext *ModelsCodeContext `json:"codeContext,omitempty"` + DeploymentExposure *string `json:"deploymentExposure,omitempty"` Finding *ModelsSCAContainerfileFinding `json:"finding,omitempty"` FixStoryPointEstimate *int `json:"fixStoryPointEstimate,omitempty"` InvestigationSteps []ModelsInvestigationStep `json:"investigationSteps,omitempty"` @@ -732,11 +1087,15 @@ type ModelsTriagedContainerFinding struct { RepoContextVersion string `json:"repoContextVersion"` Triage *ModelsTriage `json:"triage,omitempty"` TriagedCommitSha string `json:"triagedCommitSha"` + Truncation *ModelsContainerTriageTruncation `json:"truncation,omitempty"` } type ModelsTriagedDependencyFinding struct { AgentVersion string `json:"agentVersion"` + AssessmentFactors []ModelsAssessmentFactor `json:"assessmentFactors,omitempty"` CodeContext *ModelsCodeContext `json:"codeContext,omitempty"` + DeploymentExposure *string `json:"deploymentExposure,omitempty"` + ExploitEvidence []ModelsExploitEvidenceAttachment `json:"exploitEvidence,omitempty"` Finding *ModelsSCADependencyFinding `json:"finding,omitempty"` FixStoryPointEstimate *int `json:"fixStoryPointEstimate,omitempty"` InvestigationSteps []ModelsInvestigationStep `json:"investigationSteps,omitempty"` @@ -745,3 +1104,14 @@ type ModelsTriagedDependencyFinding struct { Triage *ModelsTriage `json:"triage,omitempty"` TriagedCommitSha string `json:"triagedCommitSha"` } + +type ModelsVersionCVEStatus struct { + FixedVersion *string `json:"fixedVersion,omitempty"` + Introduced *string `json:"introduced,omitempty"` + Vulnerable bool `json:"vulnerable"` +} + +type ModelsVulnerableImport struct { + Path *string `json:"path,omitempty"` + Symbols []string `json:"symbols,omitempty"` +} diff --git a/internal/api/models/scpm.go b/internal/api/models/scpm.go index 9cd4d29..1c91b02 100644 --- a/internal/api/models/scpm.go +++ b/internal/api/models/scpm.go @@ -3,17 +3,6 @@ package models import "encoding/json" -type DependenciesDependencyUsage struct { - IsPinned *bool `json:"isPinned,omitempty"` - Name *string `json:"name,omitempty"` - Platform *string `json:"platform,omitempty"` - RepositoryID *string `json:"repositoryId,omitempty"` - StepName *string `json:"stepName,omitempty"` - TenantID *string `json:"tenantId,omitempty"` - VersionRef *string `json:"versionRef,omitempty"` - WorkflowFile *string `json:"workflowFile,omitempty"` -} - type EndpointsAnalyzeContainerInput struct { IdempotencyKey *string `json:"idempotencyKey,omitempty"` PreviousReference *string `json:"previousReference,omitempty"` @@ -51,21 +40,39 @@ type EndpointsBatchQueryDependenciesInput struct { } type EndpointsBatchQueryDependenciesOutput struct { + IntegrityBudgetExhausted *bool `json:"integrityBudgetExhausted,omitempty"` Results []EndpointsBatchQueryDependencyResult `json:"results,omitempty"` Version *string `json:"version,omitempty"` } type EndpointsBatchQueryDependencyPackage struct { Ecosystem string `json:"ecosystem"` + Integrity *string `json:"integrity,omitempty"` Name string `json:"name"` + Provenance *string `json:"provenance,omitempty"` + RegistryHost *string `json:"registryHost,omitempty"` + ResolvedURL *string `json:"resolvedUrl,omitempty"` Version string `json:"version"` } type EndpointsBatchQueryDependencyResult struct { + AdvisoriesUnavailable *bool `json:"advisoriesUnavailable,omitempty"` + AllowlistExpiresAt *string `json:"allowlistExpiresAt,omitempty"` + AllowlistReason *string `json:"allowlistReason,omitempty"` + Allowlisted *bool `json:"allowlisted,omitempty"` + AnalysisStatus *string `json:"analysisStatus,omitempty"` Ecosystem *string `json:"ecosystem,omitempty"` + Found *bool `json:"found,omitempty"` + IdentityMismatch *bool `json:"identityMismatch,omitempty"` + IdentityMismatchReason *string `json:"identityMismatchReason,omitempty"` + IntegrityUnchecked *bool `json:"integrityUnchecked,omitempty"` + IntegrityUncheckedReason *string `json:"integrityUncheckedReason,omitempty"` + IntegrityVerified *bool `json:"integrityVerified,omitempty"` IsMalicious *bool `json:"isMalicious,omitempty"` MalwareVerdict *string `json:"malwareVerdict,omitempty"` Name *string `json:"name,omitempty"` + ProvenanceMissing *bool `json:"provenanceMissing,omitempty"` + ProvenanceVerified *bool `json:"provenanceVerified,omitempty"` Version *string `json:"version,omitempty"` Vulnerabilities []EndpointsBatchQueryVulnInfo `json:"vulnerabilities,omitempty"` } @@ -81,14 +88,13 @@ type EndpointsBatchQueryVulnInfo struct { Summary *string `json:"summary,omitempty"` } -type EndpointsGetDependenciesOutput struct { - Dependencies []DependenciesDependencyUsage `json:"dependencies,omitempty"` - NumItems *int `json:"numItems,omitempty"` +type EndpointsDeleteTicketSCPMFindingOutput struct { Version *string `json:"version,omitempty"` } type EndpointsGetSCPMEventsOutput struct { Events []ModelsSCPMEventInterface `json:"events,omitempty"` + NextToken string `json:"nextToken"` NumItems int `json:"numItems"` Version *string `json:"version,omitempty"` } @@ -105,21 +111,14 @@ type EndpointsGetSCPMFindingAutofixStatusOutput struct { type EndpointsGetSCPMFindingEventsOutput struct { Events []ModelsSCPMEventInterface `json:"events,omitempty"` + NextToken *string `json:"nextToken,omitempty"` NumItems int `json:"numItems"` Version *string `json:"version,omitempty"` } -type EndpointsGetSCPMFindingFixOutput struct { - Commit string `json:"commit"` - Diffs []ModelsDiffFile `json:"diffs,omitempty"` - Explanation string `json:"explanation"` - PullRequestBody string `json:"pullRequestBody"` - PullRequestTitle string `json:"pullRequestTitle"` - Version *string `json:"version,omitempty"` -} - type EndpointsGetSCPMFindingOutput struct { Finding ModelsSCPMFinding `json:"finding"` + Movements []ModelsSCPMFindingMovement `json:"movements,omitempty"` PresignedURL string `json:"presignedUrl"` Version *string `json:"version,omitempty"` } @@ -128,12 +127,20 @@ type EndpointsGetSCPMFindingTriageOutput struct { Finding *ModelsTriagedSCPMFinding `json:"finding,omitempty"` PresignedURL string `json:"presignedUrl"` Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` +} + +type EndpointsGetSCPMFindingUsersOutput struct { + Users []ModelsCandidate `json:"users,omitempty"` + Version *string `json:"version,omitempty"` } type EndpointsGetSCPMFindingsDetailedOutput struct { + CooldownWarnOnly *bool `json:"cooldownWarnOnly,omitempty"` Findings []ModelsSCPMFinding `json:"findings,omitempty"` NextToken string `json:"nextToken"` NumItems int `json:"numItems"` + ScannedBaseline *bool `json:"scannedBaseline,omitempty"` Version *string `json:"version,omitempty"` } @@ -144,9 +151,28 @@ type EndpointsGetSCPMFindingsOutput struct { Version *string `json:"version,omitempty"` } +type EndpointsGetSCPMRepositoriesOutput struct { + NextToken string `json:"nextToken"` + NumItems int `json:"numItems"` + Repositories map[string]ModelsRepositoryPublic `json:"repositories,omitempty"` + Version *string `json:"version,omitempty"` +} + +type EndpointsGetSCPMSettingsOutput struct { + AcceptedLicenses []string `json:"acceptedLicenses,omitempty"` + CooldownDays int `json:"cooldownDays"` + CooldownEnabled bool `json:"cooldownEnabled"` + CooldownOverrides map[string]int `json:"cooldownOverrides,omitempty"` + CooldownWarnOnly bool `json:"cooldownWarnOnly"` + PackageAllowlist []ModelsSCPMPackageAllowlistEntry `json:"packageAllowlist,omitempty"` + Version *string `json:"version,omitempty"` +} + type EndpointsPatchSCPMFindingInput struct { + IsFalsePositive *bool `json:"isFalsePositive,omitempty"` PriorityOverride *ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *ModelsSeverity `json:"severityOverride,omitempty"` + UserNotes *string `json:"userNotes,omitempty"` } type EndpointsPatchSCPMFindingOutput struct { @@ -181,20 +207,21 @@ type EndpointsPostAutofixSCPMFindingInput struct { type EndpointsPostAutofixSCPMFindingOutput struct { AutoFixState ModelsAutoFixState `json:"autoFixState"` Error *string `json:"error,omitempty"` + RunID *string `json:"runId,omitempty"` Version *string `json:"version,omitempty"` } -type EndpointsPostCacheAutofixSCPMFindingInput struct { - Force *bool `json:"force,omitempty"` -} - -type EndpointsPostCreatePullRequestSCPMFindingInput struct { +type EndpointsPostCreateTicketSCPMFindingInput struct { + Assignees []ModelsUser `json:"assignees,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + CampaignTitle *string `json:"campaignTitle,omitempty"` Message *string `json:"message,omitempty"` + Project *string `json:"project,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` } -type EndpointsPostCreatePullRequestSCPMFindingOutput struct { - AutoFixState ModelsAutoFixState `json:"autoFixState"` - Error *string `json:"error,omitempty"` +type EndpointsPostCreateTicketSCPMFindingOutput struct { + Ticket ModelsTicketProvider `json:"ticket"` Version *string `json:"version,omitempty"` } @@ -207,24 +234,31 @@ type EndpointsPostGetUploadSCPMFindingsURLOutput struct { Version *string `json:"version,omitempty"` } -type EndpointsPostRetriageSCPMFindingsInput struct { - Branch *string `json:"branch,omitempty"` - ContinueOnError *bool `json:"continueOnError,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - ForceRetriage *bool `json:"forceRetriage,omitempty"` - PriorityMinimum *string `json:"priorityMinimum,omitempty"` - RepositoryIds []string `json:"repositoryIds,omitempty"` - ReprocessFailedTriages *bool `json:"reprocessFailedTriages,omitempty"` - ReprocessFalsePositives *bool `json:"reprocessFalsePositives,omitempty"` +type EndpointsPostUnallowlistSCPMFindingInput struct { + UnallowlistReason string `json:"unallowlistReason"` } -type EndpointsPostRetriageSCPMFindingsOutput struct { - Message string `json:"message"` - Version string `json:"version"` +type EndpointsPostUnmarkFalsePositiveSCPMFindingOutput struct { + Version *string `json:"version,omitempty"` } -type EndpointsPostUnallowlistSCPMFindingInput struct { - UnallowlistReason string `json:"unallowlistReason"` +type EndpointsPutSCPMSettingsInput struct { + AcceptedLicenses []string `json:"acceptedLicenses,omitempty"` + CooldownDays int `json:"cooldownDays"` + CooldownEnabled bool `json:"cooldownEnabled"` + CooldownOverrides map[string]int `json:"cooldownOverrides,omitempty"` + CooldownWarnOnly *bool `json:"cooldownWarnOnly,omitempty"` + PackageAllowlist []ModelsSCPMPackageAllowlistEntry `json:"packageAllowlist,omitempty"` +} + +type EndpointsPutSCPMSettingsOutput struct { + AcceptedLicenses []string `json:"acceptedLicenses,omitempty"` + CooldownDays int `json:"cooldownDays"` + CooldownEnabled bool `json:"cooldownEnabled"` + CooldownOverrides map[string]int `json:"cooldownOverrides,omitempty"` + CooldownWarnOnly bool `json:"cooldownWarnOnly"` + PackageAllowlist []ModelsSCPMPackageAllowlistEntry `json:"packageAllowlist,omitempty"` + Version *string `json:"version,omitempty"` } type ModelsSCPMEventInterface struct { @@ -256,10 +290,18 @@ type ModelsSCPMFinding struct { CommitMessage *string `json:"commitMessage,omitempty"` CommitURL *string `json:"commitUrl,omitempty"` ConcurrencyLimit *int `json:"concurrencyLimit,omitempty"` + CooldownExpiresAt *string `json:"cooldownExpiresAt,omitempty"` + CooldownPublishedAt *string `json:"cooldownPublishedAt,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` DeletedAt *string `json:"deletedAt,omitempty"` Description *string `json:"description,omitempty"` + EndLine *int `json:"endLine,omitempty"` + Enforcement *ModelsSCPMEnforcement `json:"enforcement,omitempty"` + FailedTriage *bool `json:"failedTriage,omitempty"` + FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` + FileOwners []ModelsFileOwner `json:"fileOwners,omitempty"` FilePath *string `json:"filePath,omitempty"` + FindingType *ModelsSCPMFindingType `json:"findingType,omitempty"` FirstSeenCommit *string `json:"firstSeenCommit,omitempty"` ID *string `json:"id,omitempty"` InstallationID string `json:"installationId"` @@ -267,30 +309,43 @@ type ModelsSCPMFinding struct { IsArchived bool `json:"isArchived"` IsAutoFixableAgentVerdict *bool `json:"isAutoFixableAgentVerdict,omitempty"` IsFalsePositive bool `json:"isFalsePositive"` + IsFixed *bool `json:"isFixed,omitempty"` IsLatest bool `json:"isLatest"` IsResolved bool `json:"isResolved"` Language *string `json:"language,omitempty"` + LockfilePath *string `json:"lockfilePath,omitempty"` + ManifestPath *string `json:"manifestPath,omitempty"` Message *string `json:"message,omitempty"` Owner *string `json:"owner,omitempty"` + PackageManager *string `json:"packageManager,omitempty"` + PackageName *string `json:"packageName,omitempty"` + PackageVersion *string `json:"packageVersion,omitempty"` Platform string `json:"platform"` PriorityLabel *ModelsPriorityLabel `json:"priorityLabel,omitempty"` PriorityLabelReason *string `json:"priorityLabelReason,omitempty"` + PriorityOverride *ModelsPriorityLabel `json:"priorityOverride,omitempty"` PriorityScore *float64 `json:"priorityScore,omitempty"` ProjectID *string `json:"projectId,omitempty"` ProjectName *string `json:"projectName,omitempty"` PullRequestID *string `json:"pullRequestId,omitempty"` PullRequestURL *string `json:"pullRequestUrl,omitempty"` PullRequestsAutofix []ModelsPullRequestInfo `json:"pullRequestsAutofix,omitempty"` + PureInsertion *bool `json:"pureInsertion,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryID *string `json:"repositoryId,omitempty"` + ResolvedAt *string `json:"resolvedAt,omitempty"` RuleID *string `json:"ruleId,omitempty"` + RuleSourceID *string `json:"ruleSourceId,omitempty"` RuleURL *string `json:"ruleUrl,omitempty"` Severity *ModelsSeverity `json:"severity,omitempty"` + SeverityOverride *ModelsSeverity `json:"severityOverride,omitempty"` + StartLine *int `json:"startLine,omitempty"` TenantID *string `json:"tenantId,omitempty"` - Ticket *string `json:"ticket,omitempty"` + Ticket *ModelsTicketProvider `json:"ticket,omitempty"` TicketState *string `json:"ticketState,omitempty"` Title *string `json:"title,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` + UserNotes *string `json:"userNotes,omitempty"` Workflow *string `json:"workflow,omitempty"` } @@ -304,21 +359,31 @@ type ModelsSCPMFindingPreview struct { Confidence string `json:"confidence"` CreatedAt string `json:"createdAt"` Description string `json:"description"` + Enforcement *ModelsSCPMEnforcement `json:"enforcement,omitempty"` + FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` FilePath string `json:"filePath"` + FindingType ModelsSCPMFindingType `json:"findingType"` ID string `json:"id"` InstallationID string `json:"installationId"` IsAllowlisted bool `json:"isAllowlisted"` IsArchived bool `json:"isArchived"` IsFalsePositive bool `json:"isFalsePositive"` + IsFixed bool `json:"isFixed"` IsLatest bool `json:"isLatest"` IsResolved bool `json:"isResolved"` Language string `json:"language"` + LockfilePath string `json:"lockfilePath"` + ManifestPath string `json:"manifestPath"` Message string `json:"message"` Owasp []string `json:"owasp,omitempty"` Owner string `json:"owner"` + PackageManager string `json:"packageManager"` + PackageName string `json:"packageName"` + PackageVersion string `json:"packageVersion"` Platform string `json:"platform"` PriorityLabel ModelsPriorityLabel `json:"priorityLabel"` PriorityLabelReason string `json:"priorityLabelReason"` + PriorityOverride *ModelsPriorityLabel `json:"priorityOverride,omitempty"` PriorityScore float64 `json:"priorityScore"` ProjectID string `json:"projectId"` ProjectName string `json:"projectName"` @@ -329,13 +394,117 @@ type ModelsSCPMFindingPreview struct { RepositoryID string `json:"repositoryId"` RuleID string `json:"ruleId"` RuleName string `json:"ruleName"` + RuleSourceID string `json:"ruleSourceId"` Severity ModelsSeverity `json:"severity"` + SeverityOverride *ModelsSeverity `json:"severityOverride,omitempty"` Tags []string `json:"tags,omitempty"` TenantID string `json:"tenantId"` Title string `json:"title"` + TriageEnd *string `json:"triageEnd,omitempty"` UpdatedAt string `json:"updatedAt"` } +type ModelsSCPMFindingType string + +const ( + ModelsSCPMFindingTypeKnownMalware ModelsSCPMFindingType = "known_malware" + ModelsSCPMFindingTypeTyposquat ModelsSCPMFindingType = "typosquat" + ModelsSCPMFindingTypeLicenseViolation ModelsSCPMFindingType = "license_violation" + ModelsSCPMFindingTypeUnpinnedDependency ModelsSCPMFindingType = "unpinned_dependency" + ModelsSCPMFindingTypeLockfileMissing ModelsSCPMFindingType = "lockfile_missing" + ModelsSCPMFindingTypeInstallScript ModelsSCPMFindingType = "install_script" + ModelsSCPMFindingTypeDependencyConfusion ModelsSCPMFindingType = "dependency_confusion" + ModelsSCPMFindingTypeCicdUnpinnedAction ModelsSCPMFindingType = "cicd_unpinned_action" + ModelsSCPMFindingTypeCicdMaliciousAction ModelsSCPMFindingType = "cicd_malicious_action" + ModelsSCPMFindingTypeCicdScriptInjection ModelsSCPMFindingType = "cicd_script_injection" + ModelsSCPMFindingTypeCicdExcessivePermissions ModelsSCPMFindingType = "cicd_excessive_permissions" + ModelsSCPMFindingTypeCicdDangerousTrigger ModelsSCPMFindingType = "cicd_dangerous_trigger" + ModelsSCPMFindingTypeCicdArtifactTokenLeak ModelsSCPMFindingType = "cicd_artifact_token_leak" + ModelsSCPMFindingTypeCicdSecretsExposure ModelsSCPMFindingType = "cicd_secrets_exposure" + ModelsSCPMFindingTypeCicdBotConditions ModelsSCPMFindingType = "cicd_bot_conditions" + ModelsSCPMFindingTypeCicdCachePoisoning ModelsSCPMFindingType = "cicd_cache_poisoning" + ModelsSCPMFindingTypeCicdGithubEnv ModelsSCPMFindingType = "cicd_github_env" + ModelsSCPMFindingTypeCicdHardcodedCredentials ModelsSCPMFindingType = "cicd_hardcoded_credentials" + ModelsSCPMFindingTypeCicdInsecureCommands ModelsSCPMFindingType = "cicd_insecure_commands" + ModelsSCPMFindingTypeCicdSecretsInherit ModelsSCPMFindingType = "cicd_secrets_inherit" + ModelsSCPMFindingTypeCicdOverprovisionedSecrets ModelsSCPMFindingType = "cicd_overprovisioned_secrets" + ModelsSCPMFindingTypeCicdUnredactedSecrets ModelsSCPMFindingType = "cicd_unredacted_secrets" + ModelsSCPMFindingTypeCicdUnpinnedImages ModelsSCPMFindingType = "cicd_unpinned_images" + ModelsSCPMFindingTypeCicdUnsoundCondition ModelsSCPMFindingType = "cicd_unsound_condition" + ModelsSCPMFindingTypeCicdConcurrencyLimits ModelsSCPMFindingType = "cicd_concurrency_limits" + ModelsSCPMFindingTypeCicdUseTrustedPublishing ModelsSCPMFindingType = "cicd_use_trusted_publishing" + ModelsSCPMFindingTypeCicdUnsoundContains ModelsSCPMFindingType = "cicd_unsound_contains" + ModelsSCPMFindingTypeCicdObfuscation ModelsSCPMFindingType = "cicd_obfuscation" + ModelsSCPMFindingTypeCicdRefVersionMismatch ModelsSCPMFindingType = "cicd_ref_version_mismatch" + ModelsSCPMFindingTypeCicdSelfHostedRunner ModelsSCPMFindingType = "cicd_self_hosted_runner" + ModelsSCPMFindingTypeCicdWorkflowRunRisk ModelsSCPMFindingType = "cicd_workflow_run_risk" + ModelsSCPMFindingTypeCicdPrivilegedCheckout ModelsSCPMFindingType = "cicd_privileged_checkout" + ModelsSCPMFindingTypeCicdDockerSocket ModelsSCPMFindingType = "cicd_docker_socket" + ModelsSCPMFindingTypeCicdGithubScriptInjection ModelsSCPMFindingType = "cicd_github_script_injection" + ModelsSCPMFindingTypeCicdUnprotectedDeployment ModelsSCPMFindingType = "cicd_unprotected_deployment" + ModelsSCPMFindingTypeCicdDefaultBranchPush ModelsSCPMFindingType = "cicd_default_branch_push" + ModelsSCPMFindingTypeCicdOidcOverscope ModelsSCPMFindingType = "cicd_oidc_overscope" + ModelsSCPMFindingTypeCicdMissingPermissions ModelsSCPMFindingType = "cicd_missing_permissions" + ModelsSCPMFindingTypeCicdUnverifiedAction ModelsSCPMFindingType = "cicd_unverified_action" + ModelsSCPMFindingTypeCicdMissingAttestation ModelsSCPMFindingType = "cicd_missing_attestation" + ModelsSCPMFindingTypeCicdDispatchToctou ModelsSCPMFindingType = "cicd_dispatch_toctou" + ModelsSCPMFindingTypeCicdEnvironmentBypass ModelsSCPMFindingType = "cicd_environment_bypass" + ModelsSCPMFindingTypeCicdAiRisk ModelsSCPMFindingType = "cicd_ai_risk" + ModelsSCPMFindingTypeCicdIncludeInjection ModelsSCPMFindingType = "cicd_include_injection" + ModelsSCPMFindingTypeCicdUnpinnedInclude ModelsSCPMFindingType = "cicd_unpinned_include" + ModelsSCPMFindingTypeCicdServiceConnection ModelsSCPMFindingType = "cicd_service_connection" + ModelsSCPMFindingTypeUnmaintainedPackage ModelsSCPMFindingType = "unmaintained_package" + ModelsSCPMFindingTypeDeprecatedPackage ModelsSCPMFindingType = "deprecated_package" + ModelsSCPMFindingTypeTrivialPackage ModelsSCPMFindingType = "trivial_package" + ModelsSCPMFindingTypeDependencyHijack ModelsSCPMFindingType = "dependency_hijack" + ModelsSCPMFindingTypeAiHallucinationHijack ModelsSCPMFindingType = "ai_hallucination_hijack" + ModelsSCPMFindingTypePhantomPackage ModelsSCPMFindingType = "phantom_package" + ModelsSCPMFindingTypeRapidPublish ModelsSCPMFindingType = "rapid_publish" + ModelsSCPMFindingTypeCopyleftLicense ModelsSCPMFindingType = "copyleft_license" + ModelsSCPMFindingTypeLicenseMismatch ModelsSCPMFindingType = "license_mismatch" + ModelsSCPMFindingTypeUnlicensedPackage ModelsSCPMFindingType = "unlicensed_package" + ModelsSCPMFindingTypeGitDependency ModelsSCPMFindingType = "git_dependency" + ModelsSCPMFindingTypeUnpinnedDockerBase ModelsSCPMFindingType = "unpinned_docker_base" + ModelsSCPMFindingTypeUnpinnedDockerImage ModelsSCPMFindingType = "unpinned_docker_image" + ModelsSCPMFindingTypeInsecureRegistry ModelsSCPMFindingType = "insecure_registry" + ModelsSCPMFindingTypeCooldownRecentPublish ModelsSCPMFindingType = "cooldown_recent_publish" + ModelsSCPMFindingTypeCooldownUpdaterMissing ModelsSCPMFindingType = "cooldown_updater_missing" + ModelsSCPMFindingTypeCooldownUpdaterBelowThreshold ModelsSCPMFindingType = "cooldown_updater_below_threshold" + ModelsSCPMFindingTypeCooldownUpdaterPartial ModelsSCPMFindingType = "cooldown_updater_partial" + ModelsSCPMFindingTypeCooldownUpdaterDisabled ModelsSCPMFindingType = "cooldown_updater_disabled" + ModelsSCPMFindingTypeCooldownUpdaterUnparseable ModelsSCPMFindingType = "cooldown_updater_unparseable" + ModelsSCPMFindingTypeCooldownUnverifiableEcosystem ModelsSCPMFindingType = "cooldown_unverifiable_ecosystem" + ModelsSCPMFindingTypeCooldownPmUnsupported ModelsSCPMFindingType = "cooldown_pm_unsupported" + ModelsSCPMFindingTypeCooldownAbsolutePinStale ModelsSCPMFindingType = "cooldown_absolute_pin_stale" + ModelsSCPMFindingTypeUpdaterUnsafeAutomation ModelsSCPMFindingType = "updater_unsafe_automation" + ModelsSCPMFindingTypeShellAccess ModelsSCPMFindingType = "shell_access" + ModelsSCPMFindingTypeUnmanagedDependency ModelsSCPMFindingType = "unmanaged_dependency" + ModelsSCPMFindingTypeStarJacking ModelsSCPMFindingType = "star_jacking" + ModelsSCPMFindingTypeNonExistentAuthor ModelsSCPMFindingType = "non_existent_author" + ModelsSCPMFindingTypeUnpopularPackage ModelsSCPMFindingType = "unpopular_package" + ModelsSCPMFindingTypeAllowScriptsEnabled ModelsSCPMFindingType = "allow_scripts_enabled" + ModelsSCPMFindingTypeHttpDependency ModelsSCPMFindingType = "http_dependency" + ModelsSCPMFindingTypeNoLicense ModelsSCPMFindingType = "no_license" + ModelsSCPMFindingTypeNonPermissiveLicense ModelsSCPMFindingType = "non_permissive_license" + ModelsSCPMFindingTypeScanManifestUnreadable ModelsSCPMFindingType = "scan_manifest_unreadable" + ModelsSCPMFindingTypeSuppressionFileChanged ModelsSCPMFindingType = "suppression_file_changed" + ModelsSCPMFindingTypeNonPublicDefaultRegistry ModelsSCPMFindingType = "non_public_default_registry" + ModelsSCPMFindingTypePatchedDependency ModelsSCPMFindingType = "patched_dependency" + ModelsSCPMFindingTypeWeakIntegrity ModelsSCPMFindingType = "weak_integrity" + ModelsSCPMFindingTypeLockfileRemoved ModelsSCPMFindingType = "lockfile_removed" + ModelsSCPMFindingTypeLockfileVersionDrift ModelsSCPMFindingType = "lockfile_version_drift" +) + +type ModelsSCPMPackageAllowlistEntry struct { + CreatedBy *string `json:"createdBy,omitempty"` + Ecosystem string `json:"ecosystem"` + ExpiresAt *string `json:"expiresAt,omitempty"` + Namespace *string `json:"namespace,omitempty"` + PackageName string `json:"packageName"` + Reason *string `json:"reason,omitempty"` + VersionRange *string `json:"versionRange,omitempty"` +} + type ModelsTriagedSCPMFinding struct { FalsePositiveReason *string `json:"falsePositiveReason,omitempty"` Finding *ModelsSCPMFinding `json:"finding,omitempty"` diff --git a/internal/api/models/secrets.go b/internal/api/models/secrets.go index 647409d..e596ff9 100644 --- a/internal/api/models/secrets.go +++ b/internal/api/models/secrets.go @@ -3,6 +3,14 @@ package models import "encoding/json" +type EndpointsDeleteTicketSecretsFindingOutput struct { + Version *string `json:"version,omitempty"` +} + +type EndpointsDeleteTicketSecretsSensitiveDataFindingOutput struct { + Version *string `json:"version,omitempty"` +} + type EndpointsGetSecretsEventsOutput struct { Events []ModelsSecretsEventInterface `json:"events,omitempty"` NextToken string `json:"nextToken"` @@ -12,6 +20,7 @@ type EndpointsGetSecretsEventsOutput struct { type EndpointsGetSecretsFindingEventsOutput struct { Events []ModelsSecretsEventInterface `json:"events,omitempty"` + NextToken *string `json:"nextToken,omitempty"` NumItems int `json:"numItems"` Version *string `json:"version,omitempty"` } @@ -25,6 +34,7 @@ type EndpointsGetSecretsFindingOutput struct { type EndpointsGetSecretsFindingTriageOutput struct { Finding *ModelsTriagedSecretsCredentialsFinding `json:"finding,omitempty"` Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` } type EndpointsGetSecretsFindingUsersOutput struct { @@ -55,6 +65,7 @@ type EndpointsGetSecretsSensitiveDataFindingOutput struct { type EndpointsGetSecretsSensitiveDataFindingTriageOutput struct { Finding *ModelsTriagedSecretsSensitiveDataFinding `json:"finding,omitempty"` Version *string `json:"version,omitempty"` + VulnManagementFrameworks *FrameworksVulnManagementFrameworks `json:"vulnManagementFrameworks,omitempty"` } type EndpointsGetSecretsSensitiveDataFindingUsersOutput struct { @@ -199,6 +210,7 @@ type ModelsSecretsCredentialsFinding struct { RepositoryName string `json:"repositoryName"` ResolvedAt *string `json:"resolvedAt,omitempty"` RuleID string `json:"ruleId"` + ScannedCommitSha *string `json:"scannedCommitSha,omitempty"` Scanner string `json:"scanner"` Scopes []string `json:"scopes,omitempty"` SecretHash string `json:"secretHash"` @@ -217,11 +229,10 @@ type ModelsSecretsCredentialsFinding struct { TriageAgentVersion *string `json:"triageAgentVersion,omitempty"` TriageDurationSeconds *int `json:"triageDurationSeconds,omitempty"` TriageEnd *string `json:"triageEnd,omitempty"` - TriageLangfuseSessionID *string `json:"triageLangfuseSessionId,omitempty"` - TriageLangfuseTraceID *string `json:"triageLangfuseTraceId,omitempty"` TriageLlmCostUsd *float64 `json:"triageLlmCostUsd,omitempty"` TriageMaxInputTokens *int `json:"triageMaxInputTokens,omitempty"` TriageStart *string `json:"triageStart,omitempty"` + TriageStopReason *string `json:"triageStopReason,omitempty"` TriageTokenCount *int `json:"triageTokenCount,omitempty"` TriageTraceID *string `json:"triageTraceId,omitempty"` UpdatedAt string `json:"updatedAt"` @@ -359,6 +370,7 @@ type ModelsSecretsSensitiveDataFinding struct { IsDuplicate bool `json:"isDuplicate"` IsFalsePositive bool `json:"isFalsePositive"` IsResolved bool `json:"isResolved"` + IsTriaged *bool `json:"isTriaged,omitempty"` Owner string `json:"owner"` OwnerType string `json:"ownerType"` Platform string `json:"platform"` @@ -371,6 +383,7 @@ type ModelsSecretsSensitiveDataFinding struct { RepositoryID string `json:"repositoryId"` RepositoryName string `json:"repositoryName"` ResolvedAt *string `json:"resolvedAt,omitempty"` + ScannedCommitSha *string `json:"scannedCommitSha,omitempty"` SecretValue *string `json:"secretValue,omitempty"` TenantID string `json:"tenantId"` Ticket *ModelsTicketProvider `json:"ticket,omitempty"` @@ -378,7 +391,10 @@ type ModelsSecretsSensitiveDataFinding struct { TriageAgentVersion string `json:"triageAgentVersion"` TriageDurationSeconds int `json:"triageDurationSeconds"` TriageEnd *string `json:"triageEnd,omitempty"` + TriageLlmCostUsd *float64 `json:"triageLlmCostUsd,omitempty"` TriageStart *string `json:"triageStart,omitempty"` + TriageStopReason *string `json:"triageStopReason,omitempty"` + TriageTokenCount *int `json:"triageTokenCount,omitempty"` UpdatedAt string `json:"updatedAt"` UserID string `json:"userId"` UserNotes string `json:"userNotes"` @@ -425,14 +441,6 @@ type ModelsSecretsValidation struct { Result *ModelsSecretsValidationResult `json:"result,omitempty"` } -type ModelsSecretsValidationResult string - -const ( - ModelsSecretsValidationResultInvalid ModelsSecretsValidationResult = "INVALID" - ModelsSecretsValidationResultUnknown ModelsSecretsValidationResult = "UNKNOWN" - ModelsSecretsValidationResultValid ModelsSecretsValidationResult = "VALID" -) - type ModelsTriagedSecretsCredentialsFinding struct { AgentVersion string `json:"agentVersion"` AssessmentFactors []ModelsAssessmentFactor `json:"assessmentFactors,omitempty"` diff --git a/internal/api/orchestrator.go b/internal/api/orchestrator.go index 143cfd8..13d08c9 100644 --- a/internal/api/orchestrator.go +++ b/internal/api/orchestrator.go @@ -23,6 +23,7 @@ var _ = models.RequestScope{} // CreateOrchestratorAutofixBatchInput is the input for CreateOrchestratorAutofixBatch — Start Batch Autofix. type CreateOrchestratorAutofixBatchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` DastBugHuntFindingIDs []string `json:"dastBugHuntFindingIDs,omitempty"` DastPentestFindingIDs []string `json:"dastPentestFindingIDs,omitempty"` OwnerProvider models.ModelsOwnerProvider `json:"ownerProvider"` @@ -41,6 +42,9 @@ func (c *Client) CreateOrchestratorAutofixBatch(ctx context.Context, in CreateOr for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -80,6 +84,7 @@ func (c *Client) CreateOrchestratorAutofixBatch(ctx context.Context, in CreateOr // GetOrchestratorAutofixBatchExecutionIdInput is the input for GetOrchestratorAutofixBatchExecutionId — Get Batch Autofix Status. type GetOrchestratorAutofixBatchExecutionIdInput struct { ExecutionID string `path:"executionId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -93,6 +98,9 @@ func (c *Client) GetOrchestratorAutofixBatchExecutionId(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -111,8 +119,178 @@ func (c *Client) GetOrchestratorAutofixBatchExecutionId(ctx context.Context, in return &out, nil } +// CreateOrchestratorAutofixIteratePrInput is the input for CreateOrchestratorAutofixIteratePr — Iterate Autofix PR. +type CreateOrchestratorAutofixIteratePrInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + OwnerProvider models.ModelsOwnerProvider `json:"ownerProvider"` + PullRequest models.ModelsGitPullRequestProvider `json:"pullRequest"` + Reason *string `json:"reason,omitempty"` + Repository models.ModelsGitRepositoryProvider `json:"repository"` + models.RequestScope +} + +// CreateOrchestratorAutofixIteratePr - Iterate Autofix PR +// POST /orchestrator/autofix/iterate-pr +func (c *Client) CreateOrchestratorAutofixIteratePr(ctx context.Context, in CreateOrchestratorAutofixIteratePrInput) (*models.EndpointsPostIterateAutofixPROutput, error) { + path := "/orchestrator/autofix/iterate-pr" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + OwnerProvider models.ModelsOwnerProvider `json:"ownerProvider"` + PullRequest models.ModelsGitPullRequestProvider `json:"pullRequest"` + Reason *string `json:"reason,omitempty"` + Repository models.ModelsGitRepositoryProvider `json:"repository"` + }{ + OwnerProvider: in.OwnerProvider, + PullRequest: in.PullRequest, + Reason: in.Reason, + Repository: in.Repository, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostIterateAutofixPROutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListOrchestratorCheckrunsInput is the input for ListOrchestratorCheckruns — Get Check Runs. +type ListOrchestratorCheckrunsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IncludeDefaultBranch *bool `url:"includeDefaultBranch,omitempty" json:"-"` + MaxRepositories *int `url:"maxRepositories,omitempty" json:"-"` + RepositoryCommit []string `url:"repositoryCommit,omitempty" json:"-"` + RepositoryID []string `url:"repositoryId,omitempty" json:"-"` + Since *string `url:"since,omitempty" json:"-"` + models.RequestScope +} + +// ListOrchestratorCheckruns - Get Check Runs +// GET /orchestrator/checkruns +func (c *Client) ListOrchestratorCheckruns(ctx context.Context, in ListOrchestratorCheckrunsInput) (*models.EndpointsGetCheckRunsOutput, error) { + path := "/orchestrator/checkruns" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Since != nil { + query.Set("since", string(*in.Since)) + } + if in.IncludeDefaultBranch != nil { + query.Set("includeDefaultBranch", strconv.FormatBool(*in.IncludeDefaultBranch)) + } + if in.MaxRepositories != nil { + query.Set("maxRepositories", strconv.Itoa(int(*in.MaxRepositories))) + } + for _, v := range in.RepositoryID { + query.Add("repositoryId", string(v)) + } + for _, v := range in.RepositoryCommit { + query.Add("repositoryCommit", string(v)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetCheckRunsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateOrchestratorCheckrunsOverrideInput is the input for CreateOrchestratorCheckrunsOverride — Override Check Run. +type CreateOrchestratorCheckrunsOverrideInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + CheckName string `json:"checkName"` + CommitSha string `json:"commitSha"` + Reason *string `json:"reason,omitempty"` + Repository models.ModelsGitRepositoryProvider `json:"repository"` + models.RequestScope +} + +// CreateOrchestratorCheckrunsOverride - Override Check Run +// POST /orchestrator/checkruns/override +func (c *Client) CreateOrchestratorCheckrunsOverride(ctx context.Context, in CreateOrchestratorCheckrunsOverrideInput) (*models.EndpointsPostCheckRunOverrideOutput, error) { + path := "/orchestrator/checkruns/override" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + CheckName string `json:"checkName"` + CommitSha string `json:"commitSha"` + Reason *string `json:"reason,omitempty"` + Repository models.ModelsGitRepositoryProvider `json:"repository"` + }{ + CheckName: in.CheckName, + CommitSha: in.CommitSha, + Reason: in.Reason, + Repository: in.Repository, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostCheckRunOverrideOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // ListOrchestratorCodereviewsInput is the input for ListOrchestratorCodereviews — Get Code Reviews. type ListOrchestratorCodereviewsInput struct { + Blocked *bool `url:"blocked,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Since *string `url:"since,omitempty" json:"-"` models.RequestScope } @@ -125,6 +303,24 @@ func (c *Client) ListOrchestratorCodereviews(ctx context.Context, in ListOrchest for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Blocked != nil { + query.Set("blocked", strconv.FormatBool(*in.Blocked)) + } + if in.Since != nil { + query.Set("since", string(*in.Since)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -146,6 +342,7 @@ func (c *Client) ListOrchestratorCodereviews(ctx context.Context, in ListOrchest // GetOrchestratorCodereviewsIdInput is the input for GetOrchestratorCodereviewsId — Get Code Review. type GetOrchestratorCodereviewsIdInput struct { ID string `path:"id" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -159,6 +356,9 @@ func (c *Client) GetOrchestratorCodereviewsId(ctx context.Context, in GetOrchest for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -179,12 +379,14 @@ func (c *Client) GetOrchestratorCodereviewsId(ctx context.Context, in GetOrchest // CreateOrchestratorFindingsRetriageInput is the input for CreateOrchestratorFindingsRetriage — Retriage Findings. type CreateOrchestratorFindingsRetriageInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` ContinueOnError *bool `json:"continueOnError,omitempty"` DebounceBypass *bool `json:"debounceBypass,omitempty"` Filters *models.ModelsRetriageFilters `json:"filters,omitempty"` FindingType string `json:"findingType"` - Message *models.EndpointsPostRetriageFindingsMessage `json:"message,omitempty"` + Message *models.ModelsRetriageMessage `json:"message,omitempty"` PlatformProvider *string `json:"platformProvider,omitempty"` + RetryOfActivityID *string `json:"retryOfActivityId,omitempty"` TriggerSource *models.ModelsRetriageTriggerSource `json:"triggerSource,omitempty"` models.RequestScope } @@ -198,6 +400,9 @@ func (c *Client) CreateOrchestratorFindingsRetriage(ctx context.Context, in Crea for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -210,8 +415,9 @@ func (c *Client) CreateOrchestratorFindingsRetriage(ctx context.Context, in Crea DebounceBypass *bool `json:"debounceBypass,omitempty"` Filters *models.ModelsRetriageFilters `json:"filters,omitempty"` FindingType string `json:"findingType"` - Message *models.EndpointsPostRetriageFindingsMessage `json:"message,omitempty"` + Message *models.ModelsRetriageMessage `json:"message,omitempty"` PlatformProvider *string `json:"platformProvider,omitempty"` + RetryOfActivityID *string `json:"retryOfActivityId,omitempty"` TriggerSource *models.ModelsRetriageTriggerSource `json:"triggerSource,omitempty"` }{ ContinueOnError: in.ContinueOnError, @@ -220,6 +426,7 @@ func (c *Client) CreateOrchestratorFindingsRetriage(ctx context.Context, in Crea FindingType: in.FindingType, Message: in.Message, PlatformProvider: in.PlatformProvider, + RetryOfActivityID: in.RetryOfActivityID, TriggerSource: in.TriggerSource, }) if err != nil { @@ -236,10 +443,49 @@ func (c *Client) CreateOrchestratorFindingsRetriage(ctx context.Context, in Crea return &out, nil } +// GetOrchestratorFindingsRetriageActivityIdInput is the input for GetOrchestratorFindingsRetriageActivityId — Get Retriage Activity. +type GetOrchestratorFindingsRetriageActivityIdInput struct { + ActivityID string `path:"activityId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetOrchestratorFindingsRetriageActivityId - Get Retriage Activity +// GET /orchestrator/findings/retriage/{activityId} +func (c *Client) GetOrchestratorFindingsRetriageActivityId(ctx context.Context, in GetOrchestratorFindingsRetriageActivityIdInput) (*models.EndpointsGetRetriageActivityOutput, error) { + path := "/orchestrator/findings/retriage/{activityId}" + path = strings.Replace(path, "{activityId}", url.PathEscape(in.ActivityID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRetriageActivityOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // ListOrchestratorFindingsFindingIDAutofixIterationsInput is the input for ListOrchestratorFindingsFindingIDAutofixIterations — Get Finding Autofix Iterations. type ListOrchestratorFindingsFindingIDAutofixIterationsInput struct { FindingID string `path:"findingID" json:"-"` FindingType *string `url:"findingType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -256,6 +502,9 @@ func (c *Client) ListOrchestratorFindingsFindingIDAutofixIterations(ctx context. if in.FindingType != nil { query.Set("findingType", string(*in.FindingType)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -274,21 +523,30 @@ func (c *Client) ListOrchestratorFindingsFindingIDAutofixIterations(ctx context. return &out, nil } -// CreateOrchestratorOnboardingCompleteInput is the input for CreateOrchestratorOnboardingComplete — Complete Onboarding (Test Only). -type CreateOrchestratorOnboardingCompleteInput struct { - TenantID string `json:"tenantId"` +// CreateOrchestratorFindingsFindingIDTicketCloseInput is the input for CreateOrchestratorFindingsFindingIDTicketClose — Close Finding Ticket. +type CreateOrchestratorFindingsFindingIDTicketCloseInput struct { + FindingID string `path:"findingID" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + ActorID *string `json:"actorId,omitempty"` + FindingType models.EndpointsFindingTypeQuery `json:"findingType"` + Reason *string `json:"reason,omitempty"` + Resolution *string `json:"resolution,omitempty"` models.RequestScope } -// CreateOrchestratorOnboardingComplete - Complete Onboarding (Test Only) -// POST /orchestrator/onboarding/complete -func (c *Client) CreateOrchestratorOnboardingComplete(ctx context.Context, in CreateOrchestratorOnboardingCompleteInput) (*models.EndpointsCompleteOnboardingOutput, error) { - path := "/orchestrator/onboarding/complete" +// CreateOrchestratorFindingsFindingIDTicketClose - Close Finding Ticket +// POST /orchestrator/findings/{findingID}/ticket/close +func (c *Client) CreateOrchestratorFindingsFindingIDTicketClose(ctx context.Context, in CreateOrchestratorFindingsFindingIDTicketCloseInput) (*models.EndpointsPostCloseFindingTicketOutput, error) { + path := "/orchestrator/findings/{findingID}/ticket/close" + path = strings.Replace(path, "{findingID}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -297,9 +555,15 @@ func (c *Client) CreateOrchestratorOnboardingComplete(ctx context.Context, in Cr } bodyBytes, err := json.Marshal(struct { - TenantID string `json:"tenantId"` + ActorID *string `json:"actorId,omitempty"` + FindingType models.EndpointsFindingTypeQuery `json:"findingType"` + Reason *string `json:"reason,omitempty"` + Resolution *string `json:"resolution,omitempty"` }{ - TenantID: in.TenantID, + ActorID: in.ActorID, + FindingType: in.FindingType, + Reason: in.Reason, + Resolution: in.Resolution, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -308,7 +572,43 @@ func (c *Client) CreateOrchestratorOnboardingComplete(ctx context.Context, in Cr if err != nil { return nil, err } - var out models.EndpointsCompleteOnboardingOutput + var out models.EndpointsPostCloseFindingTicketOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListOrchestratorOnboardingRequirementsInput is the input for ListOrchestratorOnboardingRequirements — Get Onboarding Requirements. +type ListOrchestratorOnboardingRequirementsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListOrchestratorOnboardingRequirements - Get Onboarding Requirements +// GET /orchestrator/onboarding/requirements +func (c *Client) ListOrchestratorOnboardingRequirements(ctx context.Context, in ListOrchestratorOnboardingRequirementsInput) (*models.EndpointsOnboardingRequirementsOutput, error) { + path := "/orchestrator/onboarding/requirements" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsOnboardingRequirementsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } @@ -317,6 +617,10 @@ func (c *Client) CreateOrchestratorOnboardingComplete(ctx context.Context, in Cr // CreateOrchestratorOnboardingStartInput is the input for CreateOrchestratorOnboardingStart — Start Onboarding. type CreateOrchestratorOnboardingStartInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AllRepositories *bool `json:"allRepositories,omitempty"` + BypassRequirements *bool `json:"bypassRequirements,omitempty"` + Force *bool `json:"force,omitempty"` GitOwnerProvider models.ModelsOwnerProvider `json:"gitOwnerProvider"` RepositoryIds []string `json:"repositoryIds,omitempty"` models.RequestScope @@ -331,6 +635,9 @@ func (c *Client) CreateOrchestratorOnboardingStart(ctx context.Context, in Creat for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -339,9 +646,15 @@ func (c *Client) CreateOrchestratorOnboardingStart(ctx context.Context, in Creat } bodyBytes, err := json.Marshal(struct { + AllRepositories *bool `json:"allRepositories,omitempty"` + BypassRequirements *bool `json:"bypassRequirements,omitempty"` + Force *bool `json:"force,omitempty"` GitOwnerProvider models.ModelsOwnerProvider `json:"gitOwnerProvider"` RepositoryIds []string `json:"repositoryIds,omitempty"` }{ + AllRepositories: in.AllRepositories, + BypassRequirements: in.BypassRequirements, + Force: in.Force, GitOwnerProvider: in.GitOwnerProvider, RepositoryIds: in.RepositoryIds, }) @@ -361,6 +674,7 @@ func (c *Client) CreateOrchestratorOnboardingStart(ctx context.Context, in Creat // ListOrchestratorOnboardingStatusInput is the input for ListOrchestratorOnboardingStatus — Get Onboarding Status. type ListOrchestratorOnboardingStatusInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -373,6 +687,9 @@ func (c *Client) ListOrchestratorOnboardingStatus(ctx context.Context, in ListOr for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -390,3 +707,250 @@ func (c *Client) ListOrchestratorOnboardingStatus(ctx context.Context, in ListOr } return &out, nil } + +// CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviewsInput is the input for CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviews — Start Pull Request Review. +type CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviewsInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + Number int `path:"number" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviews - Start Pull Request Review +// POST /orchestrator/repositories/{repositoryId}/pull-requests/{number}/reviews +func (c *Client) CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviews(ctx context.Context, in CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviewsInput) (*models.EndpointsStartPullRequestReviewOutput, error) { + path := "/orchestrator/repositories/{repositoryId}/pull-requests/{number}/reviews" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{number}", url.PathEscape(strconv.Itoa(in.Number)), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsStartPullRequestReviewOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateOrchestratorRepositoriesRepositoryIdScansInput is the input for CreateOrchestratorRepositoriesRepositoryIdScans — Start Repository Scan. +type CreateOrchestratorRepositoriesRepositoryIdScansInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + FullHistory *bool `json:"fullHistory,omitempty"` + RegenerateContext *bool `json:"regenerateContext,omitempty"` + ScopeBackfill *bool `json:"scopeBackfill,omitempty"` + Services []models.EndpointsRepositoryScanService `json:"services,omitempty"` + Triage *models.EndpointsRepositoryScanTriage `json:"triage,omitempty"` + models.RequestScope +} + +// CreateOrchestratorRepositoriesRepositoryIdScans - Start Repository Scan +// POST /orchestrator/repositories/{repositoryId}/scans +func (c *Client) CreateOrchestratorRepositoriesRepositoryIdScans(ctx context.Context, in CreateOrchestratorRepositoriesRepositoryIdScansInput) (*models.EndpointsStartRepositoryScanOutput, error) { + path := "/orchestrator/repositories/{repositoryId}/scans" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Branch *string `json:"branch,omitempty"` + CommitSha *string `json:"commitSha,omitempty"` + FullHistory *bool `json:"fullHistory,omitempty"` + RegenerateContext *bool `json:"regenerateContext,omitempty"` + ScopeBackfill *bool `json:"scopeBackfill,omitempty"` + Services []models.EndpointsRepositoryScanService `json:"services,omitempty"` + Triage *models.EndpointsRepositoryScanTriage `json:"triage,omitempty"` + }{ + Branch: in.Branch, + CommitSha: in.CommitSha, + FullHistory: in.FullHistory, + RegenerateContext: in.RegenerateContext, + ScopeBackfill: in.ScopeBackfill, + Services: in.Services, + Triage: in.Triage, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsStartRepositoryScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetOrchestratorRepositoriesRepositoryIdScansRunIdInput is the input for GetOrchestratorRepositoriesRepositoryIdScansRunId — Get Repository Scan. +type GetOrchestratorRepositoriesRepositoryIdScansRunIdInput struct { + RepositoryID string `path:"repositoryId" json:"-"` + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Services *string `url:"services,omitempty" json:"-"` + models.RequestScope +} + +// GetOrchestratorRepositoriesRepositoryIdScansRunId - Get Repository Scan +// GET /orchestrator/repositories/{repositoryId}/scans/{runId} +func (c *Client) GetOrchestratorRepositoriesRepositoryIdScansRunId(ctx context.Context, in GetOrchestratorRepositoriesRepositoryIdScansRunIdInput) (*models.EndpointsGetRepositoryScanOutput, error) { + path := "/orchestrator/repositories/{repositoryId}/scans/{runId}" + path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Services != nil { + query.Set("services", string(*in.Services)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRepositoryScanOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateOrchestratorRunsKindRunIdControlInput is the input for CreateOrchestratorRunsKindRunIdControl — Control Run. +type CreateOrchestratorRunsKindRunIdControlInput struct { + Kind string `path:"kind" json:"-"` + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Action string `json:"action"` + ApprovalID *string `json:"approvalId,omitempty"` + IdempotencyKey string `json:"idempotencyKey"` + Message *string `json:"message,omitempty"` + models.RequestScope +} + +// CreateOrchestratorRunsKindRunIdControl - Control Run +// POST /orchestrator/runs/{kind}/{runId}/control +func (c *Client) CreateOrchestratorRunsKindRunIdControl(ctx context.Context, in CreateOrchestratorRunsKindRunIdControlInput) (*models.EndpointsPostRunControlOutput, error) { + path := "/orchestrator/runs/{kind}/{runId}/control" + path = strings.Replace(path, "{kind}", url.PathEscape(in.Kind), 1) + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + bodyBytes, err := json.Marshal(struct { + Action string `json:"action"` + ApprovalID *string `json:"approvalId,omitempty"` + IdempotencyKey string `json:"idempotencyKey"` + Message *string `json:"message,omitempty"` + }{ + Action: in.Action, + ApprovalID: in.ApprovalID, + IdempotencyKey: in.IdempotencyKey, + Message: in.Message, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPostRunControlOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListOrchestratorRunsKindRunIdControlCapabilitiesInput is the input for ListOrchestratorRunsKindRunIdControlCapabilities — Get Run Control Capabilities. +type ListOrchestratorRunsKindRunIdControlCapabilitiesInput struct { + Kind string `path:"kind" json:"-"` + RunID string `path:"runId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListOrchestratorRunsKindRunIdControlCapabilities - Get Run Control Capabilities +// GET /orchestrator/runs/{kind}/{runId}/control/capabilities +func (c *Client) ListOrchestratorRunsKindRunIdControlCapabilities(ctx context.Context, in ListOrchestratorRunsKindRunIdControlCapabilitiesInput) (*models.EndpointsGetRunControlCapabilitiesOutput, error) { + path := "/orchestrator/runs/{kind}/{runId}/control/capabilities" + path = strings.Replace(path, "{kind}", url.PathEscape(in.Kind), 1) + path = strings.Replace(path, "{runId}", url.PathEscape(in.RunID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetRunControlCapabilitiesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} diff --git a/internal/api/sast.go b/internal/api/sast.go index 194a44e..b7bc7c1 100644 --- a/internal/api/sast.go +++ b/internal/api/sast.go @@ -27,6 +27,7 @@ type ListSastEventsInput struct { FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` FindingID *string `url:"findingId,omitempty" json:"-"` FromTime *string `url:"fromTime,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` @@ -63,6 +64,9 @@ func (c *Client) ListSastEvents(ctx context.Context, in ListSastEventsInput) (*m if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -84,9 +88,10 @@ func (c *Client) ListSastEvents(ctx context.Context, in ListSastEventsInput) (*m // ListSastFindingsInput is the input for ListSastFindings — Get SAST Findings. type ListSastFindingsInput struct { AiGenerated *bool `url:"aiGenerated,omitempty" json:"-"` - AutoFixState *string `url:"autoFixState,omitempty" json:"-"` + AutoFixState *models.ModelsAutoFixState `url:"autoFixState,omitempty" json:"-"` Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` HasPullRequest *bool `url:"hasPullRequest,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsArchived *bool `url:"isArchived,omitempty" json:"-"` @@ -171,6 +176,9 @@ func (c *Client) ListSastFindings(ctx context.Context, in ListSastFindingsInput) if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -191,6 +199,7 @@ func (c *Client) ListSastFindings(ctx context.Context, in ListSastFindingsInput) // CreateSastFindingsAllowlistInput is the input for CreateSastFindingsAllowlist — Allowlist Batch of SAST Findings. type CreateSastFindingsAllowlistInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` FindingIds []string `json:"findingIds,omitempty"` @@ -206,6 +215,9 @@ func (c *Client) CreateSastFindingsAllowlist(ctx context.Context, in CreateSastF for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -234,6 +246,8 @@ type ListSastFindingsDetailedInput struct { AiGenerated *bool `url:"aiGenerated,omitempty" json:"-"` Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + FilePath []string `url:"filePath,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` HasPullRequest *bool `url:"hasPullRequest,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsArchived *bool `url:"isArchived,omitempty" json:"-"` @@ -244,6 +258,7 @@ type ListSastFindingsDetailedInput struct { Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` PriorityLabel *string `url:"priorityLabel,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` Severity *string `url:"severity,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` @@ -287,6 +302,12 @@ func (c *Client) ListSastFindingsDetailed(ctx context.Context, in ListSastFindin if in.Workflow != nil { query.Set("workflow", string(*in.Workflow)) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + for _, v := range in.FilePath { + query.Add("filePath", string(v)) + } if in.IsResolved != nil { query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) } @@ -311,6 +332,9 @@ func (c *Client) ListSastFindingsDetailed(ctx context.Context, in ListSastFindin if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -332,9 +356,10 @@ func (c *Client) ListSastFindingsDetailed(ctx context.Context, in ListSastFindin // ListSastFindingsPreviewInput is the input for ListSastFindingsPreview — Get SAST Findings. type ListSastFindingsPreviewInput struct { AiGenerated *bool `url:"aiGenerated,omitempty" json:"-"` - AutoFixState *string `url:"autoFixState,omitempty" json:"-"` + AutoFixState *models.ModelsAutoFixState `url:"autoFixState,omitempty" json:"-"` Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` HasPullRequest *bool `url:"hasPullRequest,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsArchived *bool `url:"isArchived,omitempty" json:"-"` @@ -419,6 +444,9 @@ func (c *Client) ListSastFindingsPreview(ctx context.Context, in ListSastFinding if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -440,9 +468,13 @@ func (c *Client) ListSastFindingsPreview(ctx context.Context, in ListSastFinding // GetSastFindingsFindingIdInput is the input for GetSastFindingsFindingId — Get Finding. type GetSastFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetSastFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetSastFindingsFindingId - Get Finding // GET /sast/findings/{findingId} func (c *Client) GetSastFindingsFindingId(ctx context.Context, in GetSastFindingsFindingIdInput) (*models.EndpointsGetSASTFindingOutput, error) { @@ -453,6 +485,9 @@ func (c *Client) GetSastFindingsFindingId(ctx context.Context, in GetSastFinding for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -474,11 +509,15 @@ func (c *Client) GetSastFindingsFindingId(ctx context.Context, in GetSastFinding // PatchSastFindingsFindingIdInput is the input for PatchSastFindingsFindingId — Update Finding. type PatchSastFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *PatchSastFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // PatchSastFindingsFindingId - Update Finding // PATCH /sast/findings/{findingId} func (c *Client) PatchSastFindingsFindingId(ctx context.Context, in PatchSastFindingsFindingIdInput) (*models.EndpointsPatchSASTFindingOutput, error) { @@ -489,6 +528,9 @@ func (c *Client) PatchSastFindingsFindingId(ctx context.Context, in PatchSastFin for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -520,11 +562,15 @@ func (c *Client) PatchSastFindingsFindingId(ctx context.Context, in PatchSastFin // CreateSastFindingsFindingIdAllowlistInput is the input for CreateSastFindingsFindingIdAllowlist — Allowlist Finding. type CreateSastFindingsFindingIdAllowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSastFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSastFindingsFindingIdAllowlist - Allowlist Finding // POST /sast/findings/{findingId}/allowlist func (c *Client) CreateSastFindingsFindingIdAllowlist(ctx context.Context, in CreateSastFindingsFindingIdAllowlistInput) (*models.EndpointsPostAllowlistSASTFindingOutput, error) { @@ -535,6 +581,9 @@ func (c *Client) CreateSastFindingsFindingIdAllowlist(ctx context.Context, in Cr for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -566,11 +615,15 @@ func (c *Client) CreateSastFindingsFindingIdAllowlist(ctx context.Context, in Cr // ListSastFindingsFindingIdAutofixActivityInput is the input for ListSastFindingsFindingIdAutofixActivity — Get SAST Finding Autofix Activity. type ListSastFindingsFindingIdAutofixActivityInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int32 `url:"limit,omitempty" json:"-"` SinceID *string `url:"since_id,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSastFindingsFindingIdAutofixActivityInput) SetFindingID(id string) { in.FindingID = id } + // ListSastFindingsFindingIdAutofixActivity - Get SAST Finding Autofix Activity // GET /sast/findings/{findingId}/autofix/activity func (c *Client) ListSastFindingsFindingIdAutofixActivity(ctx context.Context, in ListSastFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { @@ -587,6 +640,9 @@ func (c *Client) ListSastFindingsFindingIdAutofixActivity(ctx context.Context, i if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -608,9 +664,13 @@ func (c *Client) ListSastFindingsFindingIdAutofixActivity(ctx context.Context, i // ListSastFindingsFindingIdAutofixCacheDiffInput is the input for ListSastFindingsFindingIdAutofixCacheDiff — Get Finding Autofix Diff. type ListSastFindingsFindingIdAutofixCacheDiffInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSastFindingsFindingIdAutofixCacheDiffInput) SetFindingID(id string) { in.FindingID = id } + // ListSastFindingsFindingIdAutofixCacheDiff - Get Finding Autofix Diff // GET /sast/findings/{findingId}/autofix/cache/diff func (c *Client) ListSastFindingsFindingIdAutofixCacheDiff(ctx context.Context, in ListSastFindingsFindingIdAutofixCacheDiffInput) (*models.EndpointsGetSASTFindingFixOutput, error) { @@ -621,6 +681,9 @@ func (c *Client) ListSastFindingsFindingIdAutofixCacheDiff(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -642,6 +705,7 @@ func (c *Client) ListSastFindingsFindingIdAutofixCacheDiff(ctx context.Context, // CreateSastFindingsFindingIdAutofixFixInput is the input for CreateSastFindingsFindingIdAutofixFix — Post Finding AutoFix. type CreateSastFindingsFindingIdAutofixFixInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` Force *bool `json:"force,omitempty"` Message *string `json:"message,omitempty"` @@ -649,6 +713,9 @@ type CreateSastFindingsFindingIdAutofixFixInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSastFindingsFindingIdAutofixFixInput) SetFindingID(id string) { in.FindingID = id } + // CreateSastFindingsFindingIdAutofixFix - Post Finding AutoFix // POST /sast/findings/{findingId}/autofix/fix func (c *Client) CreateSastFindingsFindingIdAutofixFix(ctx context.Context, in CreateSastFindingsFindingIdAutofixFixInput) (*models.EndpointsPostAutofixSASTFindingOutput, error) { @@ -659,6 +726,9 @@ func (c *Client) CreateSastFindingsFindingIdAutofixFix(ctx context.Context, in C for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -694,9 +764,13 @@ func (c *Client) CreateSastFindingsFindingIdAutofixFix(ctx context.Context, in C // ListSastFindingsFindingIdAutofixStateInput is the input for ListSastFindingsFindingIdAutofixState — Get SAST Finding Autofix State. type ListSastFindingsFindingIdAutofixStateInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSastFindingsFindingIdAutofixStateInput) SetFindingID(id string) { in.FindingID = id } + // ListSastFindingsFindingIdAutofixState - Get SAST Finding Autofix State // GET /sast/findings/{findingId}/autofix/state func (c *Client) ListSastFindingsFindingIdAutofixState(ctx context.Context, in ListSastFindingsFindingIdAutofixStateInput) (*models.EndpointsGetSASTFindingAutofixStateOutput, error) { @@ -707,6 +781,9 @@ func (c *Client) ListSastFindingsFindingIdAutofixState(ctx context.Context, in L for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -728,9 +805,13 @@ func (c *Client) ListSastFindingsFindingIdAutofixState(ctx context.Context, in L // ListSastFindingsFindingIdAutofixStatusInput is the input for ListSastFindingsFindingIdAutofixStatus — Get SAST Finding Autofix Status. type ListSastFindingsFindingIdAutofixStatusInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSastFindingsFindingIdAutofixStatusInput) SetFindingID(id string) { in.FindingID = id } + // ListSastFindingsFindingIdAutofixStatus - Get SAST Finding Autofix Status // GET /sast/findings/{findingId}/autofix/status func (c *Client) ListSastFindingsFindingIdAutofixStatus(ctx context.Context, in ListSastFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetSASTFindingAutofixStatusOutput, error) { @@ -741,6 +822,9 @@ func (c *Client) ListSastFindingsFindingIdAutofixStatus(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -762,9 +846,14 @@ func (c *Client) ListSastFindingsFindingIdAutofixStatus(ctx context.Context, in // ListSastFindingsFindingIdEventsInput is the input for ListSastFindingsFindingIdEvents — Get Finding Events. type ListSastFindingsFindingIdEventsInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSastFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + // ListSastFindingsFindingIdEvents - Get Finding Events // GET /sast/findings/{findingId}/events func (c *Client) ListSastFindingsFindingIdEvents(ctx context.Context, in ListSastFindingsFindingIdEventsInput) (*models.EndpointsGetSASTFindingEventsOutput, error) { @@ -775,6 +864,12 @@ func (c *Client) ListSastFindingsFindingIdEvents(ctx context.Context, in ListSas for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -793,9 +888,51 @@ func (c *Client) ListSastFindingsFindingIdEvents(ctx context.Context, in ListSas return &out, nil } +// DeleteSastFindingsFindingIdTicketInput is the input for DeleteSastFindingsFindingIdTicket — Delete Ticket. +type DeleteSastFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteSastFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteSastFindingsFindingIdTicket - Delete Ticket +// DELETE /sast/findings/{findingId}/ticket +func (c *Client) DeleteSastFindingsFindingIdTicket(ctx context.Context, in DeleteSastFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketSASTFindingOutput, error) { + path := "/sast/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSASTFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateSastFindingsFindingIdTicketInput is the input for CreateSastFindingsFindingIdTicket — Create Ticket. type CreateSastFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` CampaignTitle *string `json:"campaignTitle,omitempty"` @@ -804,6 +941,9 @@ type CreateSastFindingsFindingIdTicketInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSastFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + // CreateSastFindingsFindingIdTicket - Create Ticket // POST /sast/findings/{findingId}/ticket func (c *Client) CreateSastFindingsFindingIdTicket(ctx context.Context, in CreateSastFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketSASTFindingOutput, error) { @@ -814,6 +954,9 @@ func (c *Client) CreateSastFindingsFindingIdTicket(ctx context.Context, in Creat for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -851,9 +994,13 @@ func (c *Client) CreateSastFindingsFindingIdTicket(ctx context.Context, in Creat // ListSastFindingsFindingIdTriageInput is the input for ListSastFindingsFindingIdTriage — Get Triaged Finding. type ListSastFindingsFindingIdTriageInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSastFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + // ListSastFindingsFindingIdTriage - Get Triaged Finding // GET /sast/findings/{findingId}/triage func (c *Client) ListSastFindingsFindingIdTriage(ctx context.Context, in ListSastFindingsFindingIdTriageInput) (*models.EndpointsGetSASTFindingTriageOutput, error) { @@ -864,6 +1011,9 @@ func (c *Client) ListSastFindingsFindingIdTriage(ctx context.Context, in ListSas for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -885,10 +1035,14 @@ func (c *Client) ListSastFindingsFindingIdTriage(ctx context.Context, in ListSas // CreateSastFindingsFindingIdUnallowlistInput is the input for CreateSastFindingsFindingIdUnallowlist — Unallowlist Finding. type CreateSastFindingsFindingIdUnallowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` UnallowlistReason string `json:"unallowlistReason"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSastFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSastFindingsFindingIdUnallowlist - Unallowlist Finding // POST /sast/findings/{findingId}/unallowlist func (c *Client) CreateSastFindingsFindingIdUnallowlist(ctx context.Context, in CreateSastFindingsFindingIdUnallowlistInput) ([]byte, error) { @@ -899,6 +1053,9 @@ func (c *Client) CreateSastFindingsFindingIdUnallowlist(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -921,9 +1078,13 @@ func (c *Client) CreateSastFindingsFindingIdUnallowlist(ctx context.Context, in // ListSastFindingsFindingIdUsersInput is the input for ListSastFindingsFindingIdUsers — Get Finding Users. type ListSastFindingsFindingIdUsersInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSastFindingsFindingIdUsersInput) SetFindingID(id string) { in.FindingID = id } + // ListSastFindingsFindingIdUsers - Get Finding Users // GET /sast/findings/{findingId}/users func (c *Client) ListSastFindingsFindingIdUsers(ctx context.Context, in ListSastFindingsFindingIdUsersInput) (*models.EndpointsGetSASTFindingUsersOutput, error) { @@ -934,6 +1095,9 @@ func (c *Client) ListSastFindingsFindingIdUsers(ctx context.Context, in ListSast for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -954,6 +1118,7 @@ func (c *Client) ListSastFindingsFindingIdUsers(ctx context.Context, in ListSast // ListSastRepositoriesInput is the input for ListSastRepositories — Get Repositories. type ListSastRepositoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope @@ -974,6 +1139,9 @@ func (c *Client) ListSastRepositories(ctx context.Context, in ListSastRepositori if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -995,6 +1163,7 @@ func (c *Client) ListSastRepositories(ctx context.Context, in ListSastRepositori // GetSastRepositoriesRepositoryIdInput is the input for GetSastRepositoriesRepositoryId — Get Repository Stats. type GetSastRepositoriesRepositoryIdInput struct { RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -1008,6 +1177,9 @@ func (c *Client) GetSastRepositoriesRepositoryId(ctx context.Context, in GetSast for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1028,10 +1200,13 @@ func (c *Client) GetSastRepositoriesRepositoryId(ctx context.Context, in GetSast // ListSastScanRunsInput is the input for ListSastScanRuns — List Scan Runs. type ListSastScanRunsInput struct { + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` Offset *int `url:"offset,omitempty" json:"-"` RepositoryID *string `url:"repositoryId,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` models.RequestScope } @@ -1056,6 +1231,15 @@ func (c *Client) ListSastScanRuns(ctx context.Context, in ListSastScanRunsInput) if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) diff --git a/internal/api/sca.go b/internal/api/sca.go index 87641b8..3a176c5 100644 --- a/internal/api/sca.go +++ b/internal/api/sca.go @@ -23,9 +23,10 @@ var _ = models.RequestScope{} // ListScaContainersFindingsInput is the input for ListScaContainersFindings — Get SCA Container Findings. type ListScaContainersFindingsInput struct { - AutoFixState *string `url:"autoFixState,omitempty" json:"-"` + AutoFixState *models.ModelsAutoFixState `url:"autoFixState,omitempty" json:"-"` Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` @@ -87,6 +88,9 @@ func (c *Client) ListScaContainersFindings(ctx context.Context, in ListScaContai if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -109,6 +113,7 @@ func (c *Client) ListScaContainersFindings(ctx context.Context, in ListScaContai type ListScaContainersFindingsDetailedInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` @@ -116,6 +121,7 @@ type ListScaContainersFindingsDetailedInput struct { Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` Package *string `url:"package,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` Workflow *string `url:"workflow,omitempty" json:"-"` @@ -149,6 +155,9 @@ func (c *Client) ListScaContainersFindingsDetailed(ctx context.Context, in ListS if in.Workflow != nil { query.Set("workflow", string(*in.Workflow)) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } if in.IsFalsePositive != nil { query.Set("isFalsePositive", strconv.FormatBool(*in.IsFalsePositive)) } @@ -167,6 +176,9 @@ func (c *Client) ListScaContainersFindingsDetailed(ctx context.Context, in ListS if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -187,9 +199,10 @@ func (c *Client) ListScaContainersFindingsDetailed(ctx context.Context, in ListS // ListScaContainersFindingsPreviewInput is the input for ListScaContainersFindingsPreview — Get SCA Container Findings Preview. type ListScaContainersFindingsPreviewInput struct { - AutoFixState *string `url:"autoFixState,omitempty" json:"-"` + AutoFixState *models.ModelsAutoFixState `url:"autoFixState,omitempty" json:"-"` Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` @@ -251,6 +264,9 @@ func (c *Client) ListScaContainersFindingsPreview(ctx context.Context, in ListSc if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -272,9 +288,13 @@ func (c *Client) ListScaContainersFindingsPreview(ctx context.Context, in ListSc // GetScaContainersFindingsFindingIdInput is the input for GetScaContainersFindingsFindingId — Get Container Finding. type GetScaContainersFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetScaContainersFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetScaContainersFindingsFindingId - Get Container Finding // GET /sca/containers/findings/{findingId} func (c *Client) GetScaContainersFindingsFindingId(ctx context.Context, in GetScaContainersFindingsFindingIdInput) (*models.EndpointsGetSCAContainerFindingOutput, error) { @@ -285,6 +305,9 @@ func (c *Client) GetScaContainersFindingsFindingId(ctx context.Context, in GetSc for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -306,11 +329,15 @@ func (c *Client) GetScaContainersFindingsFindingId(ctx context.Context, in GetSc // PatchScaContainersFindingsFindingIdInput is the input for PatchScaContainersFindingsFindingId — Update Container Finding. type PatchScaContainersFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *PatchScaContainersFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // PatchScaContainersFindingsFindingId - Update Container Finding // PATCH /sca/containers/findings/{findingId} func (c *Client) PatchScaContainersFindingsFindingId(ctx context.Context, in PatchScaContainersFindingsFindingIdInput) (*models.EndpointsPatchSCAContainerFindingOutput, error) { @@ -321,6 +348,9 @@ func (c *Client) PatchScaContainersFindingsFindingId(ctx context.Context, in Pat for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -352,11 +382,15 @@ func (c *Client) PatchScaContainersFindingsFindingId(ctx context.Context, in Pat // CreateScaContainersFindingsFindingIdAllowlistInput is the input for CreateScaContainersFindingsFindingIdAllowlist — Allowlist Container Finding. type CreateScaContainersFindingsFindingIdAllowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateScaContainersFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateScaContainersFindingsFindingIdAllowlist - Allowlist Container Finding // POST /sca/containers/findings/{findingId}/allowlist func (c *Client) CreateScaContainersFindingsFindingIdAllowlist(ctx context.Context, in CreateScaContainersFindingsFindingIdAllowlistInput) ([]byte, error) { @@ -367,6 +401,9 @@ func (c *Client) CreateScaContainersFindingsFindingIdAllowlist(ctx context.Conte for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -391,11 +428,15 @@ func (c *Client) CreateScaContainersFindingsFindingIdAllowlist(ctx context.Conte // ListScaContainersFindingsFindingIdAutofixActivityInput is the input for ListScaContainersFindingsFindingIdAutofixActivity — Get SCA Container Finding Autofix Activity. type ListScaContainersFindingsFindingIdAutofixActivityInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int32 `url:"limit,omitempty" json:"-"` SinceID *string `url:"since_id,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdAutofixActivityInput) SetFindingID(id string) { in.FindingID = id } + // ListScaContainersFindingsFindingIdAutofixActivity - Get SCA Container Finding Autofix Activity // GET /sca/containers/findings/{findingId}/autofix/activity func (c *Client) ListScaContainersFindingsFindingIdAutofixActivity(ctx context.Context, in ListScaContainersFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { @@ -412,6 +453,9 @@ func (c *Client) ListScaContainersFindingsFindingIdAutofixActivity(ctx context.C if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -433,6 +477,7 @@ func (c *Client) ListScaContainersFindingsFindingIdAutofixActivity(ctx context.C // CreateScaContainersFindingsFindingIdAutofixFixInput is the input for CreateScaContainersFindingsFindingIdAutofixFix — Fix Container Findings. type CreateScaContainersFindingsFindingIdAutofixFixInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` Force *bool `json:"force,omitempty"` Message *string `json:"message,omitempty"` @@ -440,6 +485,9 @@ type CreateScaContainersFindingsFindingIdAutofixFixInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateScaContainersFindingsFindingIdAutofixFixInput) SetFindingID(id string) { in.FindingID = id } + // CreateScaContainersFindingsFindingIdAutofixFix - Fix Container Findings // POST /sca/containers/findings/{findingId}/autofix/fix func (c *Client) CreateScaContainersFindingsFindingIdAutofixFix(ctx context.Context, in CreateScaContainersFindingsFindingIdAutofixFixInput) (*models.EndpointsPostSCAContainerFindingFixOutput, error) { @@ -450,6 +498,9 @@ func (c *Client) CreateScaContainersFindingsFindingIdAutofixFix(ctx context.Cont for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -485,9 +536,13 @@ func (c *Client) CreateScaContainersFindingsFindingIdAutofixFix(ctx context.Cont // ListScaContainersFindingsFindingIdAutofixStateInput is the input for ListScaContainersFindingsFindingIdAutofixState — Get Container Finding Autofix State. type ListScaContainersFindingsFindingIdAutofixStateInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdAutofixStateInput) SetFindingID(id string) { in.FindingID = id } + // ListScaContainersFindingsFindingIdAutofixState - Get Container Finding Autofix State // GET /sca/containers/findings/{findingId}/autofix/state func (c *Client) ListScaContainersFindingsFindingIdAutofixState(ctx context.Context, in ListScaContainersFindingsFindingIdAutofixStateInput) (*models.EndpointsGetSCAContainerFindingAutofixStateOutput, error) { @@ -498,6 +553,9 @@ func (c *Client) ListScaContainersFindingsFindingIdAutofixState(ctx context.Cont for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -519,9 +577,13 @@ func (c *Client) ListScaContainersFindingsFindingIdAutofixState(ctx context.Cont // ListScaContainersFindingsFindingIdAutofixStatusInput is the input for ListScaContainersFindingsFindingIdAutofixStatus — Get Container Finding Autofix Status. type ListScaContainersFindingsFindingIdAutofixStatusInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdAutofixStatusInput) SetFindingID(id string) { in.FindingID = id } + // ListScaContainersFindingsFindingIdAutofixStatus - Get Container Finding Autofix Status // GET /sca/containers/findings/{findingId}/autofix/status func (c *Client) ListScaContainersFindingsFindingIdAutofixStatus(ctx context.Context, in ListScaContainersFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetSCAContainerFindingAutofixStatusOutput, error) { @@ -532,6 +594,9 @@ func (c *Client) ListScaContainersFindingsFindingIdAutofixStatus(ctx context.Con for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -553,9 +618,14 @@ func (c *Client) ListScaContainersFindingsFindingIdAutofixStatus(ctx context.Con // ListScaContainersFindingsFindingIdEventsInput is the input for ListScaContainersFindingsFindingIdEvents — Get SCA Container Finding Events. type ListScaContainersFindingsFindingIdEventsInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + // ListScaContainersFindingsFindingIdEvents - Get SCA Container Finding Events // GET /sca/containers/findings/{findingId}/events func (c *Client) ListScaContainersFindingsFindingIdEvents(ctx context.Context, in ListScaContainersFindingsFindingIdEventsInput) (*models.EndpointsGetSCAContainerFindingEventsOutput, error) { @@ -566,6 +636,12 @@ func (c *Client) ListScaContainersFindingsFindingIdEvents(ctx context.Context, i for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -584,9 +660,51 @@ func (c *Client) ListScaContainersFindingsFindingIdEvents(ctx context.Context, i return &out, nil } -// CreateScaContainersFindingsFindingIdTicketInput is the input for CreateScaContainersFindingsFindingIdTicket — Create Jira Ticket. +// DeleteScaContainersFindingsFindingIdTicketInput is the input for DeleteScaContainersFindingsFindingIdTicket — Delete Ticket for Container Finding. +type DeleteScaContainersFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteScaContainersFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteScaContainersFindingsFindingIdTicket - Delete Ticket for Container Finding +// DELETE /sca/containers/findings/{findingId}/ticket +func (c *Client) DeleteScaContainersFindingsFindingIdTicket(ctx context.Context, in DeleteScaContainersFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketSCAFindingOutput, error) { + path := "/sca/containers/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSCAFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateScaContainersFindingsFindingIdTicketInput is the input for CreateScaContainersFindingsFindingIdTicket — Create Ticket. type CreateScaContainersFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` CampaignTitle *string `json:"campaignTitle,omitempty"` @@ -595,7 +713,10 @@ type CreateScaContainersFindingsFindingIdTicketInput struct { models.RequestScope } -// CreateScaContainersFindingsFindingIdTicket - Create Jira Ticket +// SetFindingID sets the finding that the request targets. +func (in *CreateScaContainersFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// CreateScaContainersFindingsFindingIdTicket - Create Ticket // POST /sca/containers/findings/{findingId}/ticket func (c *Client) CreateScaContainersFindingsFindingIdTicket(ctx context.Context, in CreateScaContainersFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketDependencyFindingOutput, error) { path := "/sca/containers/findings/{findingId}/ticket" @@ -605,6 +726,9 @@ func (c *Client) CreateScaContainersFindingsFindingIdTicket(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -642,9 +766,13 @@ func (c *Client) CreateScaContainersFindingsFindingIdTicket(ctx context.Context, // ListScaContainersFindingsFindingIdTriageInput is the input for ListScaContainersFindingsFindingIdTriage — Get Triaged Finding. type ListScaContainersFindingsFindingIdTriageInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + // ListScaContainersFindingsFindingIdTriage - Get Triaged Finding // GET /sca/containers/findings/{findingId}/triage func (c *Client) ListScaContainersFindingsFindingIdTriage(ctx context.Context, in ListScaContainersFindingsFindingIdTriageInput) (*models.EndpointsGetSCAContainerFindingTriageOutput, error) { @@ -655,6 +783,9 @@ func (c *Client) ListScaContainersFindingsFindingIdTriage(ctx context.Context, i for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -673,13 +804,107 @@ func (c *Client) ListScaContainersFindingsFindingIdTriage(ctx context.Context, i return &out, nil } +// ListScaContainersFindingsFindingIdTriageActivityInput is the input for ListScaContainersFindingsFindingIdTriageActivity — Get SCA Container Finding Triage Activity. +type ListScaContainersFindingsFindingIdTriageActivityInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + SinceID *string `url:"since_id,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdTriageActivityInput) SetFindingID(id string) { in.FindingID = id } + +// ListScaContainersFindingsFindingIdTriageActivity - Get SCA Container Finding Triage Activity +// GET /sca/containers/findings/{findingId}/triage/activity +func (c *Client) ListScaContainersFindingsFindingIdTriageActivity(ctx context.Context, in ListScaContainersFindingsFindingIdTriageActivityInput) (*models.EndpointsGetTriageActivityLogOutput, error) { + path := "/sca/containers/findings/{findingId}/triage/activity" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.SinceID != nil { + query.Set("since_id", string(*in.SinceID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetTriageActivityLogOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListScaContainersFindingsFindingIdTriageStatusInput is the input for ListScaContainersFindingsFindingIdTriageStatus — Get SCA Container Finding Triage Status. +type ListScaContainersFindingsFindingIdTriageStatusInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdTriageStatusInput) SetFindingID(id string) { in.FindingID = id } + +// ListScaContainersFindingsFindingIdTriageStatus - Get SCA Container Finding Triage Status +// GET /sca/containers/findings/{findingId}/triage/status +func (c *Client) ListScaContainersFindingsFindingIdTriageStatus(ctx context.Context, in ListScaContainersFindingsFindingIdTriageStatusInput) (*models.EndpointsTriageStatusOutput, error) { + path := "/sca/containers/findings/{findingId}/triage/status" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsTriageStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateScaContainersFindingsFindingIdUnallowlistInput is the input for CreateScaContainersFindingsFindingIdUnallowlist — Unallowlist Container Finding. type CreateScaContainersFindingsFindingIdUnallowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` UnallowlistReason string `json:"unallowlistReason"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateScaContainersFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateScaContainersFindingsFindingIdUnallowlist - Unallowlist Container Finding // POST /sca/containers/findings/{findingId}/unallowlist func (c *Client) CreateScaContainersFindingsFindingIdUnallowlist(ctx context.Context, in CreateScaContainersFindingsFindingIdUnallowlistInput) ([]byte, error) { @@ -690,6 +915,9 @@ func (c *Client) CreateScaContainersFindingsFindingIdUnallowlist(ctx context.Con for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -712,9 +940,13 @@ func (c *Client) CreateScaContainersFindingsFindingIdUnallowlist(ctx context.Con // ListScaContainersFindingsFindingIdUsersInput is the input for ListScaContainersFindingsFindingIdUsers — Get Finding Related Users. type ListScaContainersFindingsFindingIdUsersInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaContainersFindingsFindingIdUsersInput) SetFindingID(id string) { in.FindingID = id } + // ListScaContainersFindingsFindingIdUsers - Get Finding Related Users // GET /sca/containers/findings/{findingId}/users func (c *Client) ListScaContainersFindingsFindingIdUsers(ctx context.Context, in ListScaContainersFindingsFindingIdUsersInput) (*models.EndpointsGetSCAContainerFindingUsersOutput, error) { @@ -725,6 +957,9 @@ func (c *Client) ListScaContainersFindingsFindingIdUsers(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -745,9 +980,11 @@ func (c *Client) ListScaContainersFindingsFindingIdUsers(ctx context.Context, in // ListScaDependenciesFindingsInput is the input for ListScaDependenciesFindings — Get SCA Dependency Findings. type ListScaDependenciesFindingsInput struct { - AutoFixState *string `url:"autoFixState,omitempty" json:"-"` + AutoFixState *models.ModelsAutoFixState `url:"autoFixState,omitempty" json:"-"` Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + HasMultipleVersions *bool `url:"hasMultipleVersions,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` @@ -800,6 +1037,9 @@ func (c *Client) ListScaDependenciesFindings(ctx context.Context, in ListScaDepe if in.IsResolved != nil { query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) } + if in.HasMultipleVersions != nil { + query.Set("hasMultipleVersions", strconv.FormatBool(*in.HasMultipleVersions)) + } if in.AutoFixState != nil { query.Set("autoFixState", string(*in.AutoFixState)) } @@ -809,6 +1049,9 @@ func (c *Client) ListScaDependenciesFindings(ctx context.Context, in ListScaDepe if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -831,6 +1074,8 @@ func (c *Client) ListScaDependenciesFindings(ctx context.Context, in ListScaDepe type ListScaDependenciesFindingsDetailedInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + HasMultipleVersions *bool `url:"hasMultipleVersions,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` @@ -838,6 +1083,7 @@ type ListScaDependenciesFindingsDetailedInput struct { Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` Package *string `url:"package,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` Workflow *string `url:"workflow,omitempty" json:"-"` @@ -871,6 +1117,9 @@ func (c *Client) ListScaDependenciesFindingsDetailed(ctx context.Context, in Lis if in.Workflow != nil { query.Set("workflow", string(*in.Workflow)) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } if in.IsFalsePositive != nil { query.Set("isFalsePositive", strconv.FormatBool(*in.IsFalsePositive)) } @@ -883,12 +1132,18 @@ func (c *Client) ListScaDependenciesFindingsDetailed(ctx context.Context, in Lis if in.IsResolved != nil { query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) } + if in.HasMultipleVersions != nil { + query.Set("hasMultipleVersions", strconv.FormatBool(*in.HasMultipleVersions)) + } if in.SortBy != nil { query.Set("sortBy", string(*in.SortBy)) } if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -909,9 +1164,11 @@ func (c *Client) ListScaDependenciesFindingsDetailed(ctx context.Context, in Lis // ListScaDependenciesFindingsPreviewInput is the input for ListScaDependenciesFindingsPreview — Get SCA Dependency Findings Preview. type ListScaDependenciesFindingsPreviewInput struct { - AutoFixState *string `url:"autoFixState,omitempty" json:"-"` + AutoFixState *models.ModelsAutoFixState `url:"autoFixState,omitempty" json:"-"` Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + HasMultipleVersions *bool `url:"hasMultipleVersions,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` @@ -964,6 +1221,9 @@ func (c *Client) ListScaDependenciesFindingsPreview(ctx context.Context, in List if in.IsResolved != nil { query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) } + if in.HasMultipleVersions != nil { + query.Set("hasMultipleVersions", strconv.FormatBool(*in.HasMultipleVersions)) + } if in.AutoFixState != nil { query.Set("autoFixState", string(*in.AutoFixState)) } @@ -973,6 +1233,9 @@ func (c *Client) ListScaDependenciesFindingsPreview(ctx context.Context, in List if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -994,9 +1257,13 @@ func (c *Client) ListScaDependenciesFindingsPreview(ctx context.Context, in List // GetScaDependenciesFindingsFindingIdInput is the input for GetScaDependenciesFindingsFindingId — Get Finding. type GetScaDependenciesFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetScaDependenciesFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetScaDependenciesFindingsFindingId - Get Finding // GET /sca/dependencies/findings/{findingId} func (c *Client) GetScaDependenciesFindingsFindingId(ctx context.Context, in GetScaDependenciesFindingsFindingIdInput) (*models.EndpointsGetSCADependencyFindingOutput, error) { @@ -1007,6 +1274,9 @@ func (c *Client) GetScaDependenciesFindingsFindingId(ctx context.Context, in Get for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1028,11 +1298,15 @@ func (c *Client) GetScaDependenciesFindingsFindingId(ctx context.Context, in Get // PatchScaDependenciesFindingsFindingIdInput is the input for PatchScaDependenciesFindingsFindingId — Update Dependencies Finding. type PatchScaDependenciesFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *PatchScaDependenciesFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // PatchScaDependenciesFindingsFindingId - Update Dependencies Finding // PATCH /sca/dependencies/findings/{findingId} func (c *Client) PatchScaDependenciesFindingsFindingId(ctx context.Context, in PatchScaDependenciesFindingsFindingIdInput) (*models.EndpointsPatchSCADependencyFindingOutput, error) { @@ -1043,6 +1317,9 @@ func (c *Client) PatchScaDependenciesFindingsFindingId(ctx context.Context, in P for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1074,11 +1351,15 @@ func (c *Client) PatchScaDependenciesFindingsFindingId(ctx context.Context, in P // CreateScaDependenciesFindingsFindingIdAllowlistInput is the input for CreateScaDependenciesFindingsFindingIdAllowlist — Allowlist Dependency Finding. type CreateScaDependenciesFindingsFindingIdAllowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateScaDependenciesFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateScaDependenciesFindingsFindingIdAllowlist - Allowlist Dependency Finding // POST /sca/dependencies/findings/{findingId}/allowlist func (c *Client) CreateScaDependenciesFindingsFindingIdAllowlist(ctx context.Context, in CreateScaDependenciesFindingsFindingIdAllowlistInput) ([]byte, error) { @@ -1089,6 +1370,9 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdAllowlist(ctx context.Con for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1113,11 +1397,15 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdAllowlist(ctx context.Con // ListScaDependenciesFindingsFindingIdAutofixActivityInput is the input for ListScaDependenciesFindingsFindingIdAutofixActivity — Get SCA Dependency Finding Autofix Activity. type ListScaDependenciesFindingsFindingIdAutofixActivityInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int32 `url:"limit,omitempty" json:"-"` SinceID *string `url:"since_id,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdAutofixActivityInput) SetFindingID(id string) { in.FindingID = id } + // ListScaDependenciesFindingsFindingIdAutofixActivity - Get SCA Dependency Finding Autofix Activity // GET /sca/dependencies/findings/{findingId}/autofix/activity func (c *Client) ListScaDependenciesFindingsFindingIdAutofixActivity(ctx context.Context, in ListScaDependenciesFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { @@ -1134,6 +1422,9 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixActivity(ctx context if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1155,9 +1446,13 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixActivity(ctx context // ListScaDependenciesFindingsFindingIdAutofixCacheDiffInput is the input for ListScaDependenciesFindingsFindingIdAutofixCacheDiff — Get SCA Dependency Finding Fix. type ListScaDependenciesFindingsFindingIdAutofixCacheDiffInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdAutofixCacheDiffInput) SetFindingID(id string) { in.FindingID = id } + // ListScaDependenciesFindingsFindingIdAutofixCacheDiff - Get SCA Dependency Finding Fix // GET /sca/dependencies/findings/{findingId}/autofix/cache/diff func (c *Client) ListScaDependenciesFindingsFindingIdAutofixCacheDiff(ctx context.Context, in ListScaDependenciesFindingsFindingIdAutofixCacheDiffInput) (*models.EndpointsGetSCADependencyFindingFixOutput, error) { @@ -1168,6 +1463,9 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixCacheDiff(ctx contex for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1189,6 +1487,7 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixCacheDiff(ctx contex // CreateScaDependenciesFindingsFindingIdAutofixFixInput is the input for CreateScaDependenciesFindingsFindingIdAutofixFix — Fix Dependency Finding. type CreateScaDependenciesFindingsFindingIdAutofixFixInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` Force *bool `json:"force,omitempty"` Message *string `json:"message,omitempty"` @@ -1196,6 +1495,9 @@ type CreateScaDependenciesFindingsFindingIdAutofixFixInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateScaDependenciesFindingsFindingIdAutofixFixInput) SetFindingID(id string) { in.FindingID = id } + // CreateScaDependenciesFindingsFindingIdAutofixFix - Fix Dependency Finding // POST /sca/dependencies/findings/{findingId}/autofix/fix func (c *Client) CreateScaDependenciesFindingsFindingIdAutofixFix(ctx context.Context, in CreateScaDependenciesFindingsFindingIdAutofixFixInput) (*models.EndpointsPostSCADependencyFindingFixOutput, error) { @@ -1206,6 +1508,9 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdAutofixFix(ctx context.Co for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1241,9 +1546,13 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdAutofixFix(ctx context.Co // ListScaDependenciesFindingsFindingIdAutofixStateInput is the input for ListScaDependenciesFindingsFindingIdAutofixState — Get Dependency Finding Autofix State. type ListScaDependenciesFindingsFindingIdAutofixStateInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdAutofixStateInput) SetFindingID(id string) { in.FindingID = id } + // ListScaDependenciesFindingsFindingIdAutofixState - Get Dependency Finding Autofix State // GET /sca/dependencies/findings/{findingId}/autofix/state func (c *Client) ListScaDependenciesFindingsFindingIdAutofixState(ctx context.Context, in ListScaDependenciesFindingsFindingIdAutofixStateInput) (*models.EndpointsGetSCADependencyFindingAutofixStateOutput, error) { @@ -1254,6 +1563,9 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixState(ctx context.Co for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1275,9 +1587,13 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixState(ctx context.Co // ListScaDependenciesFindingsFindingIdAutofixStatusInput is the input for ListScaDependenciesFindingsFindingIdAutofixStatus — Get Dependency Finding Autofix Status. type ListScaDependenciesFindingsFindingIdAutofixStatusInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdAutofixStatusInput) SetFindingID(id string) { in.FindingID = id } + // ListScaDependenciesFindingsFindingIdAutofixStatus - Get Dependency Finding Autofix Status // GET /sca/dependencies/findings/{findingId}/autofix/status func (c *Client) ListScaDependenciesFindingsFindingIdAutofixStatus(ctx context.Context, in ListScaDependenciesFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetSCADependencyFindingAutofixStatusOutput, error) { @@ -1288,6 +1604,9 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixStatus(ctx context.C for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1309,9 +1628,14 @@ func (c *Client) ListScaDependenciesFindingsFindingIdAutofixStatus(ctx context.C // ListScaDependenciesFindingsFindingIdEventsInput is the input for ListScaDependenciesFindingsFindingIdEvents — Get SCA Dependency Finding Events. type ListScaDependenciesFindingsFindingIdEventsInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + // ListScaDependenciesFindingsFindingIdEvents - Get SCA Dependency Finding Events // GET /sca/dependencies/findings/{findingId}/events func (c *Client) ListScaDependenciesFindingsFindingIdEvents(ctx context.Context, in ListScaDependenciesFindingsFindingIdEventsInput) (*models.EndpointsGetSCADependencyFindingEventsOutput, error) { @@ -1322,6 +1646,12 @@ func (c *Client) ListScaDependenciesFindingsFindingIdEvents(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1340,9 +1670,51 @@ func (c *Client) ListScaDependenciesFindingsFindingIdEvents(ctx context.Context, return &out, nil } -// CreateScaDependenciesFindingsFindingIdTicketInput is the input for CreateScaDependenciesFindingsFindingIdTicket — Create Jira Ticket. +// DeleteScaDependenciesFindingsFindingIdTicketInput is the input for DeleteScaDependenciesFindingsFindingIdTicket — Delete Ticket for Dependency Finding. +type DeleteScaDependenciesFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteScaDependenciesFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteScaDependenciesFindingsFindingIdTicket - Delete Ticket for Dependency Finding +// DELETE /sca/dependencies/findings/{findingId}/ticket +func (c *Client) DeleteScaDependenciesFindingsFindingIdTicket(ctx context.Context, in DeleteScaDependenciesFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketSCAFindingOutput, error) { + path := "/sca/dependencies/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSCAFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateScaDependenciesFindingsFindingIdTicketInput is the input for CreateScaDependenciesFindingsFindingIdTicket — Create Ticket. type CreateScaDependenciesFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` CampaignTitle *string `json:"campaignTitle,omitempty"` @@ -1351,7 +1723,10 @@ type CreateScaDependenciesFindingsFindingIdTicketInput struct { models.RequestScope } -// CreateScaDependenciesFindingsFindingIdTicket - Create Jira Ticket +// SetFindingID sets the finding that the request targets. +func (in *CreateScaDependenciesFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// CreateScaDependenciesFindingsFindingIdTicket - Create Ticket // POST /sca/dependencies/findings/{findingId}/ticket func (c *Client) CreateScaDependenciesFindingsFindingIdTicket(ctx context.Context, in CreateScaDependenciesFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketDependencyFindingOutput, error) { path := "/sca/dependencies/findings/{findingId}/ticket" @@ -1361,6 +1736,9 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdTicket(ctx context.Contex for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1398,9 +1776,13 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdTicket(ctx context.Contex // ListScaDependenciesFindingsFindingIdTriageInput is the input for ListScaDependenciesFindingsFindingIdTriage — Get Triaged Finding. type ListScaDependenciesFindingsFindingIdTriageInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + // ListScaDependenciesFindingsFindingIdTriage - Get Triaged Finding // GET /sca/dependencies/findings/{findingId}/triage func (c *Client) ListScaDependenciesFindingsFindingIdTriage(ctx context.Context, in ListScaDependenciesFindingsFindingIdTriageInput) (*models.EndpointsGetSCADependencyFindingTriageOutput, error) { @@ -1411,6 +1793,9 @@ func (c *Client) ListScaDependenciesFindingsFindingIdTriage(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1429,13 +1814,107 @@ func (c *Client) ListScaDependenciesFindingsFindingIdTriage(ctx context.Context, return &out, nil } +// ListScaDependenciesFindingsFindingIdTriageActivityInput is the input for ListScaDependenciesFindingsFindingIdTriageActivity — Get SCA Dependency Finding Triage Activity. +type ListScaDependenciesFindingsFindingIdTriageActivityInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int32 `url:"limit,omitempty" json:"-"` + SinceID *string `url:"since_id,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdTriageActivityInput) SetFindingID(id string) { in.FindingID = id } + +// ListScaDependenciesFindingsFindingIdTriageActivity - Get SCA Dependency Finding Triage Activity +// GET /sca/dependencies/findings/{findingId}/triage/activity +func (c *Client) ListScaDependenciesFindingsFindingIdTriageActivity(ctx context.Context, in ListScaDependenciesFindingsFindingIdTriageActivityInput) (*models.EndpointsGetTriageActivityLogOutput, error) { + path := "/sca/dependencies/findings/{findingId}/triage/activity" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.SinceID != nil { + query.Set("since_id", string(*in.SinceID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetTriageActivityLogOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListScaDependenciesFindingsFindingIdTriageStatusInput is the input for ListScaDependenciesFindingsFindingIdTriageStatus — Get SCA Dependency Finding Triage Status. +type ListScaDependenciesFindingsFindingIdTriageStatusInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdTriageStatusInput) SetFindingID(id string) { in.FindingID = id } + +// ListScaDependenciesFindingsFindingIdTriageStatus - Get SCA Dependency Finding Triage Status +// GET /sca/dependencies/findings/{findingId}/triage/status +func (c *Client) ListScaDependenciesFindingsFindingIdTriageStatus(ctx context.Context, in ListScaDependenciesFindingsFindingIdTriageStatusInput) (*models.EndpointsTriageStatusOutput, error) { + path := "/sca/dependencies/findings/{findingId}/triage/status" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsTriageStatusOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateScaDependenciesFindingsFindingIdUnallowlistInput is the input for CreateScaDependenciesFindingsFindingIdUnallowlist — Unallowlist Dependency Finding. type CreateScaDependenciesFindingsFindingIdUnallowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` UnallowlistReason string `json:"unallowlistReason"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateScaDependenciesFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateScaDependenciesFindingsFindingIdUnallowlist - Unallowlist Dependency Finding // POST /sca/dependencies/findings/{findingId}/unallowlist func (c *Client) CreateScaDependenciesFindingsFindingIdUnallowlist(ctx context.Context, in CreateScaDependenciesFindingsFindingIdUnallowlistInput) ([]byte, error) { @@ -1446,6 +1925,9 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdUnallowlist(ctx context.C for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1468,9 +1950,14 @@ func (c *Client) CreateScaDependenciesFindingsFindingIdUnallowlist(ctx context.C // ListScaDependenciesFindingsFindingIdUsersInput is the input for ListScaDependenciesFindingsFindingIdUsers — Get Finding Related Users. type ListScaDependenciesFindingsFindingIdUsersInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + SourceOwnerOnly *bool `url:"sourceOwnerOnly,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScaDependenciesFindingsFindingIdUsersInput) SetFindingID(id string) { in.FindingID = id } + // ListScaDependenciesFindingsFindingIdUsers - Get Finding Related Users // GET /sca/dependencies/findings/{findingId}/users func (c *Client) ListScaDependenciesFindingsFindingIdUsers(ctx context.Context, in ListScaDependenciesFindingsFindingIdUsersInput) (*models.EndpointsGetSCADependencyFindingUsersOutput, error) { @@ -1481,6 +1968,12 @@ func (c *Client) ListScaDependenciesFindingsFindingIdUsers(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.SourceOwnerOnly != nil { + query.Set("sourceOwnerOnly", strconv.FormatBool(*in.SourceOwnerOnly)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1505,6 +1998,7 @@ type ListScaEventsInput struct { FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` FindingID *string `url:"findingId,omitempty" json:"-"` FromTime *string `url:"fromTime,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` @@ -1541,6 +2035,9 @@ func (c *Client) ListScaEvents(ctx context.Context, in ListScaEventsInput) (*mod if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1561,6 +2058,7 @@ func (c *Client) ListScaEvents(ctx context.Context, in ListScaEventsInput) (*mod // ListScaRepositoriesInput is the input for ListScaRepositories — Get Repository Stats. type ListScaRepositoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope @@ -1581,6 +2079,9 @@ func (c *Client) ListScaRepositories(ctx context.Context, in ListScaRepositories if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1602,6 +2103,7 @@ func (c *Client) ListScaRepositories(ctx context.Context, in ListScaRepositories // GetScaRepositoriesRepositoryIdInput is the input for GetScaRepositoriesRepositoryId — Get Repository Stats. type GetScaRepositoriesRepositoryIdInput struct { RepositoryID string `path:"repositoryId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } @@ -1615,6 +2117,9 @@ func (c *Client) GetScaRepositoriesRepositoryId(ctx context.Context, in GetScaRe for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1633,22 +2138,52 @@ func (c *Client) GetScaRepositoriesRepositoryId(ctx context.Context, in GetScaRe return &out, nil } -// ListScaRepositoriesRepositoryIdSbomInput is the input for ListScaRepositoriesRepositoryIdSbom — Get Repository SBOM. -type ListScaRepositoriesRepositoryIdSbomInput struct { - RepositoryID string `path:"repositoryId" json:"-"` +// ListScaScanRunsInput is the input for ListScaScanRuns — List Scan Runs. +type ListScaScanRunsInput struct { + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + ScanType *string `url:"scanType,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` models.RequestScope } -// ListScaRepositoriesRepositoryIdSbom - Get Repository SBOM -// GET /sca/repositories/{repositoryId}/sbom -func (c *Client) ListScaRepositoriesRepositoryIdSbom(ctx context.Context, in ListScaRepositoriesRepositoryIdSbomInput) (*models.EndpointsGetSCARepositorySBOMOutput, error) { - path := "/sca/repositories/{repositoryId}/sbom" - path = strings.Replace(path, "{repositoryId}", url.PathEscape(in.RepositoryID), 1) +// ListScaScanRuns - List Scan Runs +// GET /sca/scan-runs +func (c *Client) ListScaScanRuns(ctx context.Context, in ListScaScanRunsInput) (*models.EndpointsGetScanRunsOutput, error) { + path := "/sca/scan-runs" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.ScanType != nil { + query.Set("scanType", string(*in.ScanType)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) + } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1660,37 +2195,41 @@ func (c *Client) ListScaRepositoriesRepositoryIdSbom(ctx context.Context, in Lis if err != nil { return nil, err } - var out models.EndpointsGetSCARepositorySBOMOutput + var out models.EndpointsGetScanRunsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListScaScanRunsInput is the input for ListScaScanRuns — List Scan Runs. -type ListScaScanRunsInput struct { +// ListScaThreatFeedInput is the input for ListScaThreatFeed — List Threat Intelligence Feed. +type ListScaThreatFeedInput struct { + CveID *string `url:"cveId,omitempty" json:"-"` + Ecosystem *string `url:"ecosystem,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` Offset *int `url:"offset,omitempty" json:"-"` - RepositoryID *string `url:"repositoryId,omitempty" json:"-"` - ScanType *string `url:"scanType,omitempty" json:"-"` - Sort *string `url:"sort,omitempty" json:"-"` + Severity *string `url:"severity,omitempty" json:"-"` models.RequestScope } -// ListScaScanRuns - List Scan Runs -// GET /sca/scan-runs -func (c *Client) ListScaScanRuns(ctx context.Context, in ListScaScanRunsInput) (*models.EndpointsGetScanRunsOutput, error) { - path := "/sca/scan-runs" +// ListScaThreatFeed - List Threat Intelligence Feed +// GET /sca/threat-feed +func (c *Client) ListScaThreatFeed(ctx context.Context, in ListScaThreatFeedInput) (*models.EndpointsGetSCAThreatFeedOutput, error) { + path := "/sca/threat-feed" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } - if in.RepositoryID != nil { - query.Set("repositoryId", string(*in.RepositoryID)) + if in.CveID != nil { + query.Set("cveId", string(*in.CveID)) } - if in.ScanType != nil { - query.Set("scanType", string(*in.ScanType)) + if in.Ecosystem != nil { + query.Set("ecosystem", string(*in.Ecosystem)) + } + if in.Severity != nil { + query.Set("severity", string(*in.Severity)) } if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) @@ -1698,8 +2237,8 @@ func (c *Client) ListScaScanRuns(ctx context.Context, in ListScaScanRunsInput) ( if in.Offset != nil { query.Set("offset", strconv.Itoa(int(*in.Offset))) } - if in.Sort != nil { - query.Set("sort", string(*in.Sort)) + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) } in.RequestScope.AddTo(query) @@ -1712,7 +2251,243 @@ func (c *Client) ListScaScanRuns(ctx context.Context, in ListScaScanRunsInput) ( if err != nil { return nil, err } - var out models.EndpointsGetScanRunsOutput + var out models.EndpointsGetSCAThreatFeedOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetScaThreatFeedThreatIdInput is the input for GetScaThreatFeedThreatId — Get Threat Intelligence Detail. +type GetScaThreatFeedThreatIdInput struct { + ThreatID string `path:"threatId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetScaThreatFeedThreatId - Get Threat Intelligence Detail +// GET /sca/threat-feed/{threatId} +func (c *Client) GetScaThreatFeedThreatId(ctx context.Context, in GetScaThreatFeedThreatIdInput) (*models.EndpointsGetSCAThreatFeedThreatOutput, error) { + path := "/sca/threat-feed/{threatId}" + path = strings.Replace(path, "{threatId}", url.PathEscape(in.ThreatID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSCAThreatFeedThreatOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListScaVulnerabilitiesInput is the input for ListScaVulnerabilities — List CVE Exposure Across The Fleet. +type ListScaVulnerabilitiesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + KevOnly *bool `url:"kevOnly,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + OpenOnly *bool `url:"openOnly,omitempty" json:"-"` + Package *string `url:"package,omitempty" json:"-"` + SortBy *string `url:"sortBy,omitempty" json:"-"` + models.RequestScope +} + +// ListScaVulnerabilities - List CVE Exposure Across The Fleet +// GET /sca/vulnerabilities +func (c *Client) ListScaVulnerabilities(ctx context.Context, in ListScaVulnerabilitiesInput) (*models.EndpointsGetSCAVulnerabilitiesOutput, error) { + path := "/sca/vulnerabilities" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.KevOnly != nil { + query.Set("kevOnly", strconv.FormatBool(*in.KevOnly)) + } + if in.OpenOnly != nil { + query.Set("openOnly", strconv.FormatBool(*in.OpenOnly)) + } + if in.SortBy != nil { + query.Set("sortBy", string(*in.SortBy)) + } + if in.Package != nil { + query.Set("package", string(*in.Package)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSCAVulnerabilitiesOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// GetScaVulnerabilitiesCveIdInput is the input for GetScaVulnerabilitiesCveId — Get CVE Intelligence. +type GetScaVulnerabilitiesCveIdInput struct { + CveID string `path:"cveId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// GetScaVulnerabilitiesCveId - Get CVE Intelligence +// GET /sca/vulnerabilities/{cveId} +func (c *Client) GetScaVulnerabilitiesCveId(ctx context.Context, in GetScaVulnerabilitiesCveIdInput) (*models.EndpointsGetSCAVulnerabilityOutput, error) { + path := "/sca/vulnerabilities/{cveId}" + path = strings.Replace(path, "{cveId}", url.PathEscape(in.CveID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSCAVulnerabilityOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListScaVulnerabilitiesCveIdFindingsInput is the input for ListScaVulnerabilitiesCveIdFindings — List Findings For A CVE. +type ListScaVulnerabilitiesCveIdFindingsInput struct { + CveID string `path:"cveId" json:"-"` + Branch *string `url:"branch,omitempty" json:"-"` + FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsResolved *bool `url:"isResolved,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + Type *string `url:"type,omitempty" json:"-"` + models.RequestScope +} + +// ListScaVulnerabilitiesCveIdFindings - List Findings For A CVE +// GET /sca/vulnerabilities/{cveId}/findings +func (c *Client) ListScaVulnerabilitiesCveIdFindings(ctx context.Context, in ListScaVulnerabilitiesCveIdFindingsInput) (*models.EndpointsGetSCAVulnerabilityFindingsOutput, error) { + path := "/sca/vulnerabilities/{cveId}/findings" + path = strings.Replace(path, "{cveId}", url.PathEscape(in.CveID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.Type != nil { + query.Set("type", string(*in.Type)) + } + if in.Branch != nil { + query.Set("branch", string(*in.Branch)) + } + if in.IsResolved != nil { + query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) + } + for _, v := range in.FileOwnerName { + query.Add("fileOwnerName", string(v)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSCAVulnerabilityFindingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListScaVulnerabilitiesCveIdPackagesInput is the input for ListScaVulnerabilitiesCveIdPackages — List Packages Affected By A CVE. +type ListScaVulnerabilitiesCveIdPackagesInput struct { + CveID string `path:"cveId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListScaVulnerabilitiesCveIdPackages - List Packages Affected By A CVE +// GET /sca/vulnerabilities/{cveId}/packages +func (c *Client) ListScaVulnerabilitiesCveIdPackages(ctx context.Context, in ListScaVulnerabilitiesCveIdPackagesInput) (*models.EndpointsGetSCAVulnerabilityPackagesOutput, error) { + path := "/sca/vulnerabilities/{cveId}/packages" + path = strings.Replace(path, "{cveId}", url.PathEscape(in.CveID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSCAVulnerabilityPackagesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } diff --git a/internal/api/scpm.go b/internal/api/scpm.go index aa6647e..8c1d77c 100644 --- a/internal/api/scpm.go +++ b/internal/api/scpm.go @@ -23,11 +23,13 @@ var _ = models.RequestScope{} // CreateScpmContainersAnalyzeInput is the input for CreateScpmContainersAnalyze — Request malware analysis for an OCI container image. type CreateScpmContainersAnalyzeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IdempotencyKey *string `json:"idempotencyKey,omitempty"` PreviousReference *string `json:"previousReference,omitempty"` Reference string `json:"reference"` Registry string `json:"registry"` Repository string `json:"repository"` + models.RequestScope } // CreateScpmContainersAnalyze - Request malware analysis for an OCI container image @@ -39,6 +41,10 @@ func (c *Client) CreateScpmContainersAnalyze(ctx context.Context, in CreateScpmC for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) if len(query) > 0 { @@ -72,59 +78,15 @@ func (c *Client) CreateScpmContainersAnalyze(ctx context.Context, in CreateScpmC return &out, nil } -// ListScpmDependenciesInput is the input for ListScpmDependencies — Get CI/CD Dependencies. -type ListScpmDependenciesInput struct { - Name *string `url:"name,omitempty" json:"-"` - Pinned *bool `url:"pinned,omitempty" json:"-"` - Platform *string `url:"platform,omitempty" json:"-"` - Version *string `url:"version,omitempty" json:"-"` -} - -// ListScpmDependencies - Get CI/CD Dependencies -// GET /scpm/dependencies -func (c *Client) ListScpmDependencies(ctx context.Context, in ListScpmDependenciesInput) (*models.EndpointsGetDependenciesOutput, error) { - path := "/scpm/dependencies" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - if in.Name != nil { - query.Set("name", string(*in.Name)) - } - if in.Version != nil { - query.Set("version", string(*in.Version)) - } - if in.Platform != nil { - query.Set("platform", string(*in.Platform)) - } - if in.Pinned != nil { - query.Set("pinned", strconv.FormatBool(*in.Pinned)) - } - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - data, err := c.do(ctx, "GET", fullURL, nil) - if err != nil { - return nil, err - } - var out models.EndpointsGetDependenciesOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - // CreateScpmDependenciesAnalyzeInput is the input for CreateScpmDependenciesAnalyze — Request malware analysis for a dependency. type CreateScpmDependenciesAnalyzeInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Ecosystem string `json:"ecosystem"` IdempotencyKey *string `json:"idempotencyKey,omitempty"` Name string `json:"name"` PreviousVersion *string `json:"previousVersion,omitempty"` Version string `json:"version"` + models.RequestScope } // CreateScpmDependenciesAnalyze - Request malware analysis for a dependency @@ -136,6 +98,10 @@ func (c *Client) CreateScpmDependenciesAnalyze(ctx context.Context, in CreateScp for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) if len(query) > 0 { @@ -171,7 +137,9 @@ func (c *Client) CreateScpmDependenciesAnalyze(ctx context.Context, in CreateScp // CreateScpmDependenciesQueryBatchInput is the input for CreateScpmDependenciesQueryBatch — Batch query vulnerabilities + malware verdict for dependencies. type CreateScpmDependenciesQueryBatchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Packages []models.EndpointsBatchQueryDependencyPackage `json:"packages,omitempty"` + models.RequestScope } // CreateScpmDependenciesQueryBatch - Batch query vulnerabilities + malware verdict for dependencies @@ -183,6 +151,10 @@ func (c *Client) CreateScpmDependenciesQueryBatch(ctx context.Context, in Create for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) if len(query) > 0 { @@ -210,6 +182,13 @@ func (c *Client) CreateScpmDependenciesQueryBatch(ctx context.Context, in Create // ListScpmEventsInput is the input for ListScpmEvents — Get SCPM Events. type ListScpmEventsInput struct { + EventType []string `url:"eventType,omitempty" json:"-"` + FindingID *string `url:"findingId,omitempty" json:"-"` + FromTime *string `url:"fromTime,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` models.RequestScope } @@ -222,6 +201,27 @@ func (c *Client) ListScpmEvents(ctx context.Context, in ListScpmEventsInput) (*m for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.FromTime != nil { + query.Set("fromTime", string(*in.FromTime)) + } + for _, v := range in.EventType { + query.Add("eventType", string(v)) + } + if in.FindingID != nil { + query.Set("findingId", string(*in.FindingID)) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -244,16 +244,20 @@ func (c *Client) ListScpmEvents(ctx context.Context, in ListScpmEventsInput) (*m type ListScpmFindingsInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + FindingType []string `url:"findingType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` HasPullRequest *bool `url:"hasPullRequest,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsArchived *bool `url:"isArchived,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` + Language []string `url:"language,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` PriorityLabel *string `url:"priorityLabel,omitempty" json:"-"` RepositoryIds []string `url:"repositoryIds,omitempty" json:"-"` + RuleID *string `url:"ruleId,omitempty" json:"-"` Severity *string `url:"severity,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` @@ -297,6 +301,15 @@ func (c *Client) ListScpmFindings(ctx context.Context, in ListScpmFindingsInput) for _, v := range in.RepositoryIds { query.Add("repositoryIds", string(v)) } + if in.RuleID != nil { + query.Set("ruleId", string(*in.RuleID)) + } + for _, v := range in.FindingType { + query.Add("findingType", string(v)) + } + for _, v := range in.Language { + query.Add("language", string(v)) + } if in.IsResolved != nil { query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) } @@ -318,6 +331,9 @@ func (c *Client) ListScpmFindings(ctx context.Context, in ListScpmFindingsInput) if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -338,6 +354,7 @@ func (c *Client) ListScpmFindings(ctx context.Context, in ListScpmFindingsInput) // CreateScpmFindingsAllowlistInput is the input for CreateScpmFindingsAllowlist — Allowlist Batch of SCPM Findings. type CreateScpmFindingsAllowlistInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` FindingIds []string `json:"findingIds,omitempty"` @@ -353,6 +370,9 @@ func (c *Client) CreateScpmFindingsAllowlist(ctx context.Context, in CreateScpmF for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -380,15 +400,21 @@ func (c *Client) CreateScpmFindingsAllowlist(ctx context.Context, in CreateScpmF type ListScpmFindingsDetailedInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + FindingType []string `url:"findingType,omitempty" json:"-"` + GateBase *bool `url:"gateBase,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` HasPullRequest *bool `url:"hasPullRequest,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsArchived *bool `url:"isArchived,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` + Language []string `url:"language,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` PriorityLabel *string `url:"priorityLabel,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + RuleID *string `url:"ruleId,omitempty" json:"-"` Severity *string `url:"severity,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` @@ -414,6 +440,9 @@ func (c *Client) ListScpmFindingsDetailed(ctx context.Context, in ListScpmFindin if in.PriorityLabel != nil { query.Set("priorityLabel", string(*in.PriorityLabel)) } + if in.RuleID != nil { + query.Set("ruleId", string(*in.RuleID)) + } if in.Severity != nil { query.Set("severity", string(*in.Severity)) } @@ -423,12 +452,21 @@ func (c *Client) ListScpmFindingsDetailed(ctx context.Context, in ListScpmFindin if in.HasPullRequest != nil { query.Set("hasPullRequest", strconv.FormatBool(*in.HasPullRequest)) } + for _, v := range in.FindingType { + query.Add("findingType", string(v)) + } + for _, v := range in.Language { + query.Add("language", string(v)) + } if in.Branch != nil { query.Set("branch", string(*in.Branch)) } if in.Workflow != nil { query.Set("workflow", string(*in.Workflow)) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } if in.IsResolved != nil { query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) } @@ -444,12 +482,18 @@ func (c *Client) ListScpmFindingsDetailed(ctx context.Context, in ListScpmFindin if in.IsArchived != nil { query.Set("isArchived", strconv.FormatBool(*in.IsArchived)) } + if in.GateBase != nil { + query.Set("gateBase", strconv.FormatBool(*in.GateBase)) + } if in.SortBy != nil { query.Set("sortBy", string(*in.SortBy)) } if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -472,16 +516,20 @@ func (c *Client) ListScpmFindingsDetailed(ctx context.Context, in ListScpmFindin type ListScpmFindingsPreviewInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + FindingType []string `url:"findingType,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` HasPullRequest *bool `url:"hasPullRequest,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsArchived *bool `url:"isArchived,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsFixed *bool `url:"isFixed,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` + Language []string `url:"language,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` PriorityLabel *string `url:"priorityLabel,omitempty" json:"-"` RepositoryIds []string `url:"repositoryIds,omitempty" json:"-"` + RuleID *string `url:"ruleId,omitempty" json:"-"` Severity *string `url:"severity,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` @@ -525,6 +573,15 @@ func (c *Client) ListScpmFindingsPreview(ctx context.Context, in ListScpmFinding for _, v := range in.RepositoryIds { query.Add("repositoryIds", string(v)) } + if in.RuleID != nil { + query.Set("ruleId", string(*in.RuleID)) + } + for _, v := range in.FindingType { + query.Add("findingType", string(v)) + } + for _, v := range in.Language { + query.Add("language", string(v)) + } if in.IsResolved != nil { query.Set("isResolved", strconv.FormatBool(*in.IsResolved)) } @@ -546,6 +603,9 @@ func (c *Client) ListScpmFindingsPreview(ctx context.Context, in ListScpmFinding if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -564,70 +624,9 @@ func (c *Client) ListScpmFindingsPreview(ctx context.Context, in ListScpmFinding return &out, nil } -// CreateScpmFindingsRetriageInput is the input for CreateScpmFindingsRetriage — Retriage Findings. -type CreateScpmFindingsRetriageInput struct { - Branch *string `json:"branch,omitempty"` - ContinueOnError *bool `json:"continueOnError,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - ForceRetriage *bool `json:"forceRetriage,omitempty"` - PriorityMinimum *string `json:"priorityMinimum,omitempty"` - RepositoryIds []string `json:"repositoryIds,omitempty"` - ReprocessFailedTriages *bool `json:"reprocessFailedTriages,omitempty"` - ReprocessFalsePositives *bool `json:"reprocessFalsePositives,omitempty"` - models.RequestScope -} - -// CreateScpmFindingsRetriage - Retriage Findings -// POST /scpm/findings/retriage -func (c *Client) CreateScpmFindingsRetriage(ctx context.Context, in CreateScpmFindingsRetriageInput) (*models.EndpointsPostRetriageSCPMFindingsOutput, error) { - path := "/scpm/findings/retriage" - - query := url.Values{} - for k, v := range c.DefaultParams { - query.Set(k, v) - } - in.RequestScope.AddTo(query) - - fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) - if len(query) > 0 { - fullURL += "?" + query.Encode() - } - - bodyBytes, err := json.Marshal(struct { - Branch *string `json:"branch,omitempty"` - ContinueOnError *bool `json:"continueOnError,omitempty"` - FindingIds []string `json:"findingIds,omitempty"` - ForceRetriage *bool `json:"forceRetriage,omitempty"` - PriorityMinimum *string `json:"priorityMinimum,omitempty"` - RepositoryIds []string `json:"repositoryIds,omitempty"` - ReprocessFailedTriages *bool `json:"reprocessFailedTriages,omitempty"` - ReprocessFalsePositives *bool `json:"reprocessFalsePositives,omitempty"` - }{ - Branch: in.Branch, - ContinueOnError: in.ContinueOnError, - FindingIds: in.FindingIds, - ForceRetriage: in.ForceRetriage, - PriorityMinimum: in.PriorityMinimum, - RepositoryIds: in.RepositoryIds, - ReprocessFailedTriages: in.ReprocessFailedTriages, - ReprocessFalsePositives: in.ReprocessFalsePositives, - }) - if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) - } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) - if err != nil { - return nil, err - } - var out models.EndpointsPostRetriageSCPMFindingsOutput - if err := json.Unmarshal(data, &out); err != nil { - return nil, fmt.Errorf("decode response: %w", err) - } - return &out, nil -} - // CreateScpmFindingsUploadInput is the input for CreateScpmFindingsUpload — Get Presigned URL to Upload SCPM Findings. type CreateScpmFindingsUploadInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` ScanID string `json:"scanId"` models.RequestScope } @@ -641,6 +640,9 @@ func (c *Client) CreateScpmFindingsUpload(ctx context.Context, in CreateScpmFind for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -670,9 +672,13 @@ func (c *Client) CreateScpmFindingsUpload(ctx context.Context, in CreateScpmFind // GetScpmFindingsFindingIdInput is the input for GetScpmFindingsFindingId — Get Finding. type GetScpmFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetScpmFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetScpmFindingsFindingId - Get Finding // GET /scpm/findings/{findingId} func (c *Client) GetScpmFindingsFindingId(ctx context.Context, in GetScpmFindingsFindingIdInput) (*models.EndpointsGetSCPMFindingOutput, error) { @@ -683,6 +689,9 @@ func (c *Client) GetScpmFindingsFindingId(ctx context.Context, in GetScpmFinding for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -704,11 +713,17 @@ func (c *Client) GetScpmFindingsFindingId(ctx context.Context, in GetScpmFinding // PatchScpmFindingsFindingIdInput is the input for PatchScpmFindingsFindingId — Update Finding. type PatchScpmFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + IsFalsePositive *bool `json:"isFalsePositive,omitempty"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` + UserNotes *string `json:"userNotes,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *PatchScpmFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // PatchScpmFindingsFindingId - Update Finding // PATCH /scpm/findings/{findingId} func (c *Client) PatchScpmFindingsFindingId(ctx context.Context, in PatchScpmFindingsFindingIdInput) (*models.EndpointsPatchSCPMFindingOutput, error) { @@ -719,6 +734,9 @@ func (c *Client) PatchScpmFindingsFindingId(ctx context.Context, in PatchScpmFin for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -727,11 +745,15 @@ func (c *Client) PatchScpmFindingsFindingId(ctx context.Context, in PatchScpmFin } bodyBytes, err := json.Marshal(struct { + IsFalsePositive *bool `json:"isFalsePositive,omitempty"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` + UserNotes *string `json:"userNotes,omitempty"` }{ + IsFalsePositive: in.IsFalsePositive, PriorityOverride: in.PriorityOverride, SeverityOverride: in.SeverityOverride, + UserNotes: in.UserNotes, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -750,11 +772,15 @@ func (c *Client) PatchScpmFindingsFindingId(ctx context.Context, in PatchScpmFin // CreateScpmFindingsFindingIdAllowlistInput is the input for CreateScpmFindingsFindingIdAllowlist — Allowlist Finding. type CreateScpmFindingsFindingIdAllowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateScpmFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateScpmFindingsFindingIdAllowlist - Allowlist Finding // POST /scpm/findings/{findingId}/allowlist func (c *Client) CreateScpmFindingsFindingIdAllowlist(ctx context.Context, in CreateScpmFindingsFindingIdAllowlistInput) (*models.EndpointsPostAllowlistSCPMFindingOutput, error) { @@ -765,6 +791,9 @@ func (c *Client) CreateScpmFindingsFindingIdAllowlist(ctx context.Context, in Cr for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -796,11 +825,15 @@ func (c *Client) CreateScpmFindingsFindingIdAllowlist(ctx context.Context, in Cr // ListScpmFindingsFindingIdAutofixActivityInput is the input for ListScpmFindingsFindingIdAutofixActivity — Get SCPM Finding Autofix Activity. type ListScpmFindingsFindingIdAutofixActivityInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int32 `url:"limit,omitempty" json:"-"` SinceID *string `url:"since_id,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListScpmFindingsFindingIdAutofixActivityInput) SetFindingID(id string) { in.FindingID = id } + // ListScpmFindingsFindingIdAutofixActivity - Get SCPM Finding Autofix Activity // GET /scpm/findings/{findingId}/autofix/activity func (c *Client) ListScpmFindingsFindingIdAutofixActivity(ctx context.Context, in ListScpmFindingsFindingIdAutofixActivityInput) (*models.EndpointsGetAutofixActivityLogOutput, error) { @@ -817,6 +850,9 @@ func (c *Client) ListScpmFindingsFindingIdAutofixActivity(ctx context.Context, i if in.Limit != nil { query.Set("limit", strconv.Itoa(int(*in.Limit))) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -835,23 +871,33 @@ func (c *Client) ListScpmFindingsFindingIdAutofixActivity(ctx context.Context, i return &out, nil } -// CreateScpmFindingsFindingIdAutofixCacheInput is the input for CreateScpmFindingsFindingIdAutofixCache — Cache Autofix. -type CreateScpmFindingsFindingIdAutofixCacheInput struct { +// CreateScpmFindingsFindingIdAutofixFixInput is the input for CreateScpmFindingsFindingIdAutofixFix — Autofix Finding. +type CreateScpmFindingsFindingIdAutofixFixInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Assignees []models.ModelsUser `json:"assignees,omitempty"` Force *bool `json:"force,omitempty"` + Message *string `json:"message,omitempty"` + OriginCampaignID *string `json:"originCampaignId,omitempty"` models.RequestScope } -// CreateScpmFindingsFindingIdAutofixCache - Cache Autofix -// POST /scpm/findings/{findingId}/autofix/cache -func (c *Client) CreateScpmFindingsFindingIdAutofixCache(ctx context.Context, in CreateScpmFindingsFindingIdAutofixCacheInput) ([]byte, error) { - path := "/scpm/findings/{findingId}/autofix/cache" +// SetFindingID sets the finding that the request targets. +func (in *CreateScpmFindingsFindingIdAutofixFixInput) SetFindingID(id string) { in.FindingID = id } + +// CreateScpmFindingsFindingIdAutofixFix - Autofix Finding +// POST /scpm/findings/{findingId}/autofix/fix +func (c *Client) CreateScpmFindingsFindingIdAutofixFix(ctx context.Context, in CreateScpmFindingsFindingIdAutofixFixInput) (*models.EndpointsPostAutofixSCPMFindingOutput, error) { + path := "/scpm/findings/{findingId}/autofix/fix" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -860,34 +906,53 @@ func (c *Client) CreateScpmFindingsFindingIdAutofixCache(ctx context.Context, in } bodyBytes, err := json.Marshal(struct { + Assignees []models.ModelsUser `json:"assignees,omitempty"` Force *bool `json:"force,omitempty"` + Message *string `json:"message,omitempty"` + OriginCampaignID *string `json:"originCampaignId,omitempty"` }{ + Assignees: in.Assignees, Force: in.Force, + Message: in.Message, + OriginCampaignID: in.OriginCampaignID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) - return data, err + if err != nil { + return nil, err + } + var out models.EndpointsPostAutofixSCPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } -// CreateScpmFindingsFindingIdAutofixCacheCreatePrInput is the input for CreateScpmFindingsFindingIdAutofixCacheCreatePr — Create Pull Request from Cached Fix. -type CreateScpmFindingsFindingIdAutofixCacheCreatePrInput struct { +// ListScpmFindingsFindingIdAutofixStateInput is the input for ListScpmFindingsFindingIdAutofixState — Get SCPM Finding Autofix State. +type ListScpmFindingsFindingIdAutofixStateInput struct { FindingID string `path:"findingId" json:"-"` - Message *string `json:"message,omitempty"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// CreateScpmFindingsFindingIdAutofixCacheCreatePr - Create Pull Request from Cached Fix -// POST /scpm/findings/{findingId}/autofix/cache/create_pr -func (c *Client) CreateScpmFindingsFindingIdAutofixCacheCreatePr(ctx context.Context, in CreateScpmFindingsFindingIdAutofixCacheCreatePrInput) (*models.EndpointsPostCreatePullRequestSCPMFindingOutput, error) { - path := "/scpm/findings/{findingId}/autofix/cache/create_pr" +// SetFindingID sets the finding that the request targets. +func (in *ListScpmFindingsFindingIdAutofixStateInput) SetFindingID(id string) { in.FindingID = id } + +// ListScpmFindingsFindingIdAutofixState - Get SCPM Finding Autofix State +// GET /scpm/findings/{findingId}/autofix/state +func (c *Client) ListScpmFindingsFindingIdAutofixState(ctx context.Context, in ListScpmFindingsFindingIdAutofixStateInput) (*models.EndpointsGetSCPMFindingAutofixStateOutput, error) { + path := "/scpm/findings/{findingId}/autofix/state" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -895,41 +960,85 @@ func (c *Client) CreateScpmFindingsFindingIdAutofixCacheCreatePr(ctx context.Con fullURL += "?" + query.Encode() } - bodyBytes, err := json.Marshal(struct { - Message *string `json:"message,omitempty"` - }{ - Message: in.Message, - }) + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { - return nil, fmt.Errorf("marshal body: %w", err) + return nil, err } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + var out models.EndpointsGetSCPMFindingAutofixStateOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListScpmFindingsFindingIdAutofixStatusInput is the input for ListScpmFindingsFindingIdAutofixStatus — Get SCPM Finding Autofix Status. +type ListScpmFindingsFindingIdAutofixStatusInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *ListScpmFindingsFindingIdAutofixStatusInput) SetFindingID(id string) { in.FindingID = id } + +// ListScpmFindingsFindingIdAutofixStatus - Get SCPM Finding Autofix Status +// GET /scpm/findings/{findingId}/autofix/status +func (c *Client) ListScpmFindingsFindingIdAutofixStatus(ctx context.Context, in ListScpmFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetSCPMFindingAutofixStatusOutput, error) { + path := "/scpm/findings/{findingId}/autofix/status" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsPostCreatePullRequestSCPMFindingOutput + var out models.EndpointsGetSCPMFindingAutofixStatusOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListScpmFindingsFindingIdAutofixCacheDiffInput is the input for ListScpmFindingsFindingIdAutofixCacheDiff — Get SCPM Finding Autofix Diff. -type ListScpmFindingsFindingIdAutofixCacheDiffInput struct { +// ListScpmFindingsFindingIdEventsInput is the input for ListScpmFindingsFindingIdEvents — Get Finding Events. +type ListScpmFindingsFindingIdEventsInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// ListScpmFindingsFindingIdAutofixCacheDiff - Get SCPM Finding Autofix Diff -// GET /scpm/findings/{findingId}/autofix/cache/diff -func (c *Client) ListScpmFindingsFindingIdAutofixCacheDiff(ctx context.Context, in ListScpmFindingsFindingIdAutofixCacheDiffInput) (*models.EndpointsGetSCPMFindingFixOutput, error) { - path := "/scpm/findings/{findingId}/autofix/cache/diff" +// SetFindingID sets the finding that the request targets. +func (in *ListScpmFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + +// ListScpmFindingsFindingIdEvents - Get Finding Events +// GET /scpm/findings/{findingId}/events +func (c *Client) ListScpmFindingsFindingIdEvents(ctx context.Context, in ListScpmFindingsFindingIdEventsInput) (*models.EndpointsGetSCPMFindingEventsOutput, error) { + path := "/scpm/findings/{findingId}/events" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -941,33 +1050,83 @@ func (c *Client) ListScpmFindingsFindingIdAutofixCacheDiff(ctx context.Context, if err != nil { return nil, err } - var out models.EndpointsGetSCPMFindingFixOutput + var out models.EndpointsGetSCPMFindingEventsOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateScpmFindingsFindingIdAutofixFixInput is the input for CreateScpmFindingsFindingIdAutofixFix — Autofix Finding. -type CreateScpmFindingsFindingIdAutofixFixInput struct { +// DeleteScpmFindingsFindingIdTicketInput is the input for DeleteScpmFindingsFindingIdTicket — Delete Ticket for SCPM Finding. +type DeleteScpmFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteScpmFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteScpmFindingsFindingIdTicket - Delete Ticket for SCPM Finding +// DELETE /scpm/findings/{findingId}/ticket +func (c *Client) DeleteScpmFindingsFindingIdTicket(ctx context.Context, in DeleteScpmFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketSCPMFindingOutput, error) { + path := "/scpm/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSCPMFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// CreateScpmFindingsFindingIdTicketInput is the input for CreateScpmFindingsFindingIdTicket — Create Ticket for SCPM Finding. +type CreateScpmFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` - Force *bool `json:"force,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + CampaignTitle *string `json:"campaignTitle,omitempty"` Message *string `json:"message,omitempty"` - OriginCampaignID *string `json:"originCampaignId,omitempty"` + Project *string `json:"project,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` models.RequestScope } -// CreateScpmFindingsFindingIdAutofixFix - Autofix Finding -// POST /scpm/findings/{findingId}/autofix/fix -func (c *Client) CreateScpmFindingsFindingIdAutofixFix(ctx context.Context, in CreateScpmFindingsFindingIdAutofixFixInput) (*models.EndpointsPostAutofixSCPMFindingOutput, error) { - path := "/scpm/findings/{findingId}/autofix/fix" +// SetFindingID sets the finding that the request targets. +func (in *CreateScpmFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// CreateScpmFindingsFindingIdTicket - Create Ticket for SCPM Finding +// POST /scpm/findings/{findingId}/ticket +func (c *Client) CreateScpmFindingsFindingIdTicket(ctx context.Context, in CreateScpmFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketSCPMFindingOutput, error) { + path := "/scpm/findings/{findingId}/ticket" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -977,14 +1136,18 @@ func (c *Client) CreateScpmFindingsFindingIdAutofixFix(ctx context.Context, in C bodyBytes, err := json.Marshal(struct { Assignees []models.ModelsUser `json:"assignees,omitempty"` - Force *bool `json:"force,omitempty"` + CampaignID *string `json:"campaignId,omitempty"` + CampaignTitle *string `json:"campaignTitle,omitempty"` Message *string `json:"message,omitempty"` - OriginCampaignID *string `json:"originCampaignId,omitempty"` + Project *string `json:"project,omitempty"` + UserCanonicalID *string `json:"userCanonicalId,omitempty"` }{ Assignees: in.Assignees, - Force: in.Force, + CampaignID: in.CampaignID, + CampaignTitle: in.CampaignTitle, Message: in.Message, - OriginCampaignID: in.OriginCampaignID, + Project: in.Project, + UserCanonicalID: in.UserCanonicalID, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) @@ -993,29 +1156,36 @@ func (c *Client) CreateScpmFindingsFindingIdAutofixFix(ctx context.Context, in C if err != nil { return nil, err } - var out models.EndpointsPostAutofixSCPMFindingOutput + var out models.EndpointsPostCreateTicketSCPMFindingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListScpmFindingsFindingIdAutofixStateInput is the input for ListScpmFindingsFindingIdAutofixState — Get SCPM Finding Autofix State. -type ListScpmFindingsFindingIdAutofixStateInput struct { +// ListScpmFindingsFindingIdTriageInput is the input for ListScpmFindingsFindingIdTriage — Get Triaged Finding. +type ListScpmFindingsFindingIdTriageInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListScpmFindingsFindingIdAutofixState - Get SCPM Finding Autofix State -// GET /scpm/findings/{findingId}/autofix/state -func (c *Client) ListScpmFindingsFindingIdAutofixState(ctx context.Context, in ListScpmFindingsFindingIdAutofixStateInput) (*models.EndpointsGetSCPMFindingAutofixStateOutput, error) { - path := "/scpm/findings/{findingId}/autofix/state" +// SetFindingID sets the finding that the request targets. +func (in *ListScpmFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + +// ListScpmFindingsFindingIdTriage - Get Triaged Finding +// GET /scpm/findings/{findingId}/triage +func (c *Client) ListScpmFindingsFindingIdTriage(ctx context.Context, in ListScpmFindingsFindingIdTriageInput) (*models.EndpointsGetSCPMFindingTriageOutput, error) { + path := "/scpm/findings/{findingId}/triage" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1027,29 +1197,37 @@ func (c *Client) ListScpmFindingsFindingIdAutofixState(ctx context.Context, in L if err != nil { return nil, err } - var out models.EndpointsGetSCPMFindingAutofixStateOutput + var out models.EndpointsGetSCPMFindingTriageOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListScpmFindingsFindingIdAutofixStatusInput is the input for ListScpmFindingsFindingIdAutofixStatus — Get SCPM Finding Autofix Status. -type ListScpmFindingsFindingIdAutofixStatusInput struct { +// CreateScpmFindingsFindingIdUnallowlistInput is the input for CreateScpmFindingsFindingIdUnallowlist — Unallowlist Finding. +type CreateScpmFindingsFindingIdUnallowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + UnallowlistReason string `json:"unallowlistReason"` models.RequestScope } -// ListScpmFindingsFindingIdAutofixStatus - Get SCPM Finding Autofix Status -// GET /scpm/findings/{findingId}/autofix/status -func (c *Client) ListScpmFindingsFindingIdAutofixStatus(ctx context.Context, in ListScpmFindingsFindingIdAutofixStatusInput) (*models.EndpointsGetSCPMFindingAutofixStatusOutput, error) { - path := "/scpm/findings/{findingId}/autofix/status" +// SetFindingID sets the finding that the request targets. +func (in *CreateScpmFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + +// CreateScpmFindingsFindingIdUnallowlist - Unallowlist Finding +// POST /scpm/findings/{findingId}/unallowlist +func (c *Client) CreateScpmFindingsFindingIdUnallowlist(ctx context.Context, in CreateScpmFindingsFindingIdUnallowlistInput) ([]byte, error) { + path := "/scpm/findings/{findingId}/unallowlist" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1057,33 +1235,82 @@ func (c *Client) ListScpmFindingsFindingIdAutofixStatus(ctx context.Context, in fullURL += "?" + query.Encode() } - data, err := c.do(ctx, "GET", fullURL, nil) + bodyBytes, err := json.Marshal(struct { + UnallowlistReason string `json:"unallowlistReason"` + }{ + UnallowlistReason: in.UnallowlistReason, + }) + if err != nil { + return nil, fmt.Errorf("marshal body: %w", err) + } + data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) + return data, err +} + +// CreateScpmFindingsFindingIdUnmarkFalsePositiveInput is the input for CreateScpmFindingsFindingIdUnmarkFalsePositive — Unmark SCPM Finding as False Positive. +type CreateScpmFindingsFindingIdUnmarkFalsePositiveInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *CreateScpmFindingsFindingIdUnmarkFalsePositiveInput) SetFindingID(id string) { in.FindingID = id } + +// CreateScpmFindingsFindingIdUnmarkFalsePositive - Unmark SCPM Finding as False Positive +// POST /scpm/findings/{findingId}/unmark-false-positive +func (c *Client) CreateScpmFindingsFindingIdUnmarkFalsePositive(ctx context.Context, in CreateScpmFindingsFindingIdUnmarkFalsePositiveInput) (*models.EndpointsPostUnmarkFalsePositiveSCPMFindingOutput, error) { + path := "/scpm/findings/{findingId}/unmark-false-positive" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "POST", fullURL, nil) if err != nil { return nil, err } - var out models.EndpointsGetSCPMFindingAutofixStatusOutput + var out models.EndpointsPostUnmarkFalsePositiveSCPMFindingOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListScpmFindingsFindingIdEventsInput is the input for ListScpmFindingsFindingIdEvents — Get Finding Events. -type ListScpmFindingsFindingIdEventsInput struct { +// ListScpmFindingsFindingIdUsersInput is the input for ListScpmFindingsFindingIdUsers — Get Finding Users. +type ListScpmFindingsFindingIdUsersInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } -// ListScpmFindingsFindingIdEvents - Get Finding Events -// GET /scpm/findings/{findingId}/events -func (c *Client) ListScpmFindingsFindingIdEvents(ctx context.Context, in ListScpmFindingsFindingIdEventsInput) (*models.EndpointsGetSCPMFindingEventsOutput, error) { - path := "/scpm/findings/{findingId}/events" +// SetFindingID sets the finding that the request targets. +func (in *ListScpmFindingsFindingIdUsersInput) SetFindingID(id string) { in.FindingID = id } + +// ListScpmFindingsFindingIdUsers - Get Finding Users +// GET /scpm/findings/{findingId}/users +func (c *Client) ListScpmFindingsFindingIdUsers(ctx context.Context, in ListScpmFindingsFindingIdUsersInput) (*models.EndpointsGetSCPMFindingUsersOutput, error) { + path := "/scpm/findings/{findingId}/users" path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1095,29 +1322,39 @@ func (c *Client) ListScpmFindingsFindingIdEvents(ctx context.Context, in ListScp if err != nil { return nil, err } - var out models.EndpointsGetSCPMFindingEventsOutput + var out models.EndpointsGetSCPMFindingUsersOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// ListScpmFindingsFindingIdTriageInput is the input for ListScpmFindingsFindingIdTriage — Get Triaged Finding. -type ListScpmFindingsFindingIdTriageInput struct { - FindingID string `path:"findingId" json:"-"` +// ListScpmRepositoriesInput is the input for ListScpmRepositories — Get Repositories. +type ListScpmRepositoriesInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } -// ListScpmFindingsFindingIdTriage - Get Triaged Finding -// GET /scpm/findings/{findingId}/triage -func (c *Client) ListScpmFindingsFindingIdTriage(ctx context.Context, in ListScpmFindingsFindingIdTriageInput) (*models.EndpointsGetSCPMFindingTriageOutput, error) { - path := "/scpm/findings/{findingId}/triage" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListScpmRepositories - Get Repositories +// GET /scpm/repositories +func (c *Client) ListScpmRepositories(ctx context.Context, in ListScpmRepositoriesInput) (*models.EndpointsGetSCPMRepositoriesOutput, error) { + path := "/scpm/repositories" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1129,30 +1366,133 @@ func (c *Client) ListScpmFindingsFindingIdTriage(ctx context.Context, in ListScp if err != nil { return nil, err } - var out models.EndpointsGetSCPMFindingTriageOutput + var out models.EndpointsGetSCPMRepositoriesOutput if err := json.Unmarshal(data, &out); err != nil { return nil, fmt.Errorf("decode response: %w", err) } return &out, nil } -// CreateScpmFindingsFindingIdUnallowlistInput is the input for CreateScpmFindingsFindingIdUnallowlist — Unallowlist Finding. -type CreateScpmFindingsFindingIdUnallowlistInput struct { - FindingID string `path:"findingId" json:"-"` - UnallowlistReason string `json:"unallowlistReason"` +// ListScpmScanRunsInput is the input for ListScpmScanRuns — List Scan Runs. +type ListScpmScanRunsInput struct { + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + Limit *int `url:"limit,omitempty" json:"-"` + Offset *int `url:"offset,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` + Sort *string `url:"sort,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` models.RequestScope } -// CreateScpmFindingsFindingIdUnallowlist - Unallowlist Finding -// POST /scpm/findings/{findingId}/unallowlist -func (c *Client) CreateScpmFindingsFindingIdUnallowlist(ctx context.Context, in CreateScpmFindingsFindingIdUnallowlistInput) ([]byte, error) { - path := "/scpm/findings/{findingId}/unallowlist" - path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) +// ListScpmScanRuns - List Scan Runs +// GET /scpm/scan-runs +func (c *Client) ListScpmScanRuns(ctx context.Context, in ListScpmScanRunsInput) (*models.EndpointsGetScanRunsOutput, error) { + path := "/scpm/scan-runs" query := url.Values{} for k, v := range c.DefaultParams { query.Set(k, v) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + if in.Limit != nil { + query.Set("limit", strconv.Itoa(int(*in.Limit))) + } + if in.Offset != nil { + query.Set("offset", strconv.Itoa(int(*in.Offset))) + } + if in.Sort != nil { + query.Set("sort", string(*in.Sort)) + } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetScanRunsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// ListScpmSettingsInput is the input for ListScpmSettings — Get SCPM Settings. +type ListScpmSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// ListScpmSettings - Get SCPM Settings +// GET /scpm/settings +func (c *Client) ListScpmSettings(ctx context.Context, in ListScpmSettingsInput) (*models.EndpointsGetSCPMSettingsOutput, error) { + path := "/scpm/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "GET", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsGetSCPMSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + +// UpdateScpmSettingsInput is the input for UpdateScpmSettings — Put SCPM Settings. +type UpdateScpmSettingsInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + AcceptedLicenses []string `json:"acceptedLicenses,omitempty"` + CooldownDays int `json:"cooldownDays"` + CooldownEnabled bool `json:"cooldownEnabled"` + CooldownOverrides map[string]int `json:"cooldownOverrides,omitempty"` + CooldownWarnOnly *bool `json:"cooldownWarnOnly,omitempty"` + PackageAllowlist []models.ModelsSCPMPackageAllowlistEntry `json:"packageAllowlist,omitempty"` + models.RequestScope +} + +// UpdateScpmSettings - Put SCPM Settings +// PUT /scpm/settings +func (c *Client) UpdateScpmSettings(ctx context.Context, in UpdateScpmSettingsInput) (*models.EndpointsPutSCPMSettingsOutput, error) { + path := "/scpm/settings" + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1161,13 +1501,30 @@ func (c *Client) CreateScpmFindingsFindingIdUnallowlist(ctx context.Context, in } bodyBytes, err := json.Marshal(struct { - UnallowlistReason string `json:"unallowlistReason"` + AcceptedLicenses []string `json:"acceptedLicenses,omitempty"` + CooldownDays int `json:"cooldownDays"` + CooldownEnabled bool `json:"cooldownEnabled"` + CooldownOverrides map[string]int `json:"cooldownOverrides,omitempty"` + CooldownWarnOnly *bool `json:"cooldownWarnOnly,omitempty"` + PackageAllowlist []models.ModelsSCPMPackageAllowlistEntry `json:"packageAllowlist,omitempty"` }{ - UnallowlistReason: in.UnallowlistReason, + AcceptedLicenses: in.AcceptedLicenses, + CooldownDays: in.CooldownDays, + CooldownEnabled: in.CooldownEnabled, + CooldownOverrides: in.CooldownOverrides, + CooldownWarnOnly: in.CooldownWarnOnly, + PackageAllowlist: in.PackageAllowlist, }) if err != nil { return nil, fmt.Errorf("marshal body: %w", err) } - data, err := c.do(ctx, "POST", fullURL, bytes.NewReader(bodyBytes)) - return data, err + data, err := c.do(ctx, "PUT", fullURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, err + } + var out models.EndpointsPutSCPMSettingsOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil } diff --git a/internal/api/secrets.go b/internal/api/secrets.go index 884e4cd..468c586 100644 --- a/internal/api/secrets.go +++ b/internal/api/secrets.go @@ -25,6 +25,7 @@ var _ = models.RequestScope{} type ListSecretsCredentialsFindingsInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` @@ -75,6 +76,9 @@ func (c *Client) ListSecretsCredentialsFindings(ctx context.Context, in ListSecr if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -95,6 +99,7 @@ func (c *Client) ListSecretsCredentialsFindings(ctx context.Context, in ListSecr // CreateSecretsCredentialsFindingsAllowlistBatchInput is the input for CreateSecretsCredentialsFindingsAllowlistBatch — Allowlist Batch of Credential Findings. type CreateSecretsCredentialsFindingsAllowlistBatchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` FindingIds []string `json:"findingIds,omitempty"` @@ -110,6 +115,9 @@ func (c *Client) CreateSecretsCredentialsFindingsAllowlistBatch(ctx context.Cont for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -137,11 +145,14 @@ func (c *Client) CreateSecretsCredentialsFindingsAllowlistBatch(ctx context.Cont type ListSecretsCredentialsFindingsDetailedInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + FilePath []string `url:"filePath,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` SecretType *string `url:"secretType,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` @@ -181,12 +192,21 @@ func (c *Client) ListSecretsCredentialsFindingsDetailed(ctx context.Context, in if in.IsFalsePositive != nil { query.Set("isFalsePositive", strconv.FormatBool(*in.IsFalsePositive)) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + for _, v := range in.FilePath { + query.Add("filePath", string(v)) + } if in.SortBy != nil { query.Set("sortBy", string(*in.SortBy)) } if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -208,9 +228,13 @@ func (c *Client) ListSecretsCredentialsFindingsDetailed(ctx context.Context, in // GetSecretsCredentialsFindingsFindingIdInput is the input for GetSecretsCredentialsFindingsFindingId — Get Credential Finding. type GetSecretsCredentialsFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetSecretsCredentialsFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetSecretsCredentialsFindingsFindingId - Get Credential Finding // GET /secrets/credentials/findings/{findingId} func (c *Client) GetSecretsCredentialsFindingsFindingId(ctx context.Context, in GetSecretsCredentialsFindingsFindingIdInput) (*models.EndpointsGetSecretsFindingOutput, error) { @@ -221,6 +245,9 @@ func (c *Client) GetSecretsCredentialsFindingsFindingId(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -242,12 +269,16 @@ func (c *Client) GetSecretsCredentialsFindingsFindingId(ctx context.Context, in // PatchSecretsCredentialsFindingsFindingIdInput is the input for PatchSecretsCredentialsFindingsFindingId — Update Credential Finding. type PatchSecretsCredentialsFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` UserNotes *string `json:"userNotes,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *PatchSecretsCredentialsFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // PatchSecretsCredentialsFindingsFindingId - Update Credential Finding // PATCH /secrets/credentials/findings/{findingId} func (c *Client) PatchSecretsCredentialsFindingsFindingId(ctx context.Context, in PatchSecretsCredentialsFindingsFindingIdInput) (*models.EndpointsPatchSecretsFindingOutput, error) { @@ -258,6 +289,9 @@ func (c *Client) PatchSecretsCredentialsFindingsFindingId(ctx context.Context, i for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -291,11 +325,15 @@ func (c *Client) PatchSecretsCredentialsFindingsFindingId(ctx context.Context, i // CreateSecretsCredentialsFindingsFindingIdAllowlistInput is the input for CreateSecretsCredentialsFindingsFindingIdAllowlist — Allowlist Credential Finding. type CreateSecretsCredentialsFindingsFindingIdAllowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsCredentialsFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsCredentialsFindingsFindingIdAllowlist - Allowlist Credential Finding // POST /secrets/credentials/findings/{findingId}/allowlist func (c *Client) CreateSecretsCredentialsFindingsFindingIdAllowlist(ctx context.Context, in CreateSecretsCredentialsFindingsFindingIdAllowlistInput) ([]byte, error) { @@ -306,6 +344,9 @@ func (c *Client) CreateSecretsCredentialsFindingsFindingIdAllowlist(ctx context. for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -330,9 +371,14 @@ func (c *Client) CreateSecretsCredentialsFindingsFindingIdAllowlist(ctx context. // ListSecretsCredentialsFindingsFindingIdEventsInput is the input for ListSecretsCredentialsFindingsFindingIdEvents — Get Finding Events. type ListSecretsCredentialsFindingsFindingIdEventsInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsCredentialsFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsCredentialsFindingsFindingIdEvents - Get Finding Events // GET /secrets/credentials/findings/{findingId}/events func (c *Client) ListSecretsCredentialsFindingsFindingIdEvents(ctx context.Context, in ListSecretsCredentialsFindingsFindingIdEventsInput) (*models.EndpointsGetSecretsFindingEventsOutput, error) { @@ -343,6 +389,12 @@ func (c *Client) ListSecretsCredentialsFindingsFindingIdEvents(ctx context.Conte for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -361,9 +413,51 @@ func (c *Client) ListSecretsCredentialsFindingsFindingIdEvents(ctx context.Conte return &out, nil } +// DeleteSecretsCredentialsFindingsFindingIdTicketInput is the input for DeleteSecretsCredentialsFindingsFindingIdTicket — Delete Ticket for Credential Finding. +type DeleteSecretsCredentialsFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteSecretsCredentialsFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteSecretsCredentialsFindingsFindingIdTicket - Delete Ticket for Credential Finding +// DELETE /secrets/credentials/findings/{findingId}/ticket +func (c *Client) DeleteSecretsCredentialsFindingsFindingIdTicket(ctx context.Context, in DeleteSecretsCredentialsFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketSecretsFindingOutput, error) { + path := "/secrets/credentials/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSecretsFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateSecretsCredentialsFindingsFindingIdTicketInput is the input for CreateSecretsCredentialsFindingsFindingIdTicket — Create Ticket for Credential Finding. type CreateSecretsCredentialsFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` CampaignTitle *string `json:"campaignTitle,omitempty"` @@ -372,6 +466,9 @@ type CreateSecretsCredentialsFindingsFindingIdTicketInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsCredentialsFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsCredentialsFindingsFindingIdTicket - Create Ticket for Credential Finding // POST /secrets/credentials/findings/{findingId}/ticket func (c *Client) CreateSecretsCredentialsFindingsFindingIdTicket(ctx context.Context, in CreateSecretsCredentialsFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketSecretsFindingOutput, error) { @@ -382,6 +479,9 @@ func (c *Client) CreateSecretsCredentialsFindingsFindingIdTicket(ctx context.Con for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -419,9 +519,13 @@ func (c *Client) CreateSecretsCredentialsFindingsFindingIdTicket(ctx context.Con // ListSecretsCredentialsFindingsFindingIdTriageInput is the input for ListSecretsCredentialsFindingsFindingIdTriage — Get Triaged Credential Finding. type ListSecretsCredentialsFindingsFindingIdTriageInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsCredentialsFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsCredentialsFindingsFindingIdTriage - Get Triaged Credential Finding // GET /secrets/credentials/findings/{findingId}/triage func (c *Client) ListSecretsCredentialsFindingsFindingIdTriage(ctx context.Context, in ListSecretsCredentialsFindingsFindingIdTriageInput) (*models.EndpointsGetSecretsFindingTriageOutput, error) { @@ -432,6 +536,9 @@ func (c *Client) ListSecretsCredentialsFindingsFindingIdTriage(ctx context.Conte for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -453,11 +560,15 @@ func (c *Client) ListSecretsCredentialsFindingsFindingIdTriage(ctx context.Conte // CreateSecretsCredentialsFindingsFindingIdUnallowlistInput is the input for CreateSecretsCredentialsFindingsFindingIdUnallowlist — Unallowlist Credential Finding. type CreateSecretsCredentialsFindingsFindingIdUnallowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` UnallowlistReason string `json:"unallowlistReason"` UnallowlistType models.ModelsAllowlistType `json:"unallowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsCredentialsFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsCredentialsFindingsFindingIdUnallowlist - Unallowlist Credential Finding // POST /secrets/credentials/findings/{findingId}/unallowlist func (c *Client) CreateSecretsCredentialsFindingsFindingIdUnallowlist(ctx context.Context, in CreateSecretsCredentialsFindingsFindingIdUnallowlistInput) ([]byte, error) { @@ -468,6 +579,9 @@ func (c *Client) CreateSecretsCredentialsFindingsFindingIdUnallowlist(ctx contex for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -492,9 +606,13 @@ func (c *Client) CreateSecretsCredentialsFindingsFindingIdUnallowlist(ctx contex // ListSecretsCredentialsFindingsFindingIdUsersInput is the input for ListSecretsCredentialsFindingsFindingIdUsers — Get Credential Finding Related Users. type ListSecretsCredentialsFindingsFindingIdUsersInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsCredentialsFindingsFindingIdUsersInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsCredentialsFindingsFindingIdUsers - Get Credential Finding Related Users // GET /secrets/credentials/findings/{findingId}/users func (c *Client) ListSecretsCredentialsFindingsFindingIdUsers(ctx context.Context, in ListSecretsCredentialsFindingsFindingIdUsersInput) (*models.EndpointsGetSecretsFindingUsersOutput, error) { @@ -505,6 +623,9 @@ func (c *Client) ListSecretsCredentialsFindingsFindingIdUsers(ctx context.Contex for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -530,6 +651,7 @@ type ListSecretsEventsInput struct { FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` FindingID *string `url:"findingId,omitempty" json:"-"` FromTime *string `url:"fromTime,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` NumItems *int `url:"numItems,omitempty" json:"-"` @@ -573,6 +695,9 @@ func (c *Client) ListSecretsEvents(ctx context.Context, in ListSecretsEventsInpu if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -595,6 +720,7 @@ func (c *Client) ListSecretsEvents(ctx context.Context, in ListSecretsEventsInpu type ListSecretsFindingsInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` @@ -645,6 +771,9 @@ func (c *Client) ListSecretsFindings(ctx context.Context, in ListSecretsFindings if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -665,6 +794,7 @@ func (c *Client) ListSecretsFindings(ctx context.Context, in ListSecretsFindings // CreateSecretsFindingsAllowlistBatchInput is the input for CreateSecretsFindingsAllowlistBatch — Allowlist Batch of Credential Findings. type CreateSecretsFindingsAllowlistBatchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` FindingIds []string `json:"findingIds,omitempty"` @@ -680,6 +810,9 @@ func (c *Client) CreateSecretsFindingsAllowlistBatch(ctx context.Context, in Cre for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -707,11 +840,14 @@ func (c *Client) CreateSecretsFindingsAllowlistBatch(ctx context.Context, in Cre type ListSecretsFindingsDetailedInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + FilePath []string `url:"filePath,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` NextToken *string `url:"nextToken,omitempty" json:"-"` + RepositoryID *string `url:"repositoryId,omitempty" json:"-"` SecretType *string `url:"secretType,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` SortBy *string `url:"sortBy,omitempty" json:"-"` @@ -751,12 +887,21 @@ func (c *Client) ListSecretsFindingsDetailed(ctx context.Context, in ListSecrets if in.IsFalsePositive != nil { query.Set("isFalsePositive", strconv.FormatBool(*in.IsFalsePositive)) } + if in.RepositoryID != nil { + query.Set("repositoryId", string(*in.RepositoryID)) + } + for _, v := range in.FilePath { + query.Add("filePath", string(v)) + } if in.SortBy != nil { query.Set("sortBy", string(*in.SortBy)) } if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -779,6 +924,7 @@ func (c *Client) ListSecretsFindingsDetailed(ctx context.Context, in ListSecrets type ListSecretsFindingsPreviewInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` @@ -829,6 +975,9 @@ func (c *Client) ListSecretsFindingsPreview(ctx context.Context, in ListSecretsF if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -850,9 +999,13 @@ func (c *Client) ListSecretsFindingsPreview(ctx context.Context, in ListSecretsF // GetSecretsFindingsFindingIdInput is the input for GetSecretsFindingsFindingId — Get Credential Finding. type GetSecretsFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetSecretsFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetSecretsFindingsFindingId - Get Credential Finding // GET /secrets/findings/{findingId} func (c *Client) GetSecretsFindingsFindingId(ctx context.Context, in GetSecretsFindingsFindingIdInput) (*models.EndpointsGetSecretsFindingOutput, error) { @@ -863,6 +1016,9 @@ func (c *Client) GetSecretsFindingsFindingId(ctx context.Context, in GetSecretsF for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -884,12 +1040,16 @@ func (c *Client) GetSecretsFindingsFindingId(ctx context.Context, in GetSecretsF // PatchSecretsFindingsFindingIdInput is the input for PatchSecretsFindingsFindingId — Update Credential Finding. type PatchSecretsFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` SeverityOverride *models.ModelsSeverity `json:"severityOverride,omitempty"` UserNotes *string `json:"userNotes,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *PatchSecretsFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // PatchSecretsFindingsFindingId - Update Credential Finding // PATCH /secrets/findings/{findingId} func (c *Client) PatchSecretsFindingsFindingId(ctx context.Context, in PatchSecretsFindingsFindingIdInput) (*models.EndpointsPatchSecretsFindingOutput, error) { @@ -900,6 +1060,9 @@ func (c *Client) PatchSecretsFindingsFindingId(ctx context.Context, in PatchSecr for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -933,11 +1096,15 @@ func (c *Client) PatchSecretsFindingsFindingId(ctx context.Context, in PatchSecr // CreateSecretsFindingsFindingIdAllowlistInput is the input for CreateSecretsFindingsFindingIdAllowlist — Allowlist Credential Finding. type CreateSecretsFindingsFindingIdAllowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsFindingsFindingIdAllowlist - Allowlist Credential Finding // POST /secrets/findings/{findingId}/allowlist func (c *Client) CreateSecretsFindingsFindingIdAllowlist(ctx context.Context, in CreateSecretsFindingsFindingIdAllowlistInput) ([]byte, error) { @@ -948,6 +1115,9 @@ func (c *Client) CreateSecretsFindingsFindingIdAllowlist(ctx context.Context, in for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -972,9 +1142,14 @@ func (c *Client) CreateSecretsFindingsFindingIdAllowlist(ctx context.Context, in // ListSecretsFindingsFindingIdEventsInput is the input for ListSecretsFindingsFindingIdEvents — Get Finding Events. type ListSecretsFindingsFindingIdEventsInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + NextToken *string `url:"nextToken,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsFindingsFindingIdEventsInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsFindingsFindingIdEvents - Get Finding Events // GET /secrets/findings/{findingId}/events func (c *Client) ListSecretsFindingsFindingIdEvents(ctx context.Context, in ListSecretsFindingsFindingIdEventsInput) (*models.EndpointsGetSecretsFindingEventsOutput, error) { @@ -985,6 +1160,12 @@ func (c *Client) ListSecretsFindingsFindingIdEvents(ctx context.Context, in List for k, v := range c.DefaultParams { query.Set(k, v) } + if in.NextToken != nil { + query.Set("nextToken", string(*in.NextToken)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1003,9 +1184,51 @@ func (c *Client) ListSecretsFindingsFindingIdEvents(ctx context.Context, in List return &out, nil } +// DeleteSecretsFindingsFindingIdTicketInput is the input for DeleteSecretsFindingsFindingIdTicket — Delete Ticket for Credential Finding. +type DeleteSecretsFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteSecretsFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteSecretsFindingsFindingIdTicket - Delete Ticket for Credential Finding +// DELETE /secrets/findings/{findingId}/ticket +func (c *Client) DeleteSecretsFindingsFindingIdTicket(ctx context.Context, in DeleteSecretsFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketSecretsFindingOutput, error) { + path := "/secrets/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSecretsFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateSecretsFindingsFindingIdTicketInput is the input for CreateSecretsFindingsFindingIdTicket — Create Ticket for Credential Finding. type CreateSecretsFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` CampaignTitle *string `json:"campaignTitle,omitempty"` @@ -1014,6 +1237,9 @@ type CreateSecretsFindingsFindingIdTicketInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsFindingsFindingIdTicket - Create Ticket for Credential Finding // POST /secrets/findings/{findingId}/ticket func (c *Client) CreateSecretsFindingsFindingIdTicket(ctx context.Context, in CreateSecretsFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketSecretsFindingOutput, error) { @@ -1024,6 +1250,9 @@ func (c *Client) CreateSecretsFindingsFindingIdTicket(ctx context.Context, in Cr for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1061,9 +1290,13 @@ func (c *Client) CreateSecretsFindingsFindingIdTicket(ctx context.Context, in Cr // ListSecretsFindingsFindingIdTriageInput is the input for ListSecretsFindingsFindingIdTriage — Get Triaged Credential Finding. type ListSecretsFindingsFindingIdTriageInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsFindingsFindingIdTriage - Get Triaged Credential Finding // GET /secrets/findings/{findingId}/triage func (c *Client) ListSecretsFindingsFindingIdTriage(ctx context.Context, in ListSecretsFindingsFindingIdTriageInput) (*models.EndpointsGetSecretsFindingTriageOutput, error) { @@ -1074,6 +1307,9 @@ func (c *Client) ListSecretsFindingsFindingIdTriage(ctx context.Context, in List for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1095,11 +1331,15 @@ func (c *Client) ListSecretsFindingsFindingIdTriage(ctx context.Context, in List // CreateSecretsFindingsFindingIdUnallowlistInput is the input for CreateSecretsFindingsFindingIdUnallowlist — Unallowlist Credential Finding. type CreateSecretsFindingsFindingIdUnallowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` UnallowlistReason string `json:"unallowlistReason"` UnallowlistType models.ModelsAllowlistType `json:"unallowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsFindingsFindingIdUnallowlist - Unallowlist Credential Finding // POST /secrets/findings/{findingId}/unallowlist func (c *Client) CreateSecretsFindingsFindingIdUnallowlist(ctx context.Context, in CreateSecretsFindingsFindingIdUnallowlistInput) ([]byte, error) { @@ -1110,6 +1350,9 @@ func (c *Client) CreateSecretsFindingsFindingIdUnallowlist(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1134,9 +1377,13 @@ func (c *Client) CreateSecretsFindingsFindingIdUnallowlist(ctx context.Context, // ListSecretsFindingsFindingIdUsersInput is the input for ListSecretsFindingsFindingIdUsers — Get Credential Finding Related Users. type ListSecretsFindingsFindingIdUsersInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsFindingsFindingIdUsersInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsFindingsFindingIdUsers - Get Credential Finding Related Users // GET /secrets/findings/{findingId}/users func (c *Client) ListSecretsFindingsFindingIdUsers(ctx context.Context, in ListSecretsFindingsFindingIdUsersInput) (*models.EndpointsGetSecretsFindingUsersOutput, error) { @@ -1147,6 +1394,9 @@ func (c *Client) ListSecretsFindingsFindingIdUsers(ctx context.Context, in ListS for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1167,10 +1417,13 @@ func (c *Client) ListSecretsFindingsFindingIdUsers(ctx context.Context, in ListS // ListSecretsScanRunsInput is the input for ListSecretsScanRuns — List Scan Runs. type ListSecretsScanRunsInput struct { + From *string `url:"from,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Limit *int `url:"limit,omitempty" json:"-"` Offset *int `url:"offset,omitempty" json:"-"` RepositoryID *string `url:"repositoryId,omitempty" json:"-"` Sort *string `url:"sort,omitempty" json:"-"` + To *string `url:"to,omitempty" json:"-"` models.RequestScope } @@ -1195,6 +1448,15 @@ func (c *Client) ListSecretsScanRuns(ctx context.Context, in ListSecretsScanRuns if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.From != nil { + query.Set("from", string(*in.From)) + } + if in.To != nil { + query.Set("to", string(*in.To)) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1217,6 +1479,7 @@ func (c *Client) ListSecretsScanRuns(ctx context.Context, in ListSecretsScanRuns type ListSecretsSensitivedataFindingsInput struct { Branch *string `url:"branch,omitempty" json:"-"` FileOwnerName []string `url:"fileOwnerName,omitempty" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` IsAllowlisted *bool `url:"isAllowlisted,omitempty" json:"-"` IsFalsePositive *bool `url:"isFalsePositive,omitempty" json:"-"` IsResolved *bool `url:"isResolved,omitempty" json:"-"` @@ -1267,6 +1530,9 @@ func (c *Client) ListSecretsSensitivedataFindings(ctx context.Context, in ListSe if in.Sort != nil { query.Set("sort", string(*in.Sort)) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1287,6 +1553,7 @@ func (c *Client) ListSecretsSensitivedataFindings(ctx context.Context, in ListSe // CreateSecretsSensitivedataFindingsAllowlistBatchInput is the input for CreateSecretsSensitivedataFindingsAllowlistBatch — Allowlist Batch of Sensitive Data Findings. type CreateSecretsSensitivedataFindingsAllowlistBatchInput struct { + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` FindingIds []string `json:"findingIds,omitempty"` @@ -1302,6 +1569,9 @@ func (c *Client) CreateSecretsSensitivedataFindingsAllowlistBatch(ctx context.Co for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1328,9 +1598,13 @@ func (c *Client) CreateSecretsSensitivedataFindingsAllowlistBatch(ctx context.Co // GetSecretsSensitivedataFindingsFindingIdInput is the input for GetSecretsSensitivedataFindingsFindingId — Get Sensitive Data Finding. type GetSecretsSensitivedataFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *GetSecretsSensitivedataFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // GetSecretsSensitivedataFindingsFindingId - Get Sensitive Data Finding // GET /secrets/sensitivedata/findings/{findingId} func (c *Client) GetSecretsSensitivedataFindingsFindingId(ctx context.Context, in GetSecretsSensitivedataFindingsFindingIdInput) (*models.EndpointsGetSecretsSensitiveDataFindingOutput, error) { @@ -1341,6 +1615,9 @@ func (c *Client) GetSecretsSensitivedataFindingsFindingId(ctx context.Context, i for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1362,11 +1639,15 @@ func (c *Client) GetSecretsSensitivedataFindingsFindingId(ctx context.Context, i // PatchSecretsSensitivedataFindingsFindingIdInput is the input for PatchSecretsSensitivedataFindingsFindingId — Update Sensitive Data Finding. type PatchSecretsSensitivedataFindingsFindingIdInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` PriorityOverride *models.ModelsPriorityLabel `json:"priorityOverride,omitempty"` UserNotes *string `json:"userNotes,omitempty"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *PatchSecretsSensitivedataFindingsFindingIdInput) SetFindingID(id string) { in.FindingID = id } + // PatchSecretsSensitivedataFindingsFindingId - Update Sensitive Data Finding // PATCH /secrets/sensitivedata/findings/{findingId} func (c *Client) PatchSecretsSensitivedataFindingsFindingId(ctx context.Context, in PatchSecretsSensitivedataFindingsFindingIdInput) (*models.EndpointsPatchSecretsSensitiveDataFindingOutput, error) { @@ -1377,6 +1658,9 @@ func (c *Client) PatchSecretsSensitivedataFindingsFindingId(ctx context.Context, for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1408,11 +1692,15 @@ func (c *Client) PatchSecretsSensitivedataFindingsFindingId(ctx context.Context, // CreateSecretsSensitivedataFindingsFindingIdAllowlistInput is the input for CreateSecretsSensitivedataFindingsFindingIdAllowlist — Allowlist Sensitive Data Finding. type CreateSecretsSensitivedataFindingsFindingIdAllowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` AllowlistReason string `json:"allowlistReason"` AllowlistType models.ModelsAllowlistType `json:"allowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsSensitivedataFindingsFindingIdAllowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsSensitivedataFindingsFindingIdAllowlist - Allowlist Sensitive Data Finding // POST /secrets/sensitivedata/findings/{findingId}/allowlist func (c *Client) CreateSecretsSensitivedataFindingsFindingIdAllowlist(ctx context.Context, in CreateSecretsSensitivedataFindingsFindingIdAllowlistInput) ([]byte, error) { @@ -1423,6 +1711,9 @@ func (c *Client) CreateSecretsSensitivedataFindingsFindingIdAllowlist(ctx contex for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1444,9 +1735,51 @@ func (c *Client) CreateSecretsSensitivedataFindingsFindingIdAllowlist(ctx contex return data, err } +// DeleteSecretsSensitivedataFindingsFindingIdTicketInput is the input for DeleteSecretsSensitivedataFindingsFindingIdTicket — Delete Ticket for Sensitive Data Finding. +type DeleteSecretsSensitivedataFindingsFindingIdTicketInput struct { + FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` + models.RequestScope +} + +// SetFindingID sets the finding that the request targets. +func (in *DeleteSecretsSensitivedataFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + +// DeleteSecretsSensitivedataFindingsFindingIdTicket - Delete Ticket for Sensitive Data Finding +// DELETE /secrets/sensitivedata/findings/{findingId}/ticket +func (c *Client) DeleteSecretsSensitivedataFindingsFindingIdTicket(ctx context.Context, in DeleteSecretsSensitivedataFindingsFindingIdTicketInput) (*models.EndpointsDeleteTicketSecretsSensitiveDataFindingOutput, error) { + path := "/secrets/sensitivedata/findings/{findingId}/ticket" + path = strings.Replace(path, "{findingId}", url.PathEscape(in.FindingID), 1) + + query := url.Values{} + for k, v := range c.DefaultParams { + query.Set(k, v) + } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } + in.RequestScope.AddTo(query) + + fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) + if len(query) > 0 { + fullURL += "?" + query.Encode() + } + + data, err := c.do(ctx, "DELETE", fullURL, nil) + if err != nil { + return nil, err + } + var out models.EndpointsDeleteTicketSecretsSensitiveDataFindingOutput + if err := json.Unmarshal(data, &out); err != nil { + return nil, fmt.Errorf("decode response: %w", err) + } + return &out, nil +} + // CreateSecretsSensitivedataFindingsFindingIdTicketInput is the input for CreateSecretsSensitivedataFindingsFindingIdTicket — Create Ticket for Sensitive Data Finding. type CreateSecretsSensitivedataFindingsFindingIdTicketInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` Assignees []models.ModelsUser `json:"assignees,omitempty"` CampaignID *string `json:"campaignId,omitempty"` CampaignTitle *string `json:"campaignTitle,omitempty"` @@ -1455,6 +1788,9 @@ type CreateSecretsSensitivedataFindingsFindingIdTicketInput struct { models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsSensitivedataFindingsFindingIdTicketInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsSensitivedataFindingsFindingIdTicket - Create Ticket for Sensitive Data Finding // POST /secrets/sensitivedata/findings/{findingId}/ticket func (c *Client) CreateSecretsSensitivedataFindingsFindingIdTicket(ctx context.Context, in CreateSecretsSensitivedataFindingsFindingIdTicketInput) (*models.EndpointsPostCreateTicketSecretsSensitiveDataFindingOutput, error) { @@ -1465,6 +1801,9 @@ func (c *Client) CreateSecretsSensitivedataFindingsFindingIdTicket(ctx context.C for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1502,9 +1841,13 @@ func (c *Client) CreateSecretsSensitivedataFindingsFindingIdTicket(ctx context.C // ListSecretsSensitivedataFindingsFindingIdTriageInput is the input for ListSecretsSensitivedataFindingsFindingIdTriage — Get Triaged Sensitive Data Finding. type ListSecretsSensitivedataFindingsFindingIdTriageInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsSensitivedataFindingsFindingIdTriageInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsSensitivedataFindingsFindingIdTriage - Get Triaged Sensitive Data Finding // GET /secrets/sensitivedata/findings/{findingId}/triage func (c *Client) ListSecretsSensitivedataFindingsFindingIdTriage(ctx context.Context, in ListSecretsSensitivedataFindingsFindingIdTriageInput) (*models.EndpointsGetSecretsSensitiveDataFindingTriageOutput, error) { @@ -1515,6 +1858,9 @@ func (c *Client) ListSecretsSensitivedataFindingsFindingIdTriage(ctx context.Con for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1536,11 +1882,15 @@ func (c *Client) ListSecretsSensitivedataFindingsFindingIdTriage(ctx context.Con // CreateSecretsSensitivedataFindingsFindingIdUnallowlistInput is the input for CreateSecretsSensitivedataFindingsFindingIdUnallowlist — Unallowlist Sensitive Data Finding. type CreateSecretsSensitivedataFindingsFindingIdUnallowlistInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` UnallowlistReason string `json:"unallowlistReason"` UnallowlistType models.ModelsAllowlistType `json:"unallowlistType"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *CreateSecretsSensitivedataFindingsFindingIdUnallowlistInput) SetFindingID(id string) { in.FindingID = id } + // CreateSecretsSensitivedataFindingsFindingIdUnallowlist - Unallowlist Sensitive Data Finding // POST /secrets/sensitivedata/findings/{findingId}/unallowlist func (c *Client) CreateSecretsSensitivedataFindingsFindingIdUnallowlist(ctx context.Context, in CreateSecretsSensitivedataFindingsFindingIdUnallowlistInput) ([]byte, error) { @@ -1551,6 +1901,9 @@ func (c *Client) CreateSecretsSensitivedataFindingsFindingIdUnallowlist(ctx cont for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) @@ -1575,9 +1928,13 @@ func (c *Client) CreateSecretsSensitivedataFindingsFindingIdUnallowlist(ctx cont // ListSecretsSensitivedataFindingsFindingIdUsersInput is the input for ListSecretsSensitivedataFindingsFindingIdUsers — Get Sensitive Data Finding Related Users. type ListSecretsSensitivedataFindingsFindingIdUsersInput struct { FindingID string `path:"findingId" json:"-"` + GithubInstallationID *int64 `url:"githubInstallationId,omitempty" json:"-"` models.RequestScope } +// SetFindingID sets the finding that the request targets. +func (in *ListSecretsSensitivedataFindingsFindingIdUsersInput) SetFindingID(id string) { in.FindingID = id } + // ListSecretsSensitivedataFindingsFindingIdUsers - Get Sensitive Data Finding Related Users // GET /secrets/sensitivedata/findings/{findingId}/users func (c *Client) ListSecretsSensitivedataFindingsFindingIdUsers(ctx context.Context, in ListSecretsSensitivedataFindingsFindingIdUsersInput) (*models.EndpointsGetSecretsSensitiveDataFindingUsersOutput, error) { @@ -1588,6 +1945,9 @@ func (c *Client) ListSecretsSensitivedataFindingsFindingIdUsers(ctx context.Cont for k, v := range c.DefaultParams { query.Set(k, v) } + if in.GithubInstallationID != nil { + query.Set("githubInstallationId", strconv.FormatInt(*in.GithubInstallationID, 10)) + } in.RequestScope.AddTo(query) fullURL := fmt.Sprintf("%s%s", c.BaseURL, path) diff --git a/internal/client/refreshing_http_client_test.go b/internal/client/refreshing_http_client_test.go index 98733c8..d05e672 100644 --- a/internal/client/refreshing_http_client_test.go +++ b/internal/client/refreshing_http_client_test.go @@ -10,6 +10,34 @@ import ( "time" ) +func TestHTTPTimeoutReachesTheRefreshingClient(t *testing.T) { + tests := []struct { + name string + env string + want time.Duration + }{ + {name: "default when unset", env: "", want: DefaultHTTPTimeout}, + {name: "overrides from env", env: "120s", want: 120 * time.Second}, + {name: "falls back to default on invalid", env: "not-a-duration", want: DefaultHTTPTimeout}, + {name: "falls back to default on non-positive", env: "0s", want: DefaultHTTPTimeout}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Setenv("NULLIFY_HTTP_TIMEOUT", tt.env) + provider := func() (string, error) { return "tok", nil } + + got, err := NewRefreshingHTTPClient("acme.nullify.ai", provider, provider) + if err != nil { + t.Fatal(err) + } + + if HTTPTimeout() != tt.want || got.Timeout != tt.want { + t.Errorf("HTTPTimeout() = %v, client timeout = %v, want %v", HTTPTimeout(), got.Timeout, tt.want) + } + }) + } +} + func TestNewRefreshingHTTPClientFetchesInitialToken(t *testing.T) { calls := 0 provider := func() (string, error) { diff --git a/internal/client/refreshing_transport.go b/internal/client/refreshing_transport.go index d69bcd6..cb10ed3 100644 --- a/internal/client/refreshing_transport.go +++ b/internal/client/refreshing_transport.go @@ -6,6 +6,7 @@ import ( "errors" "io" "net/http" + "os" "strings" "sync" "time" @@ -13,6 +14,22 @@ import ( "github.com/nullify-platform/cli/internal/logger" ) +// DefaultHTTPTimeout is the request timeout used when NULLIFY_HTTP_TIMEOUT is +// unset or invalid. 30s is too short for long-running calls (scan-start, autofix), +// so callers can raise it via the env var (e.g. "120s"). +const DefaultHTTPTimeout = 30 * time.Second + +// HTTPTimeout returns the request timeout, overridable via the +// NULLIFY_HTTP_TIMEOUT env var (a Go duration string such as "120s"). +func HTTPTimeout() time.Duration { + if v := os.Getenv("NULLIFY_HTTP_TIMEOUT"); v != "" { + if d, err := time.ParseDuration(v); err == nil && d > 0 { + return d + } + } + return DefaultHTTPTimeout +} + // TokenProvider is a function that returns a valid token. type TokenProvider func() (string, error) @@ -67,7 +84,7 @@ func NewRefreshingHTTPClient(nullifyHost string, tokenProvider, refreshProvider } return &http.Client{ - Timeout: 30 * time.Second, + Timeout: HTTPTimeout(), Transport: NewRetryTransport(t), }, nil } diff --git a/internal/commands/admin.go b/internal/commands/admin.go index 6c48919..cf6c886 100644 --- a/internal/commands/admin.go +++ b/internal/commands/admin.go @@ -28,6 +28,314 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } parent.AddCommand(serviceCmd) + { + cmd := &cobra.Command{ + Use: "list-me", + Short: "Get Caller Access", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminAccessMeInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminAccessMe(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/access/me") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-access-preferences", + Short: "Get RBAC Preferences", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminAccessPreferencesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminAccessPreferences(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/access/preferences") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-access-preferences", + Short: "Set RBAC Preferences", + Long: "Request body (JSON) fields: defaultInviteeRole (string, required), teamScopedRoles (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminAccessPreferencesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminAccessPreferences(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/access/preferences") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-access-users", + Short: "List User Roles", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminAccessUsersInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int32(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + if v, _ := cmd.Flags().GetString("start-key"); v != "" { + x := string(v) + in.StartKey = &x + } + out, err := client.ListAdminAccessUsers(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/access/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Max users to return (default 100, max 500)") + cmd.Flags().String("offset", "", "Row offset into the filtered set; overrides startKey when set") + cmd.Flags().String("search", "", "Case-insensitive filter across name, username and email") + cmd.Flags().String("start-key", "", "Pagination offset cursor from a prior response") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-org-owners", + Short: "List Organization Owners", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminAccessUsersOrgOwnersInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminAccessUsersOrgOwners(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/access/users/org-owners") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-roles", + Short: "Set User Roles", + Long: "Request body (JSON) fields: role (string, required), users (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminAccessUsersRolesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminAccessUsersRoles(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/access/users/roles") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + { cmd := &cobra.Command{ Use: "list-scan-coverage", @@ -39,6 +347,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListAdminAssessmentsScanCoverageInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -55,15 +371,7804 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { in.Offset = &x } } - if v, _ := cmd.Flags().GetString("search"); v != "" { - x := string(v) - in.Search = &x + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + if v, _ := cmd.Flags().GetString("sort-by"); v != "" { + x := string(v) + in.SortBy = &x + } + if v, _ := cmd.Flags().GetString("sort-order"); v != "" { + x := string(v) + in.SortOrder = &x + } + if v, _ := cmd.Flags().GetString("type"); v != "" { + x := string(v) + in.Type = &x + } + out, err := client.ListAdminAssessmentsScanCoverage(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/assessments/scan-coverage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Max repos per page (default 50)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") + cmd.Flags().String("search", "", "Case-insensitive substring filter on repository name or owner") + cmd.Flags().String("sort-by", "", "Sort column (default lastCommitAt)") + cmd.Flags().String("sort-order", "", "Sort direction (default desc)") + cmd.Flags().String("type", "", "Scanner type") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-assessments-scan-coverage-findings", + Short: "Get Scan Coverage Findings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminAssessmentsScanCoverageFindingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("type"); v != "" { + x := string(v) + in.Type = &x + } + out, err := client.ListAdminAssessmentsScanCoverageFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/assessments/scan-coverage/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Max findings per page (default 50, max 500)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") + cmd.Flags().String("repository-id", "", "Repository ID to drill into") + cmd.Flags().String("type", "", "Scanner type") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-checklist", + Short: "Get Checklist", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminChecklistInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminChecklist(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/checklist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-routing-exclusions", + Short: "Get Routing Exclusions", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminConfigRoutingExclusionsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminConfigRoutingExclusions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/config/routing-exclusions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-routing-exclusions", + Short: "Set Routing Exclusions", + Long: "Request body (JSON) fields: users (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminConfigRoutingExclusionsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminConfigRoutingExclusions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/config/routing-exclusions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-security-owner", + Short: "Get Security Owner", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminConfigSecurityOwnerInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminConfigSecurityOwner(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/config/security-owner") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-security-owner", + Short: "Set Security Owner", + Long: "Request body (JSON) fields: teamId (string, required), userId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminConfigSecurityOwnerInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminConfigSecurityOwner(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/config/security-owner") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-ingest", + Short: "Get Context Upload Credentials", + Long: "Request body (JSON) fields: branch (string), commitSha (string), contextType (string, required), environment (object), fromPR (integer), name (string, required), prNumber (integer), repository (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminContextIngestInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminContextIngest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/context/ingest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-events", + Short: "List Unified Events", + Long: "Request body (JSON) fields: afterId (string), afterTimeUnix (integer), autofixId (string), beforeTimeUnix (integer), campaignId (string), eventTypes (array), excludeEventTypes (array), excludeServices (array), findingIds (array), hideNoise (boolean), limit (integer), prCanonicalId (string), query (string), queryEventTypes (array), runId (string), services (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminEventsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminEvents(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-external-writes", + Short: "Read External Writes", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminExternalWritesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminExternalWrites(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/external-writes") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-external-writes", + Short: "Change External Writes", + Long: "Request body (JSON) fields: gitWrites (boolean), messaging (boolean), pullRequestReviews (boolean), pullRequests (boolean), tickets (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminExternalWritesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminExternalWrites(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/external-writes") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-finding ", + Short: "Get Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetAdminFindingFindingIdInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetAdminFindingFindingId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/finding/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-findings", + Short: "Query Findings", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminFindingsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-download", + Short: "Download Findings", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminFindingsDownloadInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminFindingsDownload(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/findings/download") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-groups", + Short: "Group Findings", + Long: "Request body (JSON) fields: groupBy (object, required), limit (integer), page (integer), query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminFindingsGroupsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminFindingsGroups(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/findings/groups") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-progress", + Short: "Post Findings Progress", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminFindingsProgressInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminFindingsProgress(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/findings/progress") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-fix-effort", + Short: "Get Fix Effort Mapping", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminFixEffortInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminFixEffort(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/fix-effort") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-fix-effort", + Short: "Put Fix Effort Mapping", + Long: "Request body (JSON) fields: fixEffort (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminFixEffortInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminFixEffort(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/fix-effort") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-getFileContents", + Short: "Get File Contents", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminGetFileContentsInput{} + if v, _ := cmd.Flags().GetString("end-line"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("endLine"+": %w", err) + } else { + x := int(n) + in.EndLine = &x + } + } + if v, _ := cmd.Flags().GetString("file-path"); v != "" { + x := string(v) + in.FilePath = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("reference"); v != "" { + x := string(v) + in.Reference = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("scan-family"); v != "" { + x := string(v) + in.ScanFamily = &x + } + if v, _ := cmd.Flags().GetString("start-line"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("startLine"+": %w", err) + } else { + x := int(n) + in.StartLine = &x + } + } + out, err := client.ListAdminGetFileContents(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/getFileContents") + cmd.Flags().String("end-line", "", "") + cmd.Flags().String("file-path", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("reference", "", "") + cmd.Flags().String("repository-id", "", "") + cmd.Flags().String("scan-family", "", "Scan family whose scope must admit the file: code (default) or secrets") + cmd.Flags().String("start-line", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-getFileOwners", + Short: "Get File Owners", + Long: "Request body (JSON) fields: files (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminGetFileOwnersInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminGetFileOwners(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/getFileOwners") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-getPullRequest", + Short: "Get PR State", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminGetPullRequestInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("pr-id"); v != "" { + x := string(v) + in.PrID = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + out, err := client.ListAdminGetPullRequest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/getPullRequest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("pr-id", "", "") + cmd.Flags().String("repository-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-entra", + Short: "Disconnect Microsoft Entra directory binding", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIdentityEntraInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.DeleteAdminIdentityEntra(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/identity/entra") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-entra", + Short: "Get Microsoft Entra directory binding status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIdentityEntraInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIdentityEntra(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/identity/entra") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-identity-entra-connect", + Short: "Start Microsoft Entra connect", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIdentityEntraConnectInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIdentityEntraConnect(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/identity/entra/connect") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-handoff", + Short: "List Microsoft Entra consent links", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIdentityEntraHandoffInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIdentityEntraHandoff(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/identity/entra/handoff") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-handoff", + Short: "Delegate Microsoft Entra directory consent", + Long: "Request body (JSON) fields: directoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIdentityEntraHandoffInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIdentityEntraHandoff(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/identity/entra/handoff") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-handoff ", + Short: "Revoke a Microsoft Entra consent link", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIdentityEntraHandoffIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.DeleteAdminIdentityEntraHandoffId(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/identity/entra/handoff/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-link", + Short: "Start Microsoft Entra self-service account link", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIdentityEntraLinkInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIdentityEntraLink(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/identity/entra/link") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-policy", + Short: "Create Interactor []", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIdentityEntraPolicyInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIdentityEntraPolicy(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/identity/entra/policy") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-policy", + Short: "Create Interactor []", + Long: "Request body (JSON) fields: dryRun (boolean), expectedUpdatedAt (string, required), reason (string, required), required (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminIdentityEntraPolicyInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminIdentityEntraPolicy(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/identity/entra/policy") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-sign-in", + Short: "Record a Microsoft sign-in", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIdentityEntraSignInInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIdentityEntraSignIn(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/identity/entra/sign-in") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-scim", + Short: "Get SCIM Identity Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIdentityScimInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIdentityScim(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/identity/scim") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-identity-scim-credentials", + Short: "Create SCIM Credential", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIdentityScimCredentialsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIdentityScimCredentials(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/identity/scim/credentials") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-credentials ", + Short: "Revoke SCIM Credential", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIdentityScimCredentialsIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIdentityScimCredentialsId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/identity/scim/credentials/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-installations", + Short: "Get App Installations", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminInstallationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminInstallations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/installations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-asana-oauth", + Short: "Get Asana install status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsAsanaOauthInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsAsanaOauth(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/asana/oauth") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-asana-ticket-config", + Short: "Set Asana Ticket Configuration", + Long: "Request body (JSON) fields: accessToken (string, required), projectGid (string, required), workspaceId (string, required), workspaceName (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAsanaTicketConfigInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAsanaTicketConfig(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/asana/ticket-config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-atlassian", + Short: "Get Atlassian integration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsAtlassianInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsAtlassian(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/atlassian") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-atlassian", + Short: "Update Atlassian integration choices", + Long: "Request body (JSON) fields: installationId (string), settings (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAtlassianInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAtlassian(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/atlassian") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-azure", + Short: "Get Azure Configuration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsAzureInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsAzure(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/azure") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-azure", + Short: "Repair Azure DevOps Service Hooks", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureInput{} + if v, _ := cmd.Flags().GetString("dry-run"); v != "" { + b := v == "true" + in.DryRun = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("reconcile"); v != "" { + b := v == "true" + in.Reconcile = &b + } + out, err := client.CreateAdminIntegrationsAzure(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure") + cmd.Flags().String("dry-run", "", "Plan the repair against Azure DevOps and return it without creating, replacing or deleting anything, and without recording health.") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("reconcile", "", "Rewrite existing service-hook subscriptions in place with the current webhook URL and per-install secret instead of skipping them. Use to repair hooks provisioned before per-install secrets.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-azure-codeowners-preview", + Short: "Preview CODEOWNERS as Azure DevOps required-reviewer policies", + Long: "Request body (JSON) fields: organizationId (string, required), path (string), projectId (string, required), ref (string), repositoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureCodeownersPreviewInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureCodeownersPreview(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/codeowners/preview") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-connect", + Short: "Disconnect an Azure DevOps organization", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsAzureConnectInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("organization-id"); v != "" { + x := string(v) + in.OrganizationID = &x + } + out, err := client.DeleteAdminIntegrationsAzureConnect(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/azure/connect") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("organization-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-azure-connect", + Short: "Start Azure DevOps connect", + Long: "Request body (JSON) fields: alsoEnableSignIn (boolean), enableBuildGate (boolean), enableWorkItems (boolean), organizationName (string), reauthorizeHandle (string), requestAdminConsent (boolean), returnPath (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureConnectInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureConnect(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/connect") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-connect ", + Short: "Get Azure DevOps connect status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsAzureConnectHandleInput{} + in.Handle = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsAzureConnectHandle(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/azure/connect/{handle}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-confirm-by-id ", + Short: "Confirm Azure DevOps connect", + Long: "Request body (JSON) fields: organizationIds (array, required), projects (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureConnectHandleConfirmInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.Handle = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureConnectHandleConfirm(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/connect/{handle}/confirm") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-recheck-by-id ", + Short: "Recheck Azure DevOps permissions", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureConnectHandleRecheckInput{} + in.Handle = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureConnectHandleRecheck(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/connect/{handle}/recheck") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-retry-by-id ", + Short: "Retry Azure DevOps connect", + Long: "Request body (JSON) fields: organizationId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureConnectHandleRetryInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.Handle = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureConnectHandleRetry(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/connect/{handle}/retry") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-credentials", + Short: "Set Azure Credentials", + Long: "Request body (JSON) fields: clientId (string, required), clientSecret (string), organization (string), projectName (string), tenantId (string, required), workItemType (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureCredentialsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureCredentials(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/credentials") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-installations", + Short: "Delete Azure DevOps webhook installation", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsAzureInstallationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("organization-id"); v != "" { + x := string(v) + in.OrganizationID = &x + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + out, err := client.DeleteAdminIntegrationsAzureInstallations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/azure/installations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("organization-id", "", "") + cmd.Flags().String("project-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-azure-installations", + Short: "List Azure DevOps webhook installations", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsAzureInstallationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsAzureInstallations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/azure/installations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-installations", + Short: "Register Azure DevOps webhook installation", + Long: "Request body (JSON) fields: organizationId (string, required), projectId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureInstallationsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureInstallations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/installations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-suspend", + Short: "Suspend or resume an Azure DevOps organization's installations", + Long: "Request body (JSON) fields: organizationId (string, required), suspended (boolean, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureInstallationsSuspendInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureInstallationsSuspend(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/installations/suspend") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-test", + Short: "Test an Azure DevOps organization's provisioning state", + Long: "Request body (JSON) fields: organizationId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsAzureInstallationsTestInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsAzureInstallationsTest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/azure/installations/test") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-buildkite", + Short: "Delete Buildkite Integration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsBuildkiteInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsBuildkite(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/buildkite") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-buildkite", + Short: "Get Buildkite Integration Status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsBuildkiteInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsBuildkite(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/buildkite") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-organizations", + Short: "List Buildkite Organizations For Token", + Long: "Request body (JSON) fields: apiToken (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsBuildkiteOrganizationsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsBuildkiteOrganizations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/buildkite/organizations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-buildkite-token", + Short: "Set Buildkite API Token", + Long: "Request body (JSON) fields: apiToken (string, required), orgSlug (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsBuildkiteTokenInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsBuildkiteToken(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/buildkite/token") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-catalog", + Short: "Get Integrations Catalog", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCatalogInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCatalog(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/catalog") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-circleci", + Short: "Delete CircleCI Integration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsCircleciInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsCircleci(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/circleci") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-circleci", + Short: "Get CircleCI Integration Status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCircleciInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCircleci(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/circleci") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-circleci-token", + Short: "Set CircleCI API Token", + Long: "Request body (JSON) fields: apiToken (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCircleciTokenInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCircleciToken(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/circleci/token") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-integrations-cloud-aws-settings", + Short: "Delete Cloud AWS Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsCloudAwsSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsCloudAwsSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/cloud/aws/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-cloud-aws-settings", + Short: "Get Cloud AWS Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCloudAwsSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCloudAwsSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/cloud/aws/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-cloud-aws-settings", + Short: "Upsert Cloud AWS Settings", + Long: "Request body (JSON) fields: awsAccounts (array, required), externalId (string), iamRoleName (string, required), preferredDeployment (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudAwsSettingsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudAwsSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/aws/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-validate-role", + Short: "Validate AWS Role", + Long: "Request body (JSON) fields: accountIds (array, required), onboarding (boolean), roleNameToAssume (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudAwsValidateRoleInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudAwsValidateRole(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/aws/validate-role") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-integrations-cloud-azure-settings", + Short: "Delete Cloud Azure Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsCloudAzureSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsCloudAzureSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/cloud/azure/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-cloud-azure-settings", + Short: "Get Cloud Azure Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCloudAzureSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCloudAzureSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/cloud/azure/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-cloud-azure-settings", + Short: "Upsert Cloud Azure Settings", + Long: "Request body (JSON) fields: authMode (string, required), clientId (string), clientSecret (string), displayName (string), subscriptions (array), tenantId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudAzureSettingsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudAzureSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/azure/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-cloud-azure-validate", + Short: "Validate Azure Credentials", + Long: "Request body (JSON) fields: subscriptionIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudAzureValidateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudAzureValidate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/azure/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-access-token", + Short: "Mint GCP Access Token", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudGcpAccessTokenInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudGcpAccessToken(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/gcp/access-token") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-integrations-cloud-gcp-settings", + Short: "Delete Cloud GCP Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsCloudGcpSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsCloudGcpSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/cloud/gcp/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-cloud-gcp-settings", + Short: "Get Cloud GCP Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCloudGcpSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCloudGcpSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/cloud/gcp/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-cloud-gcp-settings", + Short: "Upsert Cloud GCP Settings", + Long: "Request body (JSON) fields: discoveryScope (string), displayName (string), folderId (string), gkeClusterOidcIssuerUrls (array), gkeServiceAccountUniqueId (string), organizationId (string), projects (array), workloadIdentityProvider (string, required), workloadIdentityServiceAccountEmail (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudGcpSettingsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudGcpSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/gcp/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-setup", + Short: "Get Cloud GCP Setup", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCloudGcpSetupInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCloudGcpSetup(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/cloud/gcp/setup") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-validate", + Short: "Validate GCP Credentials", + Long: "Request body (JSON) fields: projectIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudGcpValidateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudGcpValidate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/gcp/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-clusters", + Short: "Add or Update a K8s Cluster", + Long: "Request body (JSON) fields: cloudAccountId (string), clusterName (string, required), clusterType (string, required), collectConfigMaps (boolean), collectSecrets (boolean), isEnabled (boolean), region (string), resourceId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudK8sClustersInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudK8sClusters(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/k8s/clusters") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-clusters ", + Short: "Remove a K8s Cluster", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsCloudK8sClustersClusterIdInput{} + in.ClusterID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsCloudK8sClustersClusterId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/cloud/k8s/clusters/{clusterId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-settings", + Short: "Delete Cloud K8s Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsCloudK8sSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsCloudK8sSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/cloud/k8s/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-cloud-k8s-settings", + Short: "Get Cloud K8s Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCloudK8sSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCloudK8sSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/cloud/k8s/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-settings", + Short: "Upsert Cloud K8s Settings", + Long: "Request body (JSON) fields: clusters (array), nullifyRoleArn (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudK8sSettingsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudK8sSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/k8s/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-whitelist", + Short: "Read collector account access", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsCloudK8sWhitelistInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsCloudK8sWhitelist(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/cloud/k8s/whitelist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-whitelist", + Short: "Whitelist K8s Connector Accounts", + Long: "Request body (JSON) fields: accountIds (array), expectedRevision (integer), expectedStateId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsCloudK8sWhitelistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsCloudK8sWhitelist(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/cloud/k8s/whitelist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-connections", + Short: "List Integration Connections", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsConnectionsInput{} + if v, _ := cmd.Flags().GetString("capability"); v != "" { + x := string(v) + in.Capability = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsConnections(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/connections") + cmd.Flags().String("capability", "", "Restrict to one capability, e.g. package_registry") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-connections ", + Short: "Disconnect Integration Connection", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsConnectionsConnectionIdInput{} + in.ConnectionID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsConnectionsConnectionId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/connections/{connectionId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-rotate ", + Short: "Rotate Integration Connection", + Long: "Request body (JSON) fields: expectedAuthorityRevision (integer), fields (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminIntegrationsConnectionsConnectionIdRotateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ConnectionID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminIntegrationsConnectionsConnectionIdRotate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/integrations/connections/{connectionId}/rotate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-connections-test-by-id ", + Short: "Test Integration Connection", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsConnectionsConnectionIdTestInput{} + in.ConnectionID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsConnectionsConnectionIdTest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/connections/{connectionId}/test") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-discover", + Short: "Discover GitHub Packages Identity", + Long: "Request body (JSON) fields: token (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsGithubPackagesDiscoverInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsGithubPackagesDiscover(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/github-packages/discover") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-app-settings", + Short: "Get GitHub App Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsGithubAppSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsGithubAppSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/github/app-settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-gitlab-connect", + Short: "Connect GitLab", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsGitlabConnectInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsGitlabConnect(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/gitlab/connect") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-confirm", + Short: "Finish GitLab connection", + Long: "Request body (JSON) fields: handle (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsGitlabConnectConfirmInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsGitlabConnectConfirm(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/gitlab/connect/confirm") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-status", + Short: "GitLab connection status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsGitlabConnectStatusInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("handle"); v != "" { + x := string(v) + in.Handle = &x + } + out, err := client.ListAdminIntegrationsGitlabConnectStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/gitlab/connect/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("handle", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-jenkins", + Short: "Delete Jenkins Integration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsJenkinsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsJenkins(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/jenkins") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-jenkins", + Short: "Get Jenkins Integration Status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsJenkinsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsJenkins(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/jenkins") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-jenkins-token", + Short: "Set Jenkins API Token", + Long: "Request body (JSON) fields: apiToken (string, required), url (string, required), username (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsJenkinsTokenInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsJenkinsToken(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/jenkins/token") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-jira", + Short: "Get Jira Configuration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsJiraInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsJira(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/jira") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-jira", + Short: "Update Jira Configuration", + Long: "Request body (JSON) fields: autoCreate (boolean, required), defaultAssigneeId (string), enabledFindingTypes (array, required), issueType (string, required), priorityThreshold (string, required), projectKey (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsJiraInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsJira(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/jira") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-forge", + Short: "Get Jira Forge connection status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsJiraForgeInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsJiraForge(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/jira/forge") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-install", + Short: "Start Jira Forge OAuth connect", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsJiraInstallInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("site-url"); v != "" { + x := string(v) + in.SiteURL = &x + } + out, err := client.ListAdminIntegrationsJiraInstall(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/jira/install") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("site-url", "", "Atlassian site URL selected for this connection") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-linear", + Short: "Get Linear Configuration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsLinearInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsLinear(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/linear") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-linear-install", + Short: "Start Linear OAuth install", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsLinearInstallInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsLinearInstall(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/linear/install") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-members", + Short: "List Linear Team Members", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsLinearMembersInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("q"); v != "" { + x := string(v) + in.Q = &x + } + if v, _ := cmd.Flags().GetString("team-id"); v != "" { + x := string(v) + in.TeamID = &x + } + out, err := client.ListAdminIntegrationsLinearMembers(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/linear/members") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("q", "", "") + cmd.Flags().String("team-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-oauth", + Short: "Get Linear OAuth install status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsLinearOauthInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsLinearOauth(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/linear/oauth") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-linear-teams", + Short: "List Linear Teams", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsLinearTeamsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsLinearTeams(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/linear/teams") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-linear-ticket-config", + Short: "Set Linear Ticket Configuration", + Long: "Request body (JSON) fields: autoCreate (boolean), defaultAssigneeId (string), enabledFindingTypes (array), priorityThreshold (string), teamId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsLinearTicketConfigInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsLinearTicketConfig(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/linear/ticket-config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-notifications", + Short: "Get Notification Config", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsNotificationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsNotifications(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/notifications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-notifications", + Short: "Put Notification Config", + Long: "Request body (JSON) fields: centralSecurityChannel (object), notifications (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminIntegrationsNotificationsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminIntegrationsNotifications(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/integrations/notifications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-slack", + Short: "Get Slack Configuration", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsSlackInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsSlack(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/slack") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-slack-install", + Short: "Start Slack distributed install", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsSlackInstallInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsSlackInstall(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/slack/install") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-key", + Short: "Set Slack API Key", + Long: "Request body (JSON) fields: apiKey (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsSlackKeyInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsSlackKey(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/slack/key") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-teams", + Short: "Get Integration Teams", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsTeamsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + out, err := client.ListAdminIntegrationsTeams(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/teams") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("provider", "", "The integration provider to query teams from") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-destinations", + Short: "Get Threat Investigation Destinations", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsThreatIntelDestinationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsThreatIntelDestinations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/threat-intel/destinations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-destinations", + Short: "Update Threat Investigation Destinations", + Long: "Request body (JSON) fields: microsoftTeamsWebhookUrl (string), nullifySharedSlack (boolean), tenantSlackChannelId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminIntegrationsThreatIntelDestinationsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminIntegrationsThreatIntelDestinations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/integrations/threat-intel/destinations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-integrations-users", + Short: "Get Integration Users", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsUsersInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + out, err := client.ListAdminIntegrationsUsers(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("provider", "", "The integration provider to query users from") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-configure ", + Short: "Configure Integration", + Long: "Request body (JSON) fields: fields (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminIntegrationsProviderIdCapabilityConfigureInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ProviderID = args[0] + in.Capability = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminIntegrationsProviderIdCapabilityConfigure(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/integrations/{providerId}/{capability}/configure") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-connect-by-id ", + Short: "Connect Integration", + Long: "Request body (JSON) fields: fields (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsProviderIdCapabilityConnectInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ProviderID = args[0] + in.Capability = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsProviderIdCapabilityConnect(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/{providerId}/{capability}/connect") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-connections-by-id ", + Short: "Create Integration Connection", + Long: "Request body (JSON) fields: displayName (string), fields (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsProviderIdCapabilityConnectionsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ProviderID = args[0] + in.Capability = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsProviderIdCapabilityConnections(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/{providerId}/{capability}/connections") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-disconnect ", + Short: "Disconnect Integration", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteAdminIntegrationsProviderIdCapabilityDisconnectInput{} + in.ProviderID = args[0] + in.Capability = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminIntegrationsProviderIdCapabilityDisconnect(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/integrations/{providerId}/{capability}/disconnect") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-install ", + Short: "Start Integration OAuth install", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminIntegrationsProviderIdCapabilityInstallInput{} + in.ProviderID = args[0] + in.Capability = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminIntegrationsProviderIdCapabilityInstall(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/integrations/{providerId}/{capability}/install") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-integrations-test-by-id ", + Short: "Test Integration", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminIntegrationsProviderIdCapabilityTestInput{} + in.ProviderID = args[0] + in.Capability = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminIntegrationsProviderIdCapabilityTest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/integrations/{providerId}/{capability}/test") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-manager-settings", + Short: "Get Manager Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminManagerSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminManagerSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/manager/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-settings", + Short: "Update Manager Settings", + Long: "Request body (JSON) fields: automatedThreatInvestigations (boolean), blockedActionTypes (array), dailyUpdatesEnabled (boolean), expectedUpdatedAt (string), groundRules (string), weeklyUpdatesEnabled (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminManagerSettingsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminManagerSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/manager/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-metrics-findings", + Short: "Post Findings Metrics", + Long: "Request body (JSON) fields: includeFunnel (boolean), query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsFindingsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminMetricsFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-by-repository", + Short: "Post Findings Metrics By Repository", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsFindingsByRepositoryInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminMetricsFindingsByRepository(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/findings/by-repository") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-frameworks", + Short: "Post Findings Compliance Frameworks", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsFindingsFrameworksInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminMetricsFindingsFrameworks(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/findings/frameworks") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-interactions", + Short: "Get Interactions", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminMetricsInteractionsInput{} + if v, _ := cmd.Flags().GetString("from-date"); v != "" { + x := string(v) + in.FromDate = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("to-date"); v != "" { + x := string(v) + in.ToDate = &x + } + out, err := client.ListAdminMetricsInteractions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/metrics/interactions") + cmd.Flags().String("from-date", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("to-date", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-over-time", + Short: "Get Metrics Over Time", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsOverTimeInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("resolution"); v != "" { + x := string(v) + in.Resolution = &x + } + out, err := client.CreateAdminMetricsOverTime(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/over-time") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("resolution", "", "Time granularity for metrics aggregation (hour, day, week)") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-overview", + Short: "Query Overview", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsOverviewInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminMetricsOverview(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/overview") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-metrics-pullrequests", + Short: "Post Pull Request Metrics", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsPullrequestsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminMetricsPullrequests(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/pullrequests") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-raw", + Short: "Query Raw Metrics", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsRawInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminMetricsRaw(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/raw") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-tickets", + Short: "Post Ticket Metrics", + Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminMetricsTicketsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminMetricsTickets(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/metrics/tickets") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-aggregate", + Short: "Usage Aggregate", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminMetricsUsageAggregateInput{} + if v, _ := cmd.Flags().GetString("agent"); v != "" { + x := string(v) + in.Agent = &x + } + if v, _ := cmd.Flags().GetString("branch-type"); v != "" { + x := string(v) + in.BranchType = &x + } + if v, _ := cmd.Flags().GetString("class"); v != "" { + x := string(v) + in.Class = &x + } + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } + if v, _ := cmd.Flags().GetString("window"); v != "" { + x := string(v) + in.Window = &x + } + out, err := client.ListAdminMetricsUsageAggregate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/metrics/usage/aggregate") + cmd.Flags().String("agent", "", "") + cmd.Flags().String("branch-type", "", "") + cmd.Flags().String("class", "", "") + cmd.Flags().String("from", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("to", "", "") + cmd.Flags().String("window", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-ledger", + Short: "Usage Ledger", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminMetricsUsageLedgerInput{} + if v, _ := cmd.Flags().GetString("agent"); v != "" { + x := string(v) + in.Agent = &x + } + if v, _ := cmd.Flags().GetString("branch-type"); v != "" { + x := string(v) + in.BranchType = &x + } + if v, _ := cmd.Flags().GetString("class"); v != "" { + x := string(v) + in.Class = &x + } + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("finding-id"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FindingID = append(in.FindingID, string(s)) + } + } + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("query"); v != "" { + x := string(v) + in.Query = &x + } + if v, _ := cmd.Flags().GetString("run-id"); v != "" { + x := string(v) + in.RunID = &x + } + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } + out, err := client.ListAdminMetricsUsageLedger(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/metrics/usage/ledger") + cmd.Flags().String("agent", "", "") + cmd.Flags().String("branch-type", "", "") + cmd.Flags().String("class", "", "") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("finding-id", "", "") + cmd.Flags().String("from", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("query", "", "") + cmd.Flags().String("run-id", "", "") + cmd.Flags().String("to", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-timeseries", + Short: "Usage Timeseries", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminMetricsUsageTimeseriesInput{} + if v, _ := cmd.Flags().GetString("agent"); v != "" { + x := string(v) + in.Agent = &x + } + if v, _ := cmd.Flags().GetString("class"); v != "" { + x := string(v) + in.Class = &x + } + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("granularity"); v != "" { + x := string(v) + in.Granularity = &x + } + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } + out, err := client.ListAdminMetricsUsageTimeseries(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/metrics/usage/timeseries") + cmd.Flags().String("agent", "", "") + cmd.Flags().String("class", "", "") + cmd.Flags().String("from", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("granularity", "", "") + cmd.Flags().String("to", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-ip-allowlist", + Short: "Get IP Allowlist", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminNetworkIpAllowlistInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminNetworkIpAllowlist(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/network/ip-allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-ip-allowlist", + Short: "Replace IP Allowlist", + Long: "Request body (JSON) fields: entries (array, required), expectedCidrs (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminNetworkIpAllowlistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminNetworkIpAllowlist(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/network/ip-allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-network-ip-allowlist-preview", + Short: "Preview IP Allowlist", + Long: "Request body (JSON) fields: entries (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminNetworkIpAllowlistPreviewInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminNetworkIpAllowlistPreview(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/network/ip-allowlist/preview") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-operator-external-writes-initialize", + Short: "Initialize External Write Defaults", + Long: "Request body (JSON) fields: dryRun (boolean), reason (string, required), tenantId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminOperatorExternalWritesInitializeInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminOperatorExternalWritesInitialize(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/operator/external-writes/initialize") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-operator-github-tenant-route", + Short: "Preview, write or inspect a GitHub tenant route born paused", + Long: "Request body (JSON) fields: deploymentId (string), dryRun (boolean), expectedBaseDomain (string), expectedRegion (string), expectedStackOwnerIds (array), githubOwnerId (integer), inspect (boolean), installationId (integer), operationId (string), prepareBeforeInstallation (boolean), reason (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminOperatorGithubTenantRouteInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + out, err := client.CreateAdminOperatorGithubTenantRoute(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/operator/github-tenant/route") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-operator-native-tenant-route", + Short: "Preview or write a native Azure workspace route", + Long: "Request body (JSON) fields: administrators (array), baseDomain (string), deploymentId (string), directoryId (string), dryRun (boolean), expectedState (string), inspect (boolean), operationId (string), operator (string), reason (string), region (string), stage (string), tenantId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminOperatorNativeTenantRouteInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + out, err := client.CreateAdminOperatorNativeTenantRoute(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/operator/native-tenant/route") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-package-feeds", + Short: "Read Staff Package Feeds", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminOperatorPackageFeedsInput{} + if v, _ := cmd.Flags().GetString("connection-id"); v != "" { + x := string(v) + in.ConnectionID = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminOperatorPackageFeeds(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/operator/package-feeds") + cmd.Flags().String("connection-id", "", "Optional connection id to read") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-package-feeds", + Short: "Control Staff Package Feed", + Long: "Request body (JSON) fields: connectionId (string), displayName (string), expectedRevision (integer), fields (object), operation (string, required), providerId (string), reason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminOperatorPackageFeedsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminOperatorPackageFeeds(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/operator/package-feeds") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-scan-entitlement", + Short: "Read Staff Scan Entitlement", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminOperatorScanEntitlementInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminOperatorScanEntitlement(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/operator/scan-entitlement") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-scan-entitlement", + Short: "Replace Staff Scan Entitlement", + Long: "Request body (JSON) fields: codeRepositoryCap (integer), expectedUpdatedAt (string), reason (string, required), scopingEnabled (boolean), secretsMode (string), secretsRepositoryCap (integer), staffRepositoryAllowlist (boolean), tenantId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminOperatorScanEntitlementInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminOperatorScanEntitlement(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/operator/scan-entitlement") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-operator-scan-scope-repositories", + Short: "Read Staff Repository Scan Scopes", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminOperatorScanScopeRepositoriesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminOperatorScanScopeRepositories(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/operator/scan-scope/repositories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-repositories", + Short: "Set Staff Repository Scan Limits", + Long: "Request body (JSON) fields: reason (string, required), repositories (array, required), tenantId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminOperatorScanScopeRepositoriesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminOperatorScanScopeRepositories(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/operator/scan-scope/repositories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-operator-tenant-capabilities", + Short: "Read Staff Tenant Capabilities", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminOperatorTenantCapabilitiesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminOperatorTenantCapabilities(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/operator/tenant-capabilities") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-operator-tenant-capabilities", + Short: "Force Tenant Capability", + Long: "Request body (JSON) fields: capability (string, required), expectedStaffUpdatedAt (string), lockReason (string), reason (string, required), repository (string), seedCustomerEnabled (boolean), seedRepositoryDisabled (boolean), seedStaffIfAbsent (boolean), staffState (string, required), tenantId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminOperatorTenantCapabilitiesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminOperatorTenantCapabilities(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/operator/tenant-capabilities") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-approve", + Short: "Approve an exact provisioning request", + Long: "Request body (JSON) fields: action (string), confirm (boolean), deploymentId (string), expectedOperationRevision (integer), expectedRevision (integer), reason (string), requestId (string), setupKind (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminOperatorWorkspaceBootstrapApproveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + out, err := client.CreateAdminOperatorWorkspaceBootstrapApprove(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/operator/workspace-bootstrap/approve") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-invitation", + Short: "Preview or issue a workspace bootstrap invitation", + Long: "Request body (JSON) fields: deploymentId (string), dryRun (boolean), expectedDirectoryId (string), expectedState (string), reason (string), recipient (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminOperatorWorkspaceBootstrapInvitationInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + out, err := client.CreateAdminOperatorWorkspaceBootstrapInvitation(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/operator/workspace-bootstrap/invitation") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-operation", + Short: "Inspect a durable workspace claim", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err } - if v, _ := cmd.Flags().GetString("type"); v != "" { + in := api.ListAdminOperatorWorkspaceBootstrapOperationInput{} + if v, _ := cmd.Flags().GetString("operation-id"); v != "" { x := string(v) - in.Type = &x + in.OperationID = &x } - out, err := client.ListAdminAssessmentsScanCoverage(cmd.Context(), in) + out, err := client.ListAdminOperatorWorkspaceBootstrapOperation(cmd.Context(), in) if err != nil { return err } @@ -75,49 +8180,53 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "Max repos per page (default 50)") - cmd.Flags().String("offset", "", "Pagination offset (default 0)") - cmd.Flags().String("search", "", "Case-insensitive substring filter on repository name or owner") - cmd.Flags().String("type", "", "Scanner type") + setRoute(cmd, "GET /admin/operator/workspace-bootstrap/operation") + cmd.Flags().String("operation-id", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-assessments-scan-coverage-findings", - Short: "Get Scan Coverage Findings", + Use: "create-renew", + Short: "Preview or renew an organization-pinned workspace invitation", + Long: "Request body (JSON) fields: dryRun (boolean), expectedRevision (integer), expectedState (string), operationId (string), reason (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminAssessmentsScanCoverageFindingsInput{} - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) - } else { - x := int(n) - in.Limit = &x + in := api.CreateAdminOperatorWorkspaceBootstrapRenewInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) } - } - if v, _ := cmd.Flags().GetString("offset"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("offset"+": %w", err) - } else { - x := int(n) - in.Offset = &x + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } } } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { - x := string(v) - in.RepositoryID = &x - } - if v, _ := cmd.Flags().GetString("type"); v != "" { - x := string(v) - in.Type = &x - } - out, err := client.ListAdminAssessmentsScanCoverageFindings(cmd.Context(), in) + out, err := client.CreateAdminOperatorWorkspaceBootstrapRenew(cmd.Context(), in) if err != nil { return err } @@ -129,25 +8238,28 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "Max findings per page (default 50, max 500)") - cmd.Flags().String("offset", "", "Pagination offset (default 0)") - cmd.Flags().String("repository-id", "", "Repository ID to drill into") - cmd.Flags().String("type", "", "Scanner type") + setRoute(cmd, "POST /admin/operator/workspace-bootstrap/renew") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-checklist", - Short: "Get Checklist", + Use: "list-requests", + Short: "List provisioning requests", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminChecklistInput{} - out, err := client.ListAdminChecklist(cmd.Context(), in) + in := api.ListAdminOperatorWorkspaceBootstrapRequestsInput{} + if v, _ := cmd.Flags().GetString("before-request-id"); v != "" { + x := string(v) + in.BeforeRequestID = &x + } + out, err := client.ListAdminOperatorWorkspaceBootstrapRequests(cmd.Context(), in) if err != nil { return err } @@ -159,21 +8271,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/operator/workspace-bootstrap/requests") + cmd.Flags().String("before-request-id", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-ingest", - Short: "Get Context Upload Credentials", - Long: "Request body (JSON) fields: branch (string), commitSha (string), contextType (string, required), environment (object), fromPR (integer), name (string, required), prNumber (integer), repository (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-revoke", + Short: "Preview or revoke a workspace claim without stage receipts", + Long: "Request body (JSON) fields: dryRun (boolean), expectedRevision (integer), expectedState (string), operationId (string), reason (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminContextIngestInput{} + in := api.CreateAdminOperatorWorkspaceBootstrapRevokeInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -203,7 +8317,7 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminContextIngest(cmd.Context(), in) + out, err := client.CreateAdminOperatorWorkspaceBootstrapRevoke(cmd.Context(), in) if err != nil { return err } @@ -215,6 +8329,7 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/operator/workspace-bootstrap/revoke") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -222,16 +8337,93 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-events", - Short: "List Unified Events", - Long: "Request body (JSON) fields: afterId (string), afterTimeUnix (integer), autofixId (string), beforeTimeUnix (integer), campaignId (string), eventTypes (array), findingIds (array), limit (integer), prCanonicalId (string), runId (string), services (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "list-organization", + Short: "Get Organization", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminEventsInput{} + in := api.ListAdminOrganizationInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-directory"); v != "" { + b := v == "true" + in.IncludeDirectory = &b + } + out, err := client.ListAdminOrganization(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/organization") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-directory", "", "Include teams and members from the git platform (default true). When false, returns identity metadata with unpopulated teams and members arrays.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-pr-gate-settings", + Short: "Get PR Gate Settings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminPrGateSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminPrGateSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/pr-gate-settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-pr-gate-settings", + Short: "Put PR Gate Settings", + Long: "Request body (JSON) fields: allowApprovingReviews (boolean), allowRequestChangesReviews (boolean), cvssEnforcement (boolean), enabled (boolean, required), expectedPrScansEnabled (boolean), expectedPushScansEnabled (boolean), failOnIncompleteCoverage (boolean), findingsPolicy (object), minPriority (object, required), mode (string), prReviewsEnabled (boolean), prScansEnabled (boolean), pushScansEnabled (boolean), scaBlockCvssThreshold (number).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminPrGateSettingsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -261,7 +8453,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminEvents(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminPrGateSettings(cmd.Context(), in) if err != nil { return err } @@ -273,6 +8473,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/pr-gate-settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -280,18 +8482,28 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-finding ", - Short: "Get Finding", - Args: cobra.ExactArgs(1), + Use: "list-acknowledgment", + Short: "Get Privacy Acknowledgment", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetAdminFindingFindingIdInput{} - in.FindingID = args[0] - out, err := client.GetAdminFindingFindingId(cmd.Context(), in) + in := api.ListAdminPrivacyAcknowledgmentInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("policy-version"); v != "" { + x := string(v) + in.PolicyVersion = &x + } + out, err := client.ListAdminPrivacyAcknowledgment(cmd.Context(), in) if err != nil { return err } @@ -303,21 +8515,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/privacy/acknowledgment") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("policy-version", "", "The version of the privacy policy to check") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-findings", - Short: "Query Findings", - Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-acknowledgment", + Short: "Post Privacy Acknowledgment", + Long: "Request body (JSON) fields: policyVersion (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminFindingsInput{} + in := api.CreateAdminPrivacyAcknowledgmentInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -347,7 +8562,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminFindings(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminPrivacyAcknowledgment(cmd.Context(), in) if err != nil { return err } @@ -359,6 +8582,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/privacy/acknowledgment") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -366,16 +8591,57 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-download", - Short: "Download Findings", - Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "list-pullrequests", + Short: "Get Pull Request Record", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminFindingsDownloadInput{} + in := api.ListAdminPullrequestsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("id"); v != "" { + x := string(v) + in.ID = &x + } + out, err := client.ListAdminPullrequests(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/pullrequests") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-pullrequests", + Short: "Query Pull Requests", + Long: "Request body (JSON) fields: query (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminPullrequestsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -405,7 +8671,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminFindingsDownload(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminPullrequests(cmd.Context(), in) if err != nil { return err } @@ -417,6 +8691,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/pullrequests") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -424,42 +8700,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-fix-effort", - Short: "Get Fix Effort Mapping", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminFixEffortInput{} - out, err := client.ListAdminFixEffort(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "update-fix-effort", - Short: "Put Fix Effort Mapping", - Long: "Request body (JSON) fields: fixEffort (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-refresh-ci", + Short: "Refresh Pull Request CI", + Long: "Request body (JSON) fields: ids (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.UpdateAdminFixEffortInput{} + in := api.CreateAdminPullrequestsRefreshCiInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -489,7 +8739,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.UpdateAdminFixEffort(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminPullrequestsRefreshCi(cmd.Context(), in) if err != nil { return err } @@ -501,6 +8759,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/pullrequests/refresh-ci") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -508,48 +8768,111 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-getFileContents", - Short: "Get File Contents", + Use: "list-repositories", + Short: "Get Repositories", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminGetFileContentsInput{} - if v, _ := cmd.Flags().GetString("end-line"); v != "" { + in := api.ListAdminRepositoriesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("ids"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Ids = append(in.Ids, string(s)) + } + } + if v, _ := cmd.Flags().GetString("include-archived"); v != "" { + b := v == "true" + in.IncludeArchived = &b + } + if v, _ := cmd.Flags().GetString("include-archived-enrolled"); v != "" { + for _, s := range strings.Split(v, ",") { + in.IncludeArchivedEnrolled = append(in.IncludeArchivedEnrolled, string(s)) + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("endLine"+": %w", err) + return fmt.Errorf("limit"+": %w", err) } else { x := int(n) - in.EndLine = &x + in.Limit = &x } } - if v, _ := cmd.Flags().GetString("file-path"); v != "" { + if v, _ := cmd.Flags().GetString("next-token"); v != "" { x := string(v) - in.FilePath = &x + in.NextToken = &x } - if v, _ := cmd.Flags().GetString("project-id"); v != "" { - x := string(v) - in.ProjectID = &x + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } } - if v, _ := cmd.Flags().GetString("reference"); v != "" { + if v, _ := cmd.Flags().GetString("search"); v != "" { x := string(v) - in.Reference = &x + in.Search = &x } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { - x := string(v) - in.RepositoryID = &x + if v, _ := cmd.Flags().GetString("team-i-ds"); v != "" { + for _, s := range strings.Split(v, ",") { + in.TeamIDs = append(in.TeamIDs, string(s)) + } } - if v, _ := cmd.Flags().GetString("start-line"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("startLine"+": %w", err) + out, err := client.ListAdminRepositories(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/repositories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("ids", "", "Return exactly these repositories (at most 100), archived ones included; search, the archived filters and paging are ignored") + cmd.Flags().String("include-archived", "", "Include repositories archived on their source platform (default false)") + cmd.Flags().String("include-archived-enrolled", "", "While archived repositories are hidden, still return those enrolled for one of these scan families: code, secrets") + cmd.Flags().String("limit", "", "Maximum number of repositories to return per page") + cmd.Flags().String("next-token", "", "Pagination token for the next page of results") + cmd.Flags().String("offset", "", "Pagination offset; overrides nextToken when set") + cmd.Flags().String("search", "", "Case-insensitive search filter for repository names") + cmd.Flags().String("team-i-ds", "", "Filter repositories by team ULID") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-recommendations", + Short: "Get Repository PoV Recommendations", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminRepositoriesRecommendationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.StartLine = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListAdminGetFileContents(cmd.Context(), in) + out, err := client.ListAdminRepositoriesRecommendations(cmd.Context(), in) if err != nil { return err } @@ -561,27 +8884,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("end-line", "", "") - cmd.Flags().String("file-path", "", "") - cmd.Flags().String("project-id", "", "") - cmd.Flags().String("reference", "", "") - cmd.Flags().String("repository-id", "", "") - cmd.Flags().String("start-line", "", "") + setRoute(cmd, "GET /admin/repositories/recommendations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-getFileOwners", - Short: "Get File Owners", - Long: "Request body (JSON) fields: files (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "update-repositories-scan-scope", + Short: "Update Repository Scan Scopes", + Long: "Request body (JSON) fields: repositories (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminGetFileOwnersInput{} + in := api.UpdateAdminRepositoriesScanScopeInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -611,7 +8930,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminGetFileOwners(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminRepositoriesScanScope(cmd.Context(), in) if err != nil { return err } @@ -623,6 +8950,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/repositories/scan-scope") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -630,24 +8959,30 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-getPullRequest", - Short: "Get PR State", + Use: "get-directories ", + Short: "List Repository Directories", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminGetPullRequestInput{} - if v, _ := cmd.Flags().GetString("pr-id"); v != "" { - x := string(v) - in.PrID = &x + in := api.ListAdminRepositoriesRepositoryIdDirectoriesInput{} + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + if v, _ := cmd.Flags().GetString("path"); v != "" { x := string(v) - in.RepositoryID = &x + in.Path = &x } - out, err := client.ListAdminGetPullRequest(cmd.Context(), in) + out, err := client.ListAdminRepositoriesRepositoryIdDirectories(cmd.Context(), in) if err != nil { return err } @@ -659,49 +8994,36 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("pr-id", "", "") - cmd.Flags().String("repository-id", "", "") + setRoute(cmd, "GET /admin/repositories/{repositoryId}/directories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("path", "", "Repo-relative directory to list; empty is the root") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-installations", - Short: "Get App Installations", + Use: "delete-repository-property-team-keys", + Short: "Delete Repository Property Team Key", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminInstallationsInput{} - out, err := client.ListAdminInstallations(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + in := api.DeleteAdminRepositoryPropertyTeamKeysInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-azure", - Short: "Get Azure Configuration", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("key-id"); v != "" { + x := string(v) + in.KeyID = &x } - in := api.ListAdminIntegrationsAzureInput{} - out, err := client.ListAdminIntegrationsAzure(cmd.Context(), in) + out, err := client.DeleteAdminRepositoryPropertyTeamKeys(cmd.Context(), in) if err != nil { return err } @@ -713,21 +9035,32 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/repository-property-team-keys") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("key-id", "", "The repository property team key ID") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-azure", - Short: "Install Azure DevOps Integration", + Use: "list-repository-property-team-keys", + Short: "List Repository Property Team Keys", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsAzureInput{} - out, err := client.CreateAdminIntegrationsAzure(cmd.Context(), in) + in := api.ListAdminRepositoryPropertyTeamKeysInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminRepositoryPropertyTeamKeys(cmd.Context(), in) if err != nil { return err } @@ -739,21 +9072,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/repository-property-team-keys") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-credentials", - Short: "Set Azure Credentials", - Long: "Request body (JSON) fields: clientId (string, required), clientSecret (string), tenantId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-repository-property-team-keys", + Short: "Create Repository Property Team Key", + Long: "Request body (JSON) fields: propertyKey (string, required), providerId (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsAzureCredentialsInput{} + in := api.CreateAdminRepositoryPropertyTeamKeysInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -783,7 +9118,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsAzureCredentials(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminRepositoryPropertyTeamKeys(cmd.Context(), in) if err != nil { return err } @@ -795,6 +9138,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/repository-property-team-keys") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -802,16 +9147,27 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-buildkite", - Short: "Delete Buildkite Integration", + Use: "get-runs ", + Short: "Get Run Snapshot", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminIntegrationsBuildkiteInput{} - out, err := client.DeleteAdminIntegrationsBuildkite(cmd.Context(), in) + in := api.GetAdminRunsKindIdInput{} + in.Kind = args[0] + in.ID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetAdminRunsKindId(cmd.Context(), in) if err != nil { return err } @@ -823,21 +9179,31 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/runs/{kind}/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-buildkite", - Short: "Get Buildkite Integration Status", + Use: "list-scan-scope", + Short: "Get Scan Scope", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminIntegrationsBuildkiteInput{} - out, err := client.ListAdminIntegrationsBuildkite(cmd.Context(), in) + in := api.ListAdminScanScopeInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminScanScope(cmd.Context(), in) if err != nil { return err } @@ -849,21 +9215,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/scan-scope") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-integrations-buildkite-token", - Short: "Set Buildkite API Token", - Long: "Request body (JSON) fields: apiToken (string, required), orgSlug (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "update-scan-scope", + Short: "Update Scan Scope Settings", + Long: "Request body (JSON) fields: scopingEnabled (boolean), secretsMode (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsBuildkiteTokenInput{} + in := api.UpdateAdminScanScopeInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -893,7 +9261,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsBuildkiteToken(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminScanScope(cmd.Context(), in) if err != nil { return err } @@ -905,6 +9281,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/scan-scope") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -912,98 +9290,58 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-circleci", - Short: "Delete CircleCI Integration", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.DeleteAdminIntegrationsCircleciInput{} - out, err := client.DeleteAdminIntegrationsCircleci(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-circleci", - Short: "Get CircleCI Integration Status", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminIntegrationsCircleciInput{} - out, err := client.ListAdminIntegrationsCircleci(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "create-integrations-circleci-token", - Short: "Set CircleCI API Token", - Long: "Request body (JSON) fields: apiToken (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "list-orchestrator", + Short: "List Orchestrator Scans", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true - return err - } - in := api.CreateAdminIntegrationsCircleciTokenInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) + return err + } + in := api.ListAdminScansOrchestratorInput{} + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) + } + if v, _ := cmd.Flags().GetString("scan-type"); v != "" { + for _, s := range strings.Split(v, ",") { + in.ScanType = append(in.ScanType, string(s)) } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Status = append(in.Status, string(s)) } } - out, err := client.CreateAdminIntegrationsCircleciToken(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } + out, err := client.ListAdminScansOrchestrator(cmd.Context(), in) if err != nil { return err } @@ -1015,23 +9353,41 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + setRoute(cmd, "GET /admin/scans/orchestrator") + cmd.Flags().String("from", "", "Only include scans started at or after this RFC3339 timestamp") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Max scans per page (default 100, max 100)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") + cmd.Flags().String("scan-type", "", "Scan types to include (sast, sca_dependencies, sca_containers, secrets); default all") + cmd.Flags().String("status", "", "Scan run statuses to include (running_scan, running_results, completed, skipped, scan_failed, results_failed, stuck_failed); default all") + cmd.Flags().String("to", "", "Only include scans started at or before this RFC3339 timestamp") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-integrations-cloud-aws-settings", - Short: "Delete Cloud AWS Settings", + Use: "delete-service_accounts", + Short: "Delete Service Account", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminIntegrationsCloudAwsSettingsInput{} - out, err := client.DeleteAdminIntegrationsCloudAwsSettings(cmd.Context(), in) + in := api.DeleteAdminServiceAccountsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("service-account-id"); v != "" { + x := string(v) + in.ServiceAccountID = &x + } + out, err := client.DeleteAdminServiceAccounts(cmd.Context(), in) if err != nil { return err } @@ -1043,21 +9399,32 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/service_accounts") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("service-account-id", "", "The service account ID") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-integrations-cloud-aws-settings", - Short: "Get Cloud AWS Settings", + Use: "list-service_accounts", + Short: "Get Service Accounts", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminIntegrationsCloudAwsSettingsInput{} - out, err := client.ListAdminIntegrationsCloudAwsSettings(cmd.Context(), in) + in := api.ListAdminServiceAccountsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminServiceAccounts(cmd.Context(), in) if err != nil { return err } @@ -1069,21 +9436,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/service_accounts") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-integrations-cloud-aws-settings", - Short: "Upsert Cloud AWS Settings", - Long: "Request body (JSON) fields: awsAccounts (array, required), externalId (string), iamRoleName (string, required), preferredDeployment (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-service_accounts", + Short: "Create Service Account", + Long: "Request body (JSON) fields: name (string, required), platform (object, required), role (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsCloudAwsSettingsInput{} + in := api.CreateAdminServiceAccountsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1113,7 +9482,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsCloudAwsSettings(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminServiceAccounts(cmd.Context(), in) if err != nil { return err } @@ -1125,6 +9502,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/service_accounts") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1132,16 +9511,52 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-validate-role", - Short: "Validate AWS Role", - Long: "Request body (JSON) fields: accountIds (array, required), onboarding (boolean), roleNameToAssume (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "list-cspm-scan-cadence", + Short: "Get CSPM Scan Cadence", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsCloudAwsValidateRoleInput{} + in := api.ListAdminSettingsCspmScanCadenceInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminSettingsCspmScanCadence(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/settings/cspm-scan-cadence") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-cspm-scan-cadence", + Short: "Set CSPM Scan Cadence", + Long: "Request body (JSON) fields: cspmScanCadence (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminSettingsCspmScanCadenceInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1171,7 +9586,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsCloudAwsValidateRole(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminSettingsCspmScanCadence(cmd.Context(), in) if err != nil { return err } @@ -1183,6 +9606,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/settings/cspm-scan-cadence") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1190,42 +9615,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-integrations-cloud-azure-settings", - Short: "Delete Cloud Azure Settings", + Use: "list-inference-region", + Short: "Get Inference Region", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminIntegrationsCloudAzureSettingsInput{} - out, err := client.DeleteAdminIntegrationsCloudAzureSettings(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-integrations-cloud-azure-settings", - Short: "Get Cloud Azure Settings", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in := api.ListAdminSettingsInferenceRegionInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListAdminIntegrationsCloudAzureSettingsInput{} - out, err := client.ListAdminIntegrationsCloudAzureSettings(cmd.Context(), in) + out, err := client.ListAdminSettingsInferenceRegion(cmd.Context(), in) if err != nil { return err } @@ -1237,21 +9644,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/settings/inference-region") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-integrations-cloud-azure-settings", - Short: "Upsert Cloud Azure Settings", - Long: "Request body (JSON) fields: clientId (string), clientSecret (string), displayName (string), subscriptions (array), tenantId (string, required), useManagedIdentity (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "update-inference-region", + Short: "Set Inference Region", + Long: "Request body (JSON) fields: inferenceRegion (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsCloudAzureSettingsInput{} + in := api.UpdateAdminSettingsInferenceRegionInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1281,7 +9690,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsCloudAzureSettings(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminSettingsInferenceRegion(cmd.Context(), in) if err != nil { return err } @@ -1293,6 +9710,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/settings/inference-region") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1300,42 +9719,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-integrations-cloud-gcp-settings", - Short: "Delete Cloud GCP Settings", + Use: "list-sla", + Short: "Get SLAs", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminIntegrationsCloudGcpSettingsInput{} - out, err := client.DeleteAdminIntegrationsCloudGcpSettings(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-integrations-cloud-gcp-settings", - Short: "Get Cloud GCP Settings", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in := api.ListAdminSlaInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListAdminIntegrationsCloudGcpSettingsInput{} - out, err := client.ListAdminIntegrationsCloudGcpSettings(cmd.Context(), in) + out, err := client.ListAdminSla(cmd.Context(), in) if err != nil { return err } @@ -1347,21 +9748,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/sla") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-integrations-cloud-gcp-settings", - Short: "Upsert Cloud GCP Settings", - Long: "Request body (JSON) fields: displayName (string), gkeClusterOidcIssuerUrls (array), gkeServiceAccountUniqueId (string), projects (array), workloadIdentityProvider (string, required), workloadIdentityServiceAccountEmail (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-sla", + Short: "Post SLA", + Long: "Request body (JSON) fields: allowExtensions (boolean, required), maxDaysToFix (integer, required), priority (object, required), severity (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsCloudGcpSettingsInput{} + in := api.CreateAdminSlaInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1391,7 +9794,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsCloudGcpSettings(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminSla(cmd.Context(), in) if err != nil { return err } @@ -1403,6 +9814,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/sla") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1410,16 +9823,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-validate", - Short: "Validate GCP Credentials", - Long: "Request body (JSON) fields: projectIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "update-bulk", + Short: "Put Bulk SLA", + Long: "Request body (JSON) fields: slas (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsCloudGcpValidateInput{} + in := api.UpdateAdminSlaBulkInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1449,7 +9862,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsCloudGcpValidate(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminSlaBulk(cmd.Context(), in) if err != nil { return err } @@ -1461,6 +9882,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/sla/bulk") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1468,16 +9891,17 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-whitelist", - Short: "Whitelist K8s Connector Accounts", - Long: "Request body (JSON) fields: accountIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "patch-sla ", + Short: "Patch SLA", + Long: "Request body (JSON) fields: allowExtensions (boolean), maxDaysToFix (integer), priority (object), severity (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsCloudK8sWhitelistInput{} + in := api.PatchAdminSlaSlaIdInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1505,37 +9929,18 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { return fmt.Errorf("decode body from stdin: %w", err) } - } - } - out, err := client.CreateAdminIntegrationsCloudK8sWhitelist(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-app-settings", - Short: "Get GitHub App Settings", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + } } - in := api.ListAdminIntegrationsGithubAppSettingsInput{} - out, err := client.ListAdminIntegrationsGithubAppSettings(cmd.Context(), in) + in.SlaID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchAdminSlaSlaId(cmd.Context(), in) if err != nil { return err } @@ -1547,21 +9952,33 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /admin/sla/{slaId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-jenkins", - Short: "Delete Jenkins Integration", + Use: "delete-support-access", + Short: "Revoke Support Access", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminIntegrationsJenkinsInput{} - out, err := client.DeleteAdminIntegrationsJenkins(cmd.Context(), in) + in := api.DeleteAdminSupportAccessInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminSupportAccess(cmd.Context(), in) if err != nil { return err } @@ -1573,21 +9990,39 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/support-access") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-jenkins", - Short: "Get Jenkins Integration Status", + Use: "list-support-access", + Short: "Get Support Access", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminIntegrationsJenkinsInput{} - out, err := client.ListAdminIntegrationsJenkins(cmd.Context(), in) + in := api.ListAdminSupportAccessInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + out, err := client.ListAdminSupportAccess(cmd.Context(), in) if err != nil { return err } @@ -1599,21 +10034,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/support-access") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Max grants to list (default 50, max 200)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-integrations-jenkins-token", - Short: "Set Jenkins API Token", - Long: "Request body (JSON) fields: apiToken (string, required), url (string, required), username (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-support-access", + Short: "Elevate Support Access", + Long: "Request body (JSON) fields: agent (string), reason (string, required), ttlSeconds (integer).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsJenkinsTokenInput{} + in := api.CreateAdminSupportAccessInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1643,7 +10081,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsJenkinsToken(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminSupportAccess(cmd.Context(), in) if err != nil { return err } @@ -1655,6 +10101,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/support-access") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1662,16 +10110,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-jira", - Short: "Get Jira Configuration", + Use: "list-team-source-preferences", + Short: "Get Team Source Preferences", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminIntegrationsJiraInput{} - out, err := client.ListAdminIntegrationsJira(cmd.Context(), in) + in := api.ListAdminTeamSourcePreferencesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminTeamSourcePreferences(cmd.Context(), in) if err != nil { return err } @@ -1683,21 +10139,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/team-source-preferences") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-jira", - Short: "Update Jira Configuration", - Long: "Request body (JSON) fields: autoCreate (boolean, required), issueType (string, required), projectKey (string, required), severityThreshold (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "update-team-source-preferences", + Short: "Update Team Source Preferences", + Long: "Request body (JSON) fields: githubTeamsEnabled (boolean, required), repositoryPropertyEnabled (boolean, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsJiraInput{} + in := api.UpdateAdminTeamSourcePreferencesInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1727,7 +10185,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsJira(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminTeamSourcePreferences(cmd.Context(), in) if err != nil { return err } @@ -1739,6 +10205,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/team-source-preferences") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1746,68 +10214,36 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-integrations-linear-install", - Short: "Start Linear OAuth install", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminIntegrationsLinearInstallInput{} - out, err := client.ListAdminIntegrationsLinearInstall(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-oauth", - Short: "Get Linear OAuth install status", + Use: "list-team-sync-runs", + Short: "List Team Sync Runs", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminIntegrationsLinearOauthInput{} - out, err := client.ListAdminIntegrationsLinearOauth(cmd.Context(), in) - if err != nil { - return err + in := api.ListAdminTeamSyncRunsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - data, err := json.Marshal(out) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-notifications", - Short: "Get Notification Config", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("source"); v != "" { + x := string(v) + in.Source = &x } - in := api.ListAdminIntegrationsNotificationsInput{} - out, err := client.ListAdminIntegrationsNotifications(cmd.Context(), in) + out, err := client.ListAdminTeamSyncRuns(cmd.Context(), in) if err != nil { return err } @@ -1819,21 +10255,25 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/team-sync-runs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("source", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "update-notifications", - Short: "Put Notification Config", - Long: "Request body (JSON) fields: notifications (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-team-sync-runs", + Short: "Trigger Team Sync", + Long: "Request body (JSON) fields: source (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.UpdateAdminIntegrationsNotificationsInput{} + in := api.CreateAdminTeamSyncRunsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1863,7 +10303,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.UpdateAdminIntegrationsNotifications(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTeamSyncRuns(cmd.Context(), in) if err != nil { return err } @@ -1875,6 +10323,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/team-sync-runs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1882,16 +10332,26 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-slack", - Short: "Get Slack Configuration", + Use: "get-team ", + Short: "Get Team", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminIntegrationsSlackInput{} - out, err := client.ListAdminIntegrationsSlack(cmd.Context(), in) + in := api.GetAdminTeamTeamIDInput{} + in.TeamID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetAdminTeamTeamID(cmd.Context(), in) if err != nil { return err } @@ -1903,21 +10363,63 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/team/{teamID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-integrations-slack-install", - Short: "Start Slack distributed install", + Use: "list-teams", + Short: "Get All Teams", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminIntegrationsSlackInstallInput{} - out, err := client.ListAdminIntegrationsSlackInstall(cmd.Context(), in) + in := api.ListAdminTeamsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + if v, _ := cmd.Flags().GetString("skip-user-enrichment"); v != "" { + b := v == "true" + in.SkipUserEnrichment = &b + } + out, err := client.ListAdminTeams(cmd.Context(), in) if err != nil { return err } @@ -1929,21 +10431,29 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/teams") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of teams to return per page") + cmd.Flags().String("next-token", "", "Pagination token for the next page of results") + cmd.Flags().String("offset", "", "Pagination offset; overrides nextToken when set") + cmd.Flags().String("repository-id", "", "Return only teams that own this repository (canonical repository ID). Skips the full-tenant scan.") + cmd.Flags().String("search", "", "Case-insensitive search filter for team names") + cmd.Flags().String("skip-user-enrichment", "", "Internal callers only: skip user (Lead/Members) enrichment and the synchronous GitHub teams refresh. Returns a pure DB-paginated page.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-key", - Short: "Set Slack API Key", - Long: "Request body (JSON) fields: apiKey (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-teams", + Short: "Post Team", + Long: "Request body (JSON) fields: codeOwnerships (array), github (object), gitlab (object), groundRules (array), jira (object), leadId (string), memberIds (array), messageChannelProvider (object, required), name (string, required), privacy (object, required), slug (string, required), ticketProjectProvider (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminIntegrationsSlackKeyInput{} + in := api.CreateAdminTeamsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1973,7 +10483,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminIntegrationsSlackKey(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTeams(cmd.Context(), in) if err != nil { return err } @@ -1985,6 +10503,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/teams") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1992,51 +10512,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-integrations-teams", - Short: "Get Integration Teams", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminIntegrationsTeamsInput{} - if v, _ := cmd.Flags().GetString("provider"); v != "" { - x := string(v) - in.Provider = &x - } - out, err := client.ListAdminIntegrationsTeams(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("provider", "", "The integration provider to query teams from") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-integrations-users", - Short: "Get Integration Users", + Use: "list-appzip", + Short: "Get Teams App Zip", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true - return err - } - in := api.ListAdminIntegrationsUsersInput{} - if v, _ := cmd.Flags().GetString("provider"); v != "" { - x := string(v) - in.Provider = &x + return err } - out, err := client.ListAdminIntegrationsUsers(cmd.Context(), in) + in := api.ListAdminTeamsAppzipInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminTeamsAppzip(cmd.Context(), in) if err != nil { return err } @@ -2048,22 +10541,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("provider", "", "The integration provider to query users from") + setRoute(cmd, "GET /admin/teams/appzip") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-metrics-findings", - Short: "Post Findings Metrics", - Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-compass", + Short: "Post Compass/Atlassian Team", + Long: "Request body (JSON) fields: displayName (string, required), lead (string, required), members (array, required), providerId (object), repositories (array, required), teamKey (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminMetricsFindingsInput{} + in := api.CreateAdminTeamsCompassInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2093,7 +10587,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminMetricsFindings(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTeamsCompass(cmd.Context(), in) if err != nil { return err } @@ -2105,6 +10607,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/teams/compass") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2112,16 +10616,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-interactions", - Short: "Get Interactions", + Use: "list-teams-findings", + Short: "Get All Team Findings mapping", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminMetricsInteractionsInput{} - out, err := client.ListAdminMetricsInteractions(cmd.Context(), in) + in := api.ListAdminTeamsFindingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminTeamsFindings(cmd.Context(), in) if err != nil { return err } @@ -2133,21 +10645,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/teams/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-over-time", - Short: "Get Metrics Over Time", - Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-teams-findings", + Short: "Manual Team Findings Assignment", + Long: "Request body (JSON) fields: actor (string), mappings (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminMetricsOverTimeInput{} + in := api.CreateAdminTeamsFindingsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2177,11 +10691,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - if v, _ := cmd.Flags().GetString("resolution"); v != "" { - x := string(v) - in.Resolution = &x + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.CreateAdminMetricsOverTime(cmd.Context(), in) + out, err := client.CreateAdminTeamsFindings(cmd.Context(), in) if err != nil { return err } @@ -2193,7 +10711,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("resolution", "", "Time granularity for metrics aggregation (hour, day, week)") + setRoute(cmd, "POST /admin/teams/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2201,16 +10720,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-overview", - Short: "Query Overview", - Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-sync", + Short: "Sync Team Findings", + Long: "Request body (JSON) fields: async (boolean), findingIds (array), findingTypes (array), repositoryIds (array), repositoryNames (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminMetricsOverviewInput{} + in := api.CreateAdminTeamsFindingsSyncInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2240,7 +10759,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminMetricsOverview(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTeamsFindingsSync(cmd.Context(), in) if err != nil { return err } @@ -2252,6 +10779,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/teams/findings/sync") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2259,16 +10788,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-raw", - Short: "Query Raw Metrics", - Long: "Request body (JSON) fields: query (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-merge", + Short: "Merge Teams", + Long: "Request body (JSON) fields: sources (array, required), targetTeamId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminMetricsRawInput{} + in := api.CreateAdminTeamsMergeInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2298,187 +10827,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminMetricsRaw(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-aggregate", - Short: "Usage Aggregate", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminMetricsUsageAggregateInput{} - if v, _ := cmd.Flags().GetString("agent"); v != "" { - x := string(v) - in.Agent = &x - } - if v, _ := cmd.Flags().GetString("branch-type"); v != "" { - x := string(v) - in.BranchType = &x - } - if v, _ := cmd.Flags().GetString("class"); v != "" { - x := string(v) - in.Class = &x - } - if v, _ := cmd.Flags().GetString("from"); v != "" { - x := string(v) - in.From = &x - } - if v, _ := cmd.Flags().GetString("to"); v != "" { - x := string(v) - in.To = &x - } - if v, _ := cmd.Flags().GetString("window"); v != "" { - x := string(v) - in.Window = &x - } - out, err := client.ListAdminMetricsUsageAggregate(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("agent", "", "") - cmd.Flags().String("branch-type", "", "") - cmd.Flags().String("class", "", "") - cmd.Flags().String("from", "", "") - cmd.Flags().String("to", "", "") - cmd.Flags().String("window", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-ledger", - Short: "Usage Ledger", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminMetricsUsageLedgerInput{} - if v, _ := cmd.Flags().GetString("agent"); v != "" { - x := string(v) - in.Agent = &x - } - if v, _ := cmd.Flags().GetString("branch-type"); v != "" { - x := string(v) - in.BranchType = &x - } - if v, _ := cmd.Flags().GetString("class"); v != "" { - x := string(v) - in.Class = &x - } - if v, _ := cmd.Flags().GetString("cursor"); v != "" { - x := string(v) - in.Cursor = &x - } - if v, _ := cmd.Flags().GetString("finding-id"); v != "" { - for _, s := range strings.Split(v, ",") { - in.FindingID = append(in.FindingID, string(s)) - } - } - if v, _ := cmd.Flags().GetString("from"); v != "" { - x := string(v) - in.From = &x - } - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("run-id"); v != "" { - x := string(v) - in.RunID = &x - } - if v, _ := cmd.Flags().GetString("to"); v != "" { - x := string(v) - in.To = &x - } - out, err := client.ListAdminMetricsUsageLedger(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("agent", "", "") - cmd.Flags().String("branch-type", "", "") - cmd.Flags().String("class", "", "") - cmd.Flags().String("cursor", "", "") - cmd.Flags().String("finding-id", "", "") - cmd.Flags().String("from", "", "") - cmd.Flags().String("limit", "", "") - cmd.Flags().String("run-id", "", "") - cmd.Flags().String("to", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-timeseries", - Short: "Usage Timeseries", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminMetricsUsageTimeseriesInput{} - if v, _ := cmd.Flags().GetString("agent"); v != "" { - x := string(v) - in.Agent = &x - } - if v, _ := cmd.Flags().GetString("class"); v != "" { - x := string(v) - in.Class = &x - } - if v, _ := cmd.Flags().GetString("from"); v != "" { - x := string(v) - in.From = &x - } - if v, _ := cmd.Flags().GetString("granularity"); v != "" { - x := string(v) - in.Granularity = &x - } - if v, _ := cmd.Flags().GetString("to"); v != "" { - x := string(v) - in.To = &x - } - out, err := client.ListAdminMetricsUsageTimeseries(cmd.Context(), in) + out, err := client.CreateAdminTeamsMerge(cmd.Context(), in) if err != nil { return err } @@ -2486,30 +10843,67 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { if err != nil { return err } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("agent", "", "") - cmd.Flags().String("class", "", "") - cmd.Flags().String("from", "", "") - cmd.Flags().String("granularity", "", "") - cmd.Flags().String("to", "", "") + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/teams/merge") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-organization", - Short: "Get Organization", + Use: "create-sla-breakdown", + Short: "Get Team SLA Breakdown", + Long: "Request body (JSON) fields: findingIDs (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminOrganizationInput{} - out, err := client.ListAdminOrganization(cmd.Context(), in) + in := api.CreateAdminTeamsSlaBreakdownInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTeamsSlaBreakdown(cmd.Context(), in) if err != nil { return err } @@ -2521,25 +10915,35 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/teams/sla-breakdown") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-acknowledgment", - Short: "Get Privacy Acknowledgment", + Use: "delete-teams ", + Short: "Delete Manual Team", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminPrivacyAcknowledgmentInput{} - if v, _ := cmd.Flags().GetString("policy-version"); v != "" { - x := string(v) - in.PolicyVersion = &x + in := api.DeleteAdminTeamsTeamIDInput{} + in.TeamID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListAdminPrivacyAcknowledgment(cmd.Context(), in) + out, err := client.DeleteAdminTeamsTeamID(cmd.Context(), in) if err != nil { return err } @@ -2551,22 +10955,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("policy-version", "", "The version of the privacy policy to check") + setRoute(cmd, "DELETE /admin/teams/{teamID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-acknowledgment", - Short: "Post Privacy Acknowledgment", - Long: "Request body (JSON) fields: policyVersion (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "patch-teams ", + Short: "Patch Team", + Long: "Request body (JSON) fields: addMemberIds (array), clearLead (boolean), codeOwnerships (array), github (object), gitlab (object), groundRules (array), jira (object), leadId (string), memberIds (array), messageChannelProvider (object), name (string), privacy (object), removeMemberIds (array), slug (string), ticketBoardId (string), ticketProjectProvider (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminPrivacyAcknowledgmentInput{} + in := api.PatchAdminTeamsTeamIDInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2596,56 +11002,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminPrivacyAcknowledgment(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-repositories", - Short: "Get Repositories", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminRepositoriesInput{} - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in.TeamID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x - } - } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x - } - if v, _ := cmd.Flags().GetString("search"); v != "" { - x := string(v) - in.Search = &x - } - if v, _ := cmd.Flags().GetString("team-i-ds"); v != "" { - for _, s := range strings.Split(v, ",") { - in.TeamIDs = append(in.TeamIDs, string(s)) + x := n + in.GithubInstallationID = &x } } - out, err := client.ListAdminRepositories(cmd.Context(), in) + out, err := client.PatchAdminTeamsTeamID(cmd.Context(), in) if err != nil { return err } @@ -2657,25 +11023,26 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "Maximum number of repositories to return per page") - cmd.Flags().String("next-token", "", "Pagination token for the next page of results") - cmd.Flags().String("search", "", "Case-insensitive search filter for repository names") - cmd.Flags().String("team-i-ds", "", "Filter repositories by team ULID") + setRoute(cmd, "PATCH /admin/teams/{teamID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-initialize", - Short: "Initialize Repositories", - Long: "Request body (JSON) fields: repositories (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-code-ownership-by-id ", + Short: "Make Team The Owner Of A Repository", + Long: "Request body (JSON) fields: actor (string), repositoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminRepositoriesInitializeInput{} + in := api.CreateAdminTeamsTeamIDCodeOwnershipInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2705,7 +11072,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminRepositoriesInitialize(cmd.Context(), in) + in.TeamID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTeamsTeamIDCodeOwnership(cmd.Context(), in) if err != nil { return err } @@ -2717,6 +11093,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/teams/{teamID}/code-ownership") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2724,16 +11102,17 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-uninitialize", - Short: "Uninitialize Repositories", - Long: "Request body (JSON) fields: repositories (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-events-by-id ", + Short: "List Team Unified Events", + Long: "Request body (JSON) fields: afterId (string), afterTimeUnix (integer), autofixId (string), beforeTimeUnix (integer), campaignId (string), eventTypes (array), excludeEventTypes (array), excludeServices (array), findingIds (array), hideNoise (boolean), limit (integer), prCanonicalId (string), query (string), queryEventTypes (array), runId (string), services (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminRepositoriesUninitializeInput{} + in := api.CreateAdminTeamsTeamIDEventsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2763,7 +11142,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminRepositoriesUninitialize(cmd.Context(), in) + in.TeamID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTeamsTeamIDEvents(cmd.Context(), in) if err != nil { return err } @@ -2775,6 +11163,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/teams/{teamID}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2782,20 +11172,26 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-repository-property-team-keys", - Short: "Delete Repository Property Team Key", + Use: "get-findings ", + Short: "Get Team Findings mapping", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminRepositoryPropertyTeamKeysInput{} - if v, _ := cmd.Flags().GetString("key-id"); v != "" { - x := string(v) - in.KeyID = &x + in := api.ListAdminTeamsTeamIDFindingsInput{} + in.TeamID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.DeleteAdminRepositoryPropertyTeamKeys(cmd.Context(), in) + out, err := client.ListAdminTeamsTeamIDFindings(cmd.Context(), in) if err != nil { return err } @@ -2807,22 +11203,31 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("key-id", "", "The repository property team key ID") + setRoute(cmd, "GET /admin/teams/{teamID}/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-repository-property-team-keys", - Short: "List Repository Property Team Keys", + Use: "list-tenant-capabilities", + Short: "List Tenant Capabilities", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminRepositoryPropertyTeamKeysInput{} - out, err := client.ListAdminRepositoryPropertyTeamKeys(cmd.Context(), in) + in := api.ListAdminTenantCapabilitiesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminTenantCapabilities(cmd.Context(), in) if err != nil { return err } @@ -2834,21 +11239,24 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/tenant-capabilities") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-repository-property-team-keys", - Short: "Create Repository Property Team Key", - Long: "Request body (JSON) fields: propertyKey (string, required), providerId (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "update-tenant-capabilities ", + Short: "Set Tenant Capability", + Long: "Request body (JSON) fields: enabled (boolean), expectedUpdatedAt (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminRepositoryPropertyTeamKeysInput{} + in := api.UpdateAdminTenantCapabilitiesCapabilityInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2878,7 +11286,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminRepositoryPropertyTeamKeys(cmd.Context(), in) + in.Capability = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminTenantCapabilitiesCapability(cmd.Context(), in) if err != nil { return err } @@ -2890,6 +11307,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/tenant-capabilities/{capability}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2897,20 +11316,56 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-service_accounts", - Short: "Delete Service Account", + Use: "list-activity", + Short: "List Ticketing Activity", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminServiceAccountsInput{} - if v, _ := cmd.Flags().GetString("service-account-id"); v != "" { + in := api.ListAdminTicketingActivityInput{} + if v, _ := cmd.Flags().GetString("actor"); v != "" { x := string(v) - in.ServiceAccountID = &x + in.Actor = &x } - out, err := client.DeleteAdminServiceAccounts(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("event-type"); v != "" { + x := string(v) + in.EventType = &x + } + if v, _ := cmd.Flags().GetString("from-time"); v != "" { + x := string(v) + in.FromTime = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int32(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("to-time"); v != "" { + x := string(v) + in.ToTime = &x + } + out, err := client.ListAdminTicketingActivity(cmd.Context(), in) if err != nil { return err } @@ -2922,22 +11377,39 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("service-account-id", "", "The service account ID") + setRoute(cmd, "GET /admin/ticketing/activity") + cmd.Flags().String("actor", "", "Optional ticket_audit_actor to filter by") + cmd.Flags().String("event-type", "", "Optional ticket_audit_event_type to filter by") + cmd.Flags().String("from-time", "", "RFC3339 lower bound on created_at") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Page size (default 50, max 200)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") + cmd.Flags().String("to-time", "", "RFC3339 upper bound on created_at") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-service_accounts", - Short: "Get Service Accounts", + Use: "get-bulk-operations ", + Short: "Get Bulk Operation Status", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminServiceAccountsInput{} - out, err := client.ListAdminServiceAccounts(cmd.Context(), in) + in := api.GetAdminTicketingBulkOperationsOperationIdInput{} + in.OperationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetAdminTicketingBulkOperationsOperationId(cmd.Context(), in) if err != nil { return err } @@ -2946,54 +11418,36 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "create-service_accounts", - Short: "Create Service Account", - Long: "Request body (JSON) fields: name (string, required), platform (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.CreateAdminServiceAccountsInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) - } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) - } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) - } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/ticketing/bulk-operations/{operationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-cancel-by-id ", + Short: "Request Bulk Operation Cancellation", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminTicketingBulkOperationsOperationIdCancelInput{} + in.OperationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } } - out, err := client.CreateAdminServiceAccounts(cmd.Context(), in) + out, err := client.CreateAdminTicketingBulkOperationsOperationIdCancel(cmd.Context(), in) if err != nil { return err } @@ -3005,23 +11459,31 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + setRoute(cmd, "POST /admin/ticketing/bulk-operations/{operationId}/cancel") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-sla", - Short: "Get SLAs", + Use: "list-saved-filters", + Short: "List Saved Ticket Filters", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminSlaInput{} - out, err := client.ListAdminSla(cmd.Context(), in) + in := api.ListAdminTicketingSavedFiltersInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminTicketingSavedFilters(cmd.Context(), in) if err != nil { return err } @@ -3033,21 +11495,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/ticketing/saved-filters") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-sla", - Short: "Post SLA", - Long: "Request body (JSON) fields: allowExtensions (boolean, required), maxDaysToFix (integer, required), priority (object, required), severity (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-saved-filters", + Short: "Create Saved Ticket Filter", + Long: "Request body (JSON) fields: filter (object, required), name (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminSlaInput{} + in := api.CreateAdminTicketingSavedFiltersInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3077,7 +11541,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminSla(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingSavedFilters(cmd.Context(), in) if err != nil { return err } @@ -3089,6 +11561,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/saved-filters") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3096,16 +11570,55 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "update-bulk", - Short: "Put Bulk SLA", - Long: "Request body (JSON) fields: slas (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "delete-saved-filters ", + Short: "Delete Saved Ticket Filter", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.UpdateAdminSlaBulkInput{} + in := api.DeleteAdminTicketingSavedFiltersIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminTicketingSavedFiltersId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/ticketing/saved-filters/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-saved-filters ", + Short: "Update Saved Ticket Filter", + Long: "Request body (JSON) fields: filter (object), name (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchAdminTicketingSavedFiltersIdInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3135,7 +11648,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.UpdateAdminSlaBulk(cmd.Context(), in) + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchAdminTicketingSavedFiltersId(cmd.Context(), in) if err != nil { return err } @@ -3147,6 +11669,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /admin/ticketing/saved-filters/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3154,9 +11678,9 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "patch-sla ", - Short: "Patch SLA", - Long: "Request body (JSON) fields: allowExtensions (boolean), maxDaysToFix (integer), priority (object), severity (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-settings-by-id ", + Short: "Save Ticket Settings", + Long: "Request body (JSON) fields: migrationAction (object), proposal (object, required), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -3164,7 +11688,7 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.PatchAdminSlaSlaIdInput{} + in := api.CreateAdminTicketingSettingsFindingTypeInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3194,8 +11718,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.SlaID = args[0] - out, err := client.PatchAdminSlaSlaId(cmd.Context(), in) + in.FindingType = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingSettingsFindingType(cmd.Context(), in) if err != nil { return err } @@ -3207,6 +11739,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/settings/{findingType}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3214,16 +11748,42 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-team-source-preferences", - Short: "Get Team Source Preferences", + Use: "get-history ", + Short: "List Ticket Settings History", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminTeamSourcePreferencesInput{} - out, err := client.ListAdminTeamSourcePreferences(cmd.Context(), in) + in := api.ListAdminTicketingSettingsFindingTypeHistoryInput{} + in.FindingType = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int32(n) + in.Offset = &x + } + } + out, err := client.ListAdminTicketingSettingsFindingTypeHistory(cmd.Context(), in) if err != nil { return err } @@ -3235,21 +11795,26 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/ticketing/settings/{findingType}/history") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Page size (default 50, max 200)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "update-team-source-preferences", - Short: "Update Team Source Preferences", - Long: "Request body (JSON) fields: githubTeamsEnabled (boolean, required), repositoryPropertyEnabled (boolean, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-preview-by-id ", + Short: "Preview Ticket Settings Impact", + Long: "Request body (JSON) fields: proposal (object, required), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.UpdateAdminTeamSourcePreferencesInput{} + in := api.CreateAdminTicketingSettingsFindingTypePreviewInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3279,7 +11844,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.UpdateAdminTeamSourcePreferences(cmd.Context(), in) + in.FindingType = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingSettingsFindingTypePreview(cmd.Context(), in) if err != nil { return err } @@ -3291,6 +11865,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/settings/{findingType}/preview") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3298,15 +11874,56 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-team-sync-runs", - Short: "List Team Sync Runs", + Use: "list-tickets", + Short: "List Tickets (Power-User Workbench)", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminTeamSyncRunsInput{} + in := api.ListAdminTicketingTicketsInput{} + if v, _ := cmd.Flags().GetString("board-id"); v != "" { + x := string(v) + in.BoardID = &x + } + if v, _ := cmd.Flags().GetString("closed-after"); v != "" { + x := string(v) + in.ClosedAfter = &x + } + if v, _ := cmd.Flags().GetString("closed-before"); v != "" { + x := string(v) + in.ClosedBefore = &x + } + if v, _ := cmd.Flags().GetString("created-after"); v != "" { + x := string(v) + in.CreatedAfter = &x + } + if v, _ := cmd.Flags().GetString("created-before"); v != "" { + x := string(v) + in.CreatedBefore = &x + } + if v, _ := cmd.Flags().GetString("finding-type"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FindingType = append(in.FindingType, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("has-sync-error"); v != "" { + x := string(v) + in.HasSyncError = &x + } + if v, _ := cmd.Flags().GetString("last-synced-before"); v != "" { + x := string(v) + in.LastSyncedBefore = &x + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -3315,11 +11932,42 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { in.Limit = &x } } - if v, _ := cmd.Flags().GetString("source"); v != "" { + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int32(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("out-of-eligibility-since-after"); v != "" { x := string(v) - in.Source = &x + in.OutOfEligibilitySinceAfter = &x } - out, err := client.ListAdminTeamSyncRuns(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("platform"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Platform = append(in.Platform, string(s)) + } + } + if v, _ := cmd.Flags().GetString("q"); v != "" { + x := string(v) + in.Q = &x + } + if v, _ := cmd.Flags().GetString("saved-filter-id"); v != "" { + x := string(v) + in.SavedFilterID = &x + } + if v, _ := cmd.Flags().GetString("source"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Source = append(in.Source, string(s)) + } + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Status = append(in.Status, string(s)) + } + } + out, err := client.ListAdminTicketingTickets(cmd.Context(), in) if err != nil { return err } @@ -3331,23 +11979,39 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") + setRoute(cmd, "GET /admin/ticketing/tickets") + cmd.Flags().String("board-id", "", "") + cmd.Flags().String("closed-after", "", "") + cmd.Flags().String("closed-before", "", "") + cmd.Flags().String("created-after", "", "") + cmd.Flags().String("created-before", "", "") + cmd.Flags().String("finding-type", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-sync-error", "", "") + cmd.Flags().String("last-synced-before", "", "") + cmd.Flags().String("limit", "", "Page size (default 50, max 200)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") + cmd.Flags().String("out-of-eligibility-since-after", "", "") + cmd.Flags().String("platform", "", "") + cmd.Flags().String("q", "", "") + cmd.Flags().String("saved-filter-id", "", "") cmd.Flags().String("source", "", "") + cmd.Flags().String("status", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-team-sync-runs", - Short: "Trigger Team Sync", - Long: "Request body (JSON) fields: source (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-bulk-add-comment", + Short: "Bulk Add Comment To Tickets", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminTeamSyncRunsInput{} + in := api.CreateAdminTicketingTicketsBulkAddCommentInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3377,7 +12041,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminTeamSyncRuns(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkAddComment(cmd.Context(), in) if err != nil { return err } @@ -3389,6 +12061,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-add-comment") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3396,18 +12070,54 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-team ", - Short: "Get Team", - Args: cobra.ExactArgs(1), + Use: "create-bulk-close", + Short: "Bulk Close Tickets", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetAdminTeamTeamIDInput{} - in.TeamID = args[0] - out, err := client.GetAdminTeamTeamID(cmd.Context(), in) + in := api.CreateAdminTicketingTicketsBulkCloseInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkClose(cmd.Context(), in) if err != nil { return err } @@ -3419,37 +12129,63 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-close") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-teams", - Short: "Get All Teams", + Use: "create-bulk-move", + Short: "Bulk Move Tickets", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminTeamsInput{} - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) - } else { - x := int(n) - in.Limit = &x + in := api.CreateAdminTicketingTicketsBulkMoveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x - } - if v, _ := cmd.Flags().GetString("search"); v != "" { - x := string(v) - in.Search = &x + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListAdminTeams(cmd.Context(), in) + out, err := client.CreateAdminTicketingTicketsBulkMove(cmd.Context(), in) if err != nil { return err } @@ -3461,24 +12197,25 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "Maximum number of teams to return per page") - cmd.Flags().String("next-token", "", "Pagination token for the next page of results") - cmd.Flags().String("search", "", "Case-insensitive search filter for team names") + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-move") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-teams", - Short: "Post Team", - Long: "Request body (JSON) fields: codeOwnerships (array), github (object), gitlab (object), groundRules (array), jira (object), leadId (string), memberIds (array), messageChannelProvider (object, required), name (string, required), privacy (object, required), slug (string, required), ticketProjectProvider (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-bulk-reassign-assignee", + Short: "Bulk Reassign Ticket Assignee", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminTeamsInput{} + in := api.CreateAdminTicketingTicketsBulkReassignAssigneeInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3508,7 +12245,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminTeams(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkReassignAssignee(cmd.Context(), in) if err != nil { return err } @@ -3520,6 +12265,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-reassign-assignee") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3527,42 +12274,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-appzip", - Short: "Get Teams App Zip", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminTeamsAppzipInput{} - out, err := client.ListAdminTeamsAppzip(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "create-compass", - Short: "Post Compass/Atlassian Team", - Long: "Request body (JSON) fields: displayName (string, required), lead (string, required), members (array, required), providerId (object), repositories (array, required), teamKey (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-bulk-reassign-team", + Short: "Bulk Reassign Tickets to Team", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminTeamsCompassInput{} + in := api.CreateAdminTicketingTicketsBulkReassignTeamInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3592,7 +12313,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminTeamsCompass(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkReassignTeam(cmd.Context(), in) if err != nil { return err } @@ -3604,6 +12333,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-reassign-team") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3611,16 +12342,54 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-teams-findings", - Short: "Get All Team Findings mapping", + Use: "create-bulk-relabel", + Short: "Bulk Relabel Tickets", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListAdminTeamsFindingsInput{} - out, err := client.ListAdminTeamsFindings(cmd.Context(), in) + in := api.CreateAdminTicketingTicketsBulkRelabelInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkRelabel(cmd.Context(), in) if err != nil { return err } @@ -3632,21 +12401,25 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-relabel") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-teams-findings", - Short: "Manual Team Findings Assignment", - Long: "Request body (JSON) fields: mappings (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-bulk-reopen", + Short: "Bulk Reopen Tickets", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminTeamsFindingsInput{} + in := api.CreateAdminTicketingTicketsBulkReopenInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3676,7 +12449,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminTeamsFindings(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkReopen(cmd.Context(), in) if err != nil { return err } @@ -3688,6 +12469,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-reopen") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3695,16 +12478,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-sync", - Short: "Sync Team Findings", - Long: "Request body (JSON) fields: async (boolean), findingIds (array), findingTypes (array), repositoryIds (array), repositoryNames (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-bulk-resync", + Short: "Bulk Re-Sync Tickets", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminTeamsFindingsSyncInput{} + in := api.CreateAdminTicketingTicketsBulkResyncInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3734,7 +12517,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminTeamsFindingsSync(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkResync(cmd.Context(), in) if err != nil { return err } @@ -3746,6 +12537,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-resync") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3753,16 +12546,16 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-merge", - Short: "Merge Teams", - Long: "Request body (JSON) fields: sources (array, required), targetTeamId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-bulk-set-priority", + Short: "Bulk Set Ticket Priority", + Long: "Request body (JSON) fields: confirmationToken (string), dryRun (boolean), filter (object, required), params (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminTeamsMergeInput{} + in := api.CreateAdminTicketingTicketsBulkSetPriorityInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3792,7 +12585,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateAdminTeamsMerge(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTicketingTicketsBulkSetPriority(cmd.Context(), in) if err != nil { return err } @@ -3804,6 +12605,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ticketing/tickets/bulk-set-priority") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3811,18 +12614,44 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-teams ", - Short: "Delete Manual Team", - Args: cobra.ExactArgs(1), + Use: "list-counts", + Short: "Get Ticket Facet Counts", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteAdminTeamsTeamIDInput{} - in.TeamID = args[0] - out, err := client.DeleteAdminTeamsTeamID(cmd.Context(), in) + in := api.ListAdminTicketingTicketsCountsInput{} + if v, _ := cmd.Flags().GetString("finding-type"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FindingType = append(in.FindingType, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("platform"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Platform = append(in.Platform, string(s)) + } + } + if v, _ := cmd.Flags().GetString("source"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Source = append(in.Source, string(s)) + } + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Status = append(in.Status, string(s)) + } + } + out, err := client.ListAdminTicketingTicketsCounts(cmd.Context(), in) if err != nil { return err } @@ -3834,14 +12663,19 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/ticketing/tickets/counts") + cmd.Flags().String("finding-type", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("platform", "", "") + cmd.Flags().String("source", "", "") + cmd.Flags().String("status", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-teams ", - Short: "Patch Team", - Long: "Request body (JSON) fields: codeOwnerships (array), github (object), gitlab (object), groundRules (array), jira (object), leadId (string), memberIds (array), messageChannelProvider (object), name (string), privacy (object), slug (string), ticketProjectProvider (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "get-tickets ", + Short: "Get Ticket Drill-Down", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -3849,7 +12683,45 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.PatchAdminTeamsTeamIDInput{} + in := api.GetAdminTicketingTicketsTicketIdInput{} + in.TicketID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetAdminTicketingTicketsTicketId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/ticketing/tickets/{ticketId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-context-census", + Short: "Post Triage Context Census", + Long: "Request body (JSON) fields: findingIds (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminTriageContextCensusInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3879,8 +12751,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.TeamID = args[0] - out, err := client.PatchAdminTeamsTeamID(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminTriageContextCensus(cmd.Context(), in) if err != nil { return err } @@ -3892,6 +12771,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/triage/context-census") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3899,17 +12780,88 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-events-by-id ", - Short: "List Team Unified Events", - Long: "Request body (JSON) fields: afterId (string), afterTimeUnix (integer), autofixId (string), beforeTimeUnix (integer), campaignId (string), eventTypes (array), findingIds (array), limit (integer), prCanonicalId (string), runId (string), services (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "delete-preferences", + Short: "Delete UI Preferences", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateAdminTeamsTeamIDEventsInput{} + in := api.DeleteAdminUiPreferencesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteAdminUiPreferences(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/ui/preferences") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-ui-preferences", + Short: "Get UI Preferences", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListAdminUiPreferencesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListAdminUiPreferences(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/ui/preferences") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-ui-preferences", + Short: "Put UI Preferences", + Long: "Request body (JSON) fields: preferences (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateAdminUiPreferencesInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3939,8 +12891,15 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.TeamID = args[0] - out, err := client.CreateAdminTeamsTeamIDEvents(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminUiPreferences(cmd.Context(), in) if err != nil { return err } @@ -3952,39 +12911,13 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/ui/preferences") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } - { - cmd := &cobra.Command{ - Use: "get-findings ", - Short: "Get Team Findings mapping", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAdminTeamsTeamIDFindingsInput{} - in.TeamID = args[0] - out, err := client.ListAdminTeamsTeamIDFindings(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - { cmd := &cobra.Command{ Use: "list-savedViews", @@ -3996,6 +12929,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListAdminUiSavedViewsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListAdminUiSavedViews(cmd.Context(), in) if err != nil { return err @@ -4008,6 +12949,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/ui/savedViews") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4052,6 +12995,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateAdminUiSavedViews(cmd.Context(), in) if err != nil { return err @@ -4064,6 +13015,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/ui/savedViews") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -4082,6 +13035,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.DeleteAdminUiSavedViewsSavedViewIdInput{} in.SavedViewID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.DeleteAdminUiSavedViewsSavedViewId(cmd.Context(), in) if err != nil { return err @@ -4094,6 +13055,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/ui/savedViews/{savedViewId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4140,6 +13103,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } in.SavedViewID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchAdminUiSavedViewsSavedViewId(cmd.Context(), in) if err != nil { return err @@ -4152,6 +13123,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /admin/ui/savedViews/{savedViewId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -4168,6 +13141,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListAdminUserCurrentInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListAdminUserCurrent(cmd.Context(), in) if err != nil { return err @@ -4180,6 +13161,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/user/current") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4194,6 +13177,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListAdminUserMappingInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("provider-id"); v != "" { x := string(v) in.ProviderID = &x @@ -4214,6 +13205,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/user/mapping") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("provider-id", "", "") cmd.Flags().String("user-id", "", "") serviceCmd.AddCommand(cmd) @@ -4260,6 +13253,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateAdminUserMapping(cmd.Context(), in) if err != nil { return err @@ -4272,6 +13273,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/user/mapping") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -4288,6 +13291,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListAdminUserMappingSuggestionsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListAdminUserMappingSuggestions(cmd.Context(), in) if err != nil { return err @@ -4300,6 +13311,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/user/mapping/suggestions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4316,7 +13329,23 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.DeleteAdminUserMappingUserIdInput{} in.UserID = args[0] - data, err := client.DeleteAdminUserMappingUserId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("hard"); v != "" { + b := v == "true" + in.Hard = &b + } + out, err := client.DeleteAdminUserMappingUserId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) if err != nil { return err } @@ -4324,6 +13353,9 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/user/mapping/{userId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("hard", "", "Delete the mapping row outright (offboarding or erasure). By default the row is kept with its Slack and Teams identities cleared and remembered as rejected. An internal automation caller (an agent) is refused; it always gets a plain clear that rejects nothing") serviceCmd.AddCommand(cmd) } @@ -4331,7 +13363,7 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { cmd := &cobra.Command{ Use: "update-mapping ", Short: "Edit User Mapping", - Long: "Request body (JSON) fields: azure (object), bitbucket (object), github (object), gitlab (object), jira (object), linear (object), slack (object), teams (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Long: "Request body (JSON) fields: azure (object), bitbucket (object), clearSlack (boolean), clearTeams (boolean), github (object), gitlab (object), jira (object), linear (object), slack (object), teams (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -4370,7 +13402,19 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } in.UserID = args[0] - data, err := client.UpdateAdminUserMappingUserId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateAdminUserMappingUserId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) if err != nil { return err } @@ -4378,6 +13422,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /admin/user/mapping/{userId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -4394,6 +13440,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListAdminUserMappingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListAdminUserMappings(cmd.Context(), in) if err != nil { return err @@ -4406,6 +13460,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/user/mappings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4422,6 +13478,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetAdminUserUserIDInput{} in.UserID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetAdminUserUserID(cmd.Context(), in) if err != nil { return err @@ -4434,6 +13498,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/user/{userID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4448,6 +13514,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListAdminUsersInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListAdminUsers(cmd.Context(), in) if err != nil { return err @@ -4460,6 +13534,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4504,6 +13580,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateAdminUsers(cmd.Context(), in) if err != nil { return err @@ -4516,6 +13600,76 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-activate", + Short: "Activate Users", + Long: "Request body (JSON) fields: users (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminUsersActivateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminUsersActivate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/users/activate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -4562,6 +13716,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateAdminUsersBulkSearchMappings(cmd.Context(), in) if err != nil { return err @@ -4574,6 +13736,183 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/users/bulkSearchMappings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-deactivate", + Short: "Deactivate User", + Long: "Request body (JSON) fields: userId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminUsersDeactivateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminUsersDeactivate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/users/deactivate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-identity ", + Short: "Get User By Git Identity", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetAdminUsersIdentityProviderIDProviderUserIDInput{} + in.ProviderID = args[0] + in.ProviderUserID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetAdminUsersIdentityProviderIDProviderUserID(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/users/identity/{providerID}/{providerUserID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-reactivate", + Short: "Reactivate User", + Long: "Request body (JSON) fields: userId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateAdminUsersReactivateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateAdminUsersReactivate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /admin/users/reactivate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -4592,6 +13931,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetAdminUsersProviderIDInput{} in.ProviderID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetAdminUsersProviderID(cmd.Context(), in) if err != nil { return err @@ -4604,6 +13951,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/users/{providerID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4621,6 +13970,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { in := api.GetAdminUsersProviderIDUserIDInput{} in.ProviderID = args[0] in.UserID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetAdminUsersProviderIDUserID(cmd.Context(), in) if err != nil { return err @@ -4633,6 +13990,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/users/{providerID}/{userID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4649,6 +14008,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.DeleteAdminUsersUserIdErasureInput{} in.UserID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.DeleteAdminUsersUserIdErasure(cmd.Context(), in) if err != nil { return err @@ -4661,6 +14028,8 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /admin/users/{userId}/erasure") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -4681,6 +14050,14 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.Format = &x } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListAdminUsersUserIdExport(cmd.Context(), in) if err != nil { return err @@ -4693,7 +14070,9 @@ func RegisterAdminCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /admin/users/{userId}/export") cmd.Flags().String("format", "", "Export format (json)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } diff --git a/internal/commands/api_services.go b/internal/commands/api_services.go new file mode 100644 index 0000000..3ba6dec --- /dev/null +++ b/internal/commands/api_services.go @@ -0,0 +1,19 @@ +// Code generated by scripts/generate/main.go. DO NOT EDIT. +package commands + +import "github.com/spf13/cobra" + +// RegisterAPICommands adds the generated command group of every service to parent. +func RegisterAPICommands(parent *cobra.Command, getClient ClientFactory) { + RegisterAdminCommands(parent, getClient) + RegisterContextCommands(parent, getClient) + RegisterCspmCommands(parent, getClient) + RegisterDastCommands(parent, getClient) + RegisterFindingsCommands(parent, getClient) + RegisterManagerCommands(parent, getClient) + RegisterOrchestratorCommands(parent, getClient) + RegisterSastCommands(parent, getClient) + RegisterScaCommands(parent, getClient) + RegisterScpmCommands(parent, getClient) + RegisterSecretsCommands(parent, getClient) +} diff --git a/internal/commands/asset-graph.go b/internal/commands/asset-graph.go deleted file mode 100644 index a5e9de1..0000000 --- a/internal/commands/asset-graph.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by scripts/generate/main.go. DO NOT EDIT. -package commands - -import ( - "encoding/json" - "fmt" - "os" - "strconv" - "strings" - - "github.com/nullify-platform/cli/internal/api" - "github.com/nullify-platform/cli/internal/api/models" - "github.com/nullify-platform/cli/internal/output" - "github.com/spf13/cobra" -) - -var _ = json.Marshal -var _ = fmt.Errorf -var _ = os.Stdin -var _ = strconv.Atoi -var _ = strings.Split -var _ = models.RequestScope{} - -func RegisterAssetGraphCommands(parent *cobra.Command, getClient ClientFactory) { - serviceCmd := &cobra.Command{ - Use: "asset-graph", - Short: "Asset Graph (reachability, search, subgraph, summary)", - } - parent.AddCommand(serviceCmd) - - { - cmd := &cobra.Command{ - Use: "list-reachability", - Short: "Get Asset Graph Reachability", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAssetGraphReachabilityInput{} - if v, _ := cmd.Flags().GetString("account-id"); v != "" { - x := string(v) - in.AccountID = &x - } - if v, _ := cmd.Flags().GetString("node-id"); v != "" { - x := string(v) - in.NodeID = &x - } - out, err := client.ListAssetGraphReachability(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("account-id", "", "") - cmd.Flags().String("node-id", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-search", - Short: "Search Asset Graph", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAssetGraphSearchInput{} - if v, _ := cmd.Flags().GetString("max-results"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("maxResults"+": %w", err) - } else { - x := int(n) - in.MaxResults = &x - } - } - if v, _ := cmd.Flags().GetString("object-types"); v != "" { - for _, s := range strings.Split(v, ",") { - in.ObjectTypes = append(in.ObjectTypes, string(s)) - } - } - if v, _ := cmd.Flags().GetString("q"); v != "" { - x := string(v) - in.Q = &x - } - out, err := client.ListAssetGraphSearch(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("max-results", "", "") - cmd.Flags().String("object-types", "", "") - cmd.Flags().String("q", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-subgraph", - Short: "Get Asset Graph Subgraph", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAssetGraphSubgraphInput{} - if v, _ := cmd.Flags().GetString("account-id"); v != "" { - x := string(v) - in.AccountID = &x - } - if v, _ := cmd.Flags().GetString("depth"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("depth"+": %w", err) - } else { - x := int(n) - in.Depth = &x - } - } - if v, _ := cmd.Flags().GetString("max-nodes"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("maxNodes"+": %w", err) - } else { - x := int(n) - in.MaxNodes = &x - } - } - if v, _ := cmd.Flags().GetString("object-types"); v != "" { - for _, s := range strings.Split(v, ",") { - in.ObjectTypes = append(in.ObjectTypes, string(s)) - } - } - if v, _ := cmd.Flags().GetString("root-node-id"); v != "" { - x := string(v) - in.RootNodeID = &x - } - out, err := client.ListAssetGraphSubgraph(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("account-id", "", "") - cmd.Flags().String("depth", "", "") - cmd.Flags().String("max-nodes", "", "") - cmd.Flags().String("object-types", "", "") - cmd.Flags().String("root-node-id", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-summary", - Short: "Get Asset Graph Summary", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListAssetGraphSummaryInput{} - out, err := client.ListAssetGraphSummary(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - -} diff --git a/internal/commands/behavior.go b/internal/commands/behavior.go index 1966066..09fe3c6 100644 --- a/internal/commands/behavior.go +++ b/internal/commands/behavior.go @@ -2,7 +2,10 @@ package commands import "github.com/spf13/cobra" -const preserveRuntimeUsageAnnotation = "nullify.preserve-runtime-usage" +const ( + preserveRuntimeUsageAnnotation = "nullify.preserve-runtime-usage" + routeAnnotation = "nullify.route" +) func preserveRuntimeUsage(cmd *cobra.Command) { if cmd.Annotations == nil { @@ -15,3 +18,13 @@ func preserveRuntimeUsage(cmd *cobra.Command) { func PreservesRuntimeUsage(cmd *cobra.Command) bool { return cmd.Annotations[preserveRuntimeUsageAnnotation] == "true" } + +func setRoute(cmd *cobra.Command, route string) { + cmd.Annotations[routeAnnotation] = route +} + +// Route returns the "METHOD /path" that a generated command calls, or an empty +// string for a command that is not generated. +func Route(cmd *cobra.Command) string { + return cmd.Annotations[routeAnnotation] +} diff --git a/internal/commands/context.go b/internal/commands/context.go index d1d3ce6..6c9f807 100644 --- a/internal/commands/context.go +++ b/internal/commands/context.go @@ -24,7 +24,7 @@ var _ = models.RequestScope{} func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { serviceCmd := &cobra.Command{ Use: "context", - Short: "Repository and Code Classification", + Short: "Repository, Asset Graph and Infrastructure Context", } parent.AddCommand(serviceCmd) @@ -39,6 +39,34 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListContextApplicationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } out, err := client.ListContextApplications(cmd.Context(), in) if err != nil { return err @@ -51,6 +79,11 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/applications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of applications to return per page (default 1000, max 1000)") + cmd.Flags().String("offset", "", "Number of applications to skip before the page") + cmd.Flags().String("search", "", "Case-insensitive substring match on application name and description") serviceCmd.AddCommand(cmd) } @@ -95,6 +128,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateContextApplications(cmd.Context(), in) if err != nil { return err @@ -107,6 +148,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/applications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -153,6 +196,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateContextApplicationsRebuild(cmd.Context(), in) if err != nil { return err @@ -165,11 +216,51 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/applications/rebuild") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } + { + cmd := &cobra.Command{ + Use: "get-rebuilds ", + Short: "Get Application Rebuild", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextApplicationsRebuildsRunIdInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextApplicationsRebuildsRunId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/applications/rebuilds/{runId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + { cmd := &cobra.Command{ Use: "delete-applications ", @@ -183,6 +274,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.DeleteContextApplicationsApplicationIdInput{} in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.DeleteContextApplicationsApplicationId(cmd.Context(), in) if err != nil { return err @@ -195,6 +294,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -211,6 +312,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetContextApplicationsApplicationIdInput{} in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetContextApplicationsApplicationId(cmd.Context(), in) if err != nil { return err @@ -223,6 +332,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -269,6 +380,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchContextApplicationsApplicationId(cmd.Context(), in) if err != nil { return err @@ -281,11 +400,76 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } + { + cmd := &cobra.Command{ + Use: "get-applications-execution-recipe ", + Short: "Get Application Execution Recipe", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextApplicationsApplicationIdExecutionRecipeInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("allow-edits"); v != "" { + b := v == "true" + in.AllowEdits = &b + } + if v, _ := cmd.Flags().GetString("capabilities"); v != "" { + x := string(v) + in.Capabilities = &x + } + if v, _ := cmd.Flags().GetString("commit-sha"); v != "" { + x := string(v) + in.CommitSha = &x + } + if v, _ := cmd.Flags().GetString("docker"); v != "" { + b := v == "true" + in.Docker = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("input-hash"); v != "" { + x := string(v) + in.InputHash = &x + } + out, err := client.ListContextApplicationsApplicationIdExecutionRecipe(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/applications/{applicationId}/execution-recipe") + cmd.Flags().String("allow-edits", "", "Whether the caller will apply the file edits a recipe carries. Defaults to true; false returns incompatible rather than a recipe the caller would refuse") + cmd.Flags().String("capabilities", "", "Comma separated sandbox capabilities beyond docker, from docker_compose, network, nested_virtualization, gpu, service_postgres, service_mysql, service_redis, service_mongo, service_elasticsearch, service_kafka") + cmd.Flags().String("commit-sha", "", "The commit the caller wants to stand the target up at") + cmd.Flags().String("docker", "", "Whether the caller's sandbox provides a Docker daemon") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("input-hash", "", "The build input hash the caller computed from its own checkout, used when Context has never observed the commit") + serviceCmd.AddCommand(cmd) + } + { cmd := &cobra.Command{ Use: "get-applications-schema ", @@ -299,6 +483,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListContextApplicationsApplicationIdSchemaInput{} in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListContextApplicationsApplicationIdSchema(cmd.Context(), in) if err != nil { return err @@ -311,6 +503,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/applications/{applicationId}/schema") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -337,6 +531,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.ComputeType = &x } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("include-deleted"); v != "" { b := v == "true" in.IncludeDeleted = &b @@ -369,9 +571,11 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/artifact-deployments") cmd.Flags().String("artifact-id", "", "") cmd.Flags().String("cloud-resource-id", "", "") cmd.Flags().String("compute-type", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("include-deleted", "", "") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") @@ -392,6 +596,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetContextArtifactDeploymentsDeploymentIdInput{} in.DeploymentID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetContextArtifactDeploymentsDeploymentId(cmd.Context(), in) if err != nil { return err @@ -404,6 +616,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/artifact-deployments/{deploymentId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -418,6 +632,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListContextArtifactsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("include-deleted"); v != "" { b := v == "true" in.IncludeDeleted = &b @@ -434,6 +656,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.NextToken = &x } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } if v, _ := cmd.Flags().GetString("project-id"); v != "" { x := string(v) in.ProjectID = &x @@ -442,6 +672,10 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.RepositoryID = &x } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } if v, _ := cmd.Flags().GetString("type"); v != "" { x := string(v) in.Type = &x @@ -458,11 +692,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/artifacts") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("include-deleted", "", "") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") + cmd.Flags().String("offset", "", "") cmd.Flags().String("project-id", "", "") cmd.Flags().String("repository-id", "", "") + cmd.Flags().String("search", "", "") cmd.Flags().String("type", "", "") serviceCmd.AddCommand(cmd) } @@ -480,6 +718,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.DeleteContextArtifactsArtifactIdInput{} in.ArtifactID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.DeleteContextArtifactsArtifactId(cmd.Context(), in) if err != nil { return err @@ -492,6 +738,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/artifacts/{artifactId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -508,6 +756,14 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetContextArtifactsArtifactIdInput{} in.ArtifactID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetContextArtifactsArtifactId(cmd.Context(), in) if err != nil { return err @@ -520,23 +776,33 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/artifacts/{artifactId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-cloud-accounts", - Short: "Get Asset Inventory Cloud Accounts", + Use: "list-attack-paths", + Short: "List Asset Graph Attack Paths", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextAssetInventoryCloudAccountsInput{} - if v, _ := cmd.Flags().GetString("active"); v != "" { + in := api.ListContextAssetGraphAttackPathsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("has-critical-finding"); v != "" { b := v == "true" - in.Active = &b + in.HasCriticalFinding = &b } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { @@ -546,15 +812,19 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { in.Limit = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } } - if v, _ := cmd.Flags().GetString("provider"); v != "" { - x := string(v) - in.Provider = &x + if v, _ := cmd.Flags().GetString("terminal-node-kind"); v != "" { + x := models.EndpointsAttackPathTerminalNodeKind(v) + in.TerminalNodeKind = &x } - out, err := client.ListContextAssetInventoryCloudAccounts(cmd.Context(), in) + out, err := client.ListContextAssetGraphAttackPaths(cmd.Context(), in) if err != nil { return err } @@ -566,57 +836,43 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("active", "", "") + setRoute(cmd, "GET /context/asset-graph/attack-paths") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-critical-finding", "", "") cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") - cmd.Flags().String("provider", "", "") + cmd.Flags().String("offset", "", "") + cmd.Flags().String("terminal-node-kind", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-cloud-resources", - Short: "Get Asset Inventory Cloud Resources", + Use: "list-landing", + Short: "Get Asset Graph Landing", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextAssetInventoryCloudResourcesInput{} - if v, _ := cmd.Flags().GetString("account-id"); v != "" { - x := string(v) - in.AccountID = &x - } - if v, _ := cmd.Flags().GetString("active"); v != "" { - b := v == "true" - in.Active = &b - } - if v, _ := cmd.Flags().GetString("category"); v != "" { - x := string(v) - in.Category = &x + in := api.ListContextAssetGraphLandingInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - if v, _ := cmd.Flags().GetString("limit"); v != "" { + if v, _ := cmd.Flags().GetString("per-category"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + return fmt.Errorf("perCategory"+": %w", err) } else { x := int(n) - in.Limit = &x + in.PerCategory = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x - } - if v, _ := cmd.Flags().GetString("provider"); v != "" { - x := string(v) - in.Provider = &x - } - if v, _ := cmd.Flags().GetString("type"); v != "" { - x := string(v) - in.Type = &x - } - out, err := client.ListContextAssetInventoryCloudResources(cmd.Context(), in) + out, err := client.ListContextAssetGraphLanding(cmd.Context(), in) if err != nil { return err } @@ -628,48 +884,36 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("account-id", "", "") - cmd.Flags().String("active", "", "") - cmd.Flags().String("category", "", "") - cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") - cmd.Flags().String("provider", "", "") - cmd.Flags().String("type", "", "") + setRoute(cmd, "GET /context/asset-graph/landing") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("per-category", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-public-facing", - Short: "Get Public Facing Assets", + Use: "list-node", + Short: "Get Asset Graph Node", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextAssetInventoryPublicFacingInput{} - if v, _ := cmd.Flags().GetString("account-id"); v != "" { - x := string(v) - in.AccountID = &x - } - if v, _ := cmd.Flags().GetString("cloud-provider"); v != "" { - x := string(v) - in.CloudProvider = &x - } - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in := api.ListContextAssetGraphNodeInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { + if v, _ := cmd.Flags().GetString("node-id"); v != "" { x := string(v) - in.NextToken = &x + in.NodeID = &x } - out, err := client.ListContextAssetInventoryPublicFacing(cmd.Context(), in) + out, err := client.ListContextAssetGraphNode(cmd.Context(), in) if err != nil { return err } @@ -681,31 +925,39 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("account-id", "", "") - cmd.Flags().String("cloud-provider", "", "") - cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") + setRoute(cmd, "GET /context/asset-graph/node") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("node-id", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-resources", - Short: "Get Asset Inventory Resources", + Use: "list-nodes", + Short: "List Asset Graph Nodes", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextAssetInventoryResourcesInput{} - if v, _ := cmd.Flags().GetString("active"); v != "" { + in := api.ListContextAssetGraphNodesInput{} + if v, _ := cmd.Flags().GetString("child-counts"); v != "" { b := v == "true" - in.Active = &b + in.ChildCounts = &b } - if v, _ := cmd.Flags().GetString("category"); v != "" { - x := string(v) - in.Category = &x + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("kinds"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Kinds = append(in.Kinds, string(s)) + } } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { @@ -715,15 +967,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { in.Limit = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x - } - if v, _ := cmd.Flags().GetString("type"); v != "" { - x := string(v) - in.Type = &x + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } } - out, err := client.ListContextAssetInventoryResources(cmd.Context(), in) + out, err := client.ListContextAssetGraphNodes(cmd.Context(), in) if err != nil { return err } @@ -735,56 +987,53 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("active", "", "") - cmd.Flags().String("category", "", "") + setRoute(cmd, "GET /context/asset-graph/nodes") + cmd.Flags().String("child-counts", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("kinds", "", "") cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") - cmd.Flags().String("type", "", "") + cmd.Flags().String("offset", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-cicd-pipelines", - Short: "List CI/CD Pipelines", + Use: "list-reachability", + Short: "Get Asset Graph Reachability", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextCicdPipelinesInput{} - if v, _ := cmd.Flags().GetString("include-deleted"); v != "" { - b := v == "true" - in.IncludeDeleted = &b + in := api.ListContextAssetGraphReachabilityInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - if v, _ := cmd.Flags().GetString("limit"); v != "" { + if v, _ := cmd.Flags().GetString("node-id"); v != "" { + x := string(v) + in.NodeID = &x + } + if v, _ := cmd.Flags().GetString("port"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + return fmt.Errorf("port"+": %w", err) } else { x := int(n) - in.Limit = &x + in.Port = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { + if v, _ := cmd.Flags().GetString("protocol"); v != "" { x := string(v) - in.NextToken = &x + in.Protocol = &x } - if v, _ := cmd.Flags().GetString("platform"); v != "" { - x := string(v) - in.Platform = &x - } - if v, _ := cmd.Flags().GetString("project-id"); v != "" { - x := string(v) - in.ProjectID = &x - } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { - x := string(v) - in.RepositoryID = &x - } - out, err := client.ListContextCicdPipelines(cmd.Context(), in) - if err != nil { - return err + out, err := client.ListContextAssetGraphReachability(cmd.Context(), in) + if err != nil { + return err } data, err := json.Marshal(out) if err != nil { @@ -794,57 +1043,46 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("include-deleted", "", "") - cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") - cmd.Flags().String("platform", "", "") - cmd.Flags().String("project-id", "", "") - cmd.Flags().String("repository-id", "", "") + setRoute(cmd, "GET /context/asset-graph/reachability") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("node-id", "", "") + cmd.Flags().String("port", "", "") + cmd.Flags().String("protocol", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-cicd-pipelines ", - Short: "Delete CI/CD Pipeline", - Args: cobra.ExactArgs(1), + Use: "list-retrieve", + Short: "Retrieve Asset Graph Nodes", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteContextCicdPipelinesPipelineIdInput{} - in.PipelineID = args[0] - out, err := client.DeleteContextCicdPipelinesPipelineId(cmd.Context(), in) - if err != nil { - return err + in := api.ListContextAssetGraphRetrieveInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - data, err := json.Marshal(out) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("max-results"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("maxResults"+": %w", err) + } else { + x := int(n) + in.MaxResults = &x + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-cicd-pipelines ", - Short: "Get CI/CD Pipeline", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("q"); v != "" { + x := string(v) + in.Q = &x } - in := api.GetContextCicdPipelinesPipelineIdInput{} - in.PipelineID = args[0] - out, err := client.GetContextCicdPipelinesPipelineId(cmd.Context(), in) + out, err := client.ListContextAssetGraphRetrieve(cmd.Context(), in) if err != nil { return err } @@ -856,47 +1094,50 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-graph/retrieve") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("max-results", "", "") + cmd.Flags().String("q", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-discovered-nodes ", - Short: "Get Cloud Recon Discovered Nodes", - Args: cobra.ExactArgs(1), + Use: "list-search", + Short: "Search Asset Graph", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextCloudReconAccountsAccountIdDiscoveredNodesInput{} - in.AccountID = args[0] - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in := api.ListContextAssetGraphSearchInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("object-type"); v != "" { - x := string(v) - in.ObjectType = &x - } - if v, _ := cmd.Flags().GetString("offset"); v != "" { + if v, _ := cmd.Flags().GetString("max-results"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("offset"+": %w", err) + return fmt.Errorf("maxResults"+": %w", err) } else { x := int(n) - in.Offset = &x + in.MaxResults = &x } } - if v, _ := cmd.Flags().GetString("source"); v != "" { + if v, _ := cmd.Flags().GetString("object-types"); v != "" { + for _, s := range strings.Split(v, ",") { + in.ObjectTypes = append(in.ObjectTypes, string(s)) + } + } + if v, _ := cmd.Flags().GetString("q"); v != "" { x := string(v) - in.Source = &x + in.Q = &x } - out, err := client.ListContextCloudReconAccountsAccountIdDiscoveredNodes(cmd.Context(), in) + out, err := client.ListContextAssetGraphSearch(cmd.Context(), in) if err != nil { return err } @@ -908,47 +1149,64 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") - cmd.Flags().String("object-type", "", "") - cmd.Flags().String("offset", "", "") - cmd.Flags().String("source", "", "") + setRoute(cmd, "GET /context/asset-graph/search") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("max-results", "", "") + cmd.Flags().String("object-types", "", "") + cmd.Flags().String("q", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-hotspots ", - Short: "Get Cloud Recon Hotspots", - Args: cobra.ExactArgs(1), + Use: "list-subgraph", + Short: "Get Asset Graph Subgraph", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextCloudReconAccountsAccountIdHotspotsInput{} - in.AccountID = args[0] - if v, _ := cmd.Flags().GetString("limit"); v != "" { + in := api.ListContextAssetGraphSubgraphInput{} + if v, _ := cmd.Flags().GetString("depth"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + return fmt.Errorf("depth"+": %w", err) } else { x := int(n) - in.Limit = &x + in.Depth = &x } } - if v, _ := cmd.Flags().GetString("offset"); v != "" { + if v, _ := cmd.Flags().GetString("edge-types"); v != "" { + for _, s := range strings.Split(v, ",") { + in.EdgeTypes = append(in.EdgeTypes, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("max-nodes"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("offset"+": %w", err) + return fmt.Errorf("maxNodes"+": %w", err) } else { x := int(n) - in.Offset = &x + in.MaxNodes = &x } } - if v, _ := cmd.Flags().GetString("severity"); v != "" { + if v, _ := cmd.Flags().GetString("object-types"); v != "" { + for _, s := range strings.Split(v, ",") { + in.ObjectTypes = append(in.ObjectTypes, string(s)) + } + } + if v, _ := cmd.Flags().GetString("root-node-id"); v != "" { x := string(v) - in.Severity = &x + in.RootNodeID = &x } - out, err := client.ListContextCloudReconAccountsAccountIdHotspots(cmd.Context(), in) + out, err := client.ListContextAssetGraphSubgraph(cmd.Context(), in) if err != nil { return err } @@ -960,26 +1218,36 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") - cmd.Flags().String("offset", "", "") - cmd.Flags().String("severity", "", "") + setRoute(cmd, "GET /context/asset-graph/subgraph") + cmd.Flags().String("depth", "", "") + cmd.Flags().String("edge-types", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("max-nodes", "", "") + cmd.Flags().String("object-types", "", "") + cmd.Flags().String("root-node-id", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-cloud-recon-accounts-scans-latest ", - Short: "Get Latest Cloud Recon Scan", - Args: cobra.ExactArgs(1), + Use: "list-asset-graph-summary", + Short: "Get Asset Graph Summary", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextCloudReconAccountsAccountIdScansLatestInput{} - in.AccountID = args[0] - out, err := client.ListContextCloudReconAccountsAccountIdScansLatest(cmd.Context(), in) + in := api.ListContextAssetGraphSummaryInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextAssetGraphSummary(cmd.Context(), in) if err != nil { return err } @@ -991,51 +1259,83 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-graph/summary") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-scans", - Short: "Persist Cloud Recon Scan", - Long: "Request body (JSON) fields: accountId (string, required), completedAt (string), modelName (string), payload (string, required), provider (string, required), scanId (string), schemaVersion (string, required), startedAt (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "list-asset-inventory", + Short: "List Asset Inventory", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextCloudReconScansInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) - } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) - } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) + in := api.ListContextAssetInventoryInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("category"); v != "" { + x := string(v) + in.Category = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x } } - out, err := client.CreateContextCloudReconScans(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("q"); v != "" { + x := string(v) + in.Q = &x + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + if v, _ := cmd.Flags().GetString("updated-after"); v != "" { + x := string(v) + in.UpdatedAfter = &x + } + out, err := client.ListContextAssetInventory(cmd.Context(), in) if err != nil { return err } @@ -1047,23 +1347,83 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + setRoute(cmd, "GET /context/asset-inventory") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("category", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("q", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + cmd.Flags().String("updated-after", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-cross-account-trusts", - Short: "Get Tenant Cloud Recon Cross-Account Trusts", + Use: "list-ai-ml", + Short: "List AI/ML Assets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextCloudReconTenantsCrossAccountTrustsInput{} - out, err := client.ListContextCloudReconTenantsCrossAccountTrusts(cmd.Context(), in) + in := api.ListContextAssetInventoryAiMlInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryAiMl(cmd.Context(), in) if err != nil { return err } @@ -1075,21 +1435,42 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/ai-ml") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-start", - Short: "Start Cloud Scan", + Use: "get-ai-ml ", + Short: "Get AI/ML Asset", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextCloudScanStartInput{} - out, err := client.CreateContextCloudScanStart(cmd.Context(), in) + in := api.GetContextAssetInventoryAiMlIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryAiMlId(cmd.Context(), in) if err != nil { return err } @@ -1101,77 +1482,71 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/ai-ml/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-status ", - Short: "Get Cloud Scan Status", - Args: cobra.ExactArgs(1), + Use: "list-artifact-repositories", + Short: "List Artifact Repositories Assets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextCloudScanScanIdStatusInput{} - in.ScanID = args[0] - out, err := client.ListContextCloudScanScanIdStatus(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + in := api.ListContextAssetInventoryArtifactRepositoriesInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "delete-deps", - Short: "Delete dependency data", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b } - in := api.DeleteContextDepsInput{} - if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { - x := string(v) - in.Ecosystem = &x + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - if v, _ := cmd.Flags().GetString("global"); v != "" { + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { b := v == "true" - in.Global = &b + in.InternetReachable = &b } - if v, _ := cmd.Flags().GetString("introduced-at"); v != "" { - x := string(v) - in.IntroducedAt = &x + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } } - if v, _ := cmd.Flags().GetString("name"); v != "" { + if v, _ := cmd.Flags().GetString("next-token"); v != "" { x := string(v) - in.Name = &x + in.NextToken = &x } - if v, _ := cmd.Flags().GetString("project-id"); v != "" { + if v, _ := cmd.Flags().GetString("provider"); v != "" { x := string(v) - in.ProjectID = &x + in.Provider = &x } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { x := string(v) - in.RepositoryID = &x + in.Region = &x } - if v, _ := cmd.Flags().GetString("version"); v != "" { + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { x := string(v) - in.Version = &x + in.SubType = &x } - out, err := client.DeleteContextDeps(cmd.Context(), in) + out, err := client.ListContextAssetInventoryArtifactRepositories(cmd.Context(), in) if err != nil { return err } @@ -1183,40 +1558,42 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("ecosystem", "", "") - cmd.Flags().String("global", "", "") - cmd.Flags().String("introduced-at", "", "") - cmd.Flags().String("name", "", "") - cmd.Flags().String("project-id", "", "") - cmd.Flags().String("repository-id", "", "") - cmd.Flags().String("version", "", "") + setRoute(cmd, "GET /context/asset-inventory/artifact-repositories") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-deps", - Short: "List Tenant Wide Dependencies (Historical)", + Use: "get-artifact-repositories ", + Short: "Get Artifact Repositories Asset", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsInput{} - if v, _ := cmd.Flags().GetString("cursor"); v != "" { - x := string(v) - in.Cursor = &x - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.GetContextAssetInventoryArtifactRepositoriesIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int32(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListContextDeps(cmd.Context(), in) + out, err := client.GetContextAssetInventoryArtifactRepositoriesId(cmd.Context(), in) if err != nil { return err } @@ -1228,63 +1605,75 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("cursor", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /context/asset-inventory/artifact-repositories/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-active", - Short: "List Tenant Wide Active Dependencies", + Use: "list-asset-inventory-artifacts", + Short: "List Artifacts Assets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsActiveInput{} - if v, _ := cmd.Flags().GetString("cursor"); v != "" { + in := api.ListContextAssetInventoryArtifactsInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { x := string(v) - in.Cursor = &x + in.AccountID = &x } - if v, _ := cmd.Flags().GetString("direct"); v != "" { + if v, _ := cmd.Flags().GetString("active"); v != "" { b := v == "true" - in.Direct = &b + in.Active = &b } - if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { - x := string(v) - in.Ecosystem = &x + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - if v, _ := cmd.Flags().GetString("name"); v != "" { - x := string(v) - in.Name = &x + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + return fmt.Errorf("limit"+": %w", err) } else { - x := int32(n) - in.PageSize = &x + x := int(n) + in.Limit = &x } } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } if v, _ := cmd.Flags().GetString("project-id"); v != "" { x := string(v) in.ProjectID = &x } - if v, _ := cmd.Flags().GetString("range"); v != "" { + if v, _ := cmd.Flags().GetString("provider"); v != "" { x := string(v) - in.Range = &x + in.Provider = &x } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { x := string(v) - in.RepositoryID = &x + in.Region = &x } - if v, _ := cmd.Flags().GetString("search"); v != "" { + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { x := string(v) - in.Search = &x + in.SubType = &x } - out, err := client.ListContextDepsActive(cmd.Context(), in) + out, err := client.ListContextAssetInventoryArtifacts(cmd.Context(), in) if err != nil { return err } @@ -1296,58 +1685,43 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("cursor", "", "") - cmd.Flags().String("direct", "", "") - cmd.Flags().String("ecosystem", "", "") - cmd.Flags().String("name", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /context/asset-inventory/artifacts") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") cmd.Flags().String("project-id", "", "") - cmd.Flags().String("range", "", "") - cmd.Flags().String("repository-id", "", "") - cmd.Flags().String("search", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-summary", - Short: "Tenant Wide Active Dependency Summary", + Use: "get-asset-inventory-artifacts ", + Short: "Get Artifacts Asset", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsActiveSummaryInput{} - if v, _ := cmd.Flags().GetString("direct"); v != "" { - b := v == "true" - in.Direct = &b - } - if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { - x := string(v) - in.Ecosystem = &x - } - if v, _ := cmd.Flags().GetString("name"); v != "" { - x := string(v) - in.Name = &x - } - if v, _ := cmd.Flags().GetString("project-id"); v != "" { - x := string(v) - in.ProjectID = &x - } - if v, _ := cmd.Flags().GetString("range"); v != "" { - x := string(v) - in.Range = &x - } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { - x := string(v) - in.RepositoryID = &x - } - if v, _ := cmd.Flags().GetString("search"); v != "" { - x := string(v) - in.Search = &x + in := api.GetContextAssetInventoryArtifactsIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListContextDepsActiveSummary(cmd.Context(), in) + out, err := client.GetContextAssetInventoryArtifactsId(cmd.Context(), in) if err != nil { return err } @@ -1359,42 +1733,71 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("direct", "", "") - cmd.Flags().String("ecosystem", "", "") - cmd.Flags().String("name", "", "") - cmd.Flags().String("project-id", "", "") - cmd.Flags().String("range", "", "") - cmd.Flags().String("repository-id", "", "") - cmd.Flags().String("search", "", "") + setRoute(cmd, "GET /context/asset-inventory/artifacts/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-by-ref ", - Short: "Get Dependencies by Bom Ref", - Args: cobra.ExactArgs(1), + Use: "list-cdn-and-dns", + Short: "List CDN and DNS Assets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsByRefBomRefInput{} - in.BomRef = args[0] - if v, _ := cmd.Flags().GetString("cursor"); v != "" { + in := api.ListContextAssetInventoryCdnAndDnsInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { x := string(v) - in.Cursor = &x + in.AccountID = &x } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + return fmt.Errorf("limit"+": %w", err) } else { - x := int32(n) - in.PageSize = &x + x := int(n) + in.Limit = &x } } - out, err := client.ListContextDepsByRefBomRef(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryCdnAndDns(cmd.Context(), in) if err != nil { return err } @@ -1406,15 +1809,24 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("cursor", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /context/asset-inventory/cdn-and-dns") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-dependents ", - Short: "List Dependents of a Bom Ref", + Use: "get-cdn-and-dns ", + Short: "Get CDN and DNS Asset", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1422,21 +1834,17 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListContextDepsDependentsBomRefInput{} - in.BomRef = args[0] - if v, _ := cmd.Flags().GetString("cursor"); v != "" { - x := string(v) - in.Cursor = &x - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.GetContextAssetInventoryCdnAndDnsIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int32(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListContextDepsDependentsBomRef(cmd.Context(), in) + out, err := client.GetContextAssetInventoryCdnAndDnsId(cmd.Context(), in) if err != nil { return err } @@ -1448,35 +1856,71 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("cursor", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /context/asset-inventory/cdn-and-dns/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-exposure", - Short: "Global package exposure by version filter (semver or hash)", + Use: "list-ci-cd", + Short: "List CI/CD Assets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsExposureInput{} - if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + in := api.ListContextAssetInventoryCiCdInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { x := string(v) - in.Ecosystem = &x + in.AccountID = &x } - if v, _ := cmd.Flags().GetString("name"); v != "" { - x := string(v) - in.Name = &x + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b } - if v, _ := cmd.Flags().GetString("range"); v != "" { + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { x := string(v) - in.Range = &x + in.NextToken = &x } - out, err := client.ListContextDepsExposure(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryCiCd(cmd.Context(), in) if err != nil { return err } @@ -1488,39 +1932,118 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("ecosystem", "", "") - cmd.Flags().String("name", "", "") - cmd.Flags().String("range", "", "") + setRoute(cmd, "GET /context/asset-inventory/ci-cd") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-active ", - Short: "List Active Dependencies", - Args: cobra.ExactArgs(2), + Use: "get-ci-cd ", + Short: "Get CI/CD Asset", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - if v, _ := cmd.Flags().GetString("direct"); v != "" { + in := api.GetContextAssetInventoryCiCdIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryCiCdId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/ci-cd/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-cluster", + Short: "List Cluster Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryClusterInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { b := v == "true" - in.Direct = &b + in.Active = &b } - if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { x := string(v) - in.Ecosystem = &x + in.NextToken = &x } - if v, _ := cmd.Flags().GetString("search"); v != "" { + if v, _ := cmd.Flags().GetString("provider"); v != "" { x := string(v) - in.Search = &x + in.Provider = &x } - out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdActive(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryCluster(cmd.Context(), in) if err != nil { return err } @@ -1532,28 +2055,42 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("direct", "", "") - cmd.Flags().String("ecosystem", "", "") - cmd.Flags().String("search", "", "") + setRoute(cmd, "GET /context/asset-inventory/cluster") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-at ", - Short: "Dependencies at commit", - Args: cobra.ExactArgs(3), + Use: "get-cluster ", + Short: "Get Cluster Asset", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - in.Commit = args[2] - out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit(cmd.Context(), in) + in := api.GetContextAssetInventoryClusterIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryClusterId(cmd.Context(), in) if err != nil { return err } @@ -1565,32 +2102,71 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/cluster/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-diff ", - Short: "Dependency diff between two commits", - Args: cobra.ExactArgs(2), + Use: "list-compute", + Short: "List Compute Assets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - if v, _ := cmd.Flags().GetString("from-commit"); v != "" { + in := api.ListContextAssetInventoryComputeInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { x := string(v) - in.FromCommit = &x + in.AccountID = &x } - if v, _ := cmd.Flags().GetString("to-commit"); v != "" { + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { x := string(v) - in.ToCommit = &x + in.NextToken = &x } - out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryCompute(cmd.Context(), in) if err != nil { return err } @@ -1602,38 +2178,42 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("from-commit", "", "") - cmd.Flags().String("to-commit", "", "") + setRoute(cmd, "GET /context/asset-inventory/compute") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-exposure ", - Short: "Project package exposure by version filter (semver or hash)", - Args: cobra.ExactArgs(2), + Use: "get-compute ", + Short: "Get Compute Asset", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { - x := string(v) - in.Ecosystem = &x - } - if v, _ := cmd.Flags().GetString("name"); v != "" { - x := string(v) - in.Name = &x - } - if v, _ := cmd.Flags().GetString("range"); v != "" { - x := string(v) - in.Range = &x + in := api.GetContextAssetInventoryComputeIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure(cmd.Context(), in) + out, err := client.GetContextAssetInventoryComputeId(cmd.Context(), in) if err != nil { return err } @@ -1645,35 +2225,71 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("ecosystem", "", "") - cmd.Flags().String("name", "", "") - cmd.Flags().String("range", "", "") + setRoute(cmd, "GET /context/asset-inventory/compute/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-history ", - Short: "Package exposure history (windows)", - Args: cobra.ExactArgs(2), + Use: "list-connectivity", + Short: "List Connectivity Assets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + in := api.ListContextAssetInventoryConnectivityInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { x := string(v) - in.Ecosystem = &x + in.AccountID = &x } - if v, _ := cmd.Flags().GetString("name"); v != "" { + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { x := string(v) - in.Name = &x + in.NextToken = &x } - out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryConnectivity(cmd.Context(), in) if err != nil { return err } @@ -1685,27 +2301,6423 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("ecosystem", "", "") - cmd.Flags().String("name", "", "") + setRoute(cmd, "GET /context/asset-inventory/connectivity") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-without-lockfile", - Short: "List projects/repos without lockfiles", + Use: "get-connectivity ", + Short: "Get Connectivity Asset", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextDepsWithoutLockfileInput{} - if v, _ := cmd.Flags().GetString("level"); v != "" { - x := string(v) - in.Level = &x + in := api.GetContextAssetInventoryConnectivityIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryConnectivityId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/connectivity/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-container", + Short: "List Container Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryContainerInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryContainer(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/container") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-container ", + Short: "Get Container Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryContainerIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryContainerId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/container/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-data-pipeline", + Short: "List Data Pipeline Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryDataPipelineInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryDataPipeline(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/data-pipeline") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-data-pipeline ", + Short: "Get Data Pipeline Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryDataPipelineIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryDataPipelineId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/data-pipeline/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-database", + Short: "List Database Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryDatabaseInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryDatabase(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/database") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-database ", + Short: "Get Database Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryDatabaseIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryDatabaseId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/database/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-endpoints", + Short: "List Asset Inventory Endpoints", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryEndpointsInput{} + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("aws-service"); v != "" { + x := string(v) + in.AwsService = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("host-category"); v != "" { + x := string(v) + in.HostCategory = &x + } + if v, _ := cmd.Flags().GetString("host-id"); v != "" { + x := string(v) + in.HostID = &x + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("q"); v != "" { + x := string(v) + in.Q = &x + } + if v, _ := cmd.Flags().GetString("source-type"); v != "" { + x := string(v) + in.SourceType = &x + } + out, err := client.ListContextAssetInventoryEndpoints(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/endpoints") + cmd.Flags().String("active", "", "") + cmd.Flags().String("aws-service", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("host-category", "", "") + cmd.Flags().String("host-id", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("q", "", "") + cmd.Flags().String("source-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-endpoints ", + Short: "Get Asset Inventory Endpoint", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryEndpointsIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryEndpointsId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/endpoints/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-identity", + Short: "List Identity Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryIdentityInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryIdentity(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/identity") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-identity ", + Short: "Get Identity Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryIdentityIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryIdentityId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/identity/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-load-balancer", + Short: "List Load Balancer Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryLoadBalancerInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryLoadBalancer(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/load-balancer") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-load-balancer ", + Short: "Get Load Balancer Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryLoadBalancerIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryLoadBalancerId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/load-balancer/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-messaging", + Short: "List Messaging Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryMessagingInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryMessaging(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/messaging") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-messaging ", + Short: "Get Messaging Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryMessagingIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryMessagingId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/messaging/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-network", + Short: "List Network Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryNetworkInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryNetwork(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/network") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-network ", + Short: "Get Network Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryNetworkIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryNetworkId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/network/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-observability", + Short: "List Observability Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryObservabilityInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryObservability(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/observability") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-observability ", + Short: "Get Observability Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryObservabilityIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryObservabilityId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/observability/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-pipelines", + Short: "List Pipelines Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryPipelinesInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("repo-id"); v != "" { + x := string(v) + in.RepoID = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryPipelines(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/pipelines") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("repo-id", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pipelines ", + Short: "Get Pipelines Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryPipelinesIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryPipelinesId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/pipelines/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-projects", + Short: "List Projects Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryProjectsInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("repo-id"); v != "" { + x := string(v) + in.RepoID = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryProjects(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/projects") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("repo-id", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-projects ", + Short: "Get Projects Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryProjectsIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryProjectsId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/projects/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-public", + Short: "List Public Asset Inventory", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryPublicInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("category"); v != "" { + x := string(v) + in.Category = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("policy"); v != "" { + x := string(v) + in.Policy = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + out, err := client.ListContextAssetInventoryPublic(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/public") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("category", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("policy", "", "") + cmd.Flags().String("provider", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-repos", + Short: "List Repos Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryReposInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryRepos(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/repos") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-repos ", + Short: "Get Repos Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryReposIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryReposId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/repos/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-security", + Short: "List Security Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventorySecurityInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventorySecurity(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/security") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-security ", + Short: "Get Security Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventorySecurityIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventorySecurityId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/security/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-serverless", + Short: "List Serverless Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryServerlessInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryServerless(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/serverless") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-serverless ", + Short: "Get Serverless Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryServerlessIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryServerlessId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/serverless/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-storage-and-backup", + Short: "List Storage and Backup Assets", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextAssetInventoryStorageAndBackupInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("active"); v != "" { + b := v == "true" + in.Active = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("internet-reachable"); v != "" { + b := v == "true" + in.InternetReachable = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("public-facing"); v != "" { + b := v == "true" + in.PublicFacing = &b + } + if v, _ := cmd.Flags().GetString("region"); v != "" { + x := string(v) + in.Region = &x + } + if v, _ := cmd.Flags().GetString("sub-type"); v != "" { + x := string(v) + in.SubType = &x + } + out, err := client.ListContextAssetInventoryStorageAndBackup(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/storage-and-backup") + cmd.Flags().String("account-id", "", "") + cmd.Flags().String("active", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("internet-reachable", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("provider", "", "") + cmd.Flags().String("public-facing", "", "") + cmd.Flags().String("region", "", "") + cmd.Flags().String("sub-type", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-storage-and-backup ", + Short: "Get Storage and Backup Asset", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextAssetInventoryStorageAndBackupIdInput{} + in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextAssetInventoryStorageAndBackupId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/asset-inventory/storage-and-backup/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-asset-inventory ", + Short: "Delete Asset", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteContextAssetInventoryCategoryIdInput{} + in.Category = args[0] + in.ID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteContextAssetInventoryCategoryId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/asset-inventory/{category}/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-flags ", + Short: "Patch Asset Flags", + Long: "Request body (JSON) fields: isInternetReachable (boolean, required), isPublicFacing (boolean, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchContextAssetInventoryCategoryIdFlagsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.Category = args[0] + in.ID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchContextAssetInventoryCategoryIdFlags(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/asset-inventory/{category}/{id}/flags") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-tags ", + Short: "Patch Asset Tags", + Long: "Request body (JSON) fields: tags (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchContextAssetInventoryCategoryIdTagsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.Category = args[0] + in.ID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchContextAssetInventoryCategoryIdTags(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/asset-inventory/{category}/{id}/tags") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-cicd-pipelines", + Short: "List CI/CD Pipelines", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCicdPipelinesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-deleted"); v != "" { + b := v == "true" + in.IncludeDeleted = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("platform"); v != "" { + x := string(v) + in.Platform = &x + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + out, err := client.ListContextCicdPipelines(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cicd-pipelines") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-deleted", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("platform", "", "") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("repository-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-cicd-pipelines ", + Short: "Delete CI/CD Pipeline", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteContextCicdPipelinesPipelineIdInput{} + in.PipelineID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteContextCicdPipelinesPipelineId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/cicd-pipelines/{pipelineId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-cicd-pipelines ", + Short: "Get CI/CD Pipeline", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextCicdPipelinesPipelineIdInput{} + in.PipelineID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextCicdPipelinesPipelineId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cicd-pipelines/{pipelineId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-cloud-connector-pr-runs", + Short: "Start Cloud Connector PR Run", + Long: "Request body (JSON) fields: digest (string), expectedRunId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextCloudConnectorPrRunsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextCloudConnectorPrRuns(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/cloud-connector-pr/runs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-cloud-connector-pr-runs ", + Short: "Get Cloud Connector PR Run", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextCloudConnectorPrRunsRunIdInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextCloudConnectorPrRunsRunId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-connector-pr/runs/{runId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-cloud-connector-pr-runs-approve-by-id ", + Short: "Create approved AWS connector draft PR", + Long: "Request body (JSON) fields: digest (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextCloudConnectorPrRunsRunIdApproveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextCloudConnectorPrRunsRunIdApprove(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/cloud-connector-pr/runs/{runId}/approve") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-cloud-connector-pr-runs-proposal ", + Short: "Review AWS connector proposal", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudConnectorPrRunsRunIdProposalInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudConnectorPrRunsRunIdProposal(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-connector-pr/runs/{runId}/proposal") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-cloud-connector-pr-runs-recover-by-id ", + Short: "Recover unresolved connector publication", + Long: "Request body (JSON) fields: confirmNoPullRequest (boolean, required), digest (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextCloudConnectorPrRunsRunIdRecoverInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextCloudConnectorPrRunsRunIdRecover(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/cloud-connector-pr/runs/{runId}/recover") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-cloud-connector-pr-status", + Short: "Get Cloud Connector PR Status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudConnectorPrStatusInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudConnectorPrStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-connector-pr/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-cross-account-relationships ", + Short: "Get Cloud Recon Cross-Account Relationships", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdCrossAccountRelationshipsInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdCrossAccountRelationships(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/cross-account-relationships") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-discovered-nodes ", + Short: "Get Cloud Recon Discovered Nodes", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdDiscoveredNodesInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("object-type"); v != "" { + x := string(v) + in.ObjectType = &x + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("source"); v != "" { + x := string(v) + in.Source = &x + } + out, err := client.ListContextCloudReconAccountsAccountIdDiscoveredNodes(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/discovered-nodes") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("object-type", "", "") + cmd.Flags().String("offset", "", "") + cmd.Flags().String("source", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-graph-gaps ", + Short: "Get Cloud Recon Graph Gaps", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdGraphGapsInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdGraphGaps(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/graph-gaps") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-hotspots ", + Short: "Get Cloud Recon Hotspots", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdHotspotsInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("severity"); v != "" { + x := string(v) + in.Severity = &x + } + out, err := client.ListContextCloudReconAccountsAccountIdHotspots(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/hotspots") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("offset", "", "") + cmd.Flags().String("severity", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-iam-posture ", + Short: "Get Cloud Recon IAM Posture", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdIamPostureInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdIamPosture(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/iam-posture") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-network-exposures ", + Short: "Get Cloud Recon Network Exposures", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdNetworkExposuresInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdNetworkExposures(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/network-exposures") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-overview ", + Short: "Get Cloud Recon Account Overview", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdOverviewInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdOverview(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/overview") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-cloud-recon-accounts-scans-latest ", + Short: "Get Latest Cloud Recon Scan", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdScansLatestInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("scan-id"); v != "" { + x := string(v) + in.ScanID = &x + } + out, err := client.ListContextCloudReconAccountsAccountIdScansLatest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/scans/latest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("scan-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-security-boundaries ", + Short: "Get Cloud Recon Security Boundaries", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdSecurityBoundariesInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdSecurityBoundaries(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/security-boundaries") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-latest ", + Short: "Get Latest Cloud Recon Account Synthesis", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdSynthesisLatestInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("scan-id"); v != "" { + x := string(v) + in.ScanID = &x + } + out, err := client.ListContextCloudReconAccountsAccountIdSynthesisLatest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/synthesis/latest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("scan-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-topology ", + Short: "Get Cloud Recon Topology", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdTopologyInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdTopology(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/topology") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-traffic-flows ", + Short: "Get Cloud Recon Traffic Flows", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdTrafficFlowsInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdTrafficFlows(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/traffic-flows") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-trusted-services ", + Short: "Get Cloud Recon Trusted Services", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconAccountsAccountIdTrustedServicesInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconAccountsAccountIdTrustedServices(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/accounts/{accountId}/trusted-services") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-latest", + Short: "Get Latest Cloud Recon Org Synthesis", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconOrganizationSynthesisLatestInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("scan-run-id"); v != "" { + x := string(v) + in.ScanRunID = &x + } + out, err := client.ListContextCloudReconOrganizationSynthesisLatest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/organization/synthesis/latest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("scan-run-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-scans", + Short: "Persist Cloud Recon Scan", + Long: "Request body (JSON) fields: accountId (string, required), completedAt (string), modelName (string), payload (string, required), provider (string, required), scanId (string), schemaVersion (string, required), startedAt (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextCloudReconScansInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextCloudReconScans(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/cloud-recon/scans") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-cross-account-trusts", + Short: "Get Tenant Cloud Recon Cross-Account Trusts", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudReconTenantsCrossAccountTrustsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudReconTenantsCrossAccountTrusts(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-recon/tenants/cross-account-trusts") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-start", + Short: "Start Cloud Scan", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextCloudScanStartInput{} + if v, _ := cmd.Flags().GetString("account-ids"); v != "" { + for _, s := range strings.Split(v, ",") { + in.AccountIds = append(in.AccountIds, string(s)) + } + } + if v, _ := cmd.Flags().GetString("cluster-ids"); v != "" { + for _, s := range strings.Split(v, ",") { + in.ClusterIds = append(in.ClusterIds, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("provider"); v != "" { + x := string(v) + in.Provider = &x + } + if v, _ := cmd.Flags().GetString("rebuild-infra-graph"); v != "" { + b := v == "true" + in.RebuildInfraGraph = &b + } + out, err := client.CreateContextCloudScanStart(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/cloud-scan/start") + cmd.Flags().String("account-ids", "", "Scan only these accounts (AWS), subscriptions (Azure), projects (GCP) or cluster ids (K8S) instead of every one the provider resolves. Repeat the parameter for each account. Requires provider.") + cmd.Flags().String("cluster-ids", "", "Managed Kubernetes cluster scan identities or admin cluster IDs to scan. Repeat the parameter for each cluster. Requires provider K8S.") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("provider", "", "Scan only this integration (AWS, AZURE, GCP or K8S). Every installed integration is scanned when omitted.") + cmd.Flags().String("rebuild-infra-graph", "", "Rebuild the infrastructure graph once the scan completes. Defaults to false.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-status ", + Short: "Get Cloud Scan Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextCloudScanScanIdStatusInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextCloudScanScanIdStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/cloud-scan/{scanId}/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-deps", + Short: "Delete dependency data", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteContextDepsInput{} + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("global"); v != "" { + b := v == "true" + in.Global = &b + } + if v, _ := cmd.Flags().GetString("introduced-at"); v != "" { + x := string(v) + in.IntroducedAt = &x + } + if v, _ := cmd.Flags().GetString("name"); v != "" { + x := string(v) + in.Name = &x + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("version"); v != "" { + x := string(v) + in.Version = &x + } + out, err := client.DeleteContextDeps(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/deps") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("global", "", "") + cmd.Flags().String("introduced-at", "", "") + cmd.Flags().String("name", "", "") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("repository-id", "", "") + cmd.Flags().String("version", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-deps", + Short: "List Tenant Wide Dependencies (Historical)", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsInput{} + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int32(n) + in.PageSize = &x + } + } + out, err := client.ListContextDeps(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-active", + Short: "List Tenant Wide Active Dependencies", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsActiveInput{} + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("direct"); v != "" { + b := v == "true" + in.Direct = &b + } + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("name"); v != "" { + x := string(v) + in.Name = &x + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int32(n) + in.PageSize = &x + } + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("range"); v != "" { + x := string(v) + in.Range = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + out, err := client.ListContextDepsActive(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/active") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("direct", "", "") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("name", "", "") + cmd.Flags().String("page-size", "", "") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("range", "", "") + cmd.Flags().String("repository-id", "", "") + cmd.Flags().String("search", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-summary", + Short: "Tenant Wide Active Dependency Summary", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsActiveSummaryInput{} + if v, _ := cmd.Flags().GetString("direct"); v != "" { + b := v == "true" + in.Direct = &b + } + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("name"); v != "" { + x := string(v) + in.Name = &x + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("range"); v != "" { + x := string(v) + in.Range = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + out, err := client.ListContextDepsActiveSummary(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/active/summary") + cmd.Flags().String("direct", "", "") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("name", "", "") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("range", "", "") + cmd.Flags().String("repository-id", "", "") + cmd.Flags().String("search", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-by-ref ", + Short: "Get Dependencies by Bom Ref", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsByRefBomRefInput{} + in.BomRef = args[0] + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int32(n) + in.PageSize = &x + } + } + out, err := client.ListContextDepsByRefBomRef(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/by-ref/{bomRef}") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-dependents ", + Short: "List Dependents of a Bom Ref", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsDependentsBomRefInput{} + in.BomRef = args[0] + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int32(n) + in.PageSize = &x + } + } + out, err := client.ListContextDepsDependentsBomRef(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/dependents/{bomRef}") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-exposure", + Short: "Global package exposure by version filter (semver or hash)", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsExposureInput{} + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("name"); v != "" { + x := string(v) + in.Name = &x + } + if v, _ := cmd.Flags().GetString("range"); v != "" { + x := string(v) + in.Range = &x + } + out, err := client.ListContextDepsExposure(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/exposure") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("name", "", "") + cmd.Flags().String("range", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-active ", + Short: "List Active Dependencies", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdActiveInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("direct"); v != "" { + b := v == "true" + in.Direct = &b + } + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdActive(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/repository/{repositoryId}/project/{projectId}/active") + cmd.Flags().String("direct", "", "") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("search", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-at ", + Short: "Dependencies at commit", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommitInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + in.Commit = args[2] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdAtCommit(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/repository/{repositoryId}/project/{projectId}/at/{commit}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-diff ", + Short: "Dependency diff between two commits", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdDiffInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("from-commit"); v != "" { + x := string(v) + in.FromCommit = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("to-commit"); v != "" { + x := string(v) + in.ToCommit = &x + } + out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdDiff(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/repository/{repositoryId}/project/{projectId}/diff") + cmd.Flags().String("from-commit", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("to-commit", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-exposure ", + Short: "Project package exposure by version filter (semver or hash)", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdExposureInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("name"); v != "" { + x := string(v) + in.Name = &x + } + if v, _ := cmd.Flags().GetString("range"); v != "" { + x := string(v) + in.Range = &x + } + out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdExposure(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/repository/{repositoryId}/project/{projectId}/exposure") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("name", "", "") + cmd.Flags().String("range", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-history ", + Short: "Package exposure history (windows)", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsRepositoryRepositoryIdProjectProjectIdHistoryInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("name"); v != "" { + x := string(v) + in.Name = &x + } + out, err := client.ListContextDepsRepositoryRepositoryIdProjectProjectIdHistory(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/repository/{repositoryId}/project/{projectId}/history") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("name", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-without-lockfile", + Short: "List projects/repos without lockfiles", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextDepsWithoutLockfileInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("level"); v != "" { + x := string(v) + in.Level = &x + } + out, err := client.ListContextDepsWithoutLockfile(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/deps/without-lockfile") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("level", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-entrypoints", + Short: "List Entrypoints", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextEntrypointsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-deleted"); v != "" { + b := v == "true" + in.IncludeDeleted = &b + } + if v, _ := cmd.Flags().GetString("kind"); v != "" { + x := string(v) + in.Kind = &x + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + out, err := client.ListContextEntrypoints(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/entrypoints") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-deleted", "", "") + cmd.Flags().String("kind", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("repository-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-entrypoints ", + Short: "Delete Entrypoint", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteContextEntrypointsEntrypointIdInput{} + in.EntrypointID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteContextEntrypointsEntrypointId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/entrypoints/{entrypointId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-entrypoints ", + Short: "Get Entrypoint", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextEntrypointsEntrypointIdInput{} + in.EntrypointID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextEntrypointsEntrypointId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/entrypoints/{entrypointId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-graphs", + Short: "List Infrastructure Graphs", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextInfrastructureGraphsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextInfrastructureGraphs(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/infrastructure/graphs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-info", + Short: "Get Infrastructure Graph Info", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextInfrastructureGraphsInfoInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextInfrastructureGraphsInfo(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/infrastructure/graphs/info") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-infrastructure-graphs-summary", + Short: "Get Infrastructure Graph Summary", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextInfrastructureGraphsSummaryInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextInfrastructureGraphsSummary(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/infrastructure/graphs/summary") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-graphs ", + Short: "Get Infrastructure Graph", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextInfrastructureGraphsAccountIdInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextInfrastructureGraphsAccountId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/infrastructure/graphs/{accountId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-download ", + Short: "Get Infrastructure Graph Download URL", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextInfrastructureGraphsAccountIdDownloadInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("version"); v != "" { + x := string(v) + in.Version = &x + } + out, err := client.ListContextInfrastructureGraphsAccountIdDownload(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/infrastructure/graphs/{accountId}/download") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("version", "", "Graph snapshot version; defaults to latest") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-infrastructure-graphs-versions ", + Short: "List Infrastructure Graph Versions", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextInfrastructureGraphsAccountIdVersionsInput{} + in.AccountID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextInfrastructureGraphsAccountIdVersions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/infrastructure/graphs/{accountId}/versions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-infrastructure-graphs-versions-2 ", + Short: "Get Infrastructure Graph Version", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextInfrastructureGraphsAccountIdVersionsVersionInput{} + in.AccountID = args[0] + in.Version = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextInfrastructureGraphsAccountIdVersionsVersion(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/infrastructure/graphs/{accountId}/versions/{version}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-collector-clusters", + Short: "List K8s Collector Clusters", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextK8sCollectorClustersInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextK8sCollectorClusters(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/k8s/collector-clusters") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-memories", + Short: "Get Memories", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextMemoriesInput{} + if v, _ := cmd.Flags().GetString("created-by"); v != "" { + x := string(v) + in.CreatedBy = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("is-latest"); v != "" { + b := v == "true" + in.IsLatest = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("memory-class"); v != "" { + x := string(v) + in.MemoryClass = &x + } + if v, _ := cmd.Flags().GetString("memory-type"); v != "" { + x := string(v) + in.MemoryType = &x + } + if v, _ := cmd.Flags().GetString("min-trust-tier"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("minTrustTier"+": %w", err) + } else { + x := int(n) + in.MinTrustTier = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("priority"); v != "" { + x := string(v) + in.Priority = &x + } + if v, _ := cmd.Flags().GetString("resource-id"); v != "" { + x := string(v) + in.ResourceID = &x + } + if v, _ := cmd.Flags().GetString("resource-type"); v != "" { + x := string(v) + in.ResourceType = &x + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + x := string(v) + in.Status = &x + } + out, err := client.ListContextMemories(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/memories") + cmd.Flags().String("created-by", "", "Filter by author: an agent name (e.g. reposcope) or a user id") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("is-latest", "", "Filter for latest memories only") + cmd.Flags().String("limit", "", "Maximum number of results (default: 50, max: 1000)") + cmd.Flags().String("memory-class", "", "Filter by cognitive class (episodic, semantic, procedural, prospective, retrieval)") + cmd.Flags().String("memory-type", "", "Filter by memory type") + cmd.Flags().String("min-trust-tier", "", "Only memories at or above this trust tier (0 ingested .. 3 human decision); untiered memories never match") + cmd.Flags().String("next-token", "", "Pagination token for next page; absent when the page is the last one") + cmd.Flags().String("offset", "", "Number of memories to skip before the page") + cmd.Flags().String("priority", "", "Filter by priority level") + cmd.Flags().String("resource-id", "", "Filter by resource ID (e.g., document ID, finding ID)") + cmd.Flags().String("resource-type", "", "Filter by resource type (e.g., 'document', 'finding', 'chat')") + cmd.Flags().String("status", "", "Filter by lifecycle status; a row with no stored status reads as active") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-memories", + Short: "Create Memory", + Long: "Request body (JSON) fields: anchors (array), citations (array), commentIds (array), confidence (number), content (string, required), createdBy (string), crossReferences (array), eventTime (string), isUserCreated (boolean), memoryClass (object), memoryId (string), memoryType (object, required), metadata (object), parentNoteId (string), priority (object), promptVersion (string), resourceId (string), resourceType (object), scope (object), sourceEvent (string), supersedesMemoryId (string), tags (array), title (string), trustTier (integer).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextMemoriesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextMemories(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/memories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-document ", + Short: "Get Memories By Document", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextMemoriesDocumentDocumentIdInput{} + in.DocumentID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("pagination-token"); v != "" { + x := string(v) + in.PaginationToken = &x + } + out, err := client.GetContextMemoriesDocumentDocumentId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/memories/document/{documentId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("pagination-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-type ", + Short: "Get Memories By Document And Type", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextMemoriesDocumentDocumentIdTypeInput{} + in.DocumentID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("memory-type"); v != "" { + x := string(v) + in.MemoryType = &x + } + if v, _ := cmd.Flags().GetString("pagination-token"); v != "" { + x := string(v) + in.PaginationToken = &x + } + out, err := client.ListContextMemoriesDocumentDocumentIdType(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/memories/document/{documentId}/type") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("memory-type", "", "") + cmd.Flags().String("pagination-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-grep", + Short: "Grep Memories", + Long: "Request body (JSON) fields: limit (integer), memoryClass (object), memoryTypes (array), minTrustTier (integer), pattern (string, required), resourceType (object), scope (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextMemoriesGrepInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextMemoriesGrep(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/memories/grep") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-memories-search", + Short: "Search Memories", + Long: "Request body (JSON) fields: anchors (array), includeOrgWide (boolean), limit (integer), memoryClass (object), memoryTypes (array), minTrustTier (integer), query (string, required), resourceType (object), scope (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextMemoriesSearchInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextMemoriesSearch(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/memories/search") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-type", + Short: "Get Memories By Type", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextMemoriesTypeInput{} + if v, _ := cmd.Flags().GetString("created-by"); v != "" { + x := string(v) + in.CreatedBy = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("is-latest"); v != "" { + b := v == "true" + in.IsLatest = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("memory-type"); v != "" { + x := string(v) + in.MemoryType = &x + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("pagination-token"); v != "" { + x := string(v) + in.PaginationToken = &x + } + if v, _ := cmd.Flags().GetString("resource-id"); v != "" { + x := string(v) + in.ResourceID = &x + } + out, err := client.ListContextMemoriesType(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/memories/type") + cmd.Flags().String("created-by", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("is-latest", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("memory-type", "", "") + cmd.Flags().String("offset", "", "") + cmd.Flags().String("pagination-token", "", "") + cmd.Flags().String("resource-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-memories ", + Short: "Delete Memory", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteContextMemoriesMemoryIdInput{} + in.MemoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("reason"); v != "" { + x := string(v) + in.Reason = &x + } + out, err := client.DeleteContextMemoriesMemoryId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/memories/{memoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("reason", "", "Why the memory is being retracted; recorded on the tombstone (default: deleted)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-memories ", + Short: "Get Memory", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextMemoriesMemoryIdInput{} + in.MemoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("version"); v != "" { + x := string(v) + in.Version = &x + } + out, err := client.GetContextMemoriesMemoryId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/memories/{memoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("version", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-memories ", + Short: "Update Memory", + Long: "Request body (JSON) fields: citations (array), confidence (number), content (string), crossReferences (array), metadata (object), parentNoteId (string), priority (object), supersedesMemoryId (string), tags (array), title (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchContextMemoriesMemoryIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.MemoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchContextMemoriesMemoryId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/memories/{memoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-findings ", + Short: "Get Memory Findings", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextMemoriesMemoryIdFindingsInput{} + in.MemoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + out, err := client.ListContextMemoriesMemoryIdFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/memories/{memoryId}/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of findings to return (1-100, default 20)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-retract-by-id ", + Short: "Retract Memory", + Long: "Request body (JSON) fields: reason (string, required), retractedBy (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextMemoriesMemoryIdRetractInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.MemoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextMemoriesMemoryIdRetract(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/memories/{memoryId}/retract") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-versions ", + Short: "Get Memory Versions", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextMemoriesMemoryIdVersionsInput{} + in.MemoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + out, err := client.ListContextMemoriesMemoryIdVersions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/memories/{memoryId}/versions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of versions to return (default: 50)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-organization", + Short: "Get Organization Context", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextOrganizationInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextOrganization(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/organization") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-organization", + Short: "Update Classification of the Organization", + Long: "Request body (JSON) fields: name (string), notes (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchContextOrganizationInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.PatchContextOrganization(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/organization") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-organization", + Short: "Upsert Classification of the Organization", + Long: "Request body (JSON) fields: organization (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateContextOrganizationInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateContextOrganization(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /context/organization") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-organization-runs ", + Short: "Get Organization Context Run", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextOrganizationRunsRunIdInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-result"); v != "" { + b := v == "true" + in.IncludeResult = &b + } + out, err := client.GetContextOrganizationRunsRunId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/organization/runs/{runId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-result", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-resync", + Short: "Resync RAG Vector Store", + Long: "Request body (JSON) fields: confluenceOnly (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextRagResyncInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextRagResync(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/rag/resync") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-repo-scans", + Short: "List Repo Context Scans", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextRepoScansInput{} + if v, _ := cmd.Flags().GetString("commit-sha"); v != "" { + x := string(v) + in.CommitSha = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + x := string(v) + in.Status = &x + } + if v, _ := cmd.Flags().GetString("versions-only"); v != "" { + b := v == "true" + in.VersionsOnly = &b + } + out, err := client.ListContextRepoScans(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repo-scans") + cmd.Flags().String("commit-sha", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + cmd.Flags().String("repository-id", "", "") + cmd.Flags().String("status", "", "") + cmd.Flags().String("versions-only", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-repo-scans", + Short: "Create Repo Context Scan", + Long: "Request body (JSON) fields: branch (string), commitSha (string, required), projectsTouched (array), repositoryId (string, required), sbomsGenerated (array), status (string), subagentsRun (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextRepoScansInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextRepoScans(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/repo-scans") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-repo-scans ", + Short: "Get Repo Context Scan", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextRepoScansScanIdInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextRepoScansScanId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repo-scans/{scanId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-repo-scans ", + Short: "Update Repo Context Scan", + Long: "Request body (JSON) fields: completedAt (string), errorMessage (string), projectsTouched (array), sbomsGenerated (array), status (string), subagentsRun (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchContextRepoScansScanIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchContextRepoScansScanId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/repo-scans/{scanId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-repo-scope-scans", + Short: "Start Repo-Scope Scan", + Long: "Request body (JSON) fields: includeArchived (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextRepoScopeScansInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-archived"); v != "" { + b := v == "true" + in.IncludeArchived = &b + } + out, err := client.CreateContextRepoScopeScans(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/repo-scope/scans") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-archived", "", "") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-scans ", + Short: "Get Repo-Scope Scan", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextRepoScopeScansScanIdInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("execution-arn"); v != "" { + x := string(v) + in.ExecutionArn = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextRepoScopeScansScanId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repo-scope/scans/{scanId}") + cmd.Flags().String("execution-arn", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-reports", + Short: "Create Report Generation Job", + Long: "Request body (JSON) fields: packages (array, required), repositories (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextReportsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextReports(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/reports") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-reports ", + Short: "Get Report Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextReportsJobIdInput{} + in.JobID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetContextReportsJobId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/reports/{jobId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-repositories", + Short: "Get Contexts of Repositories", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextRepositoriesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x + } + if v, _ := cmd.Flags().GetString("sort-by"); v != "" { + x := string(v) + in.SortBy = &x + } + out, err := client.ListContextRepositories(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repositories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("sort", "", "") + cmd.Flags().String("sort-by", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-repositories ", + Short: "Delete Repository", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteContextRepositoriesRepositoryIdInput{} + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteContextRepositoriesRepositoryId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/repositories/{repositoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-repositories ", + Short: "Get Repository", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetContextRepositoriesRepositoryIdInput{} + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("prefer-url"); v != "" { + b := v == "true" + in.PreferURL = &b + } + out, err := client.GetContextRepositoriesRepositoryId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repositories/{repositoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("prefer-url", "", "Return a presigned URL instead of the repository context inline") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-repositories ", + Short: "Update Repository", + Long: "Request body (JSON) fields: name (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchContextRepositoriesRepositoryIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.PatchContextRepositoriesRepositoryId(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/repositories/{repositoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-discover-by-id ", + Short: "Start Repository Execution Recipe Discovery", + Long: "Request body (JSON) fields: branch (string), projectIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextRepositoriesRepositoryIdExecutionRecipesDiscoverInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListContextDepsWithoutLockfile(cmd.Context(), in) + out, err := client.CreateContextRepositoriesRepositoryIdExecutionRecipesDiscover(cmd.Context(), in) if err != nil { return err } @@ -1717,29 +8729,38 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("level", "", "") + setRoute(cmd, "POST /context/repositories/{repositoryId}/execution-recipes/discover") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-entrypoints", - Short: "List Entrypoints", + Use: "get-repositories-projects ", + Short: "List Projects", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextEntrypointsInput{} + in := api.ListContextRepositoriesRepositoryIdProjectsInput{} + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("include-deleted"); v != "" { b := v == "true" in.IncludeDeleted = &b } - if v, _ := cmd.Flags().GetString("kind"); v != "" { - x := string(v) - in.Kind = &x - } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1752,15 +8773,7 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.NextToken = &x } - if v, _ := cmd.Flags().GetString("project-id"); v != "" { - x := string(v) - in.ProjectID = &x - } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { - x := string(v) - in.RepositoryID = &x - } - out, err := client.ListContextEntrypoints(cmd.Context(), in) + out, err := client.ListContextRepositoriesRepositoryIdProjects(cmd.Context(), in) if err != nil { return err } @@ -1772,57 +8785,37 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("include-deleted", "", "") - cmd.Flags().String("kind", "", "") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") - cmd.Flags().String("project-id", "", "") - cmd.Flags().String("repository-id", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-entrypoints ", - Short: "Delete Entrypoint", - Args: cobra.ExactArgs(1), + Use: "delete-projects ", + Short: "Delete Project", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteContextEntrypointsEntrypointIdInput{} - in.EntrypointID = args[0] - out, err := client.DeleteContextEntrypointsEntrypointId(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-entrypoints ", - Short: "Get Entrypoint", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in := api.DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.GetContextEntrypointsEntrypointIdInput{} - in.EntrypointID = args[0] - out, err := client.GetContextEntrypointsEntrypointId(cmd.Context(), in) + out, err := client.DeleteContextRepositoriesRepositoryIdProjectsProjectId(cmd.Context(), in) if err != nil { return err } @@ -1834,53 +8827,34 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/repositories/{repositoryId}/projects/{projectId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-memories", - Short: "Get Memories", + Use: "get-repositories-projects-2 ", + Short: "Get Project", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextMemoriesInput{} - if v, _ := cmd.Flags().GetString("is-latest"); v != "" { - b := v == "true" - in.IsLatest = &b - } - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in := api.GetContextRepositoriesRepositoryIdProjectsProjectIdInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("memory-type"); v != "" { - x := string(v) - in.MemoryType = &x - } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x - } - if v, _ := cmd.Flags().GetString("priority"); v != "" { - x := string(v) - in.Priority = &x - } - if v, _ := cmd.Flags().GetString("resource-id"); v != "" { - x := string(v) - in.ResourceID = &x - } - if v, _ := cmd.Flags().GetString("resource-type"); v != "" { - x := string(v) - in.ResourceType = &x - } - out, err := client.ListContextMemories(cmd.Context(), in) + out, err := client.GetContextRepositoriesRepositoryIdProjectsProjectId(cmd.Context(), in) if err != nil { return err } @@ -1892,28 +8866,24 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("is-latest", "", "Filter for latest memories only") - cmd.Flags().String("limit", "", "Maximum number of results (default: 50, max: 1000)") - cmd.Flags().String("memory-type", "", "Filter by memory type") - cmd.Flags().String("next-token", "", "Pagination token for next page") - cmd.Flags().String("priority", "", "Filter by priority level") - cmd.Flags().String("resource-id", "", "Filter by resource ID (e.g., document ID, finding ID)") - cmd.Flags().String("resource-type", "", "Filter by resource type (e.g., 'document', 'finding', 'chat')") + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects/{projectId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-memories", - Short: "Create Memory", - Long: "Request body (JSON) fields: citations (array), confidence (number), content (string, required), createdBy (string), crossReferences (array), isUserCreated (boolean), memoryType (object, required), metadata (object), parentNoteId (string), priority (object), resourceId (string), resourceType (object), tags (array), title (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "patch-projects ", + Short: "Update Project", + Long: "Request body (JSON) fields: deletedAt (string), description (string), isDeleted (boolean), metadata (object), tags (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextMemoriesInput{} + in := api.PatchContextRepositoriesRepositoryIdProjectsProjectIdInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1943,7 +8913,17 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextMemories(cmd.Context(), in) + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchContextRepositoriesRepositoryIdProjectsProjectId(cmd.Context(), in) if err != nil { return err } @@ -1955,6 +8935,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/repositories/{repositoryId}/projects/{projectId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1962,18 +8944,89 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-type", - Short: "Get Memories By Type", + Use: "get-repositories-projects-execution-recipe ", + Short: "Get Project Execution Recipe", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextMemoriesTypeInput{} - if v, _ := cmd.Flags().GetString("is-latest"); v != "" { + in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("allow-edits"); v != "" { b := v == "true" - in.IsLatest = &b + in.AllowEdits = &b + } + if v, _ := cmd.Flags().GetString("capabilities"); v != "" { + x := string(v) + in.Capabilities = &x + } + if v, _ := cmd.Flags().GetString("commit-sha"); v != "" { + x := string(v) + in.CommitSha = &x + } + if v, _ := cmd.Flags().GetString("docker"); v != "" { + b := v == "true" + in.Docker = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("input-hash"); v != "" { + x := string(v) + in.InputHash = &x + } + out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipe(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe") + cmd.Flags().String("allow-edits", "", "Whether the caller will apply the file edits a recipe carries. Defaults to true; false returns incompatible rather than a recipe the caller would refuse") + cmd.Flags().String("capabilities", "", "Comma separated sandbox capabilities beyond docker, from docker_compose, network, nested_virtualization, gpu, service_postgres, service_mysql, service_redis, service_mongo, service_elasticsearch, service_kafka") + cmd.Flags().String("commit-sha", "", "The commit the caller wants to stand the target up at") + cmd.Flags().String("docker", "", "Whether the caller's sandbox provides a Docker daemon") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("input-hash", "", "The build input hash the caller computed from its own checkout, used when Context has never observed the commit") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-validations ", + Short: "List Project Execution Recipe Validations", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidationsInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { @@ -1983,15 +9036,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { in.Limit = &x } } - if v, _ := cmd.Flags().GetString("memory-type"); v != "" { - x := string(v) - in.MemoryType = &x - } - if v, _ := cmd.Flags().GetString("pagination-token"); v != "" { - x := string(v) - in.PaginationToken = &x + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } } - out, err := client.ListContextMemoriesType(cmd.Context(), in) + out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeValidations(cmd.Context(), in) if err != nil { return err } @@ -2003,27 +9056,52 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("is-latest", "", "") - cmd.Flags().String("limit", "", "") - cmd.Flags().String("memory-type", "", "") - cmd.Flags().String("pagination-token", "", "") + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/validations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Runs per page, default 50, max 200") + cmd.Flags().String("offset", "", "Runs to skip before the page") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-memories ", - Short: "Delete Memory", - Args: cobra.ExactArgs(1), + Use: "get-repositories-projects-execution-recipe-versions ", + Short: "List Project Execution Recipe Versions", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteContextMemoriesMemoryIdInput{} - in.MemoryID = args[0] - out, err := client.DeleteContextMemoriesMemoryId(cmd.Context(), in) + in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersionsInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdExecutionRecipeVersions(cmd.Context(), in) if err != nil { return err } @@ -2035,27 +9113,36 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/versions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Versions per page, default 50, max 200") + cmd.Flags().String("offset", "", "Versions to skip before the page") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-memories ", - Short: "Get Memory", - Args: cobra.ExactArgs(1), + Use: "get-repositories-projects-schema ", + Short: "Get Project Schema", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetContextMemoriesMemoryIdInput{} - in.MemoryID = args[0] - if v, _ := cmd.Flags().GetString("version"); v != "" { - x := string(v) - in.Version = &x + in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.GetContextMemoriesMemoryId(cmd.Context(), in) + out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdSchema(cmd.Context(), in) if err != nil { return err } @@ -2067,23 +9154,24 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("version", "", "") + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects/{projectId}/schema") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-memories ", - Short: "Update Memory", - Long: "Request body (JSON) fields: citations (array), confidence (number), content (string), createNewVersion (boolean), crossReferences (array), metadata (object), parentNoteId (string), priority (object), tags (array), title (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-schema-by-id ", + Short: "Upload Project Schema", + Long: "Request body (JSON) fields: content (string, required), format (object, required), type (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchContextMemoriesMemoryIdInput{} + in := api.CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2113,8 +9201,17 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.MemoryID = args[0] - out, err := client.PatchContextMemoriesMemoryId(cmd.Context(), in) + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema(cmd.Context(), in) if err != nil { return err } @@ -2126,6 +9223,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/repositories/{repositoryId}/projects/{projectId}/schema") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2133,26 +9232,27 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-versions ", - Short: "Get Memory Versions", - Args: cobra.ExactArgs(1), + Use: "get-metadata ", + Short: "Get Project Schema Metadata", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextMemoriesMemoryIdVersionsInput{} - in.MemoryID = args[0] - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int32(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListContextMemoriesMemoryIdVersions(cmd.Context(), in) + out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata(cmd.Context(), in) if err != nil { return err } @@ -2164,22 +9264,34 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "Maximum number of versions to return (default: 50)") + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects/{projectId}/schema/metadata") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-organization", - Short: "Get Organization Context", + Use: "get-raw ", + Short: "Get Project Schema Raw File", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextOrganizationInput{} - out, err := client.ListContextOrganization(cmd.Context(), in) + in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw(cmd.Context(), in) if err != nil { return err } @@ -2191,21 +9303,24 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/repositories/{repositoryId}/projects/{projectId}/schema/raw") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-organization", - Short: "Update Classification of the Organization", - Long: "Request body (JSON) fields: name (string), notes (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-repositories-projects-schema-trigger-by-id ", + Short: "Trigger Project Schema Reversing", + Long: "Request body (JSON) fields: branch (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchContextOrganizationInput{} + in := api.CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTriggerInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2235,7 +9350,21 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - data, err := client.PatchContextOrganization(cmd.Context(), in) + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaTrigger(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) if err != nil { return err } @@ -2243,6 +9372,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/repositories/{repositoryId}/projects/{projectId}/schema/trigger") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2250,16 +9381,17 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "update-organization", - Short: "Upsert Classification of the Organization", - Long: "Request body (JSON) fields: organization (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-repositories-repo-context-trigger-by-id ", + Short: "Trigger Repository Context", + Long: "Request body (JSON) fields: branch (string), force (boolean), pathPrefixes (array), subagents (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.UpdateContextOrganizationInput{} + in := api.CreateContextRepositoriesRepositoryIdRepoContextTriggerInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2289,89 +9421,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.UpdateContextOrganization(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "create-resync", - Short: "Resync RAG Vector Store", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.CreateContextRagResyncInput{} - out, err := client.CreateContextRagResync(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-repo-scans", - Short: "List Repo Context Scans", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListContextRepoScansInput{} - if v, _ := cmd.Flags().GetString("commit-sha"); v != "" { - x := string(v) - in.CommitSha = &x - } - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { - x := string(v) - in.RepositoryID = &x - } - if v, _ := cmd.Flags().GetString("status"); v != "" { - x := string(v) - in.Status = &x - } - out, err := client.ListContextRepoScans(cmd.Context(), in) + out, err := client.CreateContextRepositoriesRepositoryIdRepoContextTrigger(cmd.Context(), in) if err != nil { return err } @@ -2383,26 +9442,25 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("commit-sha", "", "") - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") - cmd.Flags().String("repository-id", "", "") - cmd.Flags().String("status", "", "") + setRoute(cmd, "POST /context/repositories/{repositoryId}/repo-context/trigger") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-repo-scans", - Short: "Create Repo Context Scan", - Long: "Request body (JSON) fields: branch (string), commitSha (string, required), projectsTouched (array), repositoryId (string, required), sbomsGenerated (array), status (string), subagentsRun (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-replay", + Short: "Compute Dependencies Repository/Project SBOM Ingest Replay", + Long: "Request body (JSON) fields: globalReplay (boolean), projectID (string), repositoryID (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextRepoScansInput{} + in := api.CreateContextSbomingestorReplayInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2432,7 +9490,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextRepoScans(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSbomingestorReplay(cmd.Context(), in) if err != nil { return err } @@ -2444,6 +9510,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/sbomingestor/replay") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2451,76 +9519,40 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-repo-scans ", - Short: "Get Repo Context Scan", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.GetContextRepoScansScanIdInput{} - in.ScanID = args[0] - out, err := client.GetContextRepoScansScanId(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "patch-repo-scans ", - Short: "Update Repo Context Scan", - Long: "Request body (JSON) fields: completedAt (string), errorMessage (string), projectsTouched (array), sbomsGenerated (array), status (string), subagentsRun (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "delete-sboms", + Short: "Delete SBOMs for tenant", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchContextRepoScansScanIdInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) - } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) - } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) - } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } + in := api.DeleteContextSbomsInput{} + if v, _ := cmd.Flags().GetString("dry-run"); v != "" { + b := v == "true" + in.DryRun = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } } - in.ScanID = args[0] - out, err := client.PatchContextRepoScansScanId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("invalid-only"); v != "" { + b := v == "true" + in.InvalidOnly = &b + } + if v, _ := cmd.Flags().GetString("project-id"); v != "" { + x := string(v) + in.ProjectID = &x + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + out, err := client.DeleteContextSboms(cmd.Context(), in) if err != nil { return err } @@ -2532,23 +9564,27 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + setRoute(cmd, "DELETE /context/sboms") + cmd.Flags().String("dry-run", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("invalid-only", "", "") + cmd.Flags().String("project-id", "", "") + cmd.Flags().String("repository-id", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-reports", - Short: "Create Report Generation Job", - Long: "Request body (JSON) fields: packages (array, required), repositories (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-generate", + Short: "Generate SBOM", + Long: "Request body (JSON) fields: cloneUrl (string), commitSha (string), defaultBranch (string), repositoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextReportsInput{} + in := api.CreateContextSbomsGenerateInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2578,7 +9614,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextReports(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSbomsGenerate(cmd.Context(), in) if err != nil { return err } @@ -2590,6 +9634,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/sboms/generate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2597,8 +9643,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-reports ", - Short: "Get Report Status", + Use: "get-sboms-repository-latest ", + Short: "Get Latest SBOMs for Repository", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -2606,9 +9652,17 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.GetContextReportsJobIdInput{} - in.JobID = args[0] - out, err := client.GetContextReportsJobId(cmd.Context(), in) + in := api.ListContextSbomsRepositoryRepositoryIdLatestInput{} + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextSbomsRepositoryRepositoryIdLatest(cmd.Context(), in) if err != nil { return err } @@ -2620,41 +9674,66 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/sboms/repository/{repositoryId}/latest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-repositories", - Short: "Get Contexts of Repositories", + Use: "get-project ", + Short: "Get Repository/Project SBOMs", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextRepositoriesInput{} - if v, _ := cmd.Flags().GetString("limit"); v != "" { + in := api.GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput{} + in.RepositoryID = args[0] + in.ProjectID = args[1] + if v, _ := cmd.Flags().GetString("from-commit"); v != "" { + x := string(v) + in.FromCommit = &x + } + if v, _ := cmd.Flags().GetString("from-time"); v != "" { + x := string(v) + in.FromTime = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + return fmt.Errorf("page"+": %w", err) } else { x := int(n) - in.Limit = &x + in.Page = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } } - if v, _ := cmd.Flags().GetString("sort"); v != "" { + if v, _ := cmd.Flags().GetString("until-commit"); v != "" { x := string(v) - in.Sort = &x + in.UntilCommit = &x } - if v, _ := cmd.Flags().GetString("sort-by"); v != "" { + if v, _ := cmd.Flags().GetString("until-time"); v != "" { x := string(v) - in.SortBy = &x + in.UntilTime = &x } - out, err := client.ListContextRepositories(cmd.Context(), in) + out, err := client.GetContextSbomsRepositoryRepositoryIdProjectProjectId(cmd.Context(), in) if err != nil { return err } @@ -2666,27 +9745,67 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") - cmd.Flags().String("sort", "", "") - cmd.Flags().String("sort-by", "", "") + setRoute(cmd, "GET /context/sboms/repository/{repositoryId}/project/{projectId}") + cmd.Flags().String("from-commit", "", "") + cmd.Flags().String("from-time", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + cmd.Flags().String("until-commit", "", "") + cmd.Flags().String("until-time", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-repositories ", - Short: "Delete Repository", - Args: cobra.ExactArgs(1), + Use: "create-resolve", + Short: "Get or generate SBOM", + Long: "Request body (JSON) fields: baselineOnly (boolean), branch (string), cdxgenMajor (integer), cloneURL (string), commitSHA (string), isDefaultBranchPush (boolean), lockfileSetHash (string), manifestOnly (boolean), ownerProvider (object), repositoryID (string), repositoryProvider (object), scannerVersion (string), tenantID (string), timestamp (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteContextRepositoriesRepositoryIdInput{} - in.RepositoryID = args[0] - out, err := client.DeleteContextRepositoriesRepositoryId(cmd.Context(), in) + in := api.CreateContextSbomsResolveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSbomsResolve(cmd.Context(), in) if err != nil { return err } @@ -2698,23 +9817,63 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/sboms/resolve") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-repositories ", - Short: "Get Repository", - Args: cobra.ExactArgs(1), + Use: "create-sboms-runs", + Short: "Start SBOM Run", + Long: "Request body (JSON) fields: branch (string), commitSha (string), repositoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetContextRepositoriesRepositoryIdInput{} - in.RepositoryID = args[0] - out, err := client.GetContextRepositoriesRepositoryId(cmd.Context(), in) + in := api.CreateContextSbomsRunsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSbomsRuns(cmd.Context(), in) if err != nil { return err } @@ -2726,22 +9885,25 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/sboms/runs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-repositories ", - Short: "Update Repository", - Long: "Request body (JSON) fields: name (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-scan", + Short: "Scan SBOM (get-or-generate)", + Long: "Request body (JSON) fields: commitSha (string, required), forceRegenerate (boolean), projectId (string, required), repositoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchContextRepositoriesRepositoryIdInput{} + in := api.CreateContextSbomsScanInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2771,8 +9933,19 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.RepositoryID = args[0] - data, err := client.PatchContextRepositoriesRepositoryId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSbomsScan(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) if err != nil { return err } @@ -2780,6 +9953,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/sboms/scan") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2787,34 +9962,65 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-repositories-projects ", - Short: "List Projects", - Args: cobra.ExactArgs(1), + Use: "list-tree", + Short: "Get SBOM key tree for tenant", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextRepositoriesRepositoryIdProjectsInput{} - in.RepositoryID = args[0] - if v, _ := cmd.Flags().GetString("include-deleted"); v != "" { + in := api.ListContextSbomsTreeInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("verbose"); v != "" { b := v == "true" - in.IncludeDeleted = &b + in.Verbose = &b } - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + out, err := client.ListContextSbomsTree(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/sboms/tree") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("verbose", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-schemas", + Short: "List Schemas", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextSchemasInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x - } - out, err := client.ListContextRepositoriesRepositoryIdProjects(cmd.Context(), in) + out, err := client.ListContextSchemas(cmd.Context(), in) if err != nil { return err } @@ -2826,27 +10032,31 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("include-deleted", "", "") - cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") + setRoute(cmd, "GET /context/schemas") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-projects ", - Short: "Delete Project", - Args: cobra.ExactArgs(2), + Use: "list-pentest-assessments", + Short: "List assessment setup proposals", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteContextRepositoriesRepositoryIdProjectsProjectIdInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - out, err := client.DeleteContextRepositoriesRepositoryIdProjectsProjectId(cmd.Context(), in) + in := api.ListContextSetupRecommendationsPentestAssessmentsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextSetupRecommendationsPentestAssessments(cmd.Context(), in) if err != nil { return err } @@ -2858,24 +10068,31 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/setup-recommendations/pentest-assessments") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-repositories-projects-2 ", - Short: "Get Project", - Args: cobra.ExactArgs(2), + Use: "create-setup-recommendations-pentest-assessments-refresh", + Short: "Refresh assessment setup proposals", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetContextRepositoriesRepositoryIdProjectsProjectIdInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - out, err := client.GetContextRepositoriesRepositoryIdProjectsProjectId(cmd.Context(), in) + in := api.CreateContextSetupRecommendationsPentestAssessmentsRefreshInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSetupRecommendationsPentestAssessmentsRefresh(cmd.Context(), in) if err != nil { return err } @@ -2887,22 +10104,24 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/setup-recommendations/pentest-assessments/refresh") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-projects ", - Short: "Update Project", - Long: "Request body (JSON) fields: deletedAt (string), description (string), isDeleted (boolean), metadata (object), tags (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(2), + Use: "create-setup-recommendations-pentest-assessments-accept-by-id ", + Short: "Accept assessment setup proposal", + Long: "Request body (JSON) fields: applicationId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchContextRepositoriesRepositoryIdProjectsProjectIdInput{} + in := api.CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAcceptInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2932,9 +10151,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.RepositoryID = args[0] - in.ProjectID = args[1] - out, err := client.PatchContextRepositoriesRepositoryIdProjectsProjectId(cmd.Context(), in) + in.RecommendationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdAccept(cmd.Context(), in) if err != nil { return err } @@ -2946,6 +10172,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/setup-recommendations/pentest-assessments/{recommendationId}/accept") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2953,19 +10181,26 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-repositories-projects-schema ", - Short: "Get Project Schema", - Args: cobra.ExactArgs(2), + Use: "create-setup-recommendations-pentest-assessments-dismiss-by-id ", + Short: "Dismiss assessment setup proposal", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdSchema(cmd.Context(), in) + in := api.CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismissInput{} + in.RecommendationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSetupRecommendationsPentestAssessmentsRecommendationIdDismiss(cmd.Context(), in) if err != nil { return err } @@ -2977,22 +10212,96 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/setup-recommendations/pentest-assessments/{recommendationId}/dismiss") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-schema-by-id ", - Short: "Upload Project Schema", - Long: "Request body (JSON) fields: content (string, required), format (object, required), type (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(2), + Use: "list-pentest-targets", + Short: "List pentest target recommendations", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextRepositoriesRepositoryIdProjectsProjectIdSchemaInput{} + in := api.ListContextSetupRecommendationsPentestTargetsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextSetupRecommendationsPentestTargets(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/setup-recommendations/pentest-targets") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-setup-recommendations-pentest-targets-refresh", + Short: "Refresh pentest target recommendations", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextSetupRecommendationsPentestTargetsRefreshInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSetupRecommendationsPentestTargetsRefresh(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/setup-recommendations/pentest-targets/refresh") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-setup-recommendations-pentest-targets-accept-by-id ", + Short: "Accept pentest target recommendation", + Long: "Request body (JSON) fields: targetId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateContextSetupRecommendationsPentestTargetsRecommendationIdAcceptInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3022,9 +10331,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.RepositoryID = args[0] - in.ProjectID = args[1] - out, err := client.CreateContextRepositoriesRepositoryIdProjectsProjectIdSchema(cmd.Context(), in) + in.RecommendationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSetupRecommendationsPentestTargetsRecommendationIdAccept(cmd.Context(), in) if err != nil { return err } @@ -3036,6 +10352,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/setup-recommendations/pentest-targets/{recommendationId}/accept") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3043,19 +10361,26 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-metadata ", - Short: "Get Project Schema Metadata", - Args: cobra.ExactArgs(2), + Use: "create-setup-recommendations-pentest-targets-dismiss-by-id ", + Short: "Dismiss pentest target recommendation", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadataInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaMetadata(cmd.Context(), in) + in := api.CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismissInput{} + in.RecommendationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextSetupRecommendationsPentestTargetsRecommendationIdDismiss(cmd.Context(), in) if err != nil { return err } @@ -3067,24 +10392,61 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/setup-recommendations/pentest-targets/{recommendationId}/dismiss") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-raw ", - Short: "Get Project Schema Raw File", - Args: cobra.ExactArgs(2), + Use: "get-text ", + Short: "Get Vault Document Text", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRawInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - out, err := client.ListContextRepositoriesRepositoryIdProjectsProjectIdSchemaRaw(cmd.Context(), in) + in := api.ListContextVaultDocumentDocumentIdTextInput{} + in.DocumentID = args[0] + if v, _ := cmd.Flags().GetString("end-page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("endPage"+": %w", err) + } else { + x := int(n) + in.EndPage = &x + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("max-chars"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("maxChars"+": %w", err) + } else { + x := int(n) + in.MaxChars = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("start-page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("startPage"+": %w", err) + } else { + x := int(n) + in.StartPage = &x + } + } + out, err := client.ListContextVaultDocumentDocumentIdText(cmd.Context(), in) if err != nil { return err } @@ -3096,21 +10458,27 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/vault/document/{documentId}/text") + cmd.Flags().String("end-page", "", "Last page to read (1-based, inclusive)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("max-chars", "", "Maximum characters to return in this response (default and ceiling 60000). Setting it also opts into paging a document too large to read whole") + cmd.Flags().String("next-token", "", "Pagination token returned by a truncated response") + cmd.Flags().String("start-page", "", "First page to read (1-based, inclusive)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-replay", - Short: "Compute Dependencies Repository/Project SBOM Ingest Replay", - Long: "Request body (JSON) fields: globalReplay (boolean), projectID (string), repositoryID (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-file", + Short: "Post Vault File", + Long: "Request body (JSON) fields: description (string), fileName (string, required), size (integer).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextSbomingestorReplayInput{} + in := api.CreateContextVaultFileInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3140,7 +10508,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextSbomingestorReplay(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextVaultFile(cmd.Context(), in) if err != nil { return err } @@ -3152,6 +10528,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/vault/file") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3159,32 +10537,60 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-sboms", - Short: "Delete SBOMs for tenant", + Use: "delete-file ", + Short: "Delete Vault File", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteContextSbomsInput{} - if v, _ := cmd.Flags().GetString("dry-run"); v != "" { - b := v == "true" - in.DryRun = &b + in := api.DeleteContextVaultFileFileIdInput{} + in.FileID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - if v, _ := cmd.Flags().GetString("invalid-only"); v != "" { - b := v == "true" - in.InvalidOnly = &b + data, err := client.DeleteContextVaultFileFileId(cmd.Context(), in) + if err != nil { + return err } - if v, _ := cmd.Flags().GetString("project-id"); v != "" { - x := string(v) - in.ProjectID = &x + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /context/vault/file/{fileId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-file ", + Short: "Get Vault File", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { - x := string(v) - in.RepositoryID = &x + in := api.GetContextVaultFileFileIdInput{} + in.FileID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.DeleteContextSboms(cmd.Context(), in) + out, err := client.GetContextVaultFileFileId(cmd.Context(), in) if err != nil { return err } @@ -3196,25 +10602,24 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("dry-run", "", "") - cmd.Flags().String("invalid-only", "", "") - cmd.Flags().String("project-id", "", "") - cmd.Flags().String("repository-id", "", "") + setRoute(cmd, "GET /context/vault/file/{fileId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-generate", - Short: "Generate SBOM", - Long: "Request body (JSON) fields: cloneUrl (string), commitSha (string), defaultBranch (string), repositoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "patch-file ", + Short: "Patch Vault File", + Long: "Request body (JSON) fields: documentId (string), metadata (object), processedAt (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextSbomsGenerateInput{} + in := api.PatchContextVaultFileFileNameInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3244,7 +10649,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextSbomsGenerate(cmd.Context(), in) + in.FileName = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchContextVaultFileFileName(cmd.Context(), in) if err != nil { return err } @@ -3256,6 +10670,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /context/vault/file/{fileName}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3263,18 +10679,44 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-sboms-repository-latest ", - Short: "Get Latest SBOMs for Repository", - Args: cobra.ExactArgs(1), + Use: "list-files", + Short: "Get Vault Files", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextSbomsRepositoryRepositoryIdLatestInput{} - in.RepositoryID = args[0] - out, err := client.ListContextSbomsRepositoryRepositoryIdLatest(cmd.Context(), in) + in := api.ListContextVaultFilesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + out, err := client.ListContextVaultFiles(cmd.Context(), in) if err != nil { return err } @@ -3286,56 +10728,34 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/vault/files") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of files to return per page (default: all, max 1000)") + cmd.Flags().String("offset", "", "Number of files to skip before the page") + cmd.Flags().String("search", "", "Case-insensitive substring match on file name") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-project ", - Short: "Get Repository/Project SBOMs", - Args: cobra.ExactArgs(2), + Use: "list-list", + Short: "Get Vault Files List", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetContextSbomsRepositoryRepositoryIdProjectProjectIdInput{} - in.RepositoryID = args[0] - in.ProjectID = args[1] - if v, _ := cmd.Flags().GetString("from-commit"); v != "" { - x := string(v) - in.FromCommit = &x - } - if v, _ := cmd.Flags().GetString("from-time"); v != "" { - x := string(v) - in.FromTime = &x - } - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.ListContextVaultFilesListInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("until-commit"); v != "" { - x := string(v) - in.UntilCommit = &x - } - if v, _ := cmd.Flags().GetString("until-time"); v != "" { - x := string(v) - in.UntilTime = &x - } - out, err := client.GetContextSbomsRepositoryRepositoryIdProjectProjectId(cmd.Context(), in) + out, err := client.ListContextVaultFilesList(cmd.Context(), in) if err != nil { return err } @@ -3347,27 +10767,23 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("from-commit", "", "") - cmd.Flags().String("from-time", "", "") - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") - cmd.Flags().String("until-commit", "", "") - cmd.Flags().String("until-time", "", "") + setRoute(cmd, "GET /context/vault/files/list") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-resolve", - Short: "Get or generate SBOM", - Long: "Request body (JSON) fields: branch (string), cdxgenMajor (integer), cloneURL (string), commitSHA (string), isDefaultBranchPush (boolean), lockfileSetHash (string), ownerProvider (object), repositoryID (string), repositoryProvider (object), scannerVersion (string), tenantID (string), timestamp (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-index", + Short: "Index Vault Files", + Long: "Request body (JSON) fields: fileIDs (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextSbomsResolveInput{} + in := api.CreateContextVaultIndexInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3397,7 +10813,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextSbomsResolve(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextVaultIndex(cmd.Context(), in) if err != nil { return err } @@ -3409,6 +10833,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/vault/index") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3416,16 +10842,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-scan", - Short: "Scan SBOM (get-or-generate)", - Long: "Request body (JSON) fields: commitSha (string, required), forceRegenerate (boolean), projectId (string, required), repositoryId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-onboard", + Short: "Trigger Vault Onboarding", + Long: "Request body (JSON) fields: fileIDs (array, required), runId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextSbomsScanInput{} + in := api.CreateContextVaultOnboardInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3455,7 +10881,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextSbomsScan(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextVaultOnboard(cmd.Context(), in) if err != nil { return err } @@ -3467,6 +10901,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/vault/onboard") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3474,47 +10910,54 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-tree", - Short: "Get SBOM key tree for tenant", + Use: "create-vault-search", + Short: "Search Vault Documents", + Long: "Request body (JSON) fields: docTypes (array), documentIds (array), limit (integer), query (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextSbomsTreeInput{} - if v, _ := cmd.Flags().GetString("verbose"); v != "" { - b := v == "true" - in.Verbose = &b - } - out, err := client.ListContextSbomsTree(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + in := api.CreateContextVaultSearchInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("verbose", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-schemas", - Short: "List Schemas", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListContextSchemasInput{} - out, err := client.ListContextSchemas(cmd.Context(), in) + out, err := client.CreateContextVaultSearch(cmd.Context(), in) if err != nil { return err } @@ -3526,21 +10969,25 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/vault/search") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-file", - Short: "Post Vault File", - Long: "Request body (JSON) fields: description (string), fileName (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-waf-allowlist-pr-runs", + Short: "Start WAF Allowlist PR Run", + Long: "Request body (JSON) fields: digest (string), expectedRunId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextVaultFileInput{} + in := api.CreateContextWafAllowlistPrRunsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3570,7 +11017,15 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextVaultFile(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextWafAllowlistPrRuns(cmd.Context(), in) if err != nil { return err } @@ -3582,6 +11037,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/waf-allowlist-pr/runs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3589,8 +11046,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-file ", - Short: "Delete Vault File", + Use: "get-waf-allowlist-pr-runs ", + Short: "Get WAF Allowlist PR Run", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -3598,33 +11055,17 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.DeleteContextVaultFileFileIdInput{} - in.FileID = args[0] - data, err := client.DeleteContextVaultFileFileId(cmd.Context(), in) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-file ", - Short: "Get Vault File", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in := api.GetContextWafAllowlistPrRunsRunIdInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.GetContextVaultFileFileIdInput{} - in.FileID = args[0] - out, err := client.GetContextVaultFileFileId(cmd.Context(), in) + out, err := client.GetContextWafAllowlistPrRunsRunId(cmd.Context(), in) if err != nil { return err } @@ -3636,14 +11077,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/waf-allowlist-pr/runs/{runId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-file ", - Short: "Patch Vault File", - Long: "Request body (JSON) fields: documentId (string), metadata (object), processedAt (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-waf-allowlist-pr-runs-approve-by-id ", + Short: "Create approved WAF allowlist draft PR", + Long: "Request body (JSON) fields: digest (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -3651,7 +11094,7 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.PatchContextVaultFileFileNameInput{} + in := api.CreateContextWafAllowlistPrRunsRunIdApproveInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3681,8 +11124,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.FileName = args[0] - out, err := client.PatchContextVaultFileFileName(cmd.Context(), in) + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextWafAllowlistPrRunsRunIdApprove(cmd.Context(), in) if err != nil { return err } @@ -3694,6 +11145,8 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/waf-allowlist-pr/runs/{runId}/approve") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -3701,42 +11154,26 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-files", - Short: "Get Vault Files", + Use: "get-waf-allowlist-pr-runs-proposal ", + Short: "Review WAF allowlist proposal", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListContextVaultFilesInput{} - out, err := client.ListContextVaultFiles(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-list", - Short: "Get Vault Files List", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in := api.ListContextWafAllowlistPrRunsRunIdProposalInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListContextVaultFilesListInput{} - out, err := client.ListContextVaultFilesList(cmd.Context(), in) + out, err := client.ListContextWafAllowlistPrRunsRunIdProposal(cmd.Context(), in) if err != nil { return err } @@ -3748,21 +11185,24 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/waf-allowlist-pr/runs/{runId}/proposal") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-onboard", - Short: "Trigger Vault Onboarding", - Long: "Request body (JSON) fields: fileIDs (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-waf-allowlist-pr-runs-recover-by-id ", + Short: "Recover unresolved WAF allowlist publication", + Long: "Request body (JSON) fields: confirmNoPullRequest (boolean, required), digest (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateContextVaultOnboardInput{} + in := api.CreateContextWafAllowlistPrRunsRunIdRecoverInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -3792,7 +11232,16 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateContextVaultOnboard(cmd.Context(), in) + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateContextWafAllowlistPrRunsRunIdRecover(cmd.Context(), in) if err != nil { return err } @@ -3804,9 +11253,47 @@ func RegisterContextCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /context/waf-allowlist-pr/runs/{runId}/recover") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } + { + cmd := &cobra.Command{ + Use: "list-waf-allowlist-pr-status", + Short: "Get WAF Allowlist PR Status", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListContextWafAllowlistPrStatusInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListContextWafAllowlistPrStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /context/waf-allowlist-pr/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + } diff --git a/internal/commands/cspm.go b/internal/commands/cspm.go index 477039e..c5321cb 100644 --- a/internal/commands/cspm.go +++ b/internal/commands/cspm.go @@ -43,6 +43,34 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.AccountID = &x } + if v, _ := cmd.Flags().GetString("category"); v != "" { + x := string(v) + in.Category = &x + } + if v, _ := cmd.Flags().GetString("cloud-provider"); v != "" { + x := string(v) + in.CloudProvider = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { + b := v == "true" + in.IsAllowlisted = &b + } + if v, _ := cmd.Flags().GetString("is-archived"); v != "" { + b := v == "true" + in.IsArchived = &b + } + if v, _ := cmd.Flags().GetString("is-false-positive"); v != "" { + b := v == "true" + in.IsFalsePositive = &b + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -55,6 +83,14 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.NextToken = &x } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } if v, _ := cmd.Flags().GetString("region"); v != "" { x := string(v) in.Region = &x @@ -63,10 +99,18 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.ResourceType = &x } + if v, _ := cmd.Flags().GetString("rule-id"); v != "" { + x := string(v) + in.RuleID = &x + } if v, _ := cmd.Flags().GetString("scan-id"); v != "" { x := string(v) in.ScanID = &x } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } if v, _ := cmd.Flags().GetString("severity"); v != "" { x := string(v) in.Severity = &x @@ -95,16 +139,26 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/findings") cmd.Flags().String("account-id", "", "Filter by account ID") + cmd.Flags().String("category", "", "Filter by rule category") + cmd.Flags().String("cloud-provider", "", "Filter by cloud provider (aws, azure, gcp, kubernetes)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("is-allowlisted", "", "Filter by allowlisted state") + cmd.Flags().String("is-archived", "", "Filter by archived state; omitted means non-archived only") + cmd.Flags().String("is-false-positive", "", "Filter by false-positive state") cmd.Flags().String("limit", "", "Maximum number of findings to return") cmd.Flags().String("next-token", "", "Token for pagination") + cmd.Flags().String("offset", "", "Pagination offset; overrides nextToken when set") cmd.Flags().String("region", "", "Filter by region") cmd.Flags().String("resource-type", "", "Filter by resource type") + cmd.Flags().String("rule-id", "", "Filter by rule ID") cmd.Flags().String("scan-id", "", "Filter by scan ID") - cmd.Flags().String("severity", "", "Filter by severity") + cmd.Flags().String("search", "", "Server-side text search over title / resource / rule") + cmd.Flags().String("severity", "", "Filter by severity (upper case, e.g. CRITICAL)") cmd.Flags().String("sort", "", "Sort order (asc or desc)") cmd.Flags().String("sort-by", "", "Field to sort by (priority, time, severity)") - cmd.Flags().String("status", "", "Filter by status") + cmd.Flags().String("status", "", "Filter by lifecycle status: open, allowlisted, archived or resolved") serviceCmd.AddCommand(cmd) } @@ -121,6 +175,14 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetCspmFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetCspmFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -133,13 +195,16 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-activity ", - Short: "Get CSPM Finding Autofix Activity", + Use: "patch-findings ", + Short: "Update CSPM Finding", + Long: "Request body (JSON) fields: clearPriorityOverride (boolean), clearSeverityOverride (boolean), priorityOverride (object), severityOverride (object), userNotes (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -147,21 +212,116 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListCspmFindingsFindingIdAutofixActivityInput{} + in := api.PatchCspmFindingsFindingIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } in.FindingID = args[0] - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int32(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("since-id"); v != "" { - x := string(v) - in.SinceID = &x + out, err := client.PatchCspmFindingsFindingId(cmd.Context(), in) + if err != nil { + return err } - out, err := client.ListCspmFindingsFindingIdAutofixActivity(cmd.Context(), in) + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /cspm/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-allowlist-by-id ", + Short: "Allowlist CSPM Finding", + Long: "Request body (JSON) fields: allowlistReason (string, required), allowlistType (object), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateCspmFindingsFindingIdAllowlistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err } @@ -173,15 +333,87 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") - cmd.Flags().String("since-id", "", "") + setRoute(cmd, "POST /cspm/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-archive-by-id ", + Short: "Archive CSPM Finding", + Long: "Request body (JSON) fields: userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateCspmFindingsFindingIdArchiveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmFindingsFindingIdArchive(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/findings/{findingId}/archive") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-diff ", - Short: "Get CSPM Finding Autofix Diff", + Use: "get-activity ", + Short: "Get CSPM Finding Autofix Activity", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -189,9 +421,29 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListCspmFindingsFindingIdAutofixCacheDiffInput{} + in := api.ListCspmFindingsFindingIdAutofixActivityInput{} in.FindingID = args[0] - out, err := client.ListCspmFindingsFindingIdAutofixCacheDiff(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("since-id"); v != "" { + x := string(v) + in.SinceID = &x + } + out, err := client.ListCspmFindingsFindingIdAutofixActivity(cmd.Context(), in) if err != nil { return err } @@ -203,6 +455,10 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/findings/{findingId}/autofix/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("since-id", "", "") serviceCmd.AddCommand(cmd) } @@ -210,7 +466,7 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { cmd := &cobra.Command{ Use: "create-fix-by-id ", Short: "Post CSPM Finding Autofix", - Long: "Request body (JSON) fields: force (boolean), message (string), originCampaignId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Long: "Request body (JSON) fields: force (boolean), gitRepositoryProvider (object), message (string), originCampaignId (string), useCachedFix (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -249,6 +505,14 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateCspmFindingsFindingIdAutofixFix(cmd.Context(), in) if err != nil { return err @@ -261,6 +525,8 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/findings/{findingId}/autofix/fix") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -279,6 +545,14 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListCspmFindingsFindingIdAutofixStateInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListCspmFindingsFindingIdAutofixState(cmd.Context(), in) if err != nil { return err @@ -291,6 +565,8 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/findings/{findingId}/autofix/state") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -307,6 +583,14 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListCspmFindingsFindingIdAutofixStatusInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListCspmFindingsFindingIdAutofixStatus(cmd.Context(), in) if err != nil { return err @@ -319,14 +603,16 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/findings/{findingId}/autofix/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-ticket-by-id ", - Short: "Create Ticket for CSPM Finding", - Long: "Request body (JSON) fields: assignees (array), campaignId (string), campaignTitle (string), message (string), project (string), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-mark-false-positive-by-id ", + Short: "Mark CSPM Finding as False Positive", + Long: "Request body (JSON) fields: falsePositiveReason (string, required), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -334,7 +620,7 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateCspmFindingsFindingIdTicketInput{} + in := api.CreateCspmFindingsFindingIdMarkFalsePositiveInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -365,7 +651,15 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] - out, err := client.CreateCspmFindingsFindingIdTicket(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmFindingsFindingIdMarkFalsePositive(cmd.Context(), in) if err != nil { return err } @@ -377,6 +671,8 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/findings/{findingId}/mark-false-positive") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -384,44 +680,26 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-scans", - Short: "Get CSPM Scans", + Use: "delete-ticket ", + Short: "Delete Ticket for CSPM Finding", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListCspmScansInput{} - if v, _ := cmd.Flags().GetString("account-id"); v != "" { - x := string(v) - in.AccountID = &x - } - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in := api.DeleteCspmFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x - } - if v, _ := cmd.Flags().GetString("region"); v != "" { - x := string(v) - in.Region = &x - } - if v, _ := cmd.Flags().GetString("scan-type"); v != "" { - x := string(v) - in.ScanType = &x - } - if v, _ := cmd.Flags().GetString("status"); v != "" { - x := string(v) - in.Status = &x - } - out, err := client.ListCspmScans(cmd.Context(), in) + out, err := client.DeleteCspmFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err } @@ -433,19 +711,453 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("account-id", "", "Filter by account ID") - cmd.Flags().String("limit", "", "Maximum number of scans to return") - cmd.Flags().String("next-token", "", "Token for pagination") - cmd.Flags().String("region", "", "Filter by region") - cmd.Flags().String("scan-type", "", "Filter by scan type") - cmd.Flags().String("status", "", "Filter by scan status") + setRoute(cmd, "DELETE /cspm/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-scans ", - Short: "Get CSPM Scan", + Use: "create-ticket-by-id ", + Short: "Create Ticket for CSPM Finding", + Long: "Request body (JSON) fields: assignees (array), campaignId (string), campaignTitle (string), message (string), project (string), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateCspmFindingsFindingIdTicketInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-triage ", + Short: "Get CSPM Finding Triage", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListCspmFindingsFindingIdTriageInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListCspmFindingsFindingIdTriage(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-unallowlist-by-id ", + Short: "Unallowlist CSPM Finding", + Long: "Request body (JSON) fields: unallowlistReason (string), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateCspmFindingsFindingIdUnallowlistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmFindingsFindingIdUnallowlist(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-unarchive-by-id ", + Short: "Unarchive CSPM Finding", + Long: "Request body (JSON) fields: userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateCspmFindingsFindingIdUnarchiveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmFindingsFindingIdUnarchive(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/findings/{findingId}/unarchive") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-unmark-false-positive-by-id ", + Short: "Unmark CSPM Finding as False Positive", + Long: "Request body (JSON) fields: userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateCspmFindingsFindingIdUnmarkFalsePositiveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmFindingsFindingIdUnmarkFalsePositive(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/findings/{findingId}/unmark-false-positive") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-scans", + Short: "Get CSPM Scans", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListCspmScansInput{} + if v, _ := cmd.Flags().GetString("account-id"); v != "" { + x := string(v) + in.AccountID = &x + } + if v, _ := cmd.Flags().GetString("cloud-provider"); v != "" { + x := string(v) + in.CloudProvider = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("is-archived"); v != "" { + b := v == "true" + in.IsArchived = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + x := string(v) + in.Status = &x + } + out, err := client.ListCspmScans(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/scans") + cmd.Flags().String("account-id", "", "Filter by account ID") + cmd.Flags().String("cloud-provider", "", "Filter by cloud provider (aws, azure, gcp, kubernetes)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("is-archived", "", "Filter by archived state") + cmd.Flags().String("limit", "", "Maximum number of scans to return") + cmd.Flags().String("next-token", "", "Token for pagination") + cmd.Flags().String("offset", "", "Pagination offset; overrides nextToken when set") + cmd.Flags().String("search", "", "Server-side text search over account / region / provider") + cmd.Flags().String("status", "", "Filter by scan status") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-start", + Short: "Start CSPM Scan", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateCspmScansStartInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateCspmScansStart(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /cspm/scans/start") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-scans ", + Short: "Get CSPM Scan", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -455,6 +1167,14 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetCspmScansScanIdInput{} in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetCspmScansScanId(cmd.Context(), in) if err != nil { return err @@ -467,6 +1187,8 @@ func RegisterCspmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /cspm/scans/{scanId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } diff --git a/internal/commands/dast.go b/internal/commands/dast.go index 9d7fac5..9353690 100644 --- a/internal/commands/dast.go +++ b/internal/commands/dast.go @@ -30,16 +30,36 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-config", - Short: "Get BugHunt Config", + Use: "list-applications-2", + Short: "List Applications", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastBughuntConfigInput{} - out, err := client.ListDastBughuntConfig(cmd.Context(), in) + in := api.ListDastApplicationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListDastApplications(cmd.Context(), in) if err != nil { return err } @@ -51,21 +71,25 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/applications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "update-config", - Short: "Put BugHunt Config", - Long: "Request body (JSON) fields: config (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-applications-2", + Short: "Create Application", + Long: "Request body (JSON) fields: contextApplicationId (string), description (string), name (string), scopeExcludePatterns (array), webServiceIds (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.UpdateDastBughuntConfigInput{} + in := api.CreateDastApplicationsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -95,7 +119,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.UpdateDastBughuntConfig(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastApplications(cmd.Context(), in) if err != nil { return err } @@ -107,6 +139,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/applications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -114,16 +148,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-validate", - Short: "Validate BugHunt Config", - Long: "Request body (JSON) fields: config (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-from-context", + Short: "Create Assessment Setup From Context Application", + Long: "Request body (JSON) fields: contextApplicationId (string, required), name (string), webServices (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastBughuntConfigValidateInput{} + in := api.CreateDastApplicationsFromContextInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -153,7 +187,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateDastBughuntConfigValidate(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastApplicationsFromContext(cmd.Context(), in) if err != nil { return err } @@ -165,6 +207,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/applications/from-context") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -172,16 +216,54 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-bughunt-findings", - Short: "Get BugHunt Findings", + Use: "create-readiness", + Short: "Get Application Assessment Readiness", + Long: "Request body (JSON) fields: applicationIds (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastBughuntFindingsInput{} - out, err := client.ListDastBughuntFindings(cmd.Context(), in) + in := api.CreateDastApplicationsReadinessInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastApplicationsReadiness(cmd.Context(), in) if err != nil { return err } @@ -193,13 +275,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/applications/readiness") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-bughunt-findings ", - Short: "Get BugHunt Finding", + Use: "delete-applications-2 ", + Short: "Delete Application", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -207,9 +293,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.GetDastBughuntFindingsFindingIdInput{} - in.FindingID = args[0] - out, err := client.GetDastBughuntFindingsFindingId(cmd.Context(), in) + in := api.DeleteDastApplicationsApplicationIdInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastApplicationsApplicationId(cmd.Context(), in) if err != nil { return err } @@ -221,14 +315,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-allowlist ", - Short: "Allowlist BugHunt Finding", - Long: "Request body (JSON) fields: allow (boolean, required), reason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "get-applications-2 ", + Short: "Get Application", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -236,7 +331,46 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.PatchDastBughuntFindingsFindingIdAllowlistInput{} + in := api.GetDastApplicationsApplicationIdInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastApplicationsApplicationId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-applications-2 ", + Short: "Update Application", + Long: "Request body (JSON) fields: description (string), name (string), scopeExcludePatterns (array), webServiceIds (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateDastApplicationsApplicationIdInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -266,8 +400,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.FindingID = args[0] - out, err := client.PatchDastBughuntFindingsFindingIdAllowlist(cmd.Context(), in) + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateDastApplicationsApplicationId(cmd.Context(), in) if err != nil { return err } @@ -279,6 +421,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -286,18 +430,24 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-bughunt-findings-events ", - Short: "Get BugHunt Finding Events", - Args: cobra.ExactArgs(1), + Use: "list-config", + Short: "Get BugHunt Config", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastBughuntFindingsFindingIdEventsInput{} - in.FindingID = args[0] - out, err := client.ListDastBughuntFindingsFindingIdEvents(cmd.Context(), in) + in := api.ListDastBughuntConfigInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntConfig(cmd.Context(), in) if err != nil { return err } @@ -309,49 +459,61 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-bughunt-findings-triage ", - Short: "Create Interactor []", - Args: cobra.ExactArgs(1), + Use: "update-config", + Short: "Put BugHunt Config", + Long: "Request body (JSON) fields: config (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastBughuntFindingsFindingIdTriageInput{} - in.FindingID = args[0] - out, err := client.ListDastBughuntFindingsFindingIdTriage(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + in := api.UpdateDastBughuntConfigInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-bughunt-scans", - Short: "Get BugHunt Scans", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListDastBughuntScansInput{} - out, err := client.ListDastBughuntScans(cmd.Context(), in) + out, err := client.UpdateDastBughuntConfig(cmd.Context(), in) if err != nil { return err } @@ -363,21 +525,25 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/bughunt/config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-scans", - Short: "Start BugHunt Scan", - Long: "Request body (JSON) fields: intensity (object, required), scope (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-validate", + Short: "Validate BugHunt Config", + Long: "Request body (JSON) fields: config (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastBughuntScansInput{} + in := api.CreateDastBughuntConfigValidateInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -407,7 +573,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateDastBughuntScans(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastBughuntConfigValidate(cmd.Context(), in) if err != nil { return err } @@ -419,6 +593,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/bughunt/config/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -426,18 +602,24 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-bughunt-scans ", - Short: "Get BugHunt Scan", - Args: cobra.ExactArgs(1), + Use: "list-bughunt-findings", + Short: "Get BugHunt Findings", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetDastBughuntScansScanIdInput{} - in.ScanID = args[0] - out, err := client.GetDastBughuntScansScanId(cmd.Context(), in) + in := api.ListDastBughuntFindingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntFindings(cmd.Context(), in) if err != nil { return err } @@ -449,13 +631,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-bughunt-scans-diff ", - Short: "Get BugHunt Scan Diff", + Use: "get-bughunt-findings ", + Short: "Get BugHunt Finding", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -463,13 +647,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastBughuntScansScanIdDiffInput{} - in.ScanID = args[0] - if v, _ := cmd.Flags().GetString("against"); v != "" { - x := string(v) - in.Against = &x + in := api.GetDastBughuntFindingsFindingIdInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListDastBughuntScansScanIdDiff(cmd.Context(), in) + out, err := client.GetDastBughuntFindingsFindingId(cmd.Context(), in) if err != nil { return err } @@ -481,14 +669,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("against", "", "") + setRoute(cmd, "GET /dast/bughunt/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-bughunt-scans-findings ", - Short: "Get BugHunt Scan Findings", + Use: "patch-allowlist ", + Short: "Allowlist BugHunt Finding", + Long: "Request body (JSON) fields: allow (boolean, required), reason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -496,37 +686,46 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastBughuntScansScanIdFindingsInput{} - in.ScanID = args[0] - out, err := client.ListDastBughuntScansScanIdFindings(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + in := api.PatchDastBughuntFindingsFindingIdAllowlistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-bughunt-scans-logs ", - Short: "Get BugHunt Sub-Agent Network Log", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListDastBughuntScansScanIdLogsInput{} - in.ScanID = args[0] - out, err := client.ListDastBughuntScansScanIdLogs(cmd.Context(), in) + out, err := client.PatchDastBughuntFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err } @@ -538,13 +737,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /dast/bughunt/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-bughunt-scans-stop-by-id ", - Short: "Stop BugHunt Scan", + Use: "get-bughunt-findings-events ", + Short: "Get BugHunt Finding Events", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -552,9 +755,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateDastBughuntScansScanIdStopInput{} - in.ScanID = args[0] - out, err := client.CreateDastBughuntScansScanIdStop(cmd.Context(), in) + in := api.ListDastBughuntFindingsFindingIdEventsInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntFindingsFindingIdEvents(cmd.Context(), in) if err != nil { return err } @@ -566,21 +777,33 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-suite-runs", - Short: "Get BugHunt Suite Runs", + Use: "delete-bughunt-findings-ticket ", + Short: "Delete Ticket for BugHunt Finding", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastBughuntSuiteRunsInput{} - out, err := client.ListDastBughuntSuiteRuns(cmd.Context(), in) + in := api.DeleteDastBughuntFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastBughuntFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err } @@ -592,14 +815,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/bughunt/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-run-now-by-id ", - Short: "Run BugHunt Suite Now", - Long: "Request body (JSON) fields: intensity (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-bughunt-findings-ticket-by-id ", + Short: "Create Ticket for BugHunt Finding", + Long: "Request body (JSON) fields: assignees (array), message (string), project (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -607,7 +832,7 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateDastBughuntSuitesSuiteRunNowInput{} + in := api.CreateDastBughuntFindingsFindingIdTicketInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -637,8 +862,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.Suite = args[0] - out, err := client.CreateDastBughuntSuitesSuiteRunNow(cmd.Context(), in) + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastBughuntFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err } @@ -650,6 +883,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/bughunt/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -657,16 +892,26 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-credentials", - Short: "Get All Credentials", + Use: "get-bughunt-findings-triage ", + Short: "Create Interactor []", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastCredentialsInput{} - out, err := client.ListDastCredentials(cmd.Context(), in) + in := api.ListDastBughuntFindingsFindingIdTriageInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err } @@ -678,21 +923,23 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-credentials", - Short: "Create Credential", - Long: "Request body (JSON) fields: config (object, required), description (string, required), name (string, required), type (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-import", + Short: "Preview BugHunt Program Import", + Long: "Request body (JSON) fields: programType (string, required), programUrl (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastCredentialsInput{} + in := api.CreateDastBughuntProgramImportInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -722,7 +969,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateDastCredentials(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastBughuntProgramImport(cmd.Context(), in) if err != nil { return err } @@ -734,6 +989,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/bughunt/program/import") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -741,46 +998,48 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-credentials ", - Short: "Delete Credential", - Args: cobra.ExactArgs(1), + Use: "list-bughunt-scans", + Short: "Get BugHunt Scans", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteDastCredentialsCredentialIdInput{} - in.CredentialID = args[0] - out, err := client.DeleteDastCredentialsCredentialId(cmd.Context(), in) - if err != nil { - return err + in := api.ListDastBughuntScansInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - data, err := json.Marshal(out) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-credentials ", - Short: "Get Credential", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x } - in := api.GetDastCredentialsCredentialIdInput{} - in.CredentialID = args[0] - out, err := client.GetDastCredentialsCredentialId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + out, err := client.ListDastBughuntScans(cmd.Context(), in) if err != nil { return err } @@ -792,22 +1051,27 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/scans") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("offset", "", "Pagination offset; overrides nextToken when > 0") + cmd.Flags().String("search", "", "Server-side text search over scan id / status / targets") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "update-credentials ", - Short: "Update Credential", - Long: "Request body (JSON) fields: config (object, required), description (string, required), name (string, required), type (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-scans", + Short: "Start BugHunt Scan", + Long: "Request body (JSON) fields: intensity (object, required), scope (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.UpdateDastCredentialsCredentialIdInput{} + in := api.CreateDastBughuntScansInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -837,8 +1101,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.CredentialID = args[0] - out, err := client.UpdateDastCredentialsCredentialId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastBughuntScans(cmd.Context(), in) if err != nil { return err } @@ -850,6 +1121,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/bughunt/scans") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -857,8 +1130,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-validate-by-id ", - Short: "Validate Credential", + Use: "get-bughunt-scans ", + Short: "Get BugHunt Scan", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -866,9 +1139,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateDastCredentialsCredentialIdValidateInput{} - in.CredentialID = args[0] - out, err := client.CreateDastCredentialsCredentialIdValidate(cmd.Context(), in) + in := api.GetDastBughuntScansScanIdInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastBughuntScansScanId(cmd.Context(), in) if err != nil { return err } @@ -880,33 +1161,45 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/scans/{scanId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-applications", - Short: "Get Pentest App Configs", + Use: "get-bughunt-scans-activity ", + Short: "Get BugHunt Scan Activity", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastPentestApplicationsInput{} + in := api.ListDastBughuntScansScanIdActivityInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) } else { - x := int(n) + x := int32(n) in.Limit = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { + if v, _ := cmd.Flags().GetString("since-id"); v != "" { x := string(v) - in.NextToken = &x + in.SinceID = &x } - out, err := client.ListDastPentestApplications(cmd.Context(), in) + out, err := client.ListDastBughuntScansScanIdActivity(cmd.Context(), in) if err != nil { return err } @@ -918,23 +1211,275 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/scans/{scanId}/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") + cmd.Flags().String("since-id", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-applications", - Short: "Create Application", - Long: "Request body (JSON) fields: credentialIds (array, required), id (string), targets (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "get-bughunt-scans-diff ", + Short: "Get BugHunt Scan Diff", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestApplicationsInput{} + in := api.ListDastBughuntScansScanIdDiffInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("against"); v != "" { + x := string(v) + in.Against = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntScansScanIdDiff(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/scans/{scanId}/diff") + cmd.Flags().String("against", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-bughunt-scans-findings ", + Short: "Get BugHunt Scan Findings", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastBughuntScansScanIdFindingsInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + out, err := client.ListDastBughuntScansScanIdFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/scans/{scanId}/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("offset", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-bughunt-scans-logs ", + Short: "Get BugHunt Sub-Agent Network Log", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastBughuntScansScanIdLogsInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntScansScanIdLogs(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/scans/{scanId}/logs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-bughunt-scans-status ", + Short: "Get BugHunt Scan Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastBughuntScansScanIdStatusInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntScansScanIdStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/scans/{scanId}/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-bughunt-scans-stop-by-id ", + Short: "Stop BugHunt Scan", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastBughuntScansScanIdStopInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastBughuntScansScanIdStop(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/bughunt/scans/{scanId}/stop") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-suite-runs", + Short: "Get BugHunt Suite Runs", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastBughuntSuiteRunsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastBughuntSuiteRuns(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/bughunt/suite-runs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-run-now-by-id ", + Short: "Run BugHunt Suite Now", + Long: "Request body (JSON) fields: intensity (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastBughuntSuitesSuiteRunNowInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -964,7 +1509,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateDastPentestApplications(cmd.Context(), in) + in.Suite = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastBughuntSuitesSuiteRunNow(cmd.Context(), in) if err != nil { return err } @@ -976,6 +1530,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/bughunt/suites/{suite}/run-now") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -983,8 +1539,3298 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-applications ", - Short: "Delete Pentest App Config", + Use: "list-credentials", + Short: "Get All Credentials", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastCredentialsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + out, err := client.ListDastCredentials(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/credentials") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of credentials to return per page (default 50, max 1000)") + cmd.Flags().String("offset", "", "Number of credentials to skip before the page") + cmd.Flags().String("search", "", "Case-insensitive search over credential name, description and type") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-credentials", + Short: "Create Credential", + Long: "Request body (JSON) fields: config (object, required), description (string, required), name (string, required), type (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastCredentialsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastCredentials(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/credentials") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-credentials-validate", + Short: "Validate Credentials", + Long: "Request body (JSON) fields: credentialIds (array, required), testUrl (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastCredentialsValidateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastCredentialsValidate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/credentials/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-credentials ", + Short: "Delete Credential", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteDastCredentialsCredentialIdInput{} + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastCredentialsCredentialId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/credentials/{credentialId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-credentials ", + Short: "Get Credential", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetDastCredentialsCredentialIdInput{} + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastCredentialsCredentialId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/credentials/{credentialId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-credentials ", + Short: "Update Credential", + Long: "Request body (JSON) fields: config (object, required), description (string, required), name (string, required), type (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateDastCredentialsCredentialIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateDastCredentialsCredentialId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/credentials/{credentialId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-active ", + Short: "Switch Credential On or Off", + Long: "Request body (JSON) fields: isActive (boolean, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateDastCredentialsCredentialIdActiveInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateDastCredentialsCredentialIdActive(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/credentials/{credentialId}/active") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-validate-by-id ", + Short: "Validate Credential", + Long: "Request body (JSON) fields: testUrl (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastCredentialsCredentialIdValidateInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastCredentialsCredentialIdValidate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/credentials/{credentialId}/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-credentials-validations ", + Short: "Credential Validation History", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastCredentialsCredentialIdValidationsInput{} + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListDastCredentialsCredentialIdValidations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/credentials/{credentialId}/validations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-validations-by-id ", + Short: "Start Credential Validation", + Long: "Request body (JSON) fields: testUrl (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastCredentialsCredentialIdValidationsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastCredentialsCredentialIdValidations(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/credentials/{credentialId}/validations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-credentials-validations-status ", + Short: "Credential Validation Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastCredentialsCredentialIdValidationsStatusInput{} + in.CredentialID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastCredentialsCredentialIdValidationsStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/credentials/{credentialId}/validations/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-attempts", + Short: "List Exploit Validation Attempts", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastExploitValidationAttemptsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListDastExploitValidationAttempts(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/exploit-validation/attempts") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-exploit-validation-findings-evidence ", + Short: "Get an Exploit Validation Evidence File", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetDastExploitValidationFindingsFindingIdEvidenceEvidenceIdInput{} + in.FindingID = args[0] + in.EvidenceID = args[1] + if v, _ := cmd.Flags().GetString("finding-type"); v != "" { + x := string(v) + in.FindingType = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastExploitValidationFindingsFindingIdEvidenceEvidenceId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/exploit-validation/findings/{findingId}/evidence/{evidenceId}") + cmd.Flags().String("finding-type", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-exploit-validation-findings-validate-by-id ", + Short: "Start Exploit Validation for a Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastExploitValidationFindingsFindingIdValidateInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastExploitValidationFindingsFindingIdValidate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/exploit-validation/findings/{findingId}/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-policies", + Short: "List Exploit Validation Policies", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastExploitValidationPoliciesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastExploitValidationPolicies(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/exploit-validation/policies") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-policies", + Short: "Create Exploit Validation Policy", + Long: "Request body (JSON) fields: daysOfWeek (array, required), enabled (boolean, required), endTime (string, required), findingTypes (array, required), minimumExploitability (string, required), minimumSeverity (string, required), name (string, required), revalidationCooldownDays (integer, required), startTime (string, required), timezone (string, required), webServiceIds (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastExploitValidationPoliciesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastExploitValidationPolicies(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/exploit-validation/policies") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-policies ", + Short: "Delete Exploit Validation Policy", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteDastExploitValidationPoliciesPolicyIdInput{} + in.PolicyID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastExploitValidationPoliciesPolicyId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/exploit-validation/policies/{policyId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-policies ", + Short: "Update Exploit Validation Policy", + Long: "Request body (JSON) fields: daysOfWeek (array, required), enabled (boolean, required), endTime (string, required), findingTypes (array, required), minimumExploitability (string, required), minimumSeverity (string, required), name (string, required), revalidationCooldownDays (integer, required), startTime (string, required), timezone (string, required), webServiceIds (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateDastExploitValidationPoliciesPolicyIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.PolicyID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateDastExploitValidationPoliciesPolicyId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/exploit-validation/policies/{policyId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-arm-by-id ", + Short: "Arm an Exploit Validation Policy", + Long: "Request body (JSON) fields: capabilities (array), expectedUpdatedAt (string, required), safetyContractVersion (integer, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastExploitValidationPoliciesPolicyIdArmInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.PolicyID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastExploitValidationPoliciesPolicyIdArm(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/exploit-validation/policies/{policyId}/arm") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-disarm-by-id ", + Short: "Disarm an Exploit Validation Policy", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastExploitValidationPoliciesPolicyIdDisarmInput{} + in.PolicyID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastExploitValidationPoliciesPolicyIdDisarm(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/exploit-validation/policies/{policyId}/disarm") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-runs ", + Short: "Get Exploit Validation Run", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetDastExploitValidationRunsRunIdInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("execution-arn"); v != "" { + x := string(v) + in.ExecutionArn = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastExploitValidationRunsRunId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/exploit-validation/runs/{runId}") + cmd.Flags().String("execution-arn", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-applications", + Short: "Get Pentest App Configs", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestApplicationsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListDastPentestApplications(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/applications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-applications", + Short: "Create Application", + Long: "Request body (JSON) fields: credentialIds (array, required), id (string), targets (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastPentestApplicationsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastPentestApplications(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/pentest/applications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-applications ", + Short: "Delete Pentest App Config", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteDastPentestApplicationsApplicationIdInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastPentestApplicationsApplicationId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/pentest/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-applications ", + Short: "Get Pentest App Config", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetDastPentestApplicationsApplicationIdInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastPentestApplicationsApplicationId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-applications ", + Short: "Partially Update Application", + Long: "Request body (JSON) fields: credentialIds (array), targets (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchDastPentestApplicationsApplicationIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchDastPentestApplicationsApplicationId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /dast/pentest/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-applications ", + Short: "Update Application", + Long: "Request body (JSON) fields: credentialIds (array), targets (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateDastPentestApplicationsApplicationIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateDastPentestApplicationsApplicationId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/pentest/applications/{applicationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-estimate ", + Short: "Get Pentest Cost Estimate", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestApplicationsApplicationIdEstimateInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestApplicationsApplicationIdEstimate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/applications/{applicationId}/estimate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-mutation-consent ", + Short: "Create Interactor []", + Long: "Request body (JSON) fields: enabled (boolean, required), warningVersion (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateDastPentestApplicationsApplicationIdMutationConsentInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.UpdateDastPentestApplicationsApplicationIdMutationConsent(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/pentest/applications/{applicationId}/mutation-consent") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-preflight-by-id ", + Short: "Start Pentest Preflight", + Long: "Request body (JSON) fields: deployment (object), triggeredByScan (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastPentestApplicationsApplicationIdPreflightInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastPentestApplicationsApplicationIdPreflight(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/pentest/applications/{applicationId}/preflight") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-latest ", + Short: "Get Latest Pentest Preflight for Application", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestApplicationsApplicationIdPreflightLatestInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("target-id"); v != "" { + x := string(v) + in.TargetID = &x + } + if v, _ := cmd.Flags().GetString("web-service-id"); v != "" { + x := string(v) + in.WebServiceID = &x + } + out, err := client.ListDastPentestApplicationsApplicationIdPreflightLatest(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/applications/{applicationId}/preflight/latest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("target-id", "", "") + cmd.Flags().String("web-service-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-quota ", + Short: "Get Pentest Preflight Quota", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestApplicationsApplicationIdPreflightQuotaInput{} + in.ApplicationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestApplicationsApplicationIdPreflightQuota(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/applications/{applicationId}/preflight/quota") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-budget", + Short: "Get Pentest Budget", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestBudgetInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestBudget(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/budget") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-pentest-findings", + Short: "Get Pentest Findings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestFindingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { + b := v == "true" + in.IsAllowlisted = &b + } + if v, _ := cmd.Flags().GetString("is-false-positive"); v != "" { + b := v == "true" + in.IsFalsePositive = &b + } + if v, _ := cmd.Flags().GetString("is-latest"); v != "" { + b := v == "true" + in.IsLatest = &b + } + if v, _ := cmd.Flags().GetString("is-resolved"); v != "" { + b := v == "true" + in.IsResolved = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("priority-label"); v != "" { + x := string(v) + in.PriorityLabel = &x + } + if v, _ := cmd.Flags().GetString("scan-id"); v != "" { + x := string(v) + in.ScanID = &x + } + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x + } + if v, _ := cmd.Flags().GetString("sort-by"); v != "" { + x := string(v) + in.SortBy = &x + } + out, err := client.ListDastPentestFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("is-allowlisted", "", "") + cmd.Flags().String("is-false-positive", "", "") + cmd.Flags().String("is-latest", "", "") + cmd.Flags().String("is-resolved", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("priority-label", "", "") + cmd.Flags().String("scan-id", "", "") + cmd.Flags().String("sort", "", "") + cmd.Flags().String("sort-by", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-findings ", + Short: "Get Pentest Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetDastPentestFindingsFindingIdInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastPentestFindingsFindingId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-allowlist-by-id ", + Short: "Allowlist Pentest Finding", + Long: "Request body (JSON) fields: allowlistReason (string, required), allowlistType (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastPentestFindingsFindingIdAllowlistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.CreateDastPentestFindingsFindingIdAllowlist(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/pentest/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-activity ", + Short: "Get DAST Pentest Finding Autofix Activity", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestFindingsFindingIdAutofixActivityInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("since-id"); v != "" { + x := string(v) + in.SinceID = &x + } + out, err := client.ListDastPentestFindingsFindingIdAutofixActivity(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings/{findingId}/autofix/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("since-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-fix-by-id ", + Short: "Post DAST Pentest Finding AutoFix", + Long: "Request body (JSON) fields: assignees (array), force (boolean), message (string), originCampaignId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastPentestFindingsFindingIdAutofixFixInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastPentestFindingsFindingIdAutofixFix(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/pentest/findings/{findingId}/autofix/fix") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-state ", + Short: "Get DAST Pentest Finding Autofix State", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestFindingsFindingIdAutofixStateInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestFindingsFindingIdAutofixState(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings/{findingId}/autofix/state") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-status ", + Short: "Get DAST Pentest Finding Autofix Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestFindingsFindingIdAutofixStatusInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestFindingsFindingIdAutofixStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings/{findingId}/autofix/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-findings-events ", + Short: "Get Pentest Finding Events", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestFindingsFindingIdEventsInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestFindingsFindingIdEvents(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-full ", + Short: "Get Pentest Finding Full", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestFindingsFindingIdFullInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestFindingsFindingIdFull(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings/{findingId}/full") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-pentest-findings-ticket ", + Short: "Delete Ticket for Pentest Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteDastPentestFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastPentestFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/pentest/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-ticket-by-id ", + Short: "Create Ticket for Pentest Finding", + Long: "Request body (JSON) fields: assignees (array), campaignId (string), campaignTitle (string), message (string), project (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastPentestFindingsFindingIdTicketInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastPentestFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/pentest/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-findings-triage ", + Short: "Get Pentest Finding Full", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestFindingsFindingIdTriageInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestFindingsFindingIdTriage(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-unallowlist-by-id ", + Short: "Unallowlist Pentest Finding", + Long: "Request body (JSON) fields: unallowlistReason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateDastPentestFindingsFindingIdUnallowlistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.CreateDastPentestFindingsFindingIdUnallowlist(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/pentest/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-mutation-warning", + Short: "Create Interactor []", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestMutationWarningInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestMutationWarning(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/mutation-warning") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-preflights ", + Short: "Get Pentest Preflight", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetDastPentestPreflightsPreflightIdInput{} + in.PreflightID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastPentestPreflightsPreflightId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/preflights/{preflightId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-preflights-events ", + Short: "Get Pentest Preflight Events", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestPreflightsPreflightIdEventsInput{} + in.PreflightID = args[0] + if v, _ := cmd.Flags().GetString("after-seq"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("afterSeq"+": %w", err) + } else { + x := n + in.AfterSeq = &x + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + out, err := client.ListDastPentestPreflightsPreflightIdEvents(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/preflights/{preflightId}/events") + cmd.Flags().String("after-seq", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-pentest-scans", + Short: "Get Pentest Scans", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + out, err := client.ListDastPentestScans(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("offset", "", "Pagination offset; overrides nextToken when > 0") + cmd.Flags().String("search", "", "Server-side text search over app id / status") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-scans ", + Short: "Get Pentest Scan", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetDastPentestScansScanIdInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastPentestScansScanId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-scans-activity ", + Short: "Get Pentest Scan Activity", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdActivityInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("since-id"); v != "" { + x := string(v) + in.SinceID = &x + } + out, err := client.ListDastPentestScansScanIdActivity(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("since-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-cases ", + Short: "List pentest auth-matrix cases", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdAuthMatrixCasesInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("hide-not-run"); v != "" { + b := v == "true" + in.HideNotRun = &b + } + if v, _ := cmd.Flags().GetString("identity"); v != "" { + x := string(v) + in.Identity = &x + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("outcome"); v != "" { + x := string(v) + in.Outcome = &x + } + out, err := client.ListDastPentestScansScanIdAuthMatrixCases(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/auth-matrix/cases") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("hide-not-run", "", "Drop cases the run never attempted: policy_skipped, and unknown with reason not_started") + cmd.Flags().String("identity", "", "Keep cases whose acting identity is this credential id (scope.users[].credentialId)") + cmd.Flags().String("limit", "", "Page size, default 50, at most 200") + cmd.Flags().String("offset", "", "Rows to skip") + cmd.Flags().String("outcome", "", "Keep one raw outcome: accepted, authz_denied, schema_rejected, policy_skipped, not_found, conflict, server_error or unknown") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-scans-auth-matrix-evidence ", + Short: "Get retained pentest attempt evidence", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdAuthMatrixEvidenceInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("attempt-id"); v != "" { + x := string(v) + in.AttemptID = &x + } + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("evidence-ref"); v != "" { + x := string(v) + in.EvidenceRef = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("identity-id"); v != "" { + x := string(v) + in.IdentityID = &x + } + if v, _ := cmd.Flags().GetString("method"); v != "" { + x := string(v) + in.Method = &x + } + if v, _ := cmd.Flags().GetString("path"); v != "" { + x := string(v) + in.Path = &x + } + if v, _ := cmd.Flags().GetString("since"); v != "" { + x := string(v) + in.Since = &x + } + if v, _ := cmd.Flags().GetString("stage"); v != "" { + x := string(v) + in.Stage = &x + } + if v, _ := cmd.Flags().GetString("until"); v != "" { + x := string(v) + in.Until = &x + } + out, err := client.ListDastPentestScansScanIdAuthMatrixEvidence(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/auth-matrix/evidence") + cmd.Flags().String("attempt-id", "", "") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("evidence-ref", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("identity-id", "", "") + cmd.Flags().String("method", "", "") + cmd.Flags().String("path", "", "") + cmd.Flags().String("since", "", "") + cmd.Flags().String("stage", "", "") + cmd.Flags().String("until", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-events ", + Short: "Get Pentest Scan Events", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdEventsInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("after-seq"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("afterSeq"+": %w", err) + } else { + x := n + in.AfterSeq = &x + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + out, err := client.ListDastPentestScansScanIdEvents(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/events") + cmd.Flags().String("after-seq", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-scans-findings ", + Short: "Get Pentest Scan Findings", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdFindingsInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-links ", + Short: "Get Pentest Scan Finding Links", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdFindingsLinksInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdFindingsLinks(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/findings/links") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-hypotheses ", + Short: "Get Auth Matrix Hypotheses", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdHypothesesInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdHypotheses(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/hypotheses") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-scans-logs ", + Short: "Get Sub-Agent Network Log", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdLogsInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdLogs(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/logs") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-transactions ", + Short: "Get filtered pentest capture transactions", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdLogsTransactionsInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("evidence-ref"); v != "" { + x := string(v) + in.EvidenceRef = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("identity-id"); v != "" { + x := string(v) + in.IdentityID = &x + } + if v, _ := cmd.Flags().GetString("method"); v != "" { + x := string(v) + in.Method = &x + } + if v, _ := cmd.Flags().GetString("path"); v != "" { + x := string(v) + in.Path = &x + } + if v, _ := cmd.Flags().GetString("since"); v != "" { + x := string(v) + in.Since = &x + } + if v, _ := cmd.Flags().GetString("stage"); v != "" { + x := string(v) + in.Stage = &x + } + if v, _ := cmd.Flags().GetString("until"); v != "" { + x := string(v) + in.Until = &x + } + out, err := client.ListDastPentestScansScanIdLogsTransactions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/logs/transactions") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("evidence-ref", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("identity-id", "", "") + cmd.Flags().String("method", "", "") + cmd.Flags().String("path", "", "") + cmd.Flags().String("since", "", "") + cmd.Flags().String("stage", "", "") + cmd.Flags().String("until", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-report ", + Short: "Get Pentest Scan Report", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdReportInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("exclude"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Exclude = append(in.Exclude, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdReport(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/report") + cmd.Flags().String("exclude", "", "Leave report parts out of the response; repeat for several. cases: auth-matrix case rows (counts stay). exploitAnalysisResult, appendices: those sections.") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-download ", + Short: "Get Pentest Scan Report Download URL", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdReportDownloadInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdReportDownload(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/report/download") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-scans-report-external-pdf ", + Short: "Get Pentest Scan External Report PDF", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastPentestScansScanIdReportExternalPdfInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdReportExternalPdf(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/report/external/pdf") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-pentest-scans-report-pdf ", + Short: "Get Pentest Scan Report PDF", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -992,9 +4838,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.DeleteDastPentestApplicationsApplicationIdInput{} - in.ApplicationID = args[0] - out, err := client.DeleteDastPentestApplicationsApplicationId(cmd.Context(), in) + in := api.ListDastPentestScansScanIdReportPdfInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdReportPdf(cmd.Context(), in) if err != nil { return err } @@ -1006,13 +4860,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/report/pdf") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-applications ", - Short: "Get Pentest App Config", + Use: "get-pentest-scans-status ", + Short: "Get Pentest Scan Progress Status", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1020,9 +4876,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.GetDastPentestApplicationsApplicationIdInput{} - in.ApplicationID = args[0] - out, err := client.GetDastPentestApplicationsApplicationId(cmd.Context(), in) + in := api.ListDastPentestScansScanIdStatusInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastPentestScansScanIdStatus(cmd.Context(), in) if err != nil { return err } @@ -1034,14 +4898,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/pentest/scans/{scanId}/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "update-applications ", - Short: "Update Application", - Long: "Request body (JSON) fields: credentialIds (array), targets (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-pentest-scans-stop-by-id ", + Short: "Stop Pentest Scan", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1049,38 +4914,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.UpdateDastPentestApplicationsApplicationIdInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) - } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) - } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) - } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } + in := api.CreateDastPentestScansScanIdStopInput{} + in.ScanID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } } - in.ApplicationID = args[0] - out, err := client.UpdateDastPentestApplicationsApplicationId(cmd.Context(), in) + out, err := client.CreateDastPentestScansScanIdStop(cmd.Context(), in) if err != nil { return err } @@ -1092,24 +4936,23 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + setRoute(cmd, "POST /dast/pentest/scans/{scanId}/stop") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-preflight-by-id ", - Short: "Start Pentest Preflight", - Long: "Request body (JSON) fields: triggeredByScan (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-start", + Short: "Request Pentest Assessment", + Long: "Request body (JSON) fields: applicationId (string, required), configOverrides (object), deployment (object), onboardingDispatch (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestApplicationsApplicationIdPreflightInput{} + in := api.CreateDastPentestStartInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1139,8 +4982,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.ApplicationID = args[0] - out, err := client.CreateDastPentestApplicationsApplicationIdPreflight(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastPentestStart(cmd.Context(), in) if err != nil { return err } @@ -1152,6 +5002,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/pentest/start") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1159,18 +5011,24 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-latest ", - Short: "Get Latest Pentest Preflight for Application", - Args: cobra.ExactArgs(1), + Use: "list-last", + Short: "Get Pentest Last Scan Status", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastPentestApplicationsApplicationIdPreflightLatestInput{} - in.ApplicationID = args[0] - out, err := client.ListDastPentestApplicationsApplicationIdPreflightLatest(cmd.Context(), in) + in := api.ListDastScansStatusLastInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastScansStatusLast(cmd.Context(), in) if err != nil { return err } @@ -1182,23 +5040,31 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/scans/status/last") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-quota ", - Short: "Get Pentest Preflight Quota", - Args: cobra.ExactArgs(1), + Use: "list-sourceips", + Short: "Get Source IPs", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastPentestApplicationsApplicationIdPreflightQuotaInput{} - in.ApplicationID = args[0] - out, err := client.ListDastPentestApplicationsApplicationIdPreflightQuota(cmd.Context(), in) + in := api.ListDastSourceipsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastSourceips(cmd.Context(), in) if err != nil { return err } @@ -1210,35 +5076,29 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/sourceips") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-pentest-findings", - Short: "Get Pentest Findings", + Use: "list-targets", + Short: "List Targets", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastPentestFindingsInput{} - if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { - b := v == "true" - in.IsAllowlisted = &b - } - if v, _ := cmd.Flags().GetString("is-false-positive"); v != "" { - b := v == "true" - in.IsFalsePositive = &b - } - if v, _ := cmd.Flags().GetString("is-latest"); v != "" { - b := v == "true" - in.IsLatest = &b - } - if v, _ := cmd.Flags().GetString("is-resolved"); v != "" { - b := v == "true" - in.IsResolved = &b + in := api.ListDastTargetsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { @@ -1252,23 +5112,7 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.NextToken = &x } - if v, _ := cmd.Flags().GetString("priority-label"); v != "" { - x := string(v) - in.PriorityLabel = &x - } - if v, _ := cmd.Flags().GetString("scan-id"); v != "" { - x := string(v) - in.ScanID = &x - } - if v, _ := cmd.Flags().GetString("sort"); v != "" { - x := string(v) - in.Sort = &x - } - if v, _ := cmd.Flags().GetString("sort-by"); v != "" { - x := string(v) - in.SortBy = &x - } - out, err := client.ListDastPentestFindings(cmd.Context(), in) + out, err := client.ListDastTargets(cmd.Context(), in) if err != nil { return err } @@ -1280,60 +5124,25 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("is-allowlisted", "", "") - cmd.Flags().String("is-false-positive", "", "") - cmd.Flags().String("is-latest", "", "") - cmd.Flags().String("is-resolved", "", "") + setRoute(cmd, "GET /dast/targets") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") - cmd.Flags().String("priority-label", "", "") - cmd.Flags().String("scan-id", "", "") - cmd.Flags().String("sort", "", "") - cmd.Flags().String("sort-by", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-pentest-findings ", - Short: "Get Pentest Finding", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.GetDastPentestFindingsFindingIdInput{} - in.FindingID = args[0] - out, err := client.GetDastPentestFindingsFindingId(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-allowlist-by-id ", - Short: "Allowlist Pentest Finding", - Long: "Request body (JSON) fields: allowlistReason (string, required), allowlistType (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-targets", + Short: "Create Target", + Long: "Request body (JSON) fields: description (string), hostname (string, required), isProd (boolean), name (string), port (integer), protocol (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestFindingsFindingIdAllowlistInput{} + in := api.CreateDastTargetsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1363,76 +5172,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.FindingID = args[0] - data, err := client.CreateDastPentestFindingsFindingIdAllowlist(cmd.Context(), in) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-activity ", - Short: "Get DAST Pentest Finding Autofix Activity", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListDastPentestFindingsFindingIdAutofixActivityInput{} - in.FindingID = args[0] - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) - } else { - x := int32(n) - in.Limit = &x - } - } - if v, _ := cmd.Flags().GetString("since-id"); v != "" { - x := string(v) - in.SinceID = &x - } - out, err := client.ListDastPentestFindingsFindingIdAutofixActivity(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") - cmd.Flags().String("since-id", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-pentest-findings-autofix-cache-diff ", - Short: "Get Pentest Finding Autofix Diff", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListDastPentestFindingsFindingIdAutofixCacheDiffInput{} - in.FindingID = args[0] - out, err := client.ListDastPentestFindingsFindingIdAutofixCacheDiff(cmd.Context(), in) + out, err := client.CreateDastTargets(cmd.Context(), in) if err != nil { return err } @@ -1444,22 +5192,25 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/targets") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-fix-by-id ", - Short: "Post DAST Pentest Finding AutoFix", - Long: "Request body (JSON) fields: assignees (array), force (boolean), message (string), originCampaignId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-targets-validate", + Short: "Validate Targets", + Long: "Request body (JSON) fields: targetIds (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestFindingsFindingIdAutofixFixInput{} + in := api.CreateDastTargetsValidateInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1489,8 +5240,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.FindingID = args[0] - out, err := client.CreateDastPentestFindingsFindingIdAutofixFix(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastTargetsValidate(cmd.Context(), in) if err != nil { return err } @@ -1502,6 +5260,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/targets/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1509,8 +5269,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-state ", - Short: "Get DAST Pentest Finding Autofix State", + Use: "delete-targets ", + Short: "Delete Target", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1518,9 +5278,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestFindingsFindingIdAutofixStateInput{} - in.FindingID = args[0] - out, err := client.ListDastPentestFindingsFindingIdAutofixState(cmd.Context(), in) + in := api.DeleteDastTargetsTargetIdInput{} + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastTargetsTargetId(cmd.Context(), in) if err != nil { return err } @@ -1532,13 +5300,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/targets/{targetId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-status ", - Short: "Get DAST Pentest Finding Autofix Status", + Use: "get-targets ", + Short: "Get Target", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1546,9 +5316,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestFindingsFindingIdAutofixStatusInput{} - in.FindingID = args[0] - out, err := client.ListDastPentestFindingsFindingIdAutofixStatus(cmd.Context(), in) + in := api.GetDastTargetsTargetIdInput{} + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastTargetsTargetId(cmd.Context(), in) if err != nil { return err } @@ -1560,13 +5338,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/targets/{targetId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-pentest-findings-events ", - Short: "Get Pentest Finding Events", + Use: "update-targets ", + Short: "Update Target", + Long: "Request body (JSON) fields: description (string), hostname (string, required), isProd (boolean), name (string), port (integer), protocol (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1574,37 +5355,46 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestFindingsFindingIdEventsInput{} - in.FindingID = args[0] - out, err := client.ListDastPentestFindingsFindingIdEvents(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + in := api.UpdateDastTargetsTargetIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-full ", - Short: "Get Pentest Finding Full", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListDastPentestFindingsFindingIdFullInput{} - in.FindingID = args[0] - out, err := client.ListDastPentestFindingsFindingIdFull(cmd.Context(), in) + out, err := client.UpdateDastTargetsTargetId(cmd.Context(), in) if err != nil { return err } @@ -1616,14 +5406,18 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/targets/{targetId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-ticket-by-id ", - Short: "Create Jira Ticket for Pentest Finding", - Long: "Request body (JSON) fields: assignees (array), campaignId (string), campaignTitle (string), message (string), project (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "update-classification ", + Short: "Create Interactor []", + Long: "Request body (JSON) fields: classification (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1631,7 +5425,7 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestFindingsFindingIdTicketInput{} + in := api.UpdateDastTargetsTargetIdClassificationInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1661,8 +5455,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.FindingID = args[0] - out, err := client.CreateDastPentestFindingsFindingIdTicket(cmd.Context(), in) + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateDastTargetsTargetIdClassification(cmd.Context(), in) if err != nil { return err } @@ -1674,6 +5476,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/targets/{targetId}/classification") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1681,8 +5485,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-pentest-findings-triage ", - Short: "Get Pentest Finding Full", + Use: "delete-exploit-validation-consent ", + Short: "Revoke Exploit Validation Write Risk", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1690,9 +5494,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestFindingsFindingIdTriageInput{} - in.FindingID = args[0] - out, err := client.ListDastPentestFindingsFindingIdTriage(cmd.Context(), in) + in := api.DeleteDastTargetsTargetIdExploitValidationConsentInput{} + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastTargetsTargetIdExploitValidationConsent(cmd.Context(), in) if err != nil { return err } @@ -1704,14 +5516,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/targets/{targetId}/exploit-validation-consent") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-unallowlist-by-id ", - Short: "Unallowlist Pentest Finding", - Long: "Request body (JSON) fields: unallowlistReason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "get-exploit-validation-consent ", + Short: "Get Exploit Validation Consent", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1719,7 +5532,46 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestFindingsFindingIdUnallowlistInput{} + in := api.ListDastTargetsTargetIdExploitValidationConsentInput{} + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastTargetsTargetIdExploitValidationConsent(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/targets/{targetId}/exploit-validation-consent") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-exploit-validation-consent ", + Short: "Accept Exploit Validation Write Risk", + Long: "Request body (JSON) fields: endpoint (string, required), evidence (string), onBehalfOf (string), warningVersion (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateDastTargetsTargetIdExploitValidationConsentInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1749,34 +5601,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.FindingID = args[0] - data, err := client.CreateDastPentestFindingsFindingIdUnallowlist(cmd.Context(), in) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-preflights ", - Short: "Get Pentest Preflight", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.GetDastPentestPreflightsPreflightIdInput{} - in.PreflightID = args[0] - out, err := client.GetDastPentestPreflightsPreflightId(cmd.Context(), in) + out, err := client.UpdateDastTargetsTargetIdExploitValidationConsent(cmd.Context(), in) if err != nil { return err } @@ -1788,13 +5622,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/targets/{targetId}/exploit-validation-consent") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-pentest-preflights-events ", - Short: "Get Pentest Preflight Events", + Use: "create-targets-validate-by-id ", + Short: "Validate Target", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1802,25 +5640,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestPreflightsPreflightIdEventsInput{} - in.PreflightID = args[0] - if v, _ := cmd.Flags().GetString("after-seq"); v != "" { + in := api.CreateDastTargetsTargetIdValidateInput{} + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { if n, err := strconv.ParseInt(v, 10, 64); err != nil { - return fmt.Errorf("afterSeq"+": %w", err) + return fmt.Errorf("githubInstallationId"+": %w", err) } else { x := n - in.AfterSeq = &x - } - } - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) - } else { - x := int(n) - in.Limit = &x + in.GithubInstallationID = &x } } - out, err := client.ListDastPentestPreflightsPreflightIdEvents(cmd.Context(), in) + out, err := client.CreateDastTargetsTargetIdValidate(cmd.Context(), in) if err != nil { return err } @@ -1832,22 +5662,32 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("after-seq", "", "") - cmd.Flags().String("limit", "", "") + setRoute(cmd, "POST /dast/targets/{targetId}/validate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-pentest-scans", - Short: "Get Pentest Scans", + Use: "get-targets-validations ", + Short: "Target Validation History", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastPentestScansInput{} + in := api.ListDastTargetsTargetIdValidationsInput{} + in.TargetID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1860,7 +5700,7 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.NextToken = &x } - out, err := client.ListDastPentestScans(cmd.Context(), in) + out, err := client.ListDastTargetsTargetIdValidations(cmd.Context(), in) if err != nil { return err } @@ -1872,6 +5712,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/targets/{targetId}/validations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) @@ -1879,46 +5721,36 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-pentest-scans ", - Short: "Get Pentest Scan", - Args: cobra.ExactArgs(1), + Use: "list-web-services", + Short: "List Web Services", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetDastPentestScansScanIdInput{} - in.ScanID = args[0] - out, err := client.GetDastPentestScansScanId(cmd.Context(), in) - if err != nil { - return err + in := api.ListDastWebServicesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - data, err := json.Marshal(out) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-pentest-scans-findings ", - Short: "Get Pentest Scan Findings", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x } - in := api.ListDastPentestScansScanIdFindingsInput{} - in.ScanID = args[0] - out, err := client.ListDastPentestScansScanIdFindings(cmd.Context(), in) + out, err := client.ListDastWebServices(cmd.Context(), in) if err != nil { return err } @@ -1930,23 +5762,63 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/web-services") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-hypotheses ", - Short: "Get Auth Matrix Hypotheses", - Args: cobra.ExactArgs(1), + Use: "create-web-services", + Short: "Create Web Service", + Long: "Request body (JSON) fields: apiType (object), credentialIds (array), description (string), name (string), projectId (string), repoPath (string), repositoryId (string), targets (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastPentestScansScanIdHypothesesInput{} - in.ScanID = args[0] - out, err := client.ListDastPentestScansScanIdHypotheses(cmd.Context(), in) + in := api.CreateDastWebServicesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastWebServices(cmd.Context(), in) if err != nil { return err } @@ -1958,13 +5830,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/web-services") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-pentest-scans-logs ", - Short: "Get Sub-Agent Network Log", + Use: "delete-web-services ", + Short: "Delete Web Service", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1972,9 +5848,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestScansScanIdLogsInput{} - in.ScanID = args[0] - out, err := client.ListDastPentestScansScanIdLogs(cmd.Context(), in) + in := api.DeleteDastWebServicesWebServiceIdInput{} + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastWebServicesWebServiceId(cmd.Context(), in) if err != nil { return err } @@ -1986,13 +5870,15 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/web-services/{webServiceId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-report ", - Short: "Get Pentest Scan Report", + Use: "get-web-services ", + Short: "Get Web Service", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -2000,9 +5886,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestScansScanIdReportInput{} - in.ScanID = args[0] - out, err := client.ListDastPentestScansScanIdReport(cmd.Context(), in) + in := api.GetDastWebServicesWebServiceIdInput{} + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetDastWebServicesWebServiceId(cmd.Context(), in) if err != nil { return err } @@ -2014,13 +5908,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/web-services/{webServiceId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-download ", - Short: "Get Pentest Scan Report Download URL", + Use: "update-web-services ", + Short: "Update Web Service", + Long: "Request body (JSON) fields: apiType (object), credentialIds (array), description (string), name (string), projectId (string), repoPath (string), repositoryId (string), targets (array, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -2028,9 +5925,46 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestScansScanIdReportDownloadInput{} - in.ScanID = args[0] - out, err := client.ListDastPentestScansScanIdReportDownload(cmd.Context(), in) + in := api.UpdateDastWebServicesWebServiceIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateDastWebServicesWebServiceId(cmd.Context(), in) if err != nil { return err } @@ -2042,13 +5976,18 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /dast/web-services/{webServiceId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-pentest-scans-report-external-pdf ", - Short: "Get Pentest Scan External Report PDF", + Use: "create-access-validation-by-id ", + Short: "Validate Web Service Access", + Long: "Request body (JSON) fields: credentialId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -2056,9 +5995,46 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestScansScanIdReportExternalPdfInput{} - in.ScanID = args[0] - out, err := client.ListDastPentestScansScanIdReportExternalPdf(cmd.Context(), in) + in := api.CreateDastWebServicesWebServiceIdAccessValidationInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastWebServicesWebServiceIdAccessValidation(cmd.Context(), in) if err != nil { return err } @@ -2070,13 +6046,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/web-services/{webServiceId}/access-validation") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-pentest-scans-report-pdf ", - Short: "Get Pentest Scan Report PDF", + Use: "get-access-validations ", + Short: "Web Service Access Validation History", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -2084,9 +6064,29 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListDastPentestScansScanIdReportPdfInput{} - in.ScanID = args[0] - out, err := client.ListDastPentestScansScanIdReportPdf(cmd.Context(), in) + in := api.ListDastWebServicesWebServiceIdAccessValidationsInput{} + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListDastWebServicesWebServiceIdAccessValidations(cmd.Context(), in) if err != nil { return err } @@ -2098,13 +6098,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/web-services/{webServiceId}/access-validations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-pentest-scans-stop-by-id ", - Short: "Stop Pentest Scan", + Use: "get-web-services-credentials ", + Short: "List Web Service Credentials", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -2112,9 +6116,17 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestScansScanIdStopInput{} - in.ScanID = args[0] - out, err := client.CreateDastPentestScansScanIdStop(cmd.Context(), in) + in := api.ListDastWebServicesWebServiceIdCredentialsInput{} + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListDastWebServicesWebServiceIdCredentials(cmd.Context(), in) if err != nil { return err } @@ -2126,21 +6138,24 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/web-services/{webServiceId}/credentials") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-start", - Short: "Start Pentest Scan from Application", - Long: "Request body (JSON) fields: applicationId (string, required), configOverrides (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-credentials-by-id ", + Short: "Map Credential to Web Service", + Long: "Request body (JSON) fields: credentialId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateDastPentestStartInput{} + in := api.CreateDastWebServicesWebServiceIdCredentialsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2170,7 +6185,16 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateDastPentestStart(cmd.Context(), in) + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastWebServicesWebServiceIdCredentials(cmd.Context(), in) if err != nil { return err } @@ -2182,6 +6206,8 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/web-services/{webServiceId}/credentials") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2189,16 +6215,27 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-last", - Short: "Get Pentest Last Scan Status", + Use: "delete-web-services-credentials ", + Short: "Unmap Credential from Web Service", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastScansStatusLastInput{} - out, err := client.ListDastScansStatusLast(cmd.Context(), in) + in := api.DeleteDastWebServicesWebServiceIdCredentialsCredentialIdInput{} + in.WebServiceID = args[0] + in.CredentialID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteDastWebServicesWebServiceIdCredentialsCredentialId(cmd.Context(), in) if err != nil { return err } @@ -2210,21 +6247,83 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /dast/web-services/{webServiceId}/credentials/{credentialId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-sourceips", - Short: "Get Source IPs", + Use: "create-status-validation-by-id ", + Short: "Validate Web Service Status", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListDastSourceipsInput{} - out, err := client.ListDastSourceips(cmd.Context(), in) + in := api.CreateDastWebServicesWebServiceIdStatusValidationInput{} + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateDastWebServicesWebServiceIdStatusValidation(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /dast/web-services/{webServiceId}/status-validation") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-status-validations ", + Short: "Web Service Status Validation History", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListDastWebServicesWebServiceIdStatusValidationsInput{} + in.WebServiceID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListDastWebServicesWebServiceIdStatusValidations(cmd.Context(), in) if err != nil { return err } @@ -2236,6 +6335,10 @@ func RegisterDastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /dast/web-services/{webServiceId}/status-validations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) } diff --git a/internal/commands/findings.go b/internal/commands/findings.go new file mode 100644 index 0000000..b72e04d --- /dev/null +++ b/internal/commands/findings.go @@ -0,0 +1,139 @@ +// Code generated by scripts/generate/main.go. DO NOT EDIT. +package commands + +import ( + "encoding/json" + "fmt" + "os" + "strconv" + "strings" + + "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/api/models" + "github.com/nullify-platform/cli/internal/output" + "github.com/spf13/cobra" +) + +var _ = json.Marshal +var _ = fmt.Errorf +var _ = os.Stdin +var _ = strconv.Atoi +var _ = strings.Split +var _ = models.RequestScope{} + +func RegisterFindingsCommands(parent *cobra.Command, getClient ClientFactory) { + serviceCmd := &cobra.Command{ + Use: "findings", + Short: "Findings across all scanner types (feedback)", + } + parent.AddCommand(serviceCmd) + + { + cmd := &cobra.Command{ + Use: "get-feedback ", + Short: "List feedback on a finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListFindingsFindingIdFeedbackInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListFindingsFindingIdFeedback(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /findings/{findingId}/feedback") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-feedback-by-id ", + Short: "Record feedback on a finding", + Long: "Request body (JSON) fields: commentText (string), findingType (string), verdict (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateFindingsFindingIdFeedbackInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateFindingsFindingIdFeedback(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /findings/{findingId}/feedback") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + +} diff --git a/internal/commands/infrastructure.go b/internal/commands/infrastructure.go deleted file mode 100644 index e94b59e..0000000 --- a/internal/commands/infrastructure.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by scripts/generate/main.go. DO NOT EDIT. -package commands - -import ( - "encoding/json" - "fmt" - "os" - "strconv" - "strings" - - "github.com/nullify-platform/cli/internal/api" - "github.com/nullify-platform/cli/internal/api/models" - "github.com/nullify-platform/cli/internal/output" - "github.com/spf13/cobra" -) - -var _ = json.Marshal -var _ = fmt.Errorf -var _ = os.Stdin -var _ = strconv.Atoi -var _ = strings.Split -var _ = models.RequestScope{} - -func RegisterInfrastructureCommands(parent *cobra.Command, getClient ClientFactory) { - serviceCmd := &cobra.Command{ - Use: "infrastructure", - Short: "Infrastructure Graphs", - } - parent.AddCommand(serviceCmd) - - { - cmd := &cobra.Command{ - Use: "list-graphs", - Short: "List Infrastructure Graphs", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListInfrastructureGraphsInput{} - out, err := client.ListInfrastructureGraphs(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-info", - Short: "Get Infrastructure Graph Info", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListInfrastructureGraphsInfoInput{} - out, err := client.ListInfrastructureGraphsInfo(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-summary", - Short: "Get Infrastructure Graph Summary", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListInfrastructureGraphsSummaryInput{} - out, err := client.ListInfrastructureGraphsSummary(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-graphs ", - Short: "Get Infrastructure Graph", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.GetInfrastructureGraphsAccountIdInput{} - in.AccountID = args[0] - out, err := client.GetInfrastructureGraphsAccountId(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-download ", - Short: "Get Infrastructure Graph Download URL", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListInfrastructureGraphsAccountIdDownloadInput{} - in.AccountID = args[0] - out, err := client.ListInfrastructureGraphsAccountIdDownload(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-graphs-versions ", - Short: "List Infrastructure Graph Versions", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListInfrastructureGraphsAccountIdVersionsInput{} - in.AccountID = args[0] - out, err := client.ListInfrastructureGraphsAccountIdVersions(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-graphs-versions-2 ", - Short: "Get Infrastructure Graph Version", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListInfrastructureGraphsAccountIdVersionsVersionInput{} - in.AccountID = args[0] - in.Version = args[1] - out, err := client.ListInfrastructureGraphsAccountIdVersionsVersion(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - -} diff --git a/internal/commands/manager.go b/internal/commands/manager.go index ea75ab4..c8a1d4c 100644 --- a/internal/commands/manager.go +++ b/internal/commands/manager.go @@ -28,6 +28,951 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } parent.AddCommand(serviceCmd) + { + cmd := &cobra.Command{ + Use: "list-action-items", + Short: "List Action Items", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerActionItemsInput{} + if v, _ := cmd.Flags().GetString("answer-type"); v != "" { + x := string(v) + in.AnswerType = &x + } + if v, _ := cmd.Flags().GetString("finding-id"); v != "" { + x := string(v) + in.FindingID = &x + } + if v, _ := cmd.Flags().GetString("finding-type"); v != "" { + x := string(v) + in.FindingType = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("group-key"); v != "" { + x := string(v) + in.GroupKey = &x + } + if v, _ := cmd.Flags().GetString("kind"); v != "" { + x := string(v) + in.Kind = &x + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x + } + if v, _ := cmd.Flags().GetString("state"); v != "" { + x := string(v) + in.State = &x + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + x := string(v) + in.Status = &x + } + if v, _ := cmd.Flags().GetString("team-id"); v != "" { + x := string(v) + in.TeamID = &x + } + if v, _ := cmd.Flags().GetString("unassigned-only"); v != "" { + b := v == "true" + in.UnassignedOnly = &b + } + out, err := client.ListManagerActionItems(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/action-items") + cmd.Flags().String("answer-type", "", "filter to one answer type, for example yes_no or team_picker") + cmd.Flags().String("finding-id", "", "filter to items linked to this finding; must be paired with findingType") + cmd.Flags().String("finding-type", "", "required when findingId is set") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("group-key", "", "filter to the items of one group") + cmd.Flags().String("kind", "", "") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + cmd.Flags().String("sort", "", "priority (the default) orders by severity, then how long the item has waited, then kind; newest orders by creation time, newest first; completed orders by the time the item was closed, most recent first") + cmd.Flags().String("state", "", "snoozed lists items snoozed until a later date; active lists the rest; waiting lists the active items that are not blocked behind another item") + cmd.Flags().String("status", "", "") + cmd.Flags().String("team-id", "", "") + cmd.Flags().String("unassigned-only", "", "if true, only items with team_id IS NULL (central security)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-summary", + Short: "Action Items Summary", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerActionItemsSummaryInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerActionItemsSummary(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/action-items/summary") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-action-items ", + Short: "Soft-Delete Action Item", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteManagerActionItemsActionItemIdInput{} + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteManagerActionItemsActionItemId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /manager/action-items/{actionItemId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-action-items ", + Short: "Get Action Item", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetManagerActionItemsActionItemIdInput{} + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetManagerActionItemsActionItemId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/action-items/{actionItemId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-action-items ", + Short: "Patch Action Item Team", + Long: "Request body (JSON) fields: teamId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchManagerActionItemsActionItemIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchManagerActionItemsActionItemId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /manager/action-items/{actionItemId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-answer-by-id ", + Short: "Answer Action Item", + Long: "Request body (JSON) fields: answer (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdAnswerInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdAnswer(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/answer") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-assign-repo-by-id ", + Short: "Assign Repository Owner To Action Item", + Long: "Request body (JSON) fields: teamId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdAssignRepoInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdAssignRepo(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/assign-repo") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-assign-team-by-id ", + Short: "Assign Team To Action Item", + Long: "Request body (JSON) fields: teamId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdAssignTeamInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdAssignTeam(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/assign-team") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-chat ", + Short: "Get or create action item chat", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateManagerActionItemsActionItemIdChatInput{} + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateManagerActionItemsActionItemIdChat(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /manager/action-items/{actionItemId}/chat") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-dismiss-by-id ", + Short: "Dismiss Action Item", + Long: "Request body (JSON) fields: classify (string), disposition (string), reason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdDismissInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdDismiss(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/dismiss") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-map-user-by-id ", + Short: "Map User For Action Item", + Long: "Request body (JSON) fields: messageUserId (string), serviceAccount (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdMapUserInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdMapUser(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/map-user") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-messages ", + Short: "Get Action Item Messages", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerActionItemsActionItemIdMessagesInput{} + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-replay"); v != "" { + b := v == "true" + in.IncludeReplay = &b + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + out, err := client.ListManagerActionItemsActionItemIdMessages(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/action-items/{actionItemId}/messages") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-replay", "", "") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-action-items-nudge-by-id ", + Short: "Nudge Escalation Action Item", + Long: "Request body (JSON) fields: message (string), recipientUserId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdNudgeInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdNudge(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/nudge") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-reopen-by-id ", + Short: "Reopen Action Item", + Long: "Request body (JSON) fields: reason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdReopenInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdReopen(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/reopen") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-snooze-by-id ", + Short: "Snooze Action Item", + Long: "Request body (JSON) fields: durationDays (integer, required), reason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerActionItemsActionItemIdSnoozeInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ActionItemID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerActionItemsActionItemIdSnooze(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/action-items/{actionItemId}/snooze") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + { cmd := &cobra.Command{ Use: "list-campaigns", @@ -38,7 +983,1144 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsInput{} + in := api.ListManagerCampaignsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + out, err := client.ListManagerCampaigns(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-campaigns", + Short: "Post Campaign", + Long: "Request body (JSON) fields: createdAfter (string), createdBefore (string), description (string), endDate (string), exploitValidated (boolean), findingIds (array), generatedReasoning (string), isActive (boolean), limitPerType (integer), maxStoryPoints (integer), minPriority (number), noEndDate (boolean), owner (string), prBudgetPerWeek (integer), priorityLabels (array), repositoryIds (array), severityConfidence (array), sortByColumns (string), sortByDirection (string), startDate (string), summary (string), teamIDs (array), title (string), types (array), userNames (array), vulnerabilityCVEIds (array), vulnerabilityCWEIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerCampaignsInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerCampaigns(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/campaigns") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-default", + Short: "Get Default Campaigns", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsDefaultInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerCampaignsDefault(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/default") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-generate", + Short: "Generate Default Campaigns", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerCampaignsDefaultGenerateInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + out, err := client.CreateManagerCampaignsDefaultGenerate(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/campaigns/default/generate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-findings", + Short: "Get All Campaigns Findings", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsFindingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerCampaignsFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-refresh", + Short: "Refresh Campaign Metrics", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsMetricsRefreshInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-expired"); v != "" { + b := v == "true" + in.IncludeExpired = &b + } + out, err := client.ListManagerCampaignsMetricsRefresh(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/metrics/refresh") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-expired", "", "Whether to include expired campaigns in the metrics refresh (default: false)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-previews", + Short: "Get Campaign Previews", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsPreviewsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + out, err := client.ListManagerCampaignsPreviews(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/previews") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of campaign previews to return; overrides pageSize when set") + cmd.Flags().String("offset", "", "Number of campaign previews to skip; overrides page when set") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-summaries", + Short: "Get Campaign Summaries", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsSummariesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + out, err := client.ListManagerCampaignsSummaries(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/summaries") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-campaigns ", + Short: "Delete Campaign", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteManagerCampaignsCampaignIdInput{} + in.CampaignID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + data, err := client.DeleteManagerCampaignsCampaignId(cmd.Context(), in) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /manager/campaigns/{campaignId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-campaigns ", + Short: "Get Campaign by ID", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetManagerCampaignsCampaignIdInput{} + in.CampaignID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetManagerCampaignsCampaignId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/{campaignId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-campaigns ", + Short: "Patch Campaign", + Long: "Request body (JSON) fields: clearExploitValidated (boolean), confirmWholeBacklog (boolean), createdAfter (string), createdBefore (string), description (string), endDate (string), exploitValidated (boolean), findingIds (array), generatedReasoning (string), isActive (boolean), limitPerType (integer), maxStoryPoints (integer), minPriority (number), noEndDate (boolean), owner (string), prBudgetPerWeek (integer), priorityLabels (array), repositoryIds (array), severityConfidence (array), sortByColumns (string), sortByDirection (string), startDate (string), summary (string), teamIDs (array), title (string), types (array), userNames (array), vulnerabilityCVEIds (array), vulnerabilityCWEIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchManagerCampaignsCampaignIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.CampaignID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchManagerCampaignsCampaignId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /manager/campaigns/{campaignId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-campaigns-events ", + Short: "Get Campaign Events", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsCampaignIdEventsInput{} + in.CampaignID = args[0] + if v, _ := cmd.Flags().GetString("action-types"); v != "" { + for _, s := range strings.Split(v, ",") { + in.ActionTypes = append(in.ActionTypes, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } + } + if v, _ := cmd.Flags().GetString("statuses"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Statuses = append(in.Statuses, string(s)) + } + } + out, err := client.ListManagerCampaignsCampaignIdEvents(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/{campaignId}/events") + cmd.Flags().String("action-types", "", "Filter by action types (e.g., PR_CREATE, TICKET_CREATE)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "Page number, 1-indexed (default: 1)") + cmd.Flags().String("page-size", "", "Number of events per page (default: 1000)") + cmd.Flags().String("statuses", "", "Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-findings ", + Short: "Get (Triaged) Findings Associated with a campaign", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsCampaignIdFindingsInput{} + in.CampaignID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerCampaignsCampaignIdFindings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/{campaignId}/findings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-preview ", + Short: "Get Campaign Preview Details", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsCampaignIdPreviewInput{} + in.CampaignID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerCampaignsCampaignIdPreview(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/{campaignId}/preview") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-campaigns-runs ", + Short: "List Campaign Runs", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerCampaignsCampaignIdRunsInput{} + in.CampaignID = args[0] + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int32(n) + in.Offset = &x + } + } + out, err := client.ListManagerCampaignsCampaignIdRuns(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/{campaignId}/runs") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("offset", "", "Number of runs to skip; use instead of cursor to jump to a page") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-campaigns-runs-2 ", + Short: "Get Campaign Run", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetManagerCampaignsCampaignIdRunsRunIdInput{} + in.CampaignID = args[0] + in.RunID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetManagerCampaignsCampaignIdRunsRunId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/campaigns/{campaignId}/runs/{runId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-general", + Short: "Get or create Operator General chat", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateManagerChatGeneralInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateManagerChatGeneral(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /manager/chat/general") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-sessions", + Short: "List Chat Sessions", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerChatSessionsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListManagerChatSessions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/chat/sessions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-sessions ", + Short: "Delete Chat Session", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteManagerChatSessionsChatIDInput{} + in.ChatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteManagerChatSessionsChatID(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /manager/chat/sessions/{chatID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-sessions ", + Short: "Get Chat Session", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetManagerChatSessionsChatIDInput{} + in.ChatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetManagerChatSessionsChatID(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/chat/sessions/{chatID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "patch-sessions ", + Short: "Patch Chat Session", + Long: "Request body (JSON) fields: title (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.PatchManagerChatSessionsChatIDInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ChatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchManagerChatSessionsChatID(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /manager/chat/sessions/{chatID}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-actions ", + Short: "Get Chat Session Actions", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerChatSessionsChatIDActionsInput{} + in.ChatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerChatSessionsChatIDActions(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/chat/sessions/{chatID}/actions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-audit ", + Short: "Get chat session audit trail", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerChatSessionsChatIDAuditInput{} + in.ChatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListManagerChatSessionsChatIDAudit(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/chat/sessions/{chatID}/audit") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-history ", + Short: "Get Chat Session History", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListManagerChatSessionsChatIDHistoryInput{} + in.ChatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-replay"); v != "" { + b := v == "true" + in.IncludeReplay = &b + } if v, _ := cmd.Flags().GetString("page"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("page"+": %w", err) @@ -55,7 +2137,7 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { in.PageSize = &x } } - out, err := client.ListManagerCampaigns(cmd.Context(), in) + out, err := client.ListManagerChatSessionsChatIDHistory(cmd.Context(), in) if err != nil { return err } @@ -67,6 +2149,9 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/chat/sessions/{chatID}/history") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-replay", "", "") cmd.Flags().String("page", "", "") cmd.Flags().String("page-size", "", "") serviceCmd.AddCommand(cmd) @@ -74,16 +2159,52 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-campaigns", - Short: "Post Campaign", - Long: "Request body (JSON) fields: createdAfter (string), createdBefore (string), description (string), endDate (string), findingIds (array), generatedReasoning (string), isActive (boolean), limitPerType (integer), maxStoryPoints (integer), minPriority (number), noEndDate (boolean), owner (string), priorityLabels (array), repositoryNames (array), sortByColumns (string), sortByDirection (string), startDate (string), summary (string), teamIDs (array), teamNames (array), title (string), types (array), userNames (array), vulnerabilityCVEIds (array), vulnerabilityCWEIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "list-config", + Short: "Get Manager config", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerCampaignsInput{} + in := api.ListManagerConfigInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerConfig(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-config", + Short: "Update Manager config", + Long: "Request body (JSON) fields: config (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerConfigInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -113,7 +2234,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateManagerCampaigns(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerConfig(cmd.Context(), in) if err != nil { return err } @@ -125,6 +2254,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -132,16 +2263,54 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-default", - Short: "Get Default Campaigns", + Use: "create-daily-summary-trigger", + Short: "Start a daily summary run", + Long: "Request body (JSON) fields: audience (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsDefaultInput{} - out, err := client.ListManagerCampaignsDefault(cmd.Context(), in) + in := api.CreateManagerDailySummaryTriggerInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerDailySummaryTrigger(cmd.Context(), in) if err != nil { return err } @@ -153,37 +2322,45 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/daily-summary/trigger") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-generate", - Short: "Generate Default Campaigns", + Use: "list-users", + Short: "Get Developer Engagement", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerCampaignsDefaultGenerateInput{} - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } + in := api.ListManagerEngagementUsersInput{} + if v, _ := cmd.Flags().GetString("campaign-id"); v != "" { + x := string(v) + in.CampaignID = &x } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.CreateManagerCampaignsDefaultGenerate(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("since"); v != "" { + x := string(v) + in.Since = &x + } + out, err := client.ListManagerEngagementUsers(cmd.Context(), in) if err != nil { return err } @@ -195,23 +2372,34 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /manager/engagement/users") + cmd.Flags().String("campaign-id", "", "") + cmd.Flags().String("cursor", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("since", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-findings", - Short: "Get All Campaigns Findings", + Use: "list-escalation-recipients", + Short: "Get Escalation Recipients", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsFindingsInput{} - out, err := client.ListManagerCampaignsFindings(cmd.Context(), in) + in := api.ListManagerEscalationRecipientsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerEscalationRecipients(cmd.Context(), in) if err != nil { return err } @@ -223,25 +2411,31 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/escalation-recipients") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-refresh", - Short: "Refresh Campaign Metrics", + Use: "list-escalations-config", + Short: "Get Escalation Config", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsMetricsRefreshInput{} - if v, _ := cmd.Flags().GetString("include-expired"); v != "" { - b := v == "true" - in.IncludeExpired = &b + in := api.ListManagerEscalationsConfigInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListManagerCampaignsMetricsRefresh(cmd.Context(), in) + out, err := client.ListManagerEscalationsConfig(cmd.Context(), in) if err != nil { return err } @@ -253,38 +2447,61 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("include-expired", "", "Whether to include expired campaigns in the metrics refresh (default: false)") + setRoute(cmd, "GET /manager/escalations/config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-previews", - Short: "Get Campaign Previews", + Use: "update-config", + Short: "Put Escalation Config", + Long: "Request body (JSON) fields: escalation (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsPreviewsInput{} - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x + in := api.UpdateManagerEscalationsConfigInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } } } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListManagerCampaignsPreviews(cmd.Context(), in) + out, err := client.UpdateManagerEscalationsConfig(cmd.Context(), in) if err != nil { return err } @@ -296,22 +2513,32 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "PUT /manager/escalations/config") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-summaries", - Short: "Get Campaign Summaries", + Use: "list-events", + Short: "Get Events", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsSummariesInput{} + in := api.ListManagerEventsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("page"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("page"+": %w", err) @@ -328,7 +2555,7 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { in.PageSize = &x } } - out, err := client.ListManagerCampaignsSummaries(cmd.Context(), in) + out, err := client.ListManagerEvents(cmd.Context(), in) if err != nil { return err } @@ -340,6 +2567,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("page", "", "") cmd.Flags().String("page-size", "", "") serviceCmd.AddCommand(cmd) @@ -347,69 +2576,16 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-campaigns ", - Short: "Delete Campaign", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.DeleteManagerCampaignsCampaignIdInput{} - in.CampaignID = args[0] - data, err := client.DeleteManagerCampaignsCampaignId(cmd.Context(), in) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-campaigns ", - Short: "Get Campaign by ID", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.GetManagerCampaignsCampaignIdInput{} - in.CampaignID = args[0] - out, err := client.GetManagerCampaignsCampaignId(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "patch-campaigns ", - Short: "Patch Campaign", - Long: "Request body (JSON) fields: createdAfter (string), createdBefore (string), description (string), endDate (string), findingIds (array), generatedReasoning (string), isActive (boolean), limitPerType (integer), maxStoryPoints (integer), minPriority (number), noEndDate (boolean), owner (string), priorityLabels (array), repositoryNames (array), sortByColumns (string), sortByDirection (string), startDate (string), summary (string), teamIDs (array), teamNames (array), title (string), types (array), userNames (array), vulnerabilityCVEIds (array), vulnerabilityCWEIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-deduplicate", + Short: "Deduplicate Events", + Long: "Request body (JSON) fields: dryRun (boolean), from (string), keep (string), statuses (array), timeoutSeconds (integer), to (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchManagerCampaignsCampaignIdInput{} + in := api.CreateManagerEventsDeduplicateInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -439,8 +2615,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.CampaignID = args[0] - out, err := client.PatchManagerCampaignsCampaignId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerEventsDeduplicate(cmd.Context(), in) if err != nil { return err } @@ -452,6 +2635,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/events/deduplicate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -459,8 +2644,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-campaigns-events ", - Short: "Get Campaign Events", + Use: "delete-events ", + Short: "Delete Event", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -468,35 +2653,17 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsCampaignIdEventsInput{} - in.CampaignID = args[0] - if v, _ := cmd.Flags().GetString("action-types"); v != "" { - for _, s := range strings.Split(v, ",") { - in.ActionTypes = append(in.ActionTypes, string(s)) - } - } - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.DeleteManagerEventsEventIdInput{} + in.EventID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x - } - } - if v, _ := cmd.Flags().GetString("statuses"); v != "" { - for _, s := range strings.Split(v, ",") { - in.Statuses = append(in.Statuses, string(s)) + x := n + in.GithubInstallationID = &x } } - out, err := client.ListManagerCampaignsCampaignIdEvents(cmd.Context(), in) + out, err := client.DeleteManagerEventsEventId(cmd.Context(), in) if err != nil { return err } @@ -508,17 +2675,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("action-types", "", "Filter by action types (e.g., PR_CREATE, TICKET_CREATE)") - cmd.Flags().String("page", "", "Page number, 1-indexed (default: 1)") - cmd.Flags().String("page-size", "", "Number of events per page (default: 1000)") - cmd.Flags().String("statuses", "", "Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR)") + setRoute(cmd, "DELETE /manager/events/{eventId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-findings ", - Short: "Get (Triaged) Findings Associated with a campaign", + Use: "get-findings-events ", + Short: "Get Finding Events", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -526,9 +2691,39 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsCampaignIdFindingsInput{} - in.CampaignID = args[0] - out, err := client.ListManagerCampaignsCampaignIdFindings(cmd.Context(), in) + in := api.ListManagerFindingsFindingIdEventsInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("action-types"); v != "" { + for _, s := range strings.Split(v, ",") { + in.ActionTypes = append(in.ActionTypes, string(s)) + } + } + if v, _ := cmd.Flags().GetString("cursor"); v != "" { + x := string(v) + in.Cursor = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("statuses"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Statuses = append(in.Statuses, string(s)) + } + } + out, err := client.ListManagerFindingsFindingIdEvents(cmd.Context(), in) if err != nil { return err } @@ -540,13 +2735,19 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/findings/{findingId}/events") + cmd.Flags().String("action-types", "", "Filter by action types (e.g., PR_CREATE, TICKET_CREATE)") + cmd.Flags().String("cursor", "", "Pagination cursor from previous request") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of events to return (default 100, max 1000)") + cmd.Flags().String("statuses", "", "Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-preview ", - Short: "Get Campaign Preview Details", + Use: "get-nudge ", + Short: "Preview Fix PR Nudge", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -554,9 +2755,17 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsCampaignIdPreviewInput{} - in.CampaignID = args[0] - out, err := client.ListManagerCampaignsCampaignIdPreview(cmd.Context(), in) + in := api.ListManagerFixPrsRecordIdNudgeInput{} + in.RecordID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerFixPrsRecordIdNudge(cmd.Context(), in) if err != nil { return err } @@ -568,13 +2777,16 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/fix-prs/{recordId}/nudge") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-campaigns-runs ", - Short: "List Campaign Runs", + Use: "create-fix-prs-nudge-by-id ", + Short: "Nudge Fix PR Reviewers", + Long: "Request body (JSON) fields: recipientUserIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -582,21 +2794,46 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListManagerCampaignsCampaignIdRunsInput{} - in.CampaignID = args[0] - if v, _ := cmd.Flags().GetString("cursor"); v != "" { - x := string(v) - in.Cursor = &x + in := api.CreateManagerFixPrsRecordIdNudgeInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } } - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in.RecordID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int32(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListManagerCampaignsCampaignIdRuns(cmd.Context(), in) + out, err := client.CreateManagerFixPrsRecordIdNudge(cmd.Context(), in) if err != nil { return err } @@ -608,26 +2845,33 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("cursor", "", "") - cmd.Flags().String("limit", "", "") + setRoute(cmd, "POST /manager/fix-prs/{recordId}/nudge") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-campaigns-runs-2 ", - Short: "Get Campaign Run", - Args: cobra.ExactArgs(2), + Use: "list-groundrules", + Short: "Get Manager ground rules", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetManagerCampaignsCampaignIdRunsRunIdInput{} - in.CampaignID = args[0] - in.RunID = args[1] - out, err := client.GetManagerCampaignsCampaignIdRunsRunId(cmd.Context(), in) + in := api.ListManagerGroundrulesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerGroundrules(cmd.Context(), in) if err != nil { return err } @@ -639,33 +2883,61 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/groundrules") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-sessions", - Short: "List Chat Sessions", + Use: "patch-groundrules", + Short: "Patch a GroundRules object", + Long: "Request body (JSON) fields: groundRules (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerChatSessionsInput{} - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) - } else { - x := int(n) - in.Limit = &x + in := api.PatchManagerGroundrulesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - out, err := client.ListManagerChatSessions(cmd.Context(), in) + out, err := client.PatchManagerGroundrules(cmd.Context(), in) if err != nil { return err } @@ -677,25 +2949,63 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") + setRoute(cmd, "PATCH /manager/groundrules") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-sessions ", - Short: "Delete Chat Session", - Args: cobra.ExactArgs(1), + Use: "create-groundrules", + Short: "Post a GroundRules object", + Long: "Request body (JSON) fields: expectedUpdatedAt (string), groundRules (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteManagerChatSessionsChatIDInput{} - in.ChatID = args[0] - out, err := client.DeleteManagerChatSessionsChatID(cmd.Context(), in) + in := api.CreateManagerGroundrulesInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerGroundrules(cmd.Context(), in) if err != nil { return err } @@ -707,23 +3017,37 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/groundrules") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-sessions ", - Short: "Get Chat Session", - Args: cobra.ExactArgs(1), + Use: "list-identity-classifications", + Short: "List Git Identity Classifications", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.GetManagerChatSessionsChatIDInput{} - in.ChatID = args[0] - out, err := client.GetManagerChatSessionsChatID(cmd.Context(), in) + in := api.ListManagerIdentityClassificationsInput{} + if v, _ := cmd.Flags().GetString("decision"); v != "" { + x := string(v) + in.Decision = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerIdentityClassifications(cmd.Context(), in) if err != nil { return err } @@ -735,22 +3059,24 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/identity-classifications") + cmd.Flags().String("decision", "", "service_account or no_chat_account; empty lists both") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-sessions ", - Short: "Patch Chat Session", - Long: "Request body (JSON) fields: title (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "create-identity-classifications", + Short: "Classify Git Identity", + Long: "Request body (JSON) fields: decision (string, required), provider (object, required), providerUserId (string, required), reason (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchManagerChatSessionsChatIDInput{} + in := api.CreateManagerIdentityClassificationsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -780,8 +3106,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.ChatID = args[0] - out, err := client.PatchManagerChatSessionsChatID(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerIdentityClassifications(cmd.Context(), in) if err != nil { return err } @@ -793,6 +3126,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/identity-classifications") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -800,18 +3135,31 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-actions ", - Short: "Get Chat Session Actions", - Args: cobra.ExactArgs(1), + Use: "delete-identity-classifications ", + Short: "Revoke Git Identity Classification", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerChatSessionsChatIDActionsInput{} - in.ChatID = args[0] - out, err := client.ListManagerChatSessionsChatIDActions(cmd.Context(), in) + in := api.DeleteManagerIdentityClassificationsProviderProviderUserIdInput{} + in.Provider = args[0] + in.ProviderUserID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("reason"); v != "" { + x := string(v) + in.Reason = &x + } + out, err := client.DeleteManagerIdentityClassificationsProviderProviderUserId(cmd.Context(), in) if err != nil { return err } @@ -823,35 +3171,103 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /manager/identity-classifications/{provider}/{providerUserId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("reason", "", "why the classification is being undone; recorded in the audit row") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-audit ", - Short: "Get chat session audit trail", - Args: cobra.ExactArgs(1), + Use: "list-metrics", + Short: "Get Metrics", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerChatSessionsChatIDAuditInput{} - in.ChatID = args[0] - if v, _ := cmd.Flags().GetString("limit"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + in := api.ListManagerMetricsInput{} + if v, _ := cmd.Flags().GetString("as-of"); v != "" { + x := string(v) + in.AsOf = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.Limit = &x + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("next-token"); v != "" { - x := string(v) - in.NextToken = &x + out, err := client.ListManagerMetrics(cmd.Context(), in) + if err != nil { + return err } - out, err := client.ListManagerChatSessionsChatIDAudit(cmd.Context(), in) + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/metrics") + cmd.Flags().String("as-of", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-wizard-progress", + Short: "Onboarding Wizard Progress", + Long: "Request body (JSON) fields: detail (string), step (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateManagerOnboardingWizardProgressInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerOnboardingWizardProgress(cmd.Context(), in) if err != nil { return err } @@ -863,24 +3279,36 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "") - cmd.Flags().String("next-token", "", "") + setRoute(cmd, "POST /manager/onboarding/wizard-progress") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-history ", - Short: "Get Chat Session History", - Args: cobra.ExactArgs(1), + Use: "list-plans", + Short: "Get Plans", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerChatSessionsChatIDHistoryInput{} - in.ChatID = args[0] + in := api.ListManagerPlansInput{} + if v, _ := cmd.Flags().GetString("campaign-id"); v != "" { + x := string(v) + in.CampaignID = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("page"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("page"+": %w", err) @@ -897,7 +3325,7 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { in.PageSize = &x } } - out, err := client.ListManagerChatSessionsChatIDHistory(cmd.Context(), in) + out, err := client.ListManagerPlans(cmd.Context(), in) if err != nil { return err } @@ -909,6 +3337,9 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/plans") + cmd.Flags().String("campaign-id", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("page", "", "") cmd.Flags().String("page-size", "", "") serviceCmd.AddCommand(cmd) @@ -916,16 +3347,24 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-config", - Short: "Get Manager config", + Use: "list-program", + Short: "Get Security Program", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerConfigInput{} - out, err := client.ListManagerConfig(cmd.Context(), in) + in := api.ListManagerProgramInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerProgram(cmd.Context(), in) if err != nil { return err } @@ -937,21 +3376,23 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/program") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-config", - Short: "Update Manager config", - Long: "Request body (JSON) fields: config (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "patch-program", + Short: "State Security Program", + Long: "Request body (JSON) fields: announceWindowDays (integer, required), autonomy (string, required), capacityPerWeek (integer), defaultCampaignDays (integer, required), maxConcurrentCampaigns (integer, required), minCoveragePerGoal (integer, required), reviewCadenceDays (integer, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerConfigInput{} + in := api.PatchManagerProgramInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -981,7 +3422,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateManagerConfig(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchManagerProgram(cmd.Context(), in) if err != nil { return err } @@ -993,6 +3442,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /manager/program") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1000,16 +3451,24 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-credits", - Short: "Get Manager credit balance", + Use: "list-proposals", + Short: "List Open Proposals", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerCreditsInput{} - out, err := client.ListManagerCredits(cmd.Context(), in) + in := api.ListManagerProposalsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerProposals(cmd.Context(), in) if err != nil { return err } @@ -1021,21 +3480,23 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/proposals") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-credits", - Short: "Update Manager credit balance", - Long: "Request body (JSON) fields: credits (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-proposals-decision", + Short: "Decide Proposed Campaign", + Long: "Request body (JSON) fields: decision (string, required), proposalId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerCreditsInput{} + in := api.CreateManagerProposalsDecisionInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1065,7 +3526,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateManagerCredits(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerProposalsDecision(cmd.Context(), in) if err != nil { return err } @@ -1077,6 +3546,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/proposals/decision") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1084,16 +3555,26 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-customer-questions", - Short: "Delete All Customer Question Sets", + Use: "get-runs ", + Short: "Get Manager Run", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteManagerCustomerQuestionsInput{} - out, err := client.DeleteManagerCustomerQuestions(cmd.Context(), in) + in := api.GetManagerRunsRunIdInput{} + in.RunID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetManagerRunsRunId(cmd.Context(), in) if err != nil { return err } @@ -1105,37 +3586,31 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/runs/{runId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-customer-questions", - Short: "List Customer Question Sets", + Use: "list-state", + Short: "Get Manager State", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerCustomerQuestionsInput{} - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.ListManagerStateInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListManagerCustomerQuestions(cmd.Context(), in) + out, err := client.ListManagerState(cmd.Context(), in) if err != nil { return err } @@ -1147,53 +3622,31 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /manager/state") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "delete-customer-questions-2 ", - Short: "Delete Customer Question Set", - Args: cobra.ExactArgs(1), + Use: "list-latest", + Short: "Get Manager State (Legacy)", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteManagerCustomerQuestionsQuestionSetIdInput{} - in.QuestionSetID = args[0] - out, err := client.DeleteManagerCustomerQuestionsQuestionSetId(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-customer-questions ", - Short: "Get Customer Question Set", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in := api.ListManagerStateLatestInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.GetManagerCustomerQuestionsQuestionSetIdInput{} - in.QuestionSetID = args[0] - out, err := client.GetManagerCustomerQuestionsQuestionSetId(cmd.Context(), in) + out, err := client.ListManagerStateLatest(cmd.Context(), in) if err != nil { return err } @@ -1205,85 +3658,47 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/state/latest") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-answers ", - Short: "Submit Question Answer", - Long: "Request body (JSON) fields: answer (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(2), + Use: "list-states", + Short: "Get Manager States", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionIdInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) - } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) - } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) - } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } + in := api.ListManagerStatesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } } - in.QuestionSetID = args[0] - in.QuestionID = args[1] - out, err := client.PatchManagerCustomerQuestionsQuestionSetIdAnswersQuestionId(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x + } } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "delete-questions ", - Short: "Delete Customer Question", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x + } } - in := api.DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionIdInput{} - in.QuestionSetID = args[0] - in.QuestionID = args[1] - out, err := client.DeleteManagerCustomerQuestionsQuestionSetIdQuestionsQuestionId(cmd.Context(), in) + out, err := client.ListManagerStates(cmd.Context(), in) if err != nil { return err } @@ -1295,37 +3710,33 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/states") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-escalations", - Short: "Get Escalations", + Use: "list-strategy", + Short: "Get Active Strategy", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerEscalationsInput{} - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.ListManagerStrategyInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListManagerEscalations(cmd.Context(), in) + out, err := client.ListManagerStrategy(cmd.Context(), in) if err != nil { return err } @@ -1337,24 +3748,23 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /manager/strategy") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-escalations ", - Short: "Patch Escalation", - Long: "Request body (JSON) fields: reasoning (string), status (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "patch-strategy", + Short: "Patch Active Strategy", + Long: "Request body (JSON) fields: quarters (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchManagerEscalationsEscalationIdInput{} + in := api.PatchManagerStrategyInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1384,8 +3794,19 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.EscalationID = args[0] - data, err := client.PatchManagerEscalationsEscalationId(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchManagerStrategy(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) if err != nil { return err } @@ -1393,6 +3814,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /manager/strategy") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1400,32 +3823,24 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-events", - Short: "Get Events", + Use: "list-proposal", + Short: "Get Proposed Strategy", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerEventsInput{} - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.ListManagerStrategyProposalInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListManagerEvents(cmd.Context(), in) + out, err := client.ListManagerStrategyProposal(cmd.Context(), in) if err != nil { return err } @@ -1437,23 +3852,23 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /manager/strategy/proposal") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-deduplicate", - Short: "Deduplicate Events", - Long: "Request body (JSON) fields: dryRun (boolean), from (string), keep (string), statuses (array), timeoutSeconds (integer), to (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-strategy-proposal-decision", + Short: "Decide Proposed Strategy", + Long: "Request body (JSON) fields: decision (string, required), strategyId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerEventsDeduplicateInput{} + in := api.CreateManagerStrategyProposalDecisionInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1483,7 +3898,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateManagerEventsDeduplicate(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerStrategyProposalDecision(cmd.Context(), in) if err != nil { return err } @@ -1495,6 +3918,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/strategy/proposal/decision") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1502,18 +3927,24 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "delete-events ", - Short: "Delete Event", - Args: cobra.ExactArgs(1), + Use: "create-strategy-trigger", + Short: "Trigger Strategy Generation", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.DeleteManagerEventsEventIdInput{} - in.EventID = args[0] - out, err := client.DeleteManagerEventsEventId(cmd.Context(), in) + in := api.CreateManagerStrategyTriggerInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerStrategyTrigger(cmd.Context(), in) if err != nil { return err } @@ -1525,45 +3956,47 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/strategy/trigger") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-findings-events ", - Short: "Get Finding Events", - Args: cobra.ExactArgs(1), + Use: "list-versions", + Short: "List Strategy Versions", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerFindingsFindingIdEventsInput{} - in.FindingID = args[0] - if v, _ := cmd.Flags().GetString("action-types"); v != "" { - for _, s := range strings.Split(v, ",") { - in.ActionTypes = append(in.ActionTypes, string(s)) + in := api.ListManagerStrategyVersionsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } } - if v, _ := cmd.Flags().GetString("cursor"); v != "" { - x := string(v) - in.Cursor = &x - } - if v, _ := cmd.Flags().GetString("limit"); v != "" { + if v, _ := cmd.Flags().GetString("page"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("limit"+": %w", err) + return fmt.Errorf("page"+": %w", err) } else { x := int(n) - in.Limit = &x + in.Page = &x } } - if v, _ := cmd.Flags().GetString("statuses"); v != "" { - for _, s := range strings.Split(v, ",") { - in.Statuses = append(in.Statuses, string(s)) + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x } } - out, err := client.ListManagerFindingsFindingIdEvents(cmd.Context(), in) + out, err := client.ListManagerStrategyVersions(cmd.Context(), in) if err != nil { return err } @@ -1575,25 +4008,33 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("action-types", "", "Filter by action types (e.g., PR_CREATE, TICKET_CREATE)") - cmd.Flags().String("cursor", "", "Pagination cursor from previous request") - cmd.Flags().String("limit", "", "Maximum number of events to return (default 100, max 1000)") - cmd.Flags().String("statuses", "", "Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR)") + setRoute(cmd, "GET /manager/strategy/versions") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-groundrules", - Short: "Get Manager ground rules", + Use: "create-tacit-knowledge-trigger", + Short: "Trigger TacitKnowledge", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerGroundrulesInput{} - out, err := client.ListManagerGroundrules(cmd.Context(), in) + in := api.CreateManagerTacitKnowledgeTriggerInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerTacitKnowledgeTrigger(cmd.Context(), in) if err != nil { return err } @@ -1605,51 +4046,87 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/tacit-knowledge/trigger") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-groundrules", - Short: "Patch a GroundRules object to S3", - Long: "Request body (JSON) fields: groundRules (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "list-threat-investigations", + Short: "Get Threat Investigations", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchManagerGroundrulesInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) + in := api.ListManagerThreatInvestigationsInput{} + if v, _ := cmd.Flags().GetString("affected-only"); v != "" { + b := v == "true" + in.AffectedOnly = &b + } + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) + } + if v, _ := cmd.Flags().GetString("page"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("page"+": %w", err) + } else { + x := int(n) + in.Page = &x } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } + } + if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("pageSize"+": %w", err) + } else { + x := int(n) + in.PageSize = &x } } - out, err := client.PatchManagerGroundrules(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("search"); v != "" { + x := string(v) + in.Search = &x + } + if v, _ := cmd.Flags().GetString("severity"); v != "" { + x := string(v) + in.Severity = &x + } + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x + } + if v, _ := cmd.Flags().GetString("status"); v != "" { + x := string(v) + in.Status = &x + } + out, err := client.ListManagerThreatInvestigations(cmd.Context(), in) if err != nil { return err } @@ -1661,23 +4138,33 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + setRoute(cmd, "GET /manager/threat-investigations") + cmd.Flags().String("affected-only", "", "Only investigations with at least one affected repository") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of investigations to return; overrides pageSize when set") + cmd.Flags().String("offset", "", "Number of investigations to skip; overrides page when set") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + cmd.Flags().String("search", "", "Case-insensitive title, CVE, package or ecosystem substring") + cmd.Flags().String("severity", "", "") + cmd.Flags().String("sort", "", "recent (default) or affected: most affected repositories first") + cmd.Flags().String("status", "", "Case-insensitive status: PENDING, INVESTIGATING, INVESTIGATED, REMEDIATING, RESOLVED, FAILED, NEEDS_REINVESTIGATION or WITHDRAWN") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-groundrules", - Short: "Post a GroundRules object to S3", - Long: "Request body (JSON) fields: groundRules (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-threat-investigations", + Short: "Post Threat Investigation", + Long: "Request body (JSON) fields: advice (string), affectedPackages (array), articleLinks (array), cveIds (array), cvss (number), description (string), ecosystem (string), keywords (string), severity (string), title (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerGroundrulesInput{} + in := api.CreateManagerThreatInvestigationsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1707,7 +4194,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.CreateManagerGroundrules(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerThreatInvestigations(cmd.Context(), in) if err != nil { return err } @@ -1719,6 +4214,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/threat-investigations") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1726,62 +4223,46 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-metrics", - Short: "Get Metrics", + Use: "get-threat-investigations ", + Short: "Get Threat Investigation", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerMetricsInput{} - out, err := client.ListManagerMetrics(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "list-plans", - Short: "Get Plans", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + in := api.GetManagerThreatInvestigationsThreatInvestigationIdInput{} + in.ThreatInvestigationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - in := api.ListManagerPlansInput{} - if v, _ := cmd.Flags().GetString("campaign-id"); v != "" { - x := string(v) - in.CampaignID = &x + if v, _ := cmd.Flags().GetString("include-versions"); v != "" { + b := v == "true" + in.IncludeVersions = &b } - if v, _ := cmd.Flags().GetString("page"); v != "" { + if v, _ := cmd.Flags().GetString("version-limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) + return fmt.Errorf("versionLimit"+": %w", err) } else { x := int(n) - in.Page = &x + in.VersionLimit = &x } } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { + if v, _ := cmd.Flags().GetString("version-offset"); v != "" { if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + return fmt.Errorf("versionOffset"+": %w", err) } else { x := int(n) - in.PageSize = &x + in.VersionOffset = &x } } - out, err := client.ListManagerPlans(cmd.Context(), in) + out, err := client.GetManagerThreatInvestigationsThreatInvestigationId(cmd.Context(), in) if err != nil { return err } @@ -1793,24 +4274,66 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("campaign-id", "", "") - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "GET /manager/threat-investigations/{threatInvestigationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-versions", "", "") + cmd.Flags().String("version-limit", "", "") + cmd.Flags().String("version-offset", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-state", - Short: "Get Manager State", + Use: "patch-threat-investigations ", + Short: "Patch Threat Investigation", + Long: "Request body (JSON) fields: action (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerStateInput{} - out, err := client.ListManagerState(cmd.Context(), in) + in := api.PatchManagerThreatInvestigationsThreatInvestigationIdInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.ThreatInvestigationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.PatchManagerThreatInvestigationsThreatInvestigationId(cmd.Context(), in) if err != nil { return err } @@ -1822,21 +4345,35 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /manager/threat-investigations/{threatInvestigationId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-latest", - Short: "Get Manager State (Legacy)", + Use: "get-progress ", + Short: "Get Threat Investigation Progress", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerStateLatestInput{} - out, err := client.ListManagerStateLatest(cmd.Context(), in) + in := api.ListManagerThreatInvestigationsThreatInvestigationIdProgressInput{} + in.ThreatInvestigationID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListManagerThreatInvestigationsThreatInvestigationIdProgress(cmd.Context(), in) if err != nil { return err } @@ -1848,20 +4385,30 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/threat-investigations/{threatInvestigationId}/progress") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-states", - Short: "Get Manager States", + Use: "list-threat-reports", + Short: "List My Reported Threats", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerStatesInput{} + in := api.ListManagerThreatReportsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("page"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("page"+": %w", err) @@ -1878,7 +4425,7 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { in.PageSize = &x } } - out, err := client.ListManagerStates(cmd.Context(), in) + out, err := client.ListManagerThreatReports(cmd.Context(), in) if err != nil { return err } @@ -1890,6 +4437,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/threat-reports") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("page", "", "") cmd.Flags().String("page-size", "", "") serviceCmd.AddCommand(cmd) @@ -1897,42 +4446,16 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "list-strategy", - Short: "Get Active Strategy", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListManagerStrategyInput{} - out, err := client.ListManagerStrategy(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "patch-strategy", - Short: "Patch Active Strategy", - Long: "Request body (JSON) fields: quarters (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-threat-reports", + Short: "Report a Threat", + Long: "Request body (JSON) fields: advisoryUrl (string), campaign (object), cveId (string), ecosystem (string), packageName (string), requestId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.PatchManagerStrategyInput{} + in := api.CreateManagerThreatReportsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1962,7 +4485,15 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - out, err := client.PatchManagerStrategy(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerThreatReports(cmd.Context(), in) if err != nil { return err } @@ -1974,6 +4505,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/threat-reports") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1981,16 +4514,26 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-strategy-trigger", - Short: "Trigger Strategy Generation", + Use: "get-threat-reports ", + Short: "Get Threat Report Status", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerStrategyTriggerInput{} - out, err := client.CreateManagerStrategyTrigger(cmd.Context(), in) + in := api.GetManagerThreatReportsRequestIdInput{} + in.RequestID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetManagerThreatReportsRequestId(cmd.Context(), in) if err != nil { return err } @@ -2002,37 +4545,33 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/threat-reports/{requestId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-versions", - Short: "List Strategy Versions", + Use: "create-resubmit-by-id ", + Short: "Resubmit a Reported Threat", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerStrategyVersionsInput{} - if v, _ := cmd.Flags().GetString("page"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("page"+": %w", err) - } else { - x := int(n) - in.Page = &x - } - } - if v, _ := cmd.Flags().GetString("page-size"); v != "" { - if n, err := strconv.Atoi(v); err != nil { - return fmt.Errorf("pageSize"+": %w", err) + in := api.CreateManagerThreatReportsRequestIdResubmitInput{} + in.RequestID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) } else { - x := int(n) - in.PageSize = &x + x := n + in.GithubInstallationID = &x } } - out, err := client.ListManagerStrategyVersions(cmd.Context(), in) + out, err := client.CreateManagerThreatReportsRequestIdResubmit(cmd.Context(), in) if err != nil { return err } @@ -2044,23 +4583,33 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") + setRoute(cmd, "POST /manager/threat-reports/{requestId}/resubmit") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-tacit-knowledge-trigger", - Short: "Trigger TacitKnowledge", + Use: "create-withdraw-by-id ", + Short: "Withdraw a Reported Threat", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateManagerTacitKnowledgeTriggerInput{} - out, err := client.CreateManagerTacitKnowledgeTrigger(cmd.Context(), in) + in := api.CreateManagerThreatReportsRequestIdWithdrawInput{} + in.RequestID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerThreatReportsRequestIdWithdraw(cmd.Context(), in) if err != nil { return err } @@ -2072,20 +4621,46 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/threat-reports/{requestId}/withdraw") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-threat-investigations", - Short: "Get Threat Investigations", + Use: "list-threats", + Short: "Get Threat Catalog", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListManagerThreatInvestigationsInput{} + in := api.ListManagerThreatsInput{} + if v, _ := cmd.Flags().GetString("advisory-id"); v != "" { + x := string(v) + in.AdvisoryID = &x + } + if v, _ := cmd.Flags().GetString("cve-id"); v != "" { + x := string(v) + in.CveID = &x + } + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("kind"); v != "" { + x := string(v) + in.Kind = &x + } if v, _ := cmd.Flags().GetString("page"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("page"+": %w", err) @@ -2102,95 +4677,31 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { in.PageSize = &x } } - out, err := client.ListManagerThreatInvestigations(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("published-after"); v != "" { + x := string(v) + in.PublishedAfter = &x } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("page", "", "") - cmd.Flags().String("page-size", "", "") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "create-threat-investigations", - Short: "Post Threat Investigation", - Long: "Request body (JSON) fields: advice (string), affectedPackages (array), articleLinks (array), cveIds (array), cvss (number), description (string), ecosystem (string), keywords (string), severity (string), title (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("published-before"); v != "" { + x := string(v) + in.PublishedBefore = &x } - in := api.CreateManagerThreatInvestigationsInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) - } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) - } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) - } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } - } + if v, _ := cmd.Flags().GetString("q"); v != "" { + x := string(v) + in.Q = &x } - out, err := client.CreateManagerThreatInvestigations(cmd.Context(), in) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("severity"); v != "" { + x := string(v) + in.Severity = &x } - data, err := json.Marshal(out) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - - { - cmd := &cobra.Command{ - Use: "get-threat-investigations ", - Short: "Get Threat Investigation", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err + if v, _ := cmd.Flags().GetString("verdict"); v != "" { + x := string(v) + in.Verdict = &x } - in := api.GetManagerThreatInvestigationsThreatInvestigationIdInput{} - in.ThreatInvestigationID = args[0] - out, err := client.GetManagerThreatInvestigationsThreatInvestigationId(cmd.Context(), in) + out, err := client.ListManagerThreats(cmd.Context(), in) if err != nil { return err } @@ -2202,13 +4713,27 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /manager/threats") + cmd.Flags().String("advisory-id", "", "Matches a threat known by this id in any database: its Nullify id, a CVE, GHSA, OSV or vendor advisory id") + cmd.Flags().String("cve-id", "", "") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("kind", "", "malware has an OSV MAL id, vulnerability a CVE or another public advisory id, campaign none but its Nullify id") + cmd.Flags().String("page", "", "") + cmd.Flags().String("page-size", "", "") + cmd.Flags().String("published-after", "", "YYYY-MM-DD or RFC 3339: keeps threats whose advisory was published at or after it") + cmd.Flags().String("published-before", "", "YYYY-MM-DD or RFC 3339: keeps threats whose advisory was published before it") + cmd.Flags().String("q", "", "Case-insensitive search over threat title, CVE/GHSA/MAL identifiers and affected package names") + cmd.Flags().String("severity", "", "") + cmd.Flags().String("sort", "", "published (default) lists the newest advisory publication first; researched the newest research") + cmd.Flags().String("verdict", "", "affected keeps threats your assessment found affecting a repository") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "patch-threat-investigations ", - Short: "Patch Threat Investigation", + Use: "create-investigate-by-id ", + Short: "Investigate Threat in My Environment", Long: "Request body (JSON) fields: action (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -2217,7 +4742,7 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.PatchManagerThreatInvestigationsThreatInvestigationIdInput{} + in := api.CreateManagerThreatsThreatIdInvestigateInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -2247,8 +4772,16 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.ThreatInvestigationID = args[0] - out, err := client.PatchManagerThreatInvestigationsThreatInvestigationId(cmd.Context(), in) + in.ThreatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateManagerThreatsThreatIdInvestigate(cmd.Context(), in) if err != nil { return err } @@ -2260,6 +4793,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/threats/{threatId}/investigate") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -2269,7 +4804,7 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { cmd := &cobra.Command{ Use: "create-trigger", Short: "Start a Manager run", - Long: "Request body (JSON) fields: campaignId (string), mode (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Long: "Request body (JSON) fields: campaignId (string), evaluationTime (string), mode (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { @@ -2306,6 +4841,14 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateManagerTrigger(cmd.Context(), in) if err != nil { return err @@ -2318,6 +4861,8 @@ func RegisterManagerCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /manager/trigger") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) diff --git a/internal/commands/moved.go b/internal/commands/moved.go new file mode 100644 index 0000000..4903b04 --- /dev/null +++ b/internal/commands/moved.go @@ -0,0 +1,112 @@ +package commands + +import ( + "strings" + + "github.com/spf13/cobra" +) + +// MovedCommand records a command whose API route moved. The old name stays as a +// deprecated alias that calls the new route. +type MovedCommand struct { + From string + To string +} + +// RemovedCommand records a command whose route the API no longer serves. +type RemovedCommand struct { + Command string + Route string + Evidence string +} + +// RetiredFlag records a flag whose query parameter the API no longer accepts. The +// flag stays accepted with a deprecation notice, so a script that passes it still +// runs, and it has no effect. +type RetiredFlag struct { + Command string + Flag string + Evidence string +} + +// SurfaceDecisions is the record of every approved change to the command surface. +type SurfaceDecisions struct { + Moved []MovedCommand + RemovedCommands []RemovedCommand + RetiredFlags []RetiredFlag +} + +func (d SurfaceDecisions) commandMoved(command string) bool { + for _, m := range d.Moved { + if m.From == command { + return true + } + } + return false +} + +func (d SurfaceDecisions) commandRemoved(command string) bool { + for _, r := range d.RemovedCommands { + if r.Command == command { + return true + } + } + return false +} + +// ApplySurfaceDecisions adds a deprecated alias for every moved command and a +// deprecated no-op flag for every retired flag. Call it after all other commands +// are registered. A row whose target is absent has no effect here, and the surface +// check then reports the missing command or flag. +func ApplySurfaceDecisions(root *cobra.Command, decisions SurfaceDecisions) { + registerMovedCommands(root, decisions.Moved) + + for _, r := range decisions.RetiredFlags { + cmd, _, err := root.Find(strings.Fields(r.Command)[1:]) + if err != nil || cmd.CommandPath() != r.Command { + continue + } + cmd.Flags().String(r.Flag, "", r.Evidence) + _ = cmd.Flags().MarkDeprecated(r.Flag, r.Evidence) + } +} + +func registerMovedCommands(root *cobra.Command, moved []MovedCommand) { + for _, m := range moved { + target, _, err := root.Find(strings.Fields(m.To)[1:]) + if err != nil || target.CommandPath() != m.To { + continue + } + + from := strings.Fields(m.From)[1:] + parent := ensureGroup(root, from[:len(from)-1]) + parent.AddCommand(aliasFor(target, from[len(from)-1], m.To)) + } +} + +func ensureGroup(root *cobra.Command, path []string) *cobra.Command { + parent := root + for _, name := range path { + child := findChild(parent, name) + if child == nil { + child = &cobra.Command{Use: name, Short: "Deprecated: see the moved commands in the changelog"} + parent.AddCommand(child) + } + parent = child + } + return parent +} + +func aliasFor(target *cobra.Command, name, to string) *cobra.Command { + alias := &cobra.Command{ + Use: strings.Join(append([]string{name}, strings.Fields(target.Use)[1:]...), " "), + Short: target.Short, + Long: target.Long, + Args: target.Args, + RunE: target.RunE, + Annotations: target.Annotations, + Deprecated: "use `" + to + "`, which calls the new route", + } + alias.Flags().AddFlagSet(target.Flags()) + return alias +} diff --git a/internal/commands/orchestrator.go b/internal/commands/orchestrator.go index 8d9615b..b000753 100644 --- a/internal/commands/orchestrator.go +++ b/internal/commands/orchestrator.go @@ -69,6 +69,14 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateOrchestratorAutofixBatch(cmd.Context(), in) if err != nil { return err @@ -81,6 +89,8 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/autofix/batch") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -99,6 +109,14 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory } in := api.GetOrchestratorAutofixBatchExecutionIdInput{} in.ExecutionID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetOrchestratorAutofixBatchExecutionId(cmd.Context(), in) if err != nil { return err @@ -111,6 +129,211 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/autofix/batch/{executionId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-iterate-pr", + Short: "Iterate Autofix PR", + Long: "Request body (JSON) fields: ownerProvider (object, required), pullRequest (object, required), reason (string), repository (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateOrchestratorAutofixIteratePrInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateOrchestratorAutofixIteratePr(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/autofix/iterate-pr") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-checkruns", + Short: "Get Check Runs", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListOrchestratorCheckrunsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("include-default-branch"); v != "" { + b := v == "true" + in.IncludeDefaultBranch = &b + } + if v, _ := cmd.Flags().GetString("max-repositories"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("maxRepositories"+": %w", err) + } else { + x := int(n) + in.MaxRepositories = &x + } + } + if v, _ := cmd.Flags().GetString("repository-commit"); v != "" { + for _, s := range strings.Split(v, ",") { + in.RepositoryCommit = append(in.RepositoryCommit, string(s)) + } + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + for _, s := range strings.Split(v, ",") { + in.RepositoryID = append(in.RepositoryID, string(s)) + } + } + if v, _ := cmd.Flags().GetString("since"); v != "" { + x := string(v) + in.Since = &x + } + out, err := client.ListOrchestratorCheckruns(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/checkruns") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("include-default-branch", "", "Also read check runs on each repository's default branch head") + cmd.Flags().String("max-repositories", "", "Maximum repositories to read (default 50, max 200)") + cmd.Flags().String("repository-commit", "", "Read exact repository and commit pairs formatted as :") + cmd.Flags().String("repository-id", "", "Filter by provider repository IDs") + cmd.Flags().String("since", "", "Only return check runs started at or after this RFC3339 timestamp") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-override", + Short: "Override Check Run", + Long: "Request body (JSON) fields: checkName (string, required), commitSha (string, required), reason (string), repository (object, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateOrchestratorCheckrunsOverrideInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateOrchestratorCheckrunsOverride(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/checkruns/override") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } @@ -125,6 +348,42 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory return err } in := api.ListOrchestratorCodereviewsInput{} + if v, _ := cmd.Flags().GetString("blocked"); v != "" { + b := v == "true" + in.Blocked = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("since"); v != "" { + x := string(v) + in.Since = &x + } out, err := client.ListOrchestratorCodereviews(cmd.Context(), in) if err != nil { return err @@ -137,6 +396,13 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/codereviews") + cmd.Flags().String("blocked", "", "Only pull requests whose latest run failed the Nullify check (findings or a blocking incomplete scan) and was not overridden") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Maximum number of code reviews to return per page") + cmd.Flags().String("next-token", "", "Pagination token for the next page of results") + cmd.Flags().String("offset", "", "Pagination offset; overrides nextToken when set") + cmd.Flags().String("since", "", "RFC 3339 lower bound on a blocked run's start time; defaults to 14 days ago. Only applies with blocked=true") serviceCmd.AddCommand(cmd) } @@ -153,6 +419,14 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory } in := api.GetOrchestratorCodereviewsIdInput{} in.ID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetOrchestratorCodereviewsId(cmd.Context(), in) if err != nil { return err @@ -165,6 +439,8 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/codereviews/{id}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -172,7 +448,7 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory cmd := &cobra.Command{ Use: "create-retriage", Short: "Retriage Findings", - Long: "Request body (JSON) fields: continueOnError (boolean), debounceBypass (boolean), filters (object), findingType (string, required), message (object), platformProvider (string), triggerSource (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Long: "Request body (JSON) fields: continueOnError (boolean), debounceBypass (boolean), filters (object), findingType (string, required), message (object), platformProvider (string), retryOfActivityId (string), triggerSource (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { @@ -209,6 +485,14 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateOrchestratorFindingsRetriage(cmd.Context(), in) if err != nil { return err @@ -221,11 +505,51 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/findings/retriage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } + { + cmd := &cobra.Command{ + Use: "get-retriage ", + Short: "Get Retriage Activity", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetOrchestratorFindingsRetriageActivityIdInput{} + in.ActivityID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetOrchestratorFindingsRetriageActivityId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/findings/retriage/{activityId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + { cmd := &cobra.Command{ Use: "get-autofix-iterations ", @@ -243,6 +567,14 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory x := string(v) in.FindingType = &x } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListOrchestratorFindingsFindingIDAutofixIterations(cmd.Context(), in) if err != nil { return err @@ -255,22 +587,25 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/findings/{findingID}/autofix-iterations") cmd.Flags().String("finding-type", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-complete", - Short: "Complete Onboarding (Test Only)", - Long: "Request body (JSON) fields: tenantId (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-close-by-id ", + Short: "Close Finding Ticket", + Long: "Request body (JSON) fields: actorId (string), findingType (object, required), reason (string), resolution (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateOrchestratorOnboardingCompleteInput{} + in := api.CreateOrchestratorFindingsFindingIDTicketCloseInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -300,7 +635,16 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory } } } - out, err := client.CreateOrchestratorOnboardingComplete(cmd.Context(), in) + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateOrchestratorFindingsFindingIDTicketClose(cmd.Context(), in) if err != nil { return err } @@ -312,16 +656,54 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/findings/{findingID}/ticket/close") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } + { + cmd := &cobra.Command{ + Use: "list-requirements", + Short: "Get Onboarding Requirements", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListOrchestratorOnboardingRequirementsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListOrchestratorOnboardingRequirements(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/onboarding/requirements") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + { cmd := &cobra.Command{ Use: "create-start", Short: "Start Onboarding", - Long: "Request body (JSON) fields: gitOwnerProvider (object, required), repositoryIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Long: "Request body (JSON) fields: allRepositories (boolean), bypassRequirements (boolean), force (boolean), gitOwnerProvider (object, required), repositoryIds (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { @@ -358,6 +740,14 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateOrchestratorOnboardingStart(cmd.Context(), in) if err != nil { return err @@ -370,6 +760,8 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/onboarding/start") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -386,6 +778,14 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory return err } in := api.ListOrchestratorOnboardingStatusInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListOrchestratorOnboardingStatus(cmd.Context(), in) if err != nil { return err @@ -398,6 +798,275 @@ func RegisterOrchestratorCommands(parent *cobra.Command, getClient ClientFactory }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/onboarding/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-reviews-by-id ", + Short: "Start Pull Request Review", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviewsInput{} + in.RepositoryID = args[0] + if v, err := strconv.Atoi(args[1]); err != nil { + return fmt.Errorf("number"+": %w", err) + } else { + in.Number = v + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateOrchestratorRepositoriesRepositoryIdPullRequestsNumberReviews(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/repositories/{repositoryId}/pull-requests/{number}/reviews") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-scans-by-id ", + Short: "Start Repository Scan", + Long: "Request body (JSON) fields: branch (string), commitSha (string), fullHistory (boolean), regenerateContext (boolean), scopeBackfill (boolean), services (array, required), triage (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateOrchestratorRepositoriesRepositoryIdScansInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateOrchestratorRepositoriesRepositoryIdScans(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/repositories/{repositoryId}/scans") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-scans ", + Short: "Get Repository Scan", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetOrchestratorRepositoriesRepositoryIdScansRunIdInput{} + in.RepositoryID = args[0] + in.RunID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("services"); v != "" { + x := string(v) + in.Services = &x + } + out, err := client.GetOrchestratorRepositoriesRepositoryIdScansRunId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/repositories/{repositoryId}/scans/{runId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("services", "", "Comma-separated scanners the run is waited on; defaults to every scanner the run dispatches") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-control-by-id ", + Short: "Control Run", + Long: "Request body (JSON) fields: action (string, required), approvalId (string), idempotencyKey (string, required), message (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateOrchestratorRunsKindRunIdControlInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { + return fmt.Errorf("open --data-file: %w", err) + } + dec := json.NewDecoder(f) + decErr := dec.Decode(&in) + f.Close() + if decErr != nil { + return fmt.Errorf("decode --data-file: %w", decErr) + } + default: + if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode body from stdin: %w", err) + } + } + } + in.Kind = args[0] + in.RunID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateOrchestratorRunsKindRunIdControl(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /orchestrator/runs/{kind}/{runId}/control") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("data", "", "Request body as a raw JSON string") + cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-capabilities ", + Short: "Get Run Control Capabilities", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListOrchestratorRunsKindRunIdControlCapabilitiesInput{} + in.Kind = args[0] + in.RunID = args[1] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListOrchestratorRunsKindRunIdControlCapabilities(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /orchestrator/runs/{kind}/{runId}/control/capabilities") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } diff --git a/internal/commands/sast.go b/internal/commands/sast.go index e94f69f..827aa8c 100644 --- a/internal/commands/sast.go +++ b/internal/commands/sast.go @@ -57,6 +57,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.FromTime = &x } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -85,10 +93,12 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/events") cmd.Flags().String("event-type", "", "") cmd.Flags().String("file-owner-name", "", "") cmd.Flags().String("finding-id", "", "") cmd.Flags().String("from-time", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("sort", "", "") @@ -111,7 +121,7 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { in.AiGenerated = &b } if v, _ := cmd.Flags().GetString("auto-fix-state"); v != "" { - x := string(v) + x := models.ModelsAutoFixState(v) in.AutoFixState = &x } if v, _ := cmd.Flags().GetString("branch"); v != "" { @@ -123,6 +133,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("has-pull-request"); v != "" { b := v == "true" in.HasPullRequest = &b @@ -200,10 +218,12 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings") cmd.Flags().String("ai-generated", "", "true = AI code-review only, false = rule-only, omitted = both") cmd.Flags().String("auto-fix-state", "", "filter by AutoFixState (e.g. 'none' for findings with no cached fix)") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("has-pull-request", "", "") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-archived", "", "") @@ -263,6 +283,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSastFindingsAllowlist(cmd.Context(), in) if err != nil { return err @@ -271,6 +299,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sast/findings/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -300,6 +330,19 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("file-path"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FilePath = append(in.FilePath, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("has-pull-request"); v != "" { b := v == "true" in.HasPullRequest = &b @@ -344,6 +387,10 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.PriorityLabel = &x } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } if v, _ := cmd.Flags().GetString("severity"); v != "" { x := string(v) in.Severity = &x @@ -372,9 +419,12 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/detailed") cmd.Flags().String("ai-generated", "", "true = AI code-review only, false = rule-only, omitted = both") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("file-path", "", "if set, only findings in one of these files are returned") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("has-pull-request", "", "") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-archived", "", "") @@ -385,6 +435,7 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("priority-label", "", "") + cmd.Flags().String("repository-id", "", "if set, only findings for this repository are returned") cmd.Flags().String("severity", "", "") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") @@ -408,7 +459,7 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { in.AiGenerated = &b } if v, _ := cmd.Flags().GetString("auto-fix-state"); v != "" { - x := string(v) + x := models.ModelsAutoFixState(v) in.AutoFixState = &x } if v, _ := cmd.Flags().GetString("branch"); v != "" { @@ -420,6 +471,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("has-pull-request"); v != "" { b := v == "true" in.HasPullRequest = &b @@ -497,10 +556,12 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/preview") cmd.Flags().String("ai-generated", "", "true = AI code-review only, false = rule-only, omitted = both") cmd.Flags().String("auto-fix-state", "", "filter by AutoFixState (e.g. 'none' for findings with no cached fix)") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("has-pull-request", "", "") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-archived", "", "") @@ -532,6 +593,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetSastFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetSastFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -544,6 +613,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -590,6 +661,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchSastFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -602,6 +681,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /sast/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -650,6 +731,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateSastFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err @@ -662,6 +751,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sast/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -680,6 +771,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSastFindingsFindingIdAutofixActivityInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -704,6 +803,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}/autofix/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("since-id", "", "") serviceCmd.AddCommand(cmd) @@ -722,6 +823,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSastFindingsFindingIdAutofixCacheDiffInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSastFindingsFindingIdAutofixCacheDiff(cmd.Context(), in) if err != nil { return err @@ -734,6 +843,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}/autofix/cache/diff") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -780,6 +891,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateSastFindingsFindingIdAutofixFix(cmd.Context(), in) if err != nil { return err @@ -792,6 +911,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sast/findings/{findingId}/autofix/fix") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -810,6 +931,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSastFindingsFindingIdAutofixStateInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSastFindingsFindingIdAutofixState(cmd.Context(), in) if err != nil { return err @@ -822,6 +951,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}/autofix/state") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -838,6 +969,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSastFindingsFindingIdAutofixStatusInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSastFindingsFindingIdAutofixStatus(cmd.Context(), in) if err != nil { return err @@ -850,6 +989,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}/autofix/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -866,6 +1007,18 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSastFindingsFindingIdEventsInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } out, err := client.ListSastFindingsFindingIdEvents(cmd.Context(), in) if err != nil { return err @@ -878,6 +1031,47 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-ticket ", + Short: "Delete Ticket", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteSastFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteSastFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /sast/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -924,6 +1118,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateSastFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err @@ -936,6 +1138,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sast/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -954,6 +1158,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSastFindingsFindingIdTriageInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSastFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err @@ -966,6 +1178,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1012,6 +1226,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSastFindingsFindingIdUnallowlist(cmd.Context(), in) if err != nil { return err @@ -1020,6 +1242,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sast/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1038,6 +1262,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSastFindingsFindingIdUsersInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSastFindingsFindingIdUsers(cmd.Context(), in) if err != nil { return err @@ -1050,6 +1282,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/findings/{findingId}/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1064,6 +1298,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListSastRepositoriesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1088,6 +1330,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/repositories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) @@ -1106,6 +1350,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetSastRepositoriesRepositoryIdInput{} in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetSastRepositoriesRepositoryId(cmd.Context(), in) if err != nil { return err @@ -1118,6 +1370,8 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/repositories/{repositoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1132,6 +1386,18 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListSastScanRunsInput{} + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1156,6 +1422,10 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.Sort = &x } + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } out, err := client.ListSastScanRuns(cmd.Context(), in) if err != nil { return err @@ -1168,10 +1438,14 @@ func RegisterSastCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sast/scan-runs") + cmd.Flags().String("from", "", "Only include scan runs started at or after this RFC3339 timestamp") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "Max scan runs per page (default 10, max 50)") cmd.Flags().String("offset", "", "Pagination offset (default 0)") cmd.Flags().String("repository-id", "", "Repository ID to list scan runs for") cmd.Flags().String("sort", "", "Sort order by start time (default newest)") + cmd.Flags().String("to", "", "Only include scan runs started at or before this RFC3339 timestamp") serviceCmd.AddCommand(cmd) } diff --git a/internal/commands/sca.go b/internal/commands/sca.go index 5d68b92..47ecd8d 100644 --- a/internal/commands/sca.go +++ b/internal/commands/sca.go @@ -40,7 +40,7 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsInput{} if v, _ := cmd.Flags().GetString("auto-fix-state"); v != "" { - x := string(v) + x := models.ModelsAutoFixState(v) in.AutoFixState = &x } if v, _ := cmd.Flags().GetString("branch"); v != "" { @@ -52,6 +52,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -108,9 +116,11 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings") cmd.Flags().String("auto-fix-state", "", "filter by AutoFixState (e.g. 'none' for findings with no cached fix)") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") @@ -144,6 +154,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -176,6 +194,10 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.Package = &x } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } if v, _ := cmd.Flags().GetString("sort"); v != "" { x := string(v) in.Sort = &x @@ -200,8 +222,10 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/detailed") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") @@ -209,6 +233,7 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("package", "", "") + cmd.Flags().String("repository-id", "", "if set, only findings for this repository are returned") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") cmd.Flags().String("workflow", "", "") @@ -227,7 +252,7 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsPreviewInput{} if v, _ := cmd.Flags().GetString("auto-fix-state"); v != "" { - x := string(v) + x := models.ModelsAutoFixState(v) in.AutoFixState = &x } if v, _ := cmd.Flags().GetString("branch"); v != "" { @@ -239,6 +264,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -295,9 +328,11 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/preview") cmd.Flags().String("auto-fix-state", "", "filter by AutoFixState (e.g. 'none' for findings with no cached fix)") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") @@ -324,6 +359,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetScaContainersFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetScaContainersFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -336,6 +379,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -382,6 +427,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchScaContainersFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -394,6 +447,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /sca/containers/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -442,6 +497,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateScaContainersFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err @@ -450,6 +513,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/containers/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -468,6 +533,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsFindingIdAutofixActivityInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -492,6 +565,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/autofix/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("since-id", "", "") serviceCmd.AddCommand(cmd) @@ -540,6 +615,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScaContainersFindingsFindingIdAutofixFix(cmd.Context(), in) if err != nil { return err @@ -552,6 +635,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/containers/findings/{findingId}/autofix/fix") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -570,6 +655,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsFindingIdAutofixStateInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaContainersFindingsFindingIdAutofixState(cmd.Context(), in) if err != nil { return err @@ -582,6 +675,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/autofix/state") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -598,6 +693,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsFindingIdAutofixStatusInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaContainersFindingsFindingIdAutofixStatus(cmd.Context(), in) if err != nil { return err @@ -610,6 +713,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/autofix/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -626,6 +731,18 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsFindingIdEventsInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } out, err := client.ListScaContainersFindingsFindingIdEvents(cmd.Context(), in) if err != nil { return err @@ -638,13 +755,54 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-containers-findings-ticket ", + Short: "Delete Ticket for Container Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteScaContainersFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteScaContainersFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /sca/containers/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ Use: "create-containers-findings-ticket-by-id ", - Short: "Create Jira Ticket", + Short: "Create Ticket", Long: "Request body (JSON) fields: assignees (array), campaignId (string), campaignTitle (string), message (string), project (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -684,6 +842,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScaContainersFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err @@ -696,6 +862,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/containers/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -714,6 +882,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsFindingIdTriageInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaContainersFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err @@ -726,6 +902,98 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-containers-findings-triage-activity ", + Short: "Get SCA Container Finding Triage Activity", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScaContainersFindingsFindingIdTriageActivityInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("since-id"); v != "" { + x := string(v) + in.SinceID = &x + } + out, err := client.ListScaContainersFindingsFindingIdTriageActivity(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/triage/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("since-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-containers-findings-triage-status ", + Short: "Get SCA Container Finding Triage Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScaContainersFindingsFindingIdTriageStatusInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScaContainersFindingsFindingIdTriageStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/triage/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -772,6 +1040,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateScaContainersFindingsFindingIdUnallowlist(cmd.Context(), in) if err != nil { return err @@ -780,6 +1056,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/containers/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -798,6 +1076,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaContainersFindingsFindingIdUsersInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaContainersFindingsFindingIdUsers(cmd.Context(), in) if err != nil { return err @@ -810,6 +1096,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/containers/findings/{findingId}/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -825,7 +1113,7 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsInput{} if v, _ := cmd.Flags().GetString("auto-fix-state"); v != "" { - x := string(v) + x := models.ModelsAutoFixState(v) in.AutoFixState = &x } if v, _ := cmd.Flags().GetString("branch"); v != "" { @@ -837,6 +1125,18 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("has-multiple-versions"); v != "" { + b := v == "true" + in.HasMultipleVersions = &b + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -893,9 +1193,12 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings") cmd.Flags().String("auto-fix-state", "", "filter by AutoFixState (e.g. 'none' for findings with no cached fix)") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-multiple-versions", "", "true to return only findings where one lockfile resolved the package to multiple versions") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") @@ -929,6 +1232,18 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("has-multiple-versions"); v != "" { + b := v == "true" + in.HasMultipleVersions = &b + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -961,6 +1276,10 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.Package = &x } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } if v, _ := cmd.Flags().GetString("sort"); v != "" { x := string(v) in.Sort = &x @@ -985,8 +1304,11 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/detailed") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-multiple-versions", "", "true to return only findings where one lockfile resolved the package to multiple versions") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") @@ -994,6 +1316,7 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("package", "", "") + cmd.Flags().String("repository-id", "", "if set, only findings for this repository are returned") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") cmd.Flags().String("workflow", "", "") @@ -1012,7 +1335,7 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsPreviewInput{} if v, _ := cmd.Flags().GetString("auto-fix-state"); v != "" { - x := string(v) + x := models.ModelsAutoFixState(v) in.AutoFixState = &x } if v, _ := cmd.Flags().GetString("branch"); v != "" { @@ -1024,6 +1347,18 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("has-multiple-versions"); v != "" { + b := v == "true" + in.HasMultipleVersions = &b + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -1080,9 +1415,12 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/preview") cmd.Flags().String("auto-fix-state", "", "filter by AutoFixState (e.g. 'none' for findings with no cached fix)") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-multiple-versions", "", "true to return only findings where one lockfile resolved the package to multiple versions") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") @@ -1109,6 +1447,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetScaDependenciesFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetScaDependenciesFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -1121,6 +1467,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1167,6 +1515,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchScaDependenciesFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -1179,6 +1535,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /sca/dependencies/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1227,6 +1585,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateScaDependenciesFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err @@ -1235,6 +1601,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/dependencies/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1253,6 +1621,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsFindingIdAutofixActivityInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1277,6 +1653,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/autofix/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("since-id", "", "") serviceCmd.AddCommand(cmd) @@ -1295,6 +1673,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsFindingIdAutofixCacheDiffInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaDependenciesFindingsFindingIdAutofixCacheDiff(cmd.Context(), in) if err != nil { return err @@ -1307,6 +1693,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/autofix/cache/diff") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1353,6 +1741,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScaDependenciesFindingsFindingIdAutofixFix(cmd.Context(), in) if err != nil { return err @@ -1365,6 +1761,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/dependencies/findings/{findingId}/autofix/fix") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1383,6 +1781,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsFindingIdAutofixStateInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaDependenciesFindingsFindingIdAutofixState(cmd.Context(), in) if err != nil { return err @@ -1395,6 +1801,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/autofix/state") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1411,6 +1819,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsFindingIdAutofixStatusInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaDependenciesFindingsFindingIdAutofixStatus(cmd.Context(), in) if err != nil { return err @@ -1423,6 +1839,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/autofix/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1439,6 +1857,18 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsFindingIdEventsInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } out, err := client.ListScaDependenciesFindingsFindingIdEvents(cmd.Context(), in) if err != nil { return err @@ -1451,13 +1881,54 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-dependencies-findings-ticket ", + Short: "Delete Ticket for Dependency Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteScaDependenciesFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteScaDependenciesFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /sca/dependencies/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ Use: "create-dependencies-findings-ticket-by-id ", - Short: "Create Jira Ticket", + Short: "Create Ticket", Long: "Request body (JSON) fields: assignees (array), campaignId (string), campaignTitle (string), message (string), project (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -1497,6 +1968,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScaDependenciesFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err @@ -1509,6 +1988,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/dependencies/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1527,6 +2008,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsFindingIdTriageInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListScaDependenciesFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err @@ -1539,14 +2028,15 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-dependencies-findings-unallowlist-by-id ", - Short: "Unallowlist Dependency Finding", - Long: "Request body (JSON) fields: unallowlistReason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "get-dependencies-findings-triage-activity ", + Short: "Get SCA Dependency Finding Triage Activity", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1554,21 +2044,112 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateScaDependenciesFindingsFindingIdUnallowlistInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) + in := api.ListScaDependenciesFindingsFindingIdTriageActivityInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int32(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("since-id"); v != "" { + x := string(v) + in.SinceID = &x + } + out, err := client.ListScaDependenciesFindingsFindingIdTriageActivity(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/triage/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("since-id", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-dependencies-findings-triage-status ", + Short: "Get SCA Dependency Finding Triage Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScaDependenciesFindingsFindingIdTriageStatusInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScaDependenciesFindingsFindingIdTriageStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/triage/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-dependencies-findings-unallowlist-by-id ", + Short: "Unallowlist Dependency Finding", + Long: "Request body (JSON) fields: unallowlistReason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.CreateScaDependenciesFindingsFindingIdUnallowlistInput{} + dataFlag, _ := cmd.Flags().GetString("data") + dataFile, _ := cmd.Flags().GetString("data-file") + switch { + case dataFlag != "": + if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { + return fmt.Errorf("decode --data: %w", err) + } + case dataFile == "-": + if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { + return fmt.Errorf("decode --data-file stdin: %w", err) + } + case dataFile != "": + f, err := os.Open(dataFile) + if err != nil { return fmt.Errorf("open --data-file: %w", err) } dec := json.NewDecoder(f) @@ -1585,6 +2166,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateScaDependenciesFindingsFindingIdUnallowlist(cmd.Context(), in) if err != nil { return err @@ -1593,6 +2182,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /sca/dependencies/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1611,6 +2202,18 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScaDependenciesFindingsFindingIdUsersInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("source-owner-only"); v != "" { + b := v == "true" + in.SourceOwnerOnly = &b + } out, err := client.ListScaDependenciesFindingsFindingIdUsers(cmd.Context(), in) if err != nil { return err @@ -1623,6 +2226,9 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/dependencies/findings/{findingId}/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("source-owner-only", "", "") serviceCmd.AddCommand(cmd) } @@ -1655,6 +2261,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.FromTime = &x } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1683,10 +2297,12 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/events") cmd.Flags().String("event-type", "", "") cmd.Flags().String("file-owner-name", "", "") cmd.Flags().String("finding-id", "", "") cmd.Flags().String("from-time", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("sort", "", "") @@ -1704,6 +2320,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListScaRepositoriesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1728,6 +2352,8 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/repositories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) @@ -1746,6 +2372,14 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetScaRepositoriesRepositoryIdInput{} in.RepositoryID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetScaRepositoriesRepositoryId(cmd.Context(), in) if err != nil { return err @@ -1758,13 +2392,163 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/repositories/{repositoryId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-sbom ", - Short: "Get Repository SBOM", + Use: "list-scan-runs", + Short: "List Scan Runs", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScaScanRunsInput{} + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("scan-type"); v != "" { + x := string(v) + in.ScanType = &x + } + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x + } + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } + out, err := client.ListScaScanRuns(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/scan-runs") + cmd.Flags().String("from", "", "Only include scan runs started at or after this RFC3339 timestamp") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Max scan runs per page (default 10, max 50)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") + cmd.Flags().String("repository-id", "", "Repository ID to list scan runs for") + cmd.Flags().String("scan-type", "", "SCA scan type") + cmd.Flags().String("sort", "", "Sort order by start time (default newest)") + cmd.Flags().String("to", "", "Only include scan runs started at or before this RFC3339 timestamp") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "list-threat-feed", + Short: "List Threat Intelligence Feed", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScaThreatFeedInput{} + if v, _ := cmd.Flags().GetString("cve-id"); v != "" { + x := string(v) + in.CveID = &x + } + if v, _ := cmd.Flags().GetString("ecosystem"); v != "" { + x := string(v) + in.Ecosystem = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("severity"); v != "" { + x := string(v) + in.Severity = &x + } + out, err := client.ListScaThreatFeed(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/threat-feed") + cmd.Flags().String("cve-id", "", "only threats referencing this CVE") + cmd.Flags().String("ecosystem", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("offset", "", "") + cmd.Flags().String("severity", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-threat-feed ", + Short: "Get Threat Intelligence Detail", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1772,9 +2556,17 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListScaRepositoriesRepositoryIdSbomInput{} - in.RepositoryID = args[0] - out, err := client.ListScaRepositoriesRepositoryIdSbom(cmd.Context(), in) + in := api.GetScaThreatFeedThreatIdInput{} + in.ThreatID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetScaThreatFeedThreatId(cmd.Context(), in) if err != nil { return err } @@ -1786,20 +2578,34 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/threat-feed/{threatId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "list-scan-runs", - Short: "List Scan Runs", + Use: "list-vulnerabilities", + Short: "List CVE Exposure Across The Fleet", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListScaScanRunsInput{} + in := api.ListScaVulnerabilitiesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("kev-only"); v != "" { + b := v == "true" + in.KevOnly = &b + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1816,19 +2622,134 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { in.Offset = &x } } - if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + if v, _ := cmd.Flags().GetString("open-only"); v != "" { + b := v == "true" + in.OpenOnly = &b + } + if v, _ := cmd.Flags().GetString("package"); v != "" { x := string(v) - in.RepositoryID = &x + in.Package = &x } - if v, _ := cmd.Flags().GetString("scan-type"); v != "" { + if v, _ := cmd.Flags().GetString("sort-by"); v != "" { x := string(v) - in.ScanType = &x + in.SortBy = &x } - if v, _ := cmd.Flags().GetString("sort"); v != "" { + out, err := client.ListScaVulnerabilities(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/vulnerabilities") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("kev-only", "", "KEV as recorded at each finding's last Review (snapshot)") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("offset", "", "") + cmd.Flags().String("open-only", "", "only CVEs with >=1 unresolved finding (default true)") + cmd.Flags().String("package", "", "only CVEs carried by a finding of this package or container artifact (exact name, case-insensitive)") + cmd.Flags().String("sort-by", "", "severity|repositories|findings|epss|cvss|firstSeen (default repositories)") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-vulnerabilities ", + Short: "Get CVE Intelligence", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.GetScaVulnerabilitiesCveIdInput{} + in.CveID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.GetScaVulnerabilitiesCveId(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/vulnerabilities/{cveId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-findings ", + Short: "List Findings For A CVE", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScaVulnerabilitiesCveIdFindingsInput{} + in.CveID = args[0] + if v, _ := cmd.Flags().GetString("branch"); v != "" { x := string(v) - in.Sort = &x + in.Branch = &x } - out, err := client.ListScaScanRuns(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("file-owner-name"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FileOwnerName = append(in.FileOwnerName, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("is-resolved"); v != "" { + b := v == "true" + in.IsResolved = &b + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("type"); v != "" { + x := string(v) + in.Type = &x + } + out, err := client.ListScaVulnerabilitiesCveIdFindings(cmd.Context(), in) if err != nil { return err } @@ -1840,11 +2761,52 @@ func RegisterScaCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) - cmd.Flags().String("limit", "", "Max scan runs per page (default 10, max 50)") - cmd.Flags().String("offset", "", "Pagination offset (default 0)") - cmd.Flags().String("repository-id", "", "Repository ID to list scan runs for") - cmd.Flags().String("scan-type", "", "SCA scan type") - cmd.Flags().String("sort", "", "Sort order by start time (default newest)") + setRoute(cmd, "GET /sca/vulnerabilities/{cveId}/findings") + cmd.Flags().String("branch", "", "") + cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("is-resolved", "", "") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("offset", "", "") + cmd.Flags().String("type", "", "dependency (default) or container") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-packages ", + Short: "List Packages Affected By A CVE", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScaVulnerabilitiesCveIdPackagesInput{} + in.CveID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScaVulnerabilitiesCveIdPackages(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /sca/vulnerabilities/{cveId}/packages") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } diff --git a/internal/commands/scpm.go b/internal/commands/scpm.go index 47b882b..61cc870 100644 --- a/internal/commands/scpm.go +++ b/internal/commands/scpm.go @@ -69,6 +69,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScpmContainersAnalyze(cmd.Context(), in) if err != nil { return err @@ -81,57 +89,13 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/containers/analyze") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } - { - cmd := &cobra.Command{ - Use: "list-dependencies", - Short: "Get CI/CD Dependencies", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.ListScpmDependenciesInput{} - if v, _ := cmd.Flags().GetString("name"); v != "" { - x := string(v) - in.Name = &x - } - if v, _ := cmd.Flags().GetString("pinned"); v != "" { - b := v == "true" - in.Pinned = &b - } - if v, _ := cmd.Flags().GetString("platform"); v != "" { - x := string(v) - in.Platform = &x - } - if v, _ := cmd.Flags().GetString("version"); v != "" { - x := string(v) - in.Version = &x - } - out, err := client.ListScpmDependencies(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("name", "", "Filter by dependency name (e.g., actions/checkout, tj-actions/changed-files)") - cmd.Flags().String("pinned", "", "Filter by pinned status") - cmd.Flags().String("platform", "", "Filter by CI/CD platform (github-actions, gitlab-ci, azure-pipelines)") - cmd.Flags().String("version", "", "Filter by version reference (requires name)") - serviceCmd.AddCommand(cmd) - } - { cmd := &cobra.Command{ Use: "create-dependencies-analyze", @@ -173,6 +137,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScpmDependenciesAnalyze(cmd.Context(), in) if err != nil { return err @@ -185,6 +157,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/dependencies/analyze") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -231,6 +205,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScpmDependenciesQueryBatch(cmd.Context(), in) if err != nil { return err @@ -243,6 +225,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/dependencies/query/batch") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -259,6 +243,43 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListScpmEventsInput{} + if v, _ := cmd.Flags().GetString("event-type"); v != "" { + for _, s := range strings.Split(v, ",") { + in.EventType = append(in.EventType, string(s)) + } + } + if v, _ := cmd.Flags().GetString("finding-id"); v != "" { + x := string(v) + in.FindingID = &x + } + if v, _ := cmd.Flags().GetString("from-time"); v != "" { + x := string(v) + in.FromTime = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x + } out, err := client.ListScpmEvents(cmd.Context(), in) if err != nil { return err @@ -271,6 +292,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/events") + cmd.Flags().String("event-type", "", "") + cmd.Flags().String("finding-id", "", "") + cmd.Flags().String("from-time", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") + cmd.Flags().String("sort", "", "") serviceCmd.AddCommand(cmd) } @@ -294,6 +323,19 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("finding-type"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FindingType = append(in.FindingType, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("has-pull-request"); v != "" { b := v == "true" in.HasPullRequest = &b @@ -318,6 +360,11 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { b := v == "true" in.IsResolved = &b } + if v, _ := cmd.Flags().GetString("language"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Language = append(in.Language, string(s)) + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -339,6 +386,10 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { in.RepositoryIds = append(in.RepositoryIds, string(s)) } } + if v, _ := cmd.Flags().GetString("rule-id"); v != "" { + x := string(v) + in.RuleID = &x + } if v, _ := cmd.Flags().GetString("severity"); v != "" { x := string(v) in.Severity = &x @@ -367,18 +418,23 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") - cmd.Flags().String("has-pull-request", "", "") + cmd.Flags().String("finding-type", "", "only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-pull-request", "", "only findings that do (or do not) have a linked pull request") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-archived", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") cmd.Flags().String("is-resolved", "", "combination of isFixed, isFalsePositive, isAllowlisted and isArchived") + cmd.Flags().String("language", "", "only findings in these languages") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("priority-label", "", "") cmd.Flags().String("repository-ids", "", "if not provided, all repositories will be included") + cmd.Flags().String("rule-id", "", "only findings produced by this rule (rule source id such as scpm-cicd-unpinned-action, or the finding type)") cmd.Flags().String("severity", "", "") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") @@ -427,6 +483,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateScpmFindingsAllowlist(cmd.Context(), in) if err != nil { return err @@ -435,6 +499,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/findings/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -460,6 +526,23 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("finding-type"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FindingType = append(in.FindingType, string(s)) + } + } + if v, _ := cmd.Flags().GetString("gate-base"); v != "" { + b := v == "true" + in.GateBase = &b + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("has-pull-request"); v != "" { b := v == "true" in.HasPullRequest = &b @@ -484,6 +567,11 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { b := v == "true" in.IsResolved = &b } + if v, _ := cmd.Flags().GetString("language"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Language = append(in.Language, string(s)) + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -500,6 +588,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.PriorityLabel = &x } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("rule-id"); v != "" { + x := string(v) + in.RuleID = &x + } if v, _ := cmd.Flags().GetString("severity"); v != "" { x := string(v) in.Severity = &x @@ -528,17 +624,24 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/detailed") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") - cmd.Flags().String("has-pull-request", "", "") + cmd.Flags().String("finding-type", "", "only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...)") + cmd.Flags().String("gate-base", "", "orchestrator net-new base set: current-branch latest, resolution-agnostic (includes allowlisted/false-positive rows)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-pull-request", "", "only findings that do (or do not) have a linked pull request") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-archived", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") cmd.Flags().String("is-resolved", "", "combination of isFixed, isFalsePositive, isAllowlisted and isArchived") + cmd.Flags().String("language", "", "only findings in these languages") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("priority-label", "", "") + cmd.Flags().String("repository-id", "", "if set, only findings for this repository are returned") + cmd.Flags().String("rule-id", "", "only findings produced by this rule (rule source id or finding type)") cmd.Flags().String("severity", "", "") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") @@ -566,6 +669,19 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("finding-type"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FindingType = append(in.FindingType, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("has-pull-request"); v != "" { b := v == "true" in.HasPullRequest = &b @@ -590,6 +706,11 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { b := v == "true" in.IsResolved = &b } + if v, _ := cmd.Flags().GetString("language"); v != "" { + for _, s := range strings.Split(v, ",") { + in.Language = append(in.Language, string(s)) + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -611,6 +732,10 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { in.RepositoryIds = append(in.RepositoryIds, string(s)) } } + if v, _ := cmd.Flags().GetString("rule-id"); v != "" { + x := string(v) + in.RuleID = &x + } if v, _ := cmd.Flags().GetString("severity"); v != "" { x := string(v) in.Severity = &x @@ -639,18 +764,23 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/preview") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") - cmd.Flags().String("has-pull-request", "", "") + cmd.Flags().String("finding-type", "", "only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...)") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("has-pull-request", "", "only findings that do (or do not) have a linked pull request") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-archived", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-fixed", "", "") cmd.Flags().String("is-resolved", "", "combination of isFixed, isFalsePositive, isAllowlisted and isArchived") + cmd.Flags().String("language", "", "only findings in these languages") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("priority-label", "", "") cmd.Flags().String("repository-ids", "", "if not provided, all repositories will be included") + cmd.Flags().String("rule-id", "", "only findings produced by this rule (rule source id such as scpm-cicd-unpinned-action, or the finding type)") cmd.Flags().String("severity", "", "") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") @@ -658,64 +788,6 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { serviceCmd.AddCommand(cmd) } - { - cmd := &cobra.Command{ - Use: "create-retriage", - Short: "Retriage Findings", - Long: "Request body (JSON) fields: branch (string), continueOnError (boolean), findingIds (array, required), forceRetriage (boolean), priorityMinimum (string), repositoryIds (array, required), reprocessFailedTriages (boolean), reprocessFalsePositives (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - RunE: func(cmd *cobra.Command, args []string) error { - client, err := getClient(cmd.Context()) - if err != nil { - cmd.SilenceUsage = true - return err - } - in := api.CreateScpmFindingsRetriageInput{} - dataFlag, _ := cmd.Flags().GetString("data") - dataFile, _ := cmd.Flags().GetString("data-file") - switch { - case dataFlag != "": - if err := json.NewDecoder(strings.NewReader(dataFlag)).Decode(&in); err != nil { - return fmt.Errorf("decode --data: %w", err) - } - case dataFile == "-": - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode --data-file stdin: %w", err) - } - case dataFile != "": - f, err := os.Open(dataFile) - if err != nil { - return fmt.Errorf("open --data-file: %w", err) - } - dec := json.NewDecoder(f) - decErr := dec.Decode(&in) - f.Close() - if decErr != nil { - return fmt.Errorf("decode --data-file: %w", decErr) - } - default: - if stat, _ := os.Stdin.Stat(); (stat.Mode() & os.ModeCharDevice) == 0 { - if err := json.NewDecoder(os.Stdin).Decode(&in); err != nil { - return fmt.Errorf("decode body from stdin: %w", err) - } - } - } - out, err := client.CreateScpmFindingsRetriage(cmd.Context(), in) - if err != nil { - return err - } - data, err := json.Marshal(out) - if err != nil { - return err - } - return output.Print(cmd, data) - }, - } - preserveRuntimeUsage(cmd) - cmd.Flags().String("data", "", "Request body as a raw JSON string") - cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") - serviceCmd.AddCommand(cmd) - } - { cmd := &cobra.Command{ Use: "create-upload", @@ -757,6 +829,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScpmFindingsUpload(cmd.Context(), in) if err != nil { return err @@ -769,6 +849,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/findings/upload") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -787,6 +869,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetScpmFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetScpmFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -799,6 +889,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -806,7 +898,7 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { cmd := &cobra.Command{ Use: "patch-findings ", Short: "Update Finding", - Long: "Request body (JSON) fields: priorityOverride (object), severityOverride (object).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Long: "Request body (JSON) fields: isFalsePositive (boolean), priorityOverride (object), severityOverride (object), userNotes (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -845,6 +937,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchScpmFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -857,6 +957,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /scpm/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -905,6 +1007,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateScpmFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err @@ -917,6 +1027,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -935,6 +1047,14 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListScpmFindingsFindingIdAutofixActivityInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -959,6 +1079,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/{findingId}/autofix/activity") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("since-id", "", "") serviceCmd.AddCommand(cmd) @@ -966,9 +1088,9 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-cache-by-id ", - Short: "Cache Autofix", - Long: "Request body (JSON) fields: force (boolean).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-fix-by-id ", + Short: "Autofix Finding", + Long: "Request body (JSON) fields: assignees (array), force (boolean), message (string), originCampaignId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -976,7 +1098,7 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateScpmFindingsFindingIdAutofixCacheInput{} + in := api.CreateScpmFindingsFindingIdAutofixFixInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1007,7 +1129,19 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] - data, err := client.CreateScpmFindingsFindingIdAutofixCache(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateScpmFindingsFindingIdAutofixFix(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) if err != nil { return err } @@ -1015,6 +1149,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/findings/{findingId}/autofix/fix") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1022,9 +1158,166 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "create-create_pr-by-id ", - Short: "Create Pull Request from Cached Fix", - Long: "Request body (JSON) fields: message (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "get-state ", + Short: "Get SCPM Finding Autofix State", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScpmFindingsFindingIdAutofixStateInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScpmFindingsFindingIdAutofixState(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/{findingId}/autofix/state") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-status ", + Short: "Get SCPM Finding Autofix Status", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScpmFindingsFindingIdAutofixStatusInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScpmFindingsFindingIdAutofixStatus(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/{findingId}/autofix/status") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "get-events ", + Short: "Get Finding Events", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.ListScpmFindingsFindingIdEventsInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListScpmFindingsFindingIdEvents(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-ticket ", + Short: "Delete Ticket for SCPM Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteScpmFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteScpmFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /scpm/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "create-ticket-by-id ", + Short: "Create Ticket for SCPM Finding", + Long: "Request body (JSON) fields: assignees (array), campaignId (string), campaignTitle (string), message (string), project (string), userCanonicalId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1032,7 +1325,7 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateScpmFindingsFindingIdAutofixCacheCreatePrInput{} + in := api.CreateScpmFindingsFindingIdTicketInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1063,7 +1356,15 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] - out, err := client.CreateScpmFindingsFindingIdAutofixCacheCreatePr(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateScpmFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err } @@ -1075,6 +1376,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1082,8 +1385,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-diff ", - Short: "Get SCPM Finding Autofix Diff", + Use: "get-triage ", + Short: "Get Triaged Finding", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1091,9 +1394,17 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListScpmFindingsFindingIdAutofixCacheDiffInput{} + in := api.ListScpmFindingsFindingIdTriageInput{} in.FindingID = args[0] - out, err := client.ListScpmFindingsFindingIdAutofixCacheDiff(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScpmFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err } @@ -1105,14 +1416,16 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-fix-by-id ", - Short: "Autofix Finding", - Long: "Request body (JSON) fields: assignees (array), force (boolean), message (string), originCampaignId (string).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + Use: "create-unallowlist-by-id ", + Short: "Unallowlist Finding", + Long: "Request body (JSON) fields: unallowlistReason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1120,7 +1433,7 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.CreateScpmFindingsFindingIdAutofixFixInput{} + in := api.CreateScpmFindingsFindingIdUnallowlistInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1151,11 +1464,15 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] - out, err := client.CreateScpmFindingsFindingIdAutofixFix(cmd.Context(), in) - if err != nil { - return err + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } } - data, err := json.Marshal(out) + data, err := client.CreateScpmFindingsFindingIdUnallowlist(cmd.Context(), in) if err != nil { return err } @@ -1163,6 +1480,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1170,8 +1489,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { { cmd := &cobra.Command{ - Use: "get-state ", - Short: "Get SCPM Finding Autofix State", + Use: "create-unmark-false-positive-by-id ", + Short: "Unmark SCPM Finding as False Positive", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1179,9 +1498,17 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListScpmFindingsFindingIdAutofixStateInput{} + in := api.CreateScpmFindingsFindingIdUnmarkFalsePositiveInput{} in.FindingID = args[0] - out, err := client.ListScpmFindingsFindingIdAutofixState(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.CreateScpmFindingsFindingIdUnmarkFalsePositive(cmd.Context(), in) if err != nil { return err } @@ -1193,13 +1520,15 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /scpm/findings/{findingId}/unmark-false-positive") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-status ", - Short: "Get SCPM Finding Autofix Status", + Use: "get-users ", + Short: "Get Finding Users", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) @@ -1207,9 +1536,17 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { cmd.SilenceUsage = true return err } - in := api.ListScpmFindingsFindingIdAutofixStatusInput{} + in := api.ListScpmFindingsFindingIdUsersInput{} in.FindingID = args[0] - out, err := client.ListScpmFindingsFindingIdAutofixStatus(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScpmFindingsFindingIdUsers(cmd.Context(), in) if err != nil { return err } @@ -1221,23 +1558,43 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/findings/{findingId}/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-events ", - Short: "Get Finding Events", - Args: cobra.ExactArgs(1), + Use: "list-repositories", + Short: "Get Repositories", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListScpmFindingsFindingIdEventsInput{} - in.FindingID = args[0] - out, err := client.ListScpmFindingsFindingIdEvents(cmd.Context(), in) + in := api.ListScpmRepositoriesInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } + out, err := client.ListScpmRepositories(cmd.Context(), in) if err != nil { return err } @@ -1249,23 +1606,65 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/repositories") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "") + cmd.Flags().String("next-token", "", "") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "get-triage ", - Short: "Get Triaged Finding", - Args: cobra.ExactArgs(1), + Use: "list-scan-runs", + Short: "List Scan Runs", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.ListScpmFindingsFindingIdTriageInput{} - in.FindingID = args[0] - out, err := client.ListScpmFindingsFindingIdTriage(cmd.Context(), in) + in := api.ListScpmScanRunsInput{} + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("limit"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("limit"+": %w", err) + } else { + x := int(n) + in.Limit = &x + } + } + if v, _ := cmd.Flags().GetString("offset"); v != "" { + if n, err := strconv.Atoi(v); err != nil { + return fmt.Errorf("offset"+": %w", err) + } else { + x := int(n) + in.Offset = &x + } + } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } + if v, _ := cmd.Flags().GetString("sort"); v != "" { + x := string(v) + in.Sort = &x + } + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } + out, err := client.ListScpmScanRuns(cmd.Context(), in) if err != nil { return err } @@ -1277,22 +1676,65 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/scan-runs") + cmd.Flags().String("from", "", "Only include scan runs started at or after this RFC3339 timestamp") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("limit", "", "Max scan runs per page (default 10, max 50)") + cmd.Flags().String("offset", "", "Pagination offset (default 0)") + cmd.Flags().String("repository-id", "", "Repository ID to list scan runs for; omit to list the whole tenant") + cmd.Flags().String("sort", "", "Sort order by start time (default newest)") + cmd.Flags().String("to", "", "Only include scan runs started at or before this RFC3339 timestamp") serviceCmd.AddCommand(cmd) } { cmd := &cobra.Command{ - Use: "create-unallowlist-by-id ", - Short: "Unallowlist Finding", - Long: "Request body (JSON) fields: unallowlistReason (string, required).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", - Args: cobra.ExactArgs(1), + Use: "list-settings", + Short: "Get SCPM Settings", RunE: func(cmd *cobra.Command, args []string) error { client, err := getClient(cmd.Context()) if err != nil { cmd.SilenceUsage = true return err } - in := api.CreateScpmFindingsFindingIdUnallowlistInput{} + in := api.ListScpmSettingsInput{} + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.ListScpmSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /scpm/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "update-settings", + Short: "Put SCPM Settings", + Long: "Request body (JSON) fields: acceptedLicenses (array), cooldownDays (integer, required), cooldownEnabled (boolean, required), cooldownOverrides (object), cooldownWarnOnly (boolean), packageAllowlist (array).\n\nProvide the body with --data '', --data-file (- for stdin), or piped stdin.", + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.UpdateScpmSettingsInput{} dataFlag, _ := cmd.Flags().GetString("data") dataFile, _ := cmd.Flags().GetString("data-file") switch { @@ -1322,8 +1764,19 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { } } } - in.FindingID = args[0] - data, err := client.CreateScpmFindingsFindingIdUnallowlist(cmd.Context(), in) + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.UpdateScpmSettings(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) if err != nil { return err } @@ -1331,6 +1784,8 @@ func RegisterScpmCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PUT /scpm/settings") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) diff --git a/internal/commands/secrets.go b/internal/commands/secrets.go index 4d24418..ab0db0a 100644 --- a/internal/commands/secrets.go +++ b/internal/commands/secrets.go @@ -48,6 +48,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -96,8 +104,10 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/credentials/findings") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-resolved", "", "") @@ -150,6 +160,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsCredentialsFindingsAllowlistBatch(cmd.Context(), in) if err != nil { return err @@ -158,6 +176,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/credentials/findings/allowlist/batch") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -183,6 +203,19 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("file-path"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FilePath = append(in.FilePath, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -207,6 +240,10 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.NextToken = &x } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } if v, _ := cmd.Flags().GetString("secret-type"); v != "" { x := string(v) in.SecretType = &x @@ -231,13 +268,17 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/credentials/findings/detailed") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("file-path", "", "if set, only findings in one of these files are returned") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-resolved", "", "") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") + cmd.Flags().String("repository-id", "", "if set, only findings for this repository are returned") cmd.Flags().String("secret-type", "", "") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") @@ -257,6 +298,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetSecretsCredentialsFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetSecretsCredentialsFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -269,6 +318,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/credentials/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -315,6 +366,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchSecretsCredentialsFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -327,6 +386,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /secrets/credentials/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -375,6 +436,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsCredentialsFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err @@ -383,6 +452,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/credentials/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -401,6 +472,18 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsCredentialsFindingsFindingIdEventsInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } out, err := client.ListSecretsCredentialsFindingsFindingIdEvents(cmd.Context(), in) if err != nil { return err @@ -413,6 +496,47 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/credentials/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-credentials-findings-ticket ", + Short: "Delete Ticket for Credential Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteSecretsCredentialsFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteSecretsCredentialsFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /secrets/credentials/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -459,6 +583,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateSecretsCredentialsFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err @@ -471,6 +603,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/credentials/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -489,6 +623,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsCredentialsFindingsFindingIdTriageInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSecretsCredentialsFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err @@ -501,6 +643,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/credentials/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -547,6 +691,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsCredentialsFindingsFindingIdUnallowlist(cmd.Context(), in) if err != nil { return err @@ -555,6 +707,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/credentials/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -573,6 +727,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsCredentialsFindingsFindingIdUsersInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSecretsCredentialsFindingsFindingIdUsers(cmd.Context(), in) if err != nil { return err @@ -585,6 +747,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/credentials/findings/{findingId}/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -621,6 +785,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.FromTime = &x } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -657,11 +829,13 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/events") cmd.Flags().String("branch", "", "") cmd.Flags().String("event-type", "", "") cmd.Flags().String("file-owner-name", "", "") cmd.Flags().String("finding-id", "", "") cmd.Flags().String("from-time", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") cmd.Flags().String("num-items", "", "") @@ -689,6 +863,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -737,8 +919,10 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/findings") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-resolved", "", "") @@ -791,6 +975,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsFindingsAllowlistBatch(cmd.Context(), in) if err != nil { return err @@ -799,6 +991,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/findings/allowlist/batch") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -824,6 +1018,19 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("file-path"); v != "" { + for _, s := range strings.Split(v, ",") { + in.FilePath = append(in.FilePath, string(s)) + } + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -848,6 +1055,10 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.NextToken = &x } + if v, _ := cmd.Flags().GetString("repository-id"); v != "" { + x := string(v) + in.RepositoryID = &x + } if v, _ := cmd.Flags().GetString("secret-type"); v != "" { x := string(v) in.SecretType = &x @@ -872,13 +1083,17 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/findings/detailed") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("file-path", "", "if set, only findings in one of these files are returned") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-resolved", "", "") cmd.Flags().String("limit", "", "") cmd.Flags().String("next-token", "", "") + cmd.Flags().String("repository-id", "", "if set, only findings for this repository are returned") cmd.Flags().String("secret-type", "", "") cmd.Flags().String("sort", "", "") cmd.Flags().String("sort-by", "", "") @@ -905,6 +1120,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -953,8 +1176,10 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/findings/preview") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-resolved", "", "") @@ -979,6 +1204,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetSecretsFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetSecretsFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -991,6 +1224,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1037,6 +1272,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchSecretsFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -1049,6 +1292,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /secrets/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1097,6 +1342,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err @@ -1105,6 +1358,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1123,6 +1378,18 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsFindingsFindingIdEventsInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + if v, _ := cmd.Flags().GetString("next-token"); v != "" { + x := string(v) + in.NextToken = &x + } out, err := client.ListSecretsFindingsFindingIdEvents(cmd.Context(), in) if err != nil { return err @@ -1135,6 +1402,47 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/findings/{findingId}/events") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + cmd.Flags().String("next-token", "", "") + serviceCmd.AddCommand(cmd) + } + + { + cmd := &cobra.Command{ + Use: "delete-findings-ticket ", + Short: "Delete Ticket for Credential Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteSecretsFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteSecretsFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /secrets/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1181,6 +1489,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateSecretsFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err @@ -1193,6 +1509,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1211,6 +1529,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsFindingsFindingIdTriageInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSecretsFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err @@ -1223,6 +1549,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1269,6 +1597,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsFindingsFindingIdUnallowlist(cmd.Context(), in) if err != nil { return err @@ -1277,6 +1613,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1295,6 +1633,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsFindingsFindingIdUsersInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSecretsFindingsFindingIdUsers(cmd.Context(), in) if err != nil { return err @@ -1307,6 +1653,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/findings/{findingId}/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1321,6 +1669,18 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { return err } in := api.ListSecretsScanRunsInput{} + if v, _ := cmd.Flags().GetString("from"); v != "" { + x := string(v) + in.From = &x + } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("limit"); v != "" { if n, err := strconv.Atoi(v); err != nil { return fmt.Errorf("limit"+": %w", err) @@ -1345,6 +1705,10 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { x := string(v) in.Sort = &x } + if v, _ := cmd.Flags().GetString("to"); v != "" { + x := string(v) + in.To = &x + } out, err := client.ListSecretsScanRuns(cmd.Context(), in) if err != nil { return err @@ -1357,10 +1721,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/scan-runs") + cmd.Flags().String("from", "", "Only include scan runs started at or after this RFC3339 timestamp") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("limit", "", "Max scan runs per page (default 10, max 50)") cmd.Flags().String("offset", "", "Pagination offset (default 0)") cmd.Flags().String("repository-id", "", "Repository ID to list scan runs for") cmd.Flags().String("sort", "", "Sort order by start time (default newest)") + cmd.Flags().String("to", "", "Only include scan runs started at or before this RFC3339 timestamp") serviceCmd.AddCommand(cmd) } @@ -1384,6 +1752,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { in.FileOwnerName = append(in.FileOwnerName, string(s)) } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } if v, _ := cmd.Flags().GetString("is-allowlisted"); v != "" { b := v == "true" in.IsAllowlisted = &b @@ -1432,8 +1808,10 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/sensitivedata/findings") cmd.Flags().String("branch", "", "") cmd.Flags().String("file-owner-name", "", "") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("is-allowlisted", "", "") cmd.Flags().String("is-false-positive", "", "") cmd.Flags().String("is-resolved", "", "") @@ -1486,6 +1864,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } } + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsSensitivedataFindingsAllowlistBatch(cmd.Context(), in) if err != nil { return err @@ -1494,6 +1880,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/sensitivedata/findings/allowlist/batch") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1512,6 +1900,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.GetSecretsSensitivedataFindingsFindingIdInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.GetSecretsSensitivedataFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -1524,6 +1920,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/sensitivedata/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1570,6 +1968,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.PatchSecretsSensitivedataFindingsFindingId(cmd.Context(), in) if err != nil { return err @@ -1582,6 +1988,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "PATCH /secrets/sensitivedata/findings/{findingId}") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1630,6 +2038,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsSensitivedataFindingsFindingIdAllowlist(cmd.Context(), in) if err != nil { return err @@ -1638,11 +2054,51 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/sensitivedata/findings/{findingId}/allowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) } + { + cmd := &cobra.Command{ + Use: "delete-sensitivedata-findings-ticket ", + Short: "Delete Ticket for Sensitive Data Finding", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + client, err := getClient(cmd.Context()) + if err != nil { + cmd.SilenceUsage = true + return err + } + in := api.DeleteSecretsSensitivedataFindingsFindingIdTicketInput{} + in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } + out, err := client.DeleteSecretsSensitivedataFindingsFindingIdTicket(cmd.Context(), in) + if err != nil { + return err + } + data, err := json.Marshal(out) + if err != nil { + return err + } + return output.Print(cmd, data) + }, + } + preserveRuntimeUsage(cmd) + setRoute(cmd, "DELETE /secrets/sensitivedata/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") + serviceCmd.AddCommand(cmd) + } + { cmd := &cobra.Command{ Use: "create-sensitivedata-findings-ticket-by-id ", @@ -1686,6 +2142,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.CreateSecretsSensitivedataFindingsFindingIdTicket(cmd.Context(), in) if err != nil { return err @@ -1698,6 +2162,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/sensitivedata/findings/{findingId}/ticket") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1716,6 +2182,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsSensitivedataFindingsFindingIdTriageInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSecretsSensitivedataFindingsFindingIdTriage(cmd.Context(), in) if err != nil { return err @@ -1728,6 +2202,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/sensitivedata/findings/{findingId}/triage") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } @@ -1774,6 +2250,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } } in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } data, err := client.CreateSecretsSensitivedataFindingsFindingIdUnallowlist(cmd.Context(), in) if err != nil { return err @@ -1782,6 +2266,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "POST /secrets/sensitivedata/findings/{findingId}/unallowlist") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") cmd.Flags().String("data", "", "Request body as a raw JSON string") cmd.Flags().String("data-file", "", "Read request body JSON from a file (- for stdin)") serviceCmd.AddCommand(cmd) @@ -1800,6 +2286,14 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { } in := api.ListSecretsSensitivedataFindingsFindingIdUsersInput{} in.FindingID = args[0] + if v, _ := cmd.Flags().GetString("github-installation-id"); v != "" { + if n, err := strconv.ParseInt(v, 10, 64); err != nil { + return fmt.Errorf("githubInstallationId"+": %w", err) + } else { + x := n + in.GithubInstallationID = &x + } + } out, err := client.ListSecretsSensitivedataFindingsFindingIdUsers(cmd.Context(), in) if err != nil { return err @@ -1812,6 +2306,8 @@ func RegisterSecretsCommands(parent *cobra.Command, getClient ClientFactory) { }, } preserveRuntimeUsage(cmd) + setRoute(cmd, "GET /secrets/sensitivedata/findings/{findingId}/users") + cmd.Flags().String("github-installation-id", "", "Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored record has none. Ignored on customer routes.") serviceCmd.AddCommand(cmd) } diff --git a/internal/commands/surface.go b/internal/commands/surface.go new file mode 100644 index 0000000..af2b451 --- /dev/null +++ b/internal/commands/surface.go @@ -0,0 +1,146 @@ +package commands + +import ( + "errors" + "fmt" + "slices" + "sort" + "strings" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" +) + +// Errors for a change to the command surface with no recorded decision. +var ( + ErrCommandDisappeared = errors.New("command disappeared without a recorded decision") + ErrFlagDisappeared = errors.New("flag disappeared without a recorded decision") + ErrArgsChanged = errors.New("positional arguments changed") + ErrRouteChanged = errors.New("route changed without a recorded move") + ErrNotInSnapshot = errors.New("command is not in the snapshot") +) + +// SurfaceEntry is one line of the command surface snapshot. +type SurfaceEntry struct { + Command string + Args string + Route string + Deprecated bool + Flags []string +} + +// Surface walks a command tree and returns every command, sorted by path. +func Surface(root *cobra.Command) []SurfaceEntry { + var entries []SurfaceEntry + var walk func(*cobra.Command) + walk = func(cmd *cobra.Command) { + entries = append(entries, surfaceEntry(cmd)) + for _, child := range cmd.Commands() { + if child.Name() != "help" { + walk(child) + } + } + } + walk(root) + + sort.Slice(entries, func(i, j int) bool { return entries[i].Command < entries[j].Command }) + return entries +} + +func surfaceEntry(cmd *cobra.Command) SurfaceEntry { + var flags []string + collect := func(f *pflag.Flag) { + if f.Name != "help" && f.Name != "version" { + flags = append(flags, f.Name) + } + } + cmd.LocalNonPersistentFlags().VisitAll(collect) + cmd.PersistentFlags().VisitAll(collect) + sort.Strings(flags) + + return SurfaceEntry{ + Command: cmd.CommandPath(), + Args: strings.Join(strings.Fields(cmd.Use)[1:], " "), + Route: Route(cmd), + Deprecated: cmd.Deprecated != "", + Flags: flags, + } +} + +// FormatSurface renders entries as the tab-separated snapshot text. +func FormatSurface(entries []SurfaceEntry) string { + var sb strings.Builder + for _, e := range entries { + status := "active" + if e.Deprecated { + status = "deprecated" + } + fmt.Fprintf(&sb, "%s\t%s\t%s\t%s\t%s\n", e.Command, e.Args, e.Route, strings.Join(e.Flags, ","), status) + } + return sb.String() +} + +// ParseSurface reads the snapshot text. +func ParseSurface(text string) ([]SurfaceEntry, error) { + var entries []SurfaceEntry + for i, line := range strings.Split(strings.TrimRight(text, "\n"), "\n") { + fields := strings.Split(line, "\t") + if len(fields) != 5 { + return nil, fmt.Errorf("surface line %d: want 5 fields, got %d", i+1, len(fields)) + } + entry := SurfaceEntry{Command: fields[0], Args: fields[1], Route: fields[2], Deprecated: fields[4] == "deprecated"} + if fields[3] != "" { + entry.Flags = strings.Split(fields[3], ",") + } + entries = append(entries, entry) + } + return entries, nil +} + +// CheckSurface reports every change from base to live that breaks a script and +// has no recorded decision. A new command or flag is not a break. +func CheckSurface(base, live []SurfaceEntry, decisions SurfaceDecisions) error { + liveByCommand := map[string]SurfaceEntry{} + for _, e := range live { + liveByCommand[e.Command] = e + } + + var errs []error + for _, want := range base { + got, ok := liveByCommand[want.Command] + if !ok { + if !decisions.commandRemoved(want.Command) { + errs = append(errs, fmt.Errorf("%w: %s", ErrCommandDisappeared, want.Command)) + } + continue + } + if got.Args != want.Args && !decisions.commandMoved(want.Command) { + errs = append(errs, fmt.Errorf("%w: %s: %q to %q", ErrArgsChanged, want.Command, want.Args, got.Args)) + } + if want.Route != "" && got.Route != want.Route && !decisions.commandMoved(want.Command) { + errs = append(errs, fmt.Errorf("%w: %s: %s to %s", ErrRouteChanged, want.Command, want.Route, got.Route)) + } + for _, flag := range want.Flags { + if !slices.Contains(got.Flags, flag) { + errs = append(errs, fmt.Errorf("%w: %s --%s", ErrFlagDisappeared, want.Command, flag)) + } + } + } + return errors.Join(errs...) +} + +// CheckSnapshotComplete reports a live command that the snapshot does not list. +func CheckSnapshotComplete(snapshot, live []SurfaceEntry) error { + listed := map[string]bool{} + for _, e := range snapshot { + listed[e.Command] = true + } + + var errs []error + for _, e := range live { + if !listed[e.Command] { + errs = append(errs, fmt.Errorf("%w: %s", ErrNotInSnapshot, e.Command)) + } + } + return errors.Join(errs...) +} diff --git a/internal/commands/surface_decisions.go b/internal/commands/surface_decisions.go new file mode 100644 index 0000000..8bb1bd2 --- /dev/null +++ b/internal/commands/surface_decisions.go @@ -0,0 +1,53 @@ +package commands + +// Decisions is the record of command surface changes for this CLI. Every row +// has passed review. The evidence for a removal names the monorepo change that +// took the route away. +var Decisions = SurfaceDecisions{ + Moved: []MovedCommand{ + {From: "nullify api asset-graph list-reachability", To: "nullify api context list-reachability"}, + {From: "nullify api asset-graph list-search", To: "nullify api context list-search"}, + {From: "nullify api asset-graph list-subgraph", To: "nullify api context list-subgraph"}, + {From: "nullify api asset-graph list-summary", To: "nullify api context list-asset-graph-summary"}, + {From: "nullify api infrastructure list-graphs", To: "nullify api context list-graphs"}, + {From: "nullify api infrastructure list-info", To: "nullify api context list-info"}, + {From: "nullify api infrastructure list-summary", To: "nullify api context list-infrastructure-graphs-summary"}, + {From: "nullify api infrastructure get-graphs", To: "nullify api context get-graphs"}, + {From: "nullify api infrastructure get-download", To: "nullify api context get-download"}, + {From: "nullify api infrastructure get-graphs-versions", To: "nullify api context get-infrastructure-graphs-versions"}, + {From: "nullify api infrastructure get-graphs-versions-2", To: "nullify api context get-infrastructure-graphs-versions-2"}, + }, + RemovedCommands: []RemovedCommand{ + {Command: "nullify api admin create-initialize", Route: "POST /admin/repositories/initialize", Evidence: "#15172 deleted legacy repository enrollment; use update-repositories-scan-scope"}, + {Command: "nullify api admin create-uninitialize", Route: "POST /admin/repositories/uninitialize", Evidence: "#15172 deleted legacy repository enrollment; use update-repositories-scan-scope"}, + {Command: "nullify api context list-cloud-accounts", Route: "GET /context/asset-inventory/cloud-accounts", Evidence: "#2758 replaced this with per-category inventory (nullify api context list-asset-inventory), with a different response"}, + {Command: "nullify api context list-cloud-resources", Route: "GET /context/asset-inventory/cloud-resources", Evidence: "#2758 replaced this with list-asset-inventory, with a different response"}, + {Command: "nullify api context list-public-facing", Route: "GET /context/asset-inventory/public-facing", Evidence: "#2758 replaced this with list-public, with a different response"}, + {Command: "nullify api context list-resources", Route: "GET /context/asset-inventory/resources", Evidence: "#2758 replaced this with list-asset-inventory, with a different response"}, + {Command: "nullify api cspm get-diff", Route: "GET /cspm/findings/{findingId}/autofix/cache/diff", Evidence: "#12577 removed the CSPM fix cache; use get-state"}, + {Command: "nullify api manager create-credits", Route: "POST /manager/credits", Evidence: "#13015 removed the legacy credits system"}, + {Command: "nullify api manager list-credits", Route: "GET /manager/credits", Evidence: "#13015 removed the legacy credits system"}, + {Command: "nullify api manager delete-customer-questions", Route: "DELETE /manager/customer-questions", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, + {Command: "nullify api manager delete-customer-questions-2", Route: "DELETE /manager/customer-questions/{questionSetId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, + {Command: "nullify api manager delete-questions", Route: "DELETE /manager/customer-questions/{questionSetId}/questions/{questionId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, + {Command: "nullify api manager get-customer-questions", Route: "GET /manager/customer-questions/{questionSetId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, + {Command: "nullify api manager list-customer-questions", Route: "GET /manager/customer-questions", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, + {Command: "nullify api manager patch-answers", Route: "PATCH /manager/customer-questions/{questionSetId}/answers/{questionId}", Evidence: "#5596 replaced customer questions with action items; use list-action-items"}, + {Command: "nullify api manager list-escalations", Route: "GET /manager/escalations", Evidence: "#5596 replaced escalations with action items; use list-action-items"}, + {Command: "nullify api manager patch-escalations", Route: "PATCH /manager/escalations/{escalationId}", Evidence: "#5596 replaced escalations with action items; use list-action-items"}, + {Command: "nullify api orchestrator create-complete", Route: "POST /orchestrator/onboarding/complete", Evidence: "the route registers only when running locally, so it can only 404 in a deployed stack"}, + {Command: "nullify api sca get-sbom", Route: "GET /sca/repositories/{repositoryId}/sbom", Evidence: "#13504 moved SBOMs to context; use nullify sbom get or nullify api context get-sboms-repository-latest"}, + {Command: "nullify api scpm create-cache-by-id", Route: "POST /scpm/findings/{findingId}/autofix/cache", Evidence: "#12580 retired the SCPM fix cache"}, + {Command: "nullify api scpm create-create_pr-by-id", Route: "POST /scpm/findings/{findingId}/autofix/cache/create_pr", Evidence: "#12580 retired the SCPM fix cache"}, + {Command: "nullify api scpm get-diff", Route: "GET /scpm/findings/{findingId}/autofix/cache/diff", Evidence: "#12580 retired the SCPM fix cache; use get-state"}, + {Command: "nullify api scpm create-retriage", Route: "POST /scpm/findings/retriage", Evidence: "#5479 moved retriage to orchestrator create-retriage, with a different request body"}, + {Command: "nullify api scpm list-dependencies", Route: "GET /scpm/dependencies", Evidence: "#13491 cut the SCPM schema to the SAST shape; use create-dependencies-analyze or create-batch"}, + {Command: "nullify pentest get-pentest-findings-autofix-cache-diff", Route: "GET /dast/pentest/findings/{findingId}/autofix/cache/diff", Evidence: "#12688 removed retired DAST previews; use get-state"}, + }, + RetiredFlags: []RetiredFlag{ + {Command: "nullify api asset-graph list-reachability", Flag: "account-id", Evidence: "GET /context/asset-graph/reachability has no account filter; the flag has no effect"}, + {Command: "nullify api asset-graph list-subgraph", Flag: "account-id", Evidence: "GET /context/asset-graph/subgraph has no account filter; the flag has no effect"}, + {Command: "nullify api cspm list-scans", Flag: "region", Evidence: "GET /cspm/scans no longer filters by region; the flag has no effect"}, + {Command: "nullify api cspm list-scans", Flag: "scan-type", Evidence: "GET /cspm/scans no longer filters by scan type; the flag has no effect"}, + }, +} diff --git a/internal/commands/surface_test.go b/internal/commands/surface_test.go new file mode 100644 index 0000000..ca423df --- /dev/null +++ b/internal/commands/surface_test.go @@ -0,0 +1,116 @@ +package commands + +import ( + "testing" + + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" +) + +func TestCheckSurface(t *testing.T) { + base := SurfaceEntry{Command: "nullify api cspm list-scans", Route: "GET /cspm/scans", Args: "", Flags: []string{"limit", "region"}} + + tests := []struct { + name string + live []SurfaceEntry + decisions SurfaceDecisions + want error + }{ + {name: "unchanged", live: []SurfaceEntry{base}}, + { + name: "new flag and new command are allowed", + live: []SurfaceEntry{ + {Command: base.Command, Route: base.Route, Args: base.Args, Flags: []string{"limit", "offset", "region"}}, + {Command: "nullify api cspm get-triage"}, + }, + }, + {name: "command gone", live: nil, want: ErrCommandDisappeared}, + {name: "command renamed", live: []SurfaceEntry{{Command: "nullify api cspm list-cspm-scans", Route: base.Route, Args: base.Args, Flags: base.Flags}}, want: ErrCommandDisappeared}, + {name: "command gone with a decision", live: nil, decisions: SurfaceDecisions{RemovedCommands: []RemovedCommand{{Command: base.Command}}}}, + {name: "flag gone", live: []SurfaceEntry{{Command: base.Command, Route: base.Route, Args: base.Args, Flags: []string{"limit"}}}, want: ErrFlagDisappeared}, + {name: "route changed", live: []SurfaceEntry{{Command: base.Command, Route: "GET /cspm/other", Args: base.Args, Flags: base.Flags}}, want: ErrRouteChanged}, + { + name: "route changed with a move", + live: []SurfaceEntry{{Command: base.Command, Route: "GET /context/scans", Args: base.Args, Flags: base.Flags}}, + decisions: SurfaceDecisions{Moved: []MovedCommand{{From: base.Command, To: "nullify api context list-scans"}}}, + }, + {name: "arguments changed", live: []SurfaceEntry{{Command: base.Command, Route: base.Route, Args: " ", Flags: base.Flags}}, want: ErrArgsChanged}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := CheckSurface([]SurfaceEntry{base}, tt.live, tt.decisions) + + require.ErrorIs(t, err, tt.want) + }) + } +} + +func TestCheckSnapshotComplete(t *testing.T) { + listed := SurfaceEntry{Command: "nullify findings"} + + tests := []struct { + name string + live []SurfaceEntry + want error + }{ + {name: "all listed", live: []SurfaceEntry{listed}}, + {name: "new command not listed", live: []SurfaceEntry{listed, {Command: "nullify new"}}, want: ErrNotInSnapshot}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.ErrorIs(t, CheckSnapshotComplete([]SurfaceEntry{listed}, tt.live), tt.want) + }) + } +} + +func TestSurfaceFormatRoundTrip(t *testing.T) { + entries := []SurfaceEntry{ + {Command: "nullify", Flags: []string{"host"}}, + {Command: "nullify api old", Args: "", Route: "GET /new/{id}", Deprecated: true, Flags: []string{"data", "limit"}}, + } + + parsed, err := ParseSurface(FormatSurface(entries)) + + require.ErrorIs(t, err, nil) + require.Equal(t, entries, parsed) +} + +func TestApplySurfaceDecisions(t *testing.T) { + var ran []string + target := &cobra.Command{ + Use: "list-search ", + Annotations: map[string]string{routeAnnotation: "GET /context/asset-graph/search"}, + RunE: func(_ *cobra.Command, args []string) error { + ran = args + return nil + }, + } + target.Flags().String("limit", "", "") + + api := &cobra.Command{Use: "api"} + api.AddCommand(&cobra.Command{Use: "context"}) + api.Commands()[0].AddCommand(target) + root := &cobra.Command{Use: "nullify"} + root.AddCommand(api) + + ApplySurfaceDecisions(root, SurfaceDecisions{ + Moved: []MovedCommand{{From: "nullify api asset-graph list-search", To: "nullify api context list-search"}}, + RetiredFlags: []RetiredFlag{{Command: "nullify api asset-graph list-search", Flag: "account-id", Evidence: "no effect"}}, + }) + + root.SetArgs([]string{"api", "asset-graph", "list-search", "n1", "--limit", "5", "--account-id", "a1"}) + require.ErrorIs(t, root.Execute(), nil) + + alias, _, err := root.Find([]string{"api", "asset-graph", "list-search"}) + require.ErrorIs(t, err, nil) + require.Equal(t, []string{"n1"}, ran) + require.NotEmpty(t, alias.Deprecated) + require.Equal(t, "GET /context/asset-graph/search", Route(alias)) + require.Equal(t, SurfaceEntry{ + Command: "nullify api asset-graph list-search", + Args: "", + Route: "GET /context/asset-graph/search", + Deprecated: true, + Flags: []string{"account-id", "limit"}, + }, surfaceEntry(alias)) +} diff --git a/internal/findings/findings_test.go b/internal/findings/findings_test.go new file mode 100644 index 0000000..2f27a97 --- /dev/null +++ b/internal/findings/findings_test.go @@ -0,0 +1,923 @@ +package findings + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "strings" + "sync" + "testing" + "time" + + "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/apierror" + "github.com/stretchr/testify/require" +) + +type request struct { + Method string + Path string + Body string +} + +// fakeTransport records every request and answers from respond. +type fakeTransport struct { + mu sync.Mutex + requests []request + respond func(call int, r request) (int, string) +} + +func (f *fakeTransport) RoundTrip(req *http.Request) (*http.Response, error) { + var body []byte + if req.Body != nil { + body, _ = io.ReadAll(req.Body) + } + r := request{Method: req.Method, Path: req.URL.Path, Body: string(body)} + + f.mu.Lock() + f.requests = append(f.requests, r) + call := len(f.requests) + f.mu.Unlock() + + status, response := 200, "{}" + if f.respond != nil { + status, response = f.respond(call, r) + } + return &http.Response{StatusCode: status, Body: io.NopCloser(strings.NewReader(response)), Header: make(http.Header), Request: req}, nil +} + +func clientFor(ft *fakeTransport) *api.Client { + return api.NewClient("acme.nullify.ai", "tok", map[string]string{}, api.WithHTTPClient(&http.Client{Transport: ft})) +} + +func verbNamed(t *testing.T, name string) Verb { + t.Helper() + for _, v := range Verbs { + if v.Name == name { + return v + } + } + t.Fatalf("no verb %q", name) + return Verb{} +} + +func TestVerbRun(t *testing.T) { + falsePositive := Params{Reason: "public by design", AllowlistType: "UserFalsePositive"} + + tests := []struct { + name string + verb string + findType string + id string + params Params + want error + requests []request + }{ + { + name: "cspm allowlist", verb: "allowlist", findType: "cspm", id: "f1", params: falsePositive, + requests: []request{{"POST", "/cspm/findings/f1/allowlist", `{"allowlistReason":"public by design","allowlistType":"UserFalsePositive"}`}}, + }, + { + name: "cspm unallowlist", verb: "unallowlist", findType: "cspm", id: "f1", params: Params{Reason: "reopen"}, + requests: []request{{"POST", "/cspm/findings/f1/unallowlist", `{"unallowlistReason":"reopen"}`}}, + }, + { + name: "cspm archive", verb: "archive", findType: "cspm", id: "f1", + requests: []request{{"POST", "/cspm/findings/f1/archive", `{}`}}, + }, + { + name: "cspm unarchive", verb: "unarchive", findType: "cspm", id: "f1", + requests: []request{{"POST", "/cspm/findings/f1/unarchive", `{}`}}, + }, + { + name: "cspm mark false positive", verb: "mark-false-positive", findType: "cspm", id: "f1", params: Params{Reason: "public by design"}, + requests: []request{{"POST", "/cspm/findings/f1/mark-false-positive", `{"falsePositiveReason":"public by design"}`}}, + }, + { + name: "cspm unmark false positive", verb: "unmark-false-positive", findType: "cspm", id: "f1", + requests: []request{{"POST", "/cspm/findings/f1/unmark-false-positive", `{}`}}, + }, + { + name: "cspm triage", verb: "triage", findType: "cspm", id: "f1", + requests: []request{{"GET", "/cspm/findings/f1/triage", ""}}, + }, + { + name: "cspm delete ticket", verb: "delete-ticket", findType: "cspm", id: "f1", + requests: []request{{"DELETE", "/cspm/findings/f1/ticket", ""}}, + }, + { + name: "scpm create ticket", verb: "create-ticket", findType: "scpm", id: "f1", + requests: []request{{"POST", "/scpm/findings/f1/ticket", `{}`}}, + }, + { + name: "sast allowlist keeps the POST body", verb: "allowlist", findType: "sast", id: "f1", params: falsePositive, + requests: []request{{"POST", "/sast/findings/f1/allowlist", `{"allowlistReason":"public by design","allowlistType":"UserFalsePositive"}`}}, + }, + { + name: "bughunt allowlist keeps the PATCH body", verb: "allowlist", findType: "bughunt", id: "f1", params: falsePositive, + requests: []request{{"PATCH", "/dast/bughunt/findings/f1/allowlist", `{"allow":true,"reason":"public by design"}`}}, + }, + { + name: "bughunt unallowlist sends allow false", verb: "unallowlist", findType: "bughunt", id: "f1", params: Params{Reason: "reopen"}, + requests: []request{{"PATCH", "/dast/bughunt/findings/f1/allowlist", `{"allow":false,"reason":"reopen"}`}}, + }, + { + name: "alias reaches the same type", verb: "get", findType: "sca", id: "f1", + requests: []request{{"GET", "/sca/dependencies/findings/f1", ""}}, + }, + {name: "allowlist without a reason", verb: "allowlist", findType: "cspm", id: "f1", params: Params{AllowlistType: "UserFixed"}, want: ErrReasonRequired}, + {name: "allowlist with a blank reason", verb: "allowlist", findType: "cspm", id: "f1", params: Params{Reason: " ", AllowlistType: "UserFixed"}, want: ErrReasonRequired}, + {name: "allowlist without a type", verb: "allowlist", findType: "cspm", id: "f1", params: Params{Reason: "r"}, want: ErrInvalidAllowlistType}, + {name: "allowlist with the server-only AI type", verb: "allowlist", findType: "cspm", id: "f1", params: Params{Reason: "r", AllowlistType: "AI"}, want: ErrInvalidAllowlistType}, + {name: "allowlist with a retired system type", verb: "allowlist", findType: "cspm", id: "f1", params: Params{Reason: "r", AllowlistType: "RuleException"}, want: ErrInvalidAllowlistType}, + {name: "archive on a type with no route", verb: "archive", findType: "sast", id: "f1", want: ErrUnsupported}, + {name: "mark false positive on a type with no route", verb: "mark-false-positive", findType: "scpm", id: "f1", params: Params{Reason: "r"}, want: ErrUnsupported}, + {name: "unknown type", verb: "get", findType: "typo", id: "f1", want: ErrUnknownType}, + {name: "empty finding ID", verb: "get", findType: "sast", id: "", want: ErrFindingIDRequired}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{} + + _, err := verbNamed(t, tt.verb).Run(context.Background(), clientFor(ft), tt.findType, tt.id, tt.params) + + require.ErrorIs(t, err, tt.want) + require.Equal(t, tt.requests, ft.requests) + }) + } +} + +func TestVerbTypes(t *testing.T) { + tests := []struct { + verb string + want []string + }{ + {verb: "allowlist", want: []string{"bughunt", "cspm", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm", "secrets", "secrets_sensitive_data"}}, + {verb: "unallowlist", want: []string{"bughunt", "cspm", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm", "secrets", "secrets_sensitive_data"}}, + {verb: "triage", want: []string{"bughunt", "cspm", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm", "secrets", "secrets_sensitive_data"}}, + {verb: "create-ticket", want: []string{"bughunt", "cspm", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm", "secrets", "secrets_sensitive_data"}}, + {verb: "fix-status", want: []string{"cspm", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm"}}, + {verb: "fix-diff", want: []string{"sast", "sca_dependencies"}}, + {verb: "archive", want: []string{"cspm"}}, + {verb: "unarchive", want: []string{"cspm"}}, + {verb: "mark-false-positive", want: []string{"cspm"}}, + {verb: "unmark-false-positive", want: []string{"cspm", "scpm"}}, + } + for _, tt := range tests { + t.Run(tt.verb, func(t *testing.T) { + require.Equal(t, tt.want, verbNamed(t, tt.verb).Types()) + }) + } +} + +func TestAPITypesFor(t *testing.T) { + tests := []struct { + name string + want []string + err error + }{ + {name: "sast", want: []string{"Code"}}, + {name: "sca", want: []string{"Dependencies", "Containers"}}, + {name: "dependencies", want: []string{"Dependencies"}}, + {name: "containers", want: []string{"Containers"}}, + {name: "secrets", want: []string{"SecretsCredentials", "SecretsSensitiveData"}}, + {name: "secrets_sensitive_data", want: []string{"SecretsSensitiveData"}}, + {name: "SecretsSensitiveData", want: []string{"SecretsSensitiveData"}}, + {name: "SecretsCredentials", want: []string{"SecretsCredentials"}}, + {name: "secrets_credentials", want: []string{"SecretsCredentials"}}, + {name: "Platform", want: []string{"SupplyChain"}}, + {name: "Unknown", err: ErrUnknownType}, + {name: "dast_bughunt", want: []string{"BugHunt"}}, + {name: "dast_pentest", want: []string{"Pentest"}}, + {name: "bughunt", want: []string{"BugHunt"}}, + {name: "cspm", want: []string{"Cloud"}}, + {name: "scpm", want: []string{"SupplyChain"}}, + {name: "Cloud", want: []string{"Cloud"}}, + {name: "SupplyChain", want: []string{"SupplyChain"}}, + {name: "typo", err: ErrUnknownType}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := APITypesFor(tt.name) + + require.ErrorIs(t, err, tt.err) + require.Equal(t, tt.want, got) + }) + } +} + +func page(findings, total int, hasMore bool) string { + items := make([]string, findings) + for i := range items { + items[i] = "{}" + } + return fmt.Sprintf(`{"findings":[%s],"total":%d,"hasMoreData":%t,"page":1}`, strings.Join(items, ","), total, hasMore) +} + +func TestSearchKeepsRowsAsSent(t *testing.T) { + tests := []struct { + name string + row string + }{ + {name: "a short row gains no fields", row: `{"id":"f1","type":"Code","severity":"HIGH","title":"t","repository":"r"}`}, + {name: "a field the models do not have stays", row: `{"id":"f1","addedLater":{"a":[1,2]}}`}, + {name: "a field of a changed type does not fail the list", row: `{"id":"f1","isFalsePositive":"no","createdAt":12}`}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(int, request) (int, string) { + return 200, `{"findings":[` + tt.row + `],"total":1,"hasMoreData":false}` + }} + + got, err := Search(context.Background(), clientFor(ft), SearchOptions{Limit: 10}) + + require.ErrorIs(t, err, nil) + require.Equal(t, tt.row, string(got.Findings[0])) + }) + } +} + +func TestSearchRejectsAnUnreadableResponse(t *testing.T) { + tests := []struct { + name string + body string + }{ + {name: "no findings field", body: `{}`}, + {name: "a null findings field", body: `{"findings":null,"total":0}`}, + {name: "findings is not a list", body: `{"findings":{},"total":0}`}, + {name: "not JSON", body: ``}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(int, request) (int, string) { return 200, tt.body }} + + _, err := Search(context.Background(), clientFor(ft), SearchOptions{Limit: 10}) + + require.ErrorIs(t, err, ErrUnreadableResponse) + }) + } +} + +func TestHasRepository(t *testing.T) { + tests := []struct { + name string + apiTypes []string + want bool + }{ + {name: "every type", want: true}, + {name: "code", apiTypes: []string{"Code"}, want: true}, + {name: "pentest", apiTypes: []string{"Pentest"}, want: true}, + {name: "sensitive data", apiTypes: []string{"SecretsSensitiveData"}, want: true}, + {name: "cloud", apiTypes: []string{"Cloud"}}, + {name: "bug hunt", apiTypes: []string{"BugHunt"}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, HasRepository(tt.apiTypes)) + }) + } +} + +func TestSearchReportsCompleteness(t *testing.T) { + tests := []struct { + name string + opts SearchOptions + pages []string + wantErr error + wantTotal int + wantReturned int + truncated bool + wantCalls int + }{ + { + name: "empty result", opts: SearchOptions{Limit: 100}, + pages: []string{page(0, 0, false)}, wantCalls: 1, + }, + { + name: "complete result", opts: SearchOptions{Limit: 100}, + pages: []string{page(3, 3, false)}, wantTotal: 3, wantReturned: 3, wantCalls: 1, + }, + { + name: "stopped at the limit", opts: SearchOptions{Limit: 150}, + pages: []string{page(100, 400, true), page(100, 400, true)}, wantTotal: 400, wantReturned: 150, truncated: true, wantCalls: 2, + }, + { + name: "server promises more but returns nothing", opts: SearchOptions{Limit: 100}, + pages: []string{page(20, 40, true), page(0, 40, true)}, wantTotal: 40, wantReturned: 20, truncated: true, wantCalls: 2, + }, + {name: "a zero limit is rejected", opts: SearchOptions{Limit: 0}, wantErr: ErrInvalidLimit}, + {name: "a negative limit is rejected", opts: SearchOptions{Limit: -1}, wantErr: ErrInvalidLimit}, + {name: "an unknown status is rejected", opts: SearchOptions{Limit: 10, Status: "allowlisted"}, wantErr: ErrInvalidStatus}, + {name: "a plain from date is rejected", opts: SearchOptions{Limit: 10, From: "2026-11-01"}, wantErr: ErrInvalidTime}, + {name: "a plain to date is rejected", opts: SearchOptions{Limit: 10, To: "2026-11-01"}, wantErr: ErrInvalidTime}, + {name: "a to time with a space is rejected", opts: SearchOptions{Limit: 10, To: "2026-11-01 10:00:00"}, wantErr: ErrInvalidTime}, + {name: "words are rejected", opts: SearchOptions{Limit: 10, From: "yesterday"}, wantErr: ErrInvalidTime}, + {name: "RFC 3339 with an offset is accepted", opts: SearchOptions{Limit: 10, From: "2026-11-01T00:00:00+10:00"}, pages: []string{page(0, 0, false)}, wantCalls: 1}, + {name: "fractional seconds are accepted", opts: SearchOptions{Limit: 10, To: "2026-11-01T00:00:00.5Z"}, pages: []string{page(0, 0, false)}, wantCalls: 1}, + {name: "a time with no zone is accepted, as on the server", opts: SearchOptions{Limit: 10, To: "2026-11-01T00:00:00"}, pages: []string{page(0, 0, false)}, wantCalls: 1}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(call int, _ request) (int, string) { + return 200, tt.pages[call-1] + }} + + got, err := Search(context.Background(), clientFor(ft), tt.opts) + + require.ErrorIs(t, err, tt.wantErr) + require.Equal(t, tt.wantTotal, got.Total) + require.Equal(t, tt.wantReturned, got.Returned) + require.Len(t, got.Findings, tt.wantReturned) + require.Equal(t, tt.truncated, got.Truncated) + require.Len(t, ft.requests, tt.wantCalls) + }) + } +} + +func TestSearchReturnsNoAccessAsAnError(t *testing.T) { + ft := &fakeTransport{respond: func(int, request) (int, string) { return 403, `{"error":"forbidden"}` }} + + got, err := Search(context.Background(), clientFor(ft), SearchOptions{Limit: 100}) + + var apiErr *apierror.APIError + require.ErrorAs(t, err, &apiErr) + require.Equal(t, 403, apiErr.StatusCode) + require.Empty(t, got.Findings) +} + +func TestSearchSendsFilters(t *testing.T) { + yes, no := true, false + + tests := []struct { + name string + opts SearchOptions + want map[string]any + }{ + { + name: "cspm with a UTC window", + opts: SearchOptions{Limit: 40, APITypes: []string{"Cloud"}, From: "2026-11-01T00:00:00Z", To: "2026-11-02T00:00:00Z"}, + want: map[string]any{"page": 1.0, "pageSize": 40.0, "type": []any{"Cloud"}, "fromDate": "2026-11-01T00:00:00Z", "toDate": "2026-11-02T00:00:00Z"}, + }, + { + name: "severity is sent upper-case with repository", + opts: SearchOptions{Limit: 10, Severity: "critical", Repository: "my-repo"}, + want: map[string]any{"page": 1.0, "pageSize": 20.0, "severity": []any{"CRITICAL"}, "repository": []any{"my-repo"}}, + }, + { + name: "a full repository name also sends the bare name that most findings hold", + opts: SearchOptions{Limit: 10, Repository: "my-org/my-repo"}, + want: map[string]any{"page": 1.0, "pageSize": 20.0, "repository": []any{"my-org/my-repo", "my-repo"}}, + }, + {name: "open", opts: SearchOptions{Limit: 500, Status: "open"}, want: map[string]any{"page": 1.0, "pageSize": 100.0, "isResolved": no}}, + {name: "fixed", opts: SearchOptions{Limit: 100, Status: "fixed"}, want: map[string]any{"page": 1.0, "pageSize": 100.0, "isFixed": yes}}, + {name: "false positive", opts: SearchOptions{Limit: 100, Status: "false_positive"}, want: map[string]any{"page": 1.0, "pageSize": 100.0, "isFalsePositive": yes}}, + {name: "accepted risk", opts: SearchOptions{Limit: 100, Status: "accepted_risk"}, want: map[string]any{"page": 1.0, "pageSize": 100.0, "isAllowlisted": yes}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(int, request) (int, string) { return 200, page(0, 0, false) }} + + _, err := Search(context.Background(), clientFor(ft), tt.opts) + + require.ErrorIs(t, err, nil) + var body struct { + Query map[string]any `json:"query"` + } + require.NoError(t, json.Unmarshal([]byte(ft.requests[0].Body), &body)) + require.Equal(t, tt.want, body.Query) + }) + } +} + +func TestSearchKeepsPageSizeConstantAcrossPages(t *testing.T) { + ft := &fakeTransport{respond: func(int, request) (int, string) { return 200, page(100, 1000, true) }} + + got, err := Search(context.Background(), clientFor(ft), SearchOptions{Limit: 250}) + + require.ErrorIs(t, err, nil) + require.Equal(t, 250, got.Returned) + require.Len(t, ft.requests, 3) + for i, r := range ft.requests { + require.Contains(t, r.Body, `"pageSize":100`) + require.Contains(t, r.Body, fmt.Sprintf(`"page":%d`, i+1)) + } +} + +func TestFeedback(t *testing.T) { + tests := []struct { + name string + run func(context.Context, *api.Client) (json.RawMessage, error) + want error + requests []request + }{ + { + name: "submit with a comment", + run: func(ctx context.Context, c *api.Client) (json.RawMessage, error) { + return SubmitFeedback(ctx, c, "f1", "wrong", "not reachable") + }, + requests: []request{{"POST", "/findings/f1/feedback", `{"commentText":"not reachable","verdict":"wrong"}`}}, + }, + { + name: "submit without a comment", + run: func(ctx context.Context, c *api.Client) (json.RawMessage, error) { + return SubmitFeedback(ctx, c, "f1", "up", "") + }, + requests: []request{{"POST", "/findings/f1/feedback", `{"verdict":"up"}`}}, + }, + { + name: "an unknown verdict is rejected", + run: func(ctx context.Context, c *api.Client) (json.RawMessage, error) { + return SubmitFeedback(ctx, c, "f1", "meh", "") + }, + want: ErrInvalidVerdict, + }, + { + name: "submit needs a finding", + run: func(ctx context.Context, c *api.Client) (json.RawMessage, error) { + return SubmitFeedback(ctx, c, "", "up", "") + }, + want: ErrFindingIDRequired, + }, + { + name: "list", + run: func(ctx context.Context, c *api.Client) (json.RawMessage, error) { + return ListFeedback(ctx, c, "f1") + }, + requests: []request{{"GET", "/findings/f1/feedback", ""}}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{} + + _, err := tt.run(context.Background(), clientFor(ft)) + + require.ErrorIs(t, err, tt.want) + require.Equal(t, tt.requests, ft.requests) + }) + } +} + +func TestAutofixPhaseDone(t *testing.T) { + newPR := []AutofixPullRequest{{URL: "http://new"}, {URL: "http://old"}} + oldPR := []AutofixPullRequest{{URL: "http://old"}} + earlier := []string{"http://old"} + + tests := []struct { + name string + st AutofixStatus + watchPR bool + want bool + }{ + {"agent in progress", AutofixStatus{State: "in_progress_agent"}, false, false}, + {"cached is terminal for fix", AutofixStatus{State: "cached", Terminal: true}, false, true}, + {"pending_review terminal for fix", AutofixStatus{State: "pending_review", Terminal: true}, false, true}, + {"failed_retry is terminal for fix", AutofixStatus{State: "failed_retry", Terminal: true}, false, true}, + {"cached without PR keeps waiting", AutofixStatus{State: "cached", Terminal: true}, true, false}, + {"cached with an earlier PR keeps waiting", AutofixStatus{State: "cached", Terminal: true, PullRequests: oldPR}, true, false}, + {"cached with a new PR is done", AutofixStatus{State: "cached", Terminal: true, PullRequests: newPR}, true, true}, + {"new PR ends the wait before terminal", AutofixStatus{State: "in_progress_draft", PullRequests: newPR}, true, true}, + {"pr_merged terminal done", AutofixStatus{State: "pr_merged", Terminal: true}, true, true}, + {"failed_pr_creation done", AutofixStatus{State: "failed_pr_creation", Terminal: true}, true, true}, + {"creating_pr still waiting", AutofixStatus{State: "in_progress_creating_pr"}, true, false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, autofixPhaseDone(tt.st, tt.watchPR, earlier)) + }) + } +} + +func TestFix(t *testing.T) { + const ( + none = `{"status":{"state":"none","terminal":false}}` + cached = `{"status":{"state":"cached","terminal":true}}` + hasOldPR = `{"status":{"state":"pending_review","terminal":true,"pullRequestUrl":"http://old","pullRequestState":"open","pullRequests":[{"url":"http://old","status":"open"}]}}` + hasNewPR = `{"status":{"state":"pending_review","terminal":true,"pullRequestUrl":"http://new","pullRequestState":"open","pullRequests":[{"url":"http://new","status":"open"},{"url":"http://old","status":"closed"}]}}` + noPRClosed = `{"status":{"state":"failed_pr_creation","terminal":true,"pullRequestUrl":"http://old","pullRequestState":"closed","pullRequests":[{"url":"http://old","status":"closed"}]}}` + abort = `{"status":{"state":"failed_abort","terminal":true,"autofixVerdictExplanation":"needs a design change"}}` + retry = `{"status":{"state":"failed_retry","terminal":true}}` + cancelled = `{"status":{"state":"cancelled","terminal":true}}` + iteration = `{"status":{"state":"failed_iteration","terminal":true}}` + openAfter = `{"status":{"state":"failed_iteration","terminal":true,"pullRequests":[{"url":"http://new","status":"open"},{"url":"http://old","status":"closed"}]}}` + closed = `{"status":{"state":"pr_closed","terminal":true}}` + unknown = `{"status":{"state":"a_new_terminal_state","terminal":true}}` + ) + + const ( + sastFix = "POST /sast/findings/f1/autofix/fix" + sastStatus = "GET /sast/findings/f1/autofix/status" + sastDiff = "GET /sast/findings/f1/autofix/cache/diff" + ) + + tests := []struct { + name string + findType string + createPR bool + statuses []string + diffCode int + want error + failure error + state string + routes []string + diff bool + pr *PullRequestStatus + }{ + { + name: "sast reads the diff", findType: "sast", statuses: []string{cached}, + state: "cached", routes: []string{sastFix, sastStatus, sastDiff}, diff: true, + }, + { + name: "sca alias reports the pull request of this run", findType: "sca", createPR: true, statuses: []string{hasOldPR, hasNewPR, hasNewPR}, + state: "pending_review", + routes: []string{ + "GET /sca/dependencies/findings/f1/autofix/status", + "POST /sca/dependencies/findings/f1/autofix/fix", + "GET /sca/dependencies/findings/f1/autofix/status", + "GET /sca/dependencies/findings/f1/autofix/cache/diff", + "GET /sca/dependencies/findings/f1/autofix/status", + }, + diff: true, + pr: &PullRequestStatus{State: "open", URL: "http://new"}, + }, + { + name: "cspm has no diff route", findType: "cspm", statuses: []string{cached}, + state: "cached", routes: []string{"POST /cspm/findings/f1/autofix/fix", "GET /cspm/findings/f1/autofix/status"}, + }, + { + name: "an older pull request is not reported", findType: "sast", createPR: true, statuses: []string{hasOldPR, hasOldPR, hasOldPR}, + failure: ErrNoPullRequest, state: "pending_review", + routes: []string{sastStatus, sastFix, sastStatus, sastDiff, sastStatus}, diff: true, + }, + { + name: "failed pull request creation does not report an older one", findType: "sast", createPR: true, statuses: []string{hasOldPR, cached, noPRClosed}, + failure: ErrAutofixFailed, state: "failed_pr_creation", + routes: []string{sastStatus, sastFix, sastStatus, sastDiff, sastStatus}, diff: true, + }, + { + name: "failed_abort", findType: "sast", statuses: []string{abort}, + failure: ErrAutofixFailed, state: "failed_abort", routes: []string{sastFix, sastStatus}, + }, + { + name: "failed_retry", findType: "sast", statuses: []string{retry}, + failure: ErrAutofixFailed, state: "failed_retry", routes: []string{sastFix, sastStatus}, + }, + { + name: "cancelled", findType: "sast", statuses: []string{cancelled}, + failure: ErrAutofixFailed, state: "cancelled", routes: []string{sastFix, sastStatus}, + }, + { + name: "failed_iteration", findType: "sast", statuses: []string{iteration}, + failure: ErrAutofixFailed, state: "failed_iteration", routes: []string{sastFix, sastStatus}, + }, + { + name: "failed_iteration keeps its open pull request", findType: "sast", statuses: []string{openAfter}, + failure: ErrAutofixFailed, state: "failed_iteration", routes: []string{sastFix, sastStatus}, + pr: &PullRequestStatus{State: "open", URL: "http://new"}, + }, + { + name: "pr_closed", findType: "sast", statuses: []string{closed}, + failure: ErrAutofixFailed, state: "pr_closed", routes: []string{sastFix, sastStatus}, + }, + { + name: "an unknown terminal state is a failure", findType: "sast", statuses: []string{unknown}, + failure: ErrAutofixFailed, state: "a_new_terminal_state", routes: []string{sastFix, sastStatus}, + }, + { + name: "failed run with create-pr stops after the fix phase", findType: "sast", createPR: true, statuses: []string{none, abort}, + failure: ErrAutofixFailed, state: "failed_abort", routes: []string{sastStatus, sastFix, sastStatus}, + }, + { + name: "a failed diff read keeps the pull request", findType: "sast", createPR: true, statuses: []string{hasOldPR, hasNewPR, hasNewPR}, diffCode: 404, + failure: ErrAutofixDiff, state: "pending_review", + routes: []string{sastStatus, sastFix, sastStatus, sastDiff, sastStatus}, + pr: &PullRequestStatus{State: "open", URL: "http://new"}, + }, + {name: "secrets has no autofix", findType: "secrets", want: ErrUnsupported}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + polled := 0 + ft := &fakeTransport{respond: func(_ int, r request) (int, string) { + if strings.HasSuffix(r.Path, "/diff") && tt.diffCode != 0 { + return tt.diffCode, `{}` + } + if !strings.HasSuffix(r.Path, "/status") { + return 200, `{}` + } + polled++ + return 200, tt.statuses[polled-1] + }} + + got, err := Fix(context.Background(), clientFor(ft), tt.findType, "f1", FixOptions{WaitForPR: tt.createPR, Timeout: time.Minute}) + + require.ErrorIs(t, err, tt.want) + require.ErrorIs(t, got.Failure, tt.failure) + var routes []string + for _, r := range ft.requests { + routes = append(routes, r.Method+" "+r.Path) + } + require.Equal(t, tt.routes, routes) + require.Equal(t, tt.state, got.State) + require.Equal(t, tt.diff, len(got.Diff) > 0) + require.Equal(t, tt.pr, got.PullRequest) + }) + } +} + +func shortPollInterval(t *testing.T) { + t.Helper() + interval := autofixPollInterval + t.Cleanup(func() { autofixPollInterval = interval }) + autofixPollInterval = 5 * time.Millisecond +} + +func TestFixReportsStillRunningAtTheDeadline(t *testing.T) { + shortPollInterval(t) + + tests := []struct { + name string + status string + createPR bool + state string + }{ + {name: "fix phase", status: `{"status":{"state":"in_progress_agent","terminal":false}}`, state: "in_progress_agent"}, + {name: "pull request phase", status: `{"status":{"state":"cached","terminal":true}}`, createPR: true, state: "cached"}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(_ int, r request) (int, string) { + return 200, map[bool]string{true: tt.status, false: `{}`}[strings.HasSuffix(r.Path, "/status")] + }} + + got, err := Fix(context.Background(), clientFor(ft), "sast", "f1", FixOptions{WaitForPR: tt.createPR, Timeout: 30 * time.Millisecond}) + + require.ErrorIs(t, err, nil) + require.ErrorIs(t, got.Failure, ErrAutofixStillRunning) + require.ErrorContains(t, got.Failure, "nullify findings fix-status f1 --type sast") + require.Equal(t, tt.state, got.State) + require.Nil(t, got.PullRequest) + }) + } +} + +func TestFixStopsOnARescuedPullRequestStep(t *testing.T) { + shortPollInterval(t) + + const creating = `{"status":{"state":"in_progress_creating_pr","terminal":false}}` + const cached = `{"status":{"state":"cached","terminal":true}}` + + tests := []struct { + name string + statuses []string + }{ + {name: "the pull-request step started in the fix phase", statuses: []string{cached, creating, cached}}, + {name: "the pull-request step started after the fix phase", statuses: []string{cached, cached, creating, cached}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + polled := 0 + ft := &fakeTransport{respond: func(_ int, r request) (int, string) { + if !strings.HasSuffix(r.Path, "/status") { + return 200, `{}` + } + status := tt.statuses[min(polled, len(tt.statuses)-1)] + polled++ + return 200, status + }} + + got, err := Fix(context.Background(), clientFor(ft), "sast", "f1", FixOptions{WaitForPR: true, Timeout: time.Minute}) + + require.ErrorIs(t, err, nil) + require.ErrorIs(t, got.Failure, ErrNoPullRequest) + require.NotErrorIs(t, got.Failure, ErrAutofixStillRunning) + require.Equal(t, "cached", got.State) + require.Nil(t, got.PullRequest) + }) + } +} + +func TestFixSaysWhenTheStatusCannotBeRead(t *testing.T) { + shortPollInterval(t) + + const done = `{"status":{"state":"cached","terminal":true}}` + + tests := []struct { + name string + createPR bool + statuses []int + }{ + {name: "fix phase", statuses: []int{500}}, + {name: "pull request phase", createPR: true, statuses: []int{200, 500}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + polled := 0 + ft := &fakeTransport{respond: func(_ int, r request) (int, string) { + if !strings.HasSuffix(r.Path, "/status") { + return 200, `{}` + } + code := tt.statuses[min(polled, len(tt.statuses)-1)] + polled++ + return code, done + }} + + got, err := Fix(context.Background(), clientFor(ft), "sast", "f1", FixOptions{WaitForPR: tt.createPR, Timeout: 30 * time.Millisecond}) + + require.ErrorIs(t, err, nil) + require.ErrorIs(t, got.Failure, ErrAutofixStatusUnreadable) + require.NotErrorIs(t, got.Failure, ErrAutofixStillRunning) + require.ErrorContains(t, got.Failure, "nullify findings fix-status f1 --type sast") + require.Equal(t, "nullify findings fix-status f1 --type sast", got.CheckWith) + }) + } +} + +func TestFixKeepsTheDiffAsSent(t *testing.T) { + const diff = `{"diffs":[],"addedLater":1}` + ft := &fakeTransport{respond: func(_ int, r request) (int, string) { + return 200, map[bool]string{true: diff, false: `{"status":{"state":"cached","terminal":true}}`}[strings.HasSuffix(r.Path, "/diff")] + }} + + got, err := Fix(context.Background(), clientFor(ft), "sast", "f1", FixOptions{Timeout: time.Minute}) + + require.ErrorIs(t, err, nil) + require.ErrorIs(t, got.Failure, nil) + require.Equal(t, diff, string(got.Diff)) +} + +func TestFixPollErrors(t *testing.T) { + shortPollInterval(t) + + const done = `{"status":{"state":"cached","terminal":true}}` + + tests := []struct { + name string + codes []int + polls int + state string + want bool + check string + }{ + {name: "a server error does not end the wait", codes: []int{503, 200}, polls: 2, state: "cached"}, + {name: "rate limiting does not end the wait", codes: []int{429, 200}, polls: 2, state: "cached"}, + {name: "no access ends the wait", codes: []int{403, 200}, polls: 1, state: "in_progress_requested", want: true, check: "nullify findings fix-status f1 --type sast"}, + {name: "not found ends the wait", codes: []int{404, 200}, polls: 1, state: "in_progress_requested", want: true, check: "nullify findings fix-status f1 --type sast"}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + polls := 0 + ft := &fakeTransport{respond: func(_ int, r request) (int, string) { + switch { + case strings.HasSuffix(r.Path, "/status"): + polls++ + return tt.codes[polls-1], done + case strings.HasSuffix(r.Path, "/fix"): + return 200, `{"autoFixState":"in_progress_requested","runId":"r1"}` + } + return 200, `{}` + }} + + got, err := Fix(context.Background(), clientFor(ft), "sast", "f1", FixOptions{Timeout: time.Minute}) + + var apiErr *apierror.APIError + require.Equal(t, tt.want, errors.As(err, &apiErr)) + require.Equal(t, tt.polls, polls) + require.Equal(t, tt.state, got.State) + require.Equal(t, "r1", got.RunID) + require.Equal(t, tt.check, got.CheckWith) + }) + } +} + +func TestStartFix(t *testing.T) { + tests := []struct { + name string + findType string + want error + start FixStart + requests []request + }{ + { + name: "starts the run once and does not poll", findType: "sast", + start: FixStart{State: "in_progress_requested", RunID: "r1"}, + requests: []request{{"POST", "/sast/findings/f1/autofix/fix", `{}`}}, + }, + {name: "secrets has no autofix", findType: "secrets", want: ErrUnsupported}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(int, request) (int, string) { + return 200, `{"autoFixState":"in_progress_requested","runId":"r1"}` + }} + + got, err := StartFix(context.Background(), clientFor(ft), tt.findType, "f1") + + require.ErrorIs(t, err, tt.want) + require.Equal(t, tt.start, got) + require.Equal(t, tt.requests, ft.requests) + }) + } +} + +func TestFixRejectsAnInvalidTimeout(t *testing.T) { + ft := &fakeTransport{} + + _, err := Fix(context.Background(), clientFor(ft), "sast", "f1", FixOptions{}) + + require.ErrorIs(t, err, ErrInvalidTimeout) + require.Empty(t, ft.requests) +} + +func TestSensitiveDataVerbsUseTheirRoutes(t *testing.T) { + const base = "/secrets/sensitivedata/findings/f1" + falsePositive := Params{Reason: "test data", AllowlistType: "UserFalsePositive"} + + tests := []struct { + name string + verb string + findType string + params Params + request request + }{ + {name: "get", verb: "get", findType: "secrets_sensitive_data", request: request{"GET", base, ""}}, + {name: "triage", verb: "triage", findType: "secrets_sensitive_data", request: request{"GET", base + "/triage", ""}}, + {name: "allowlist", verb: "allowlist", findType: "secrets_sensitive_data", params: falsePositive, request: request{"POST", base + "/allowlist", `{"allowlistReason":"test data","allowlistType":"UserFalsePositive"}`}}, + {name: "unallowlist", verb: "unallowlist", findType: "secrets_sensitive_data", params: Params{Reason: "real"}, request: request{"POST", base + "/unallowlist", `{"unallowlistReason":"real","unallowlistType":"UserOther"}`}}, + {name: "credential unallowlist names a type", verb: "unallowlist", findType: "secrets", params: Params{Reason: "real"}, request: request{"POST", "/secrets/findings/f1/unallowlist", `{"unallowlistReason":"real","unallowlistType":"UserOther"}`}}, + {name: "create ticket", verb: "create-ticket", findType: "secrets_sensitive_data", request: request{"POST", base + "/ticket", `{}`}}, + {name: "delete ticket", verb: "delete-ticket", findType: "secrets_sensitive_data", request: request{"DELETE", base + "/ticket", ""}}, + {name: "row type of a sensitive-data finding", verb: "get", findType: "SecretsSensitiveData", request: request{"GET", base, ""}}, + {name: "row type of a credential", verb: "get", findType: "SecretsCredentials", request: request{"GET", "/secrets/findings/f1", ""}}, + {name: "secrets keeps the credential routes", verb: "get", findType: "secrets", request: request{"GET", "/secrets/findings/f1", ""}}, + {name: "row type of a cloud finding", verb: "get", findType: "Cloud", request: request{"GET", "/cspm/findings/f1", ""}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{} + + _, err := verbNamed(t, tt.verb).Run(context.Background(), clientFor(ft), tt.findType, "f1", tt.params) + + require.ErrorIs(t, err, nil) + require.Equal(t, []request{tt.request}, ft.requests) + }) + } +} + +func TestAllowlistTypeWarning(t *testing.T) { + falsePositive := Params{Reason: "r", AllowlistType: "UserFalsePositive"} + + tests := []struct { + name string + verb string + findType string + params Params + response string + want string + }{ + {name: "bughunt warns", verb: "allowlist", findType: "bughunt", params: falsePositive, response: `{"success":true}`, want: `{"success":true,"warning":"` + AllowlistTypeWarning + `"}`}, + {name: "sca dependencies warns and keeps the response", verb: "allowlist", findType: "sca_dependencies", params: falsePositive, response: `{"a":1}`, want: `{"a":1,"warning":"` + AllowlistTypeWarning + `"}`}, + {name: "sensitive data warns", verb: "allowlist", findType: "secrets_sensitive_data", params: falsePositive, response: `{}`, want: `{"warning":"` + AllowlistTypeWarning + `"}`}, + {name: "cspm unallowlist says the reason is not recorded", verb: "unallowlist", findType: "cspm", params: Params{Reason: "r"}, response: `{}`, want: `{"warning":"` + UnallowlistReasonWarning + `"}`}, + {name: "pentest unallowlist records the reason", verb: "unallowlist", findType: "pentest", params: Params{Reason: "r"}, response: `{}`, want: `{}`}, + {name: "sca containers warns", verb: "allowlist", findType: "sca_containers", params: falsePositive, response: `{}`, want: `{"warning":"` + AllowlistTypeWarning + `"}`}, + {name: "a response that is not an object is kept", verb: "allowlist", findType: "sca", params: falsePositive, response: `done`, want: `{"response":"done","warning":"` + AllowlistTypeWarning + `"}`}, + {name: "cspm records the type", verb: "allowlist", findType: "cspm", params: falsePositive, response: `{}`, want: `{}`}, + {name: "secrets records the type", verb: "allowlist", findType: "secrets", params: falsePositive, response: `{}`, want: `{}`}, + {name: "unallowlist has no type", verb: "unallowlist", findType: "sca", params: Params{Reason: "r"}, response: `{}`, want: `{}`}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(int, request) (int, string) { return 200, tt.response }} + + got, err := verbNamed(t, tt.verb).Run(context.Background(), clientFor(ft), tt.findType, "f1", tt.params) + + require.ErrorIs(t, err, nil) + require.JSONEq(t, tt.want, string(got)) + }) + } +} + +func TestVerbTypeValues(t *testing.T) { + tests := []struct { + verb string + want []string + }{ + {verb: "archive", want: []string{"Cloud", "cspm"}}, + {verb: "unmark-false-positive", want: []string{"Cloud", "Platform", "SupplyChain", "cspm", "scpm"}}, + {verb: "fix-diff", want: []string{"Code", "Dependencies", "dependencies", "sast", "sca", "sca_dependencies"}}, + {verb: "get", want: []string{ + "BugHunt", "Cloud", "Code", "Containers", "Dependencies", "Pentest", "Platform", "SecretsCredentials", "SecretsSensitiveData", "SupplyChain", + "bughunt", "containers", "cspm", "dast_bughunt", "dast_pentest", "dependencies", "pentest", "sast", "sca", "sca_containers", + "sca_dependencies", "scpm", "secrets", "secrets_credentials", "secrets_sensitive_data", + }}, + } + for _, tt := range tests { + t.Run(tt.verb, func(t *testing.T) { + require.Equal(t, tt.want, verbNamed(t, tt.verb).TypeValues()) + }) + } +} diff --git a/internal/findings/fix.go b/internal/findings/fix.go new file mode 100644 index 0000000..cc242ec --- /dev/null +++ b/internal/findings/fix.go @@ -0,0 +1,359 @@ +package findings + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "slices" + "time" + + "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/api/models" + "github.com/nullify-platform/cli/internal/apierror" +) + +// Errors that FixResult.Failure holds when a fix did not deliver its result. +var ( + ErrAutofixFailed = errors.New("autofix failed") + ErrAutofixStillRunning = errors.New("autofix is still running") + // ErrAutofixStatusUnreadable means that the status route was failing when the + // wait ended, so the state of the run is not known. + ErrAutofixStatusUnreadable = errors.New("autofix status could not be read") + ErrNoPullRequest = errors.New("autofix finished without opening a new pull request") + ErrAutofixDiff = errors.New("get autofix diff") +) + +// ErrInvalidTimeout is returned before the API is called. +var ErrInvalidTimeout = errors.New("timeout must be greater than zero") + +// DefaultFixTimeout is longer than the 45 minutes that the server allows one +// autofix run, so that a healthy run ends before the wait does. +const DefaultFixTimeout = 50 * time.Minute + +// autoFixStateCached is the one terminal fix-generation state that carries no +// pull request. When waiting on pull-request creation, a poll must not stop here +// even though the server reports terminal=true. +const autoFixStateCached = "cached" + +const autoFixStateFailedIteration = "failed_iteration" + +// autofixPRPhaseStates are the states of a run that is opening a pull request. The +// server allows no move from them to cached, except when it rescues an abandoned +// run. So cached after one of these states means that no pull request will come. +var autofixPRPhaseStates = []string{"in_progress_preview_available", "in_progress_creating_pr", "in_progress_draft"} + +// autofixSuccessStates are the terminal states in which the run produced a fix. +// Every other terminal state, known or not, is a failure. +var autofixSuccessStates = []string{autoFixStateCached, "pending_review", "pr_merged"} + +var autofixPollInterval = 3 * time.Second + +// AutofixStatus is the part of the autofix status payload that polling reads. +type AutofixStatus struct { + State string `json:"state"` + Terminal bool `json:"terminal"` + Explanation string `json:"autofixVerdictExplanation"` + // PullRequests is the history of autofix pull requests on the finding, most + // recent first. The pullRequestUrl field is not read, because it can name a + // pull request of an earlier run. + PullRequests []AutofixPullRequest `json:"pullRequests"` +} + +// AutofixPullRequest is one entry in the pull-request history of a finding. +type AutofixPullRequest struct { + URL string `json:"url"` + Status string `json:"status"` +} + +// FixResult is the outcome of Fix. +type FixResult struct { + // State is the last autofix state that the run reported. + State string + // RunID identifies the run. It is empty when the server does not report one. + RunID string + // CheckWith is the command that reports a run that continues on the server. It + // is set when the wait ended before the run did. + CheckWith string + // Diff is the proposed change. It is empty for a type with no diff route. + Diff json.RawMessage + // PullRequest is set when the run opened a pull request, or when its latest + // iteration failed and left a pull request open. + PullRequest *PullRequestStatus + // Failure is why the run did not deliver its result. It is nil on success. + Failure error +} + +// PullRequestStatus is the pull-request phase of an autofix run. +type PullRequestStatus struct { + State string `json:"state,omitempty"` + URL string `json:"url,omitempty"` +} + +// FixStart is the answer to a request that starts an autofix run. +type FixStart struct { + State string `json:"autoFixState"` + RunID string `json:"runId"` +} + +// FixOptions control how long Fix waits and for what. +type FixOptions struct { + // WaitForPR also waits for a pull request that the run opens. + WaitForPR bool + // Timeout is the longest that Fix waits for the run. + Timeout time.Duration +} + +// StartFix starts the autofix agent for a finding and returns at once. The run +// continues on the server, and the fix-status verb reports it. +func StartFix(ctx context.Context, c *api.Client, typeName, findingID string) (FixStart, error) { + t, err := fixType(typeName, findingID) + if err != nil { + return FixStart{}, err + } + return startFix(ctx, c, t, findingID) +} + +// Fix starts the autofix agent for a finding, waits for it to end and returns +// the diff. The fix run opens any pull request itself, so WaitForPR only waits +// for a pull request that was not on the finding before the run. The returned +// error is a failure to call the API; FixResult.Failure is a run that failed. +// When the run started before the failure, the result still holds what is known +// about it, and CheckWith is set. +func Fix(ctx context.Context, c *api.Client, typeName, findingID string, opts FixOptions) (FixResult, error) { + t, err := fixType(typeName, findingID) + if err != nil { + return FixResult{}, err + } + if opts.Timeout <= 0 { + return FixResult{}, fmt.Errorf("%w: %s", ErrInvalidTimeout, opts.Timeout) + } + + var earlier []string + if opts.WaitForPR { + before, err := readAutofixStatus(ctx, c, t, findingID) + if err != nil { + return FixResult{}, err + } + for _, pr := range before.PullRequests { + earlier = append(earlier, pr.URL) + } + } + + start, err := startFix(ctx, c, t, findingID) + if err != nil { + return FixResult{}, err + } + result := FixResult{State: start.State, RunID: start.RunID} + deadline := time.Now().Add(opts.Timeout) + check := fmt.Sprintf("nullify findings fix-status %s --type %s", findingID, typeName) + stillRunning := fmt.Errorf("%w after %s; check it with: %s", ErrAutofixStillRunning, opts.Timeout, check) + + var sawPRPhase bool + status, err := pollAutofix(ctx, c, t, findingID, false, earlier, deadline, &sawPRPhase) + if status.State != "" { + result.State = status.State + } + if ended := waitEnded(err, stillRunning, check); ended != nil { + result.CheckWith = check + result.Failure = ended + return result, nil + } + if err != nil { + result.CheckWith = check + return result, fmt.Errorf("the run started but its status cannot be read; check it with: %s: %w", check, err) + } + + if !status.succeeded() { + result.PullRequest = status.openPullRequestOfFailedIteration() + result.Failure = status.failure() + return result, nil + } + + var diffErr error + if t.AutofixDiff != nil { + result.Diff, err = t.AutofixDiff(ctx, c, findingID, nil) + if err != nil { + diffErr = fmt.Errorf("%w: %w", ErrAutofixDiff, err) + } + } + + if !opts.WaitForPR { + result.Failure = diffErr + return result, nil + } + + status, err = pollAutofix(ctx, c, t, findingID, true, earlier, deadline, &sawPRPhase) + if status.State != "" { + result.State = status.State + } + if ended := waitEnded(err, stillRunning, check); ended != nil { + result.CheckWith = check + result.Failure = errors.Join(diffErr, ended) + return result, nil + } + if err != nil { + result.CheckWith = check + return result, fmt.Errorf("the run started but its status cannot be read; check it with: %s: %w", check, err) + } + + if pr := status.newPullRequest(earlier); pr != nil { + result.PullRequest = &PullRequestStatus{State: pr.Status, URL: pr.URL} + } + switch { + case !status.succeeded(): + if result.PullRequest == nil { + result.PullRequest = status.openPullRequestOfFailedIteration() + } + result.Failure = errors.Join(diffErr, status.failure()) + case result.PullRequest == nil: + result.Failure = errors.Join(diffErr, fmt.Errorf("%w: state %s", ErrNoPullRequest, status.State)) + default: + result.Failure = diffErr + } + return result, nil +} + +// waitEnded returns the failure for a poll that reached its deadline, or nil for any +// other poll result. +func waitEnded(err, stillRunning error, check string) error { + switch { + case errors.Is(err, ErrAutofixStatusUnreadable): + return fmt.Errorf("%w; the run may continue on the server; check it with: %s", err, check) + case errors.Is(err, context.DeadlineExceeded): + return stillRunning + } + return nil +} + +func fixType(typeName, findingID string) (Type, error) { + t, err := Lookup(typeName) + if err != nil { + return Type{}, err + } + if t.AutofixFix == nil { + return Type{}, fmt.Errorf("autofix of type %q: %w", typeName, ErrUnsupported) + } + if findingID == "" { + return Type{}, ErrFindingIDRequired + } + return t, nil +} + +func startFix(ctx context.Context, c *api.Client, t Type, findingID string) (FixStart, error) { + data, err := t.AutofixFix(ctx, c, findingID, nil) + if err != nil { + return FixStart{}, fmt.Errorf("trigger autofix: %w", err) + } + + var start FixStart + if err := json.Unmarshal(data, &start); err != nil { + return FixStart{}, fmt.Errorf("decode autofix start: %w", err) + } + return start, nil +} + +func (s AutofixStatus) succeeded() bool { + return slices.Contains(autofixSuccessStates, s.State) +} + +func (s AutofixStatus) failure() error { + if s.Explanation != "" { + return fmt.Errorf("%w: state %s: %s", ErrAutofixFailed, s.State, s.Explanation) + } + return fmt.Errorf("%w: state %s", ErrAutofixFailed, s.State) +} + +// newPullRequest returns the most recent pull request that is not in earlier. +func (s AutofixStatus) newPullRequest(earlier []string) *AutofixPullRequest { + for _, pr := range s.PullRequests { + if pr.URL != "" && !slices.Contains(earlier, pr.URL) { + return &pr + } + } + return nil +} + +// openPullRequestOfFailedIteration returns the open pull request when the latest +// iteration failed. The pull request stays open with its earlier commits. +func (s AutofixStatus) openPullRequestOfFailedIteration() *PullRequestStatus { + if s.State != autoFixStateFailedIteration { + return nil + } + for _, pr := range s.PullRequests { + if pr.Status == string(models.ModelsPullRequestStateOpen) { + return &PullRequestStatus{State: pr.Status, URL: pr.URL} + } + } + return nil +} + +// autofixPhaseDone reports whether the watched autofix phase has ended, with the +// server-computed terminal flag as the authority. +func autofixPhaseDone(st AutofixStatus, watchPR bool, earlier []string) bool { + if watchPR { + return st.newPullRequest(earlier) != nil || (st.Terminal && st.State != autoFixStateCached) + } + return st.Terminal +} + +func readAutofixStatus(ctx context.Context, c *api.Client, t Type, findingID string) (AutofixStatus, error) { + data, err := t.AutofixStatus(ctx, c, findingID, nil) + if err != nil { + return AutofixStatus{}, fmt.Errorf("poll autofix status: %w", err) + } + + var wrapper struct { + Status AutofixStatus `json:"status"` + } + if err := json.Unmarshal(data, &wrapper); err != nil { + return AutofixStatus{}, fmt.Errorf("decode autofix status: %w", err) + } + return wrapper.Status, nil +} + +// transientPollError reports whether a later poll can succeed. A long wait must +// not fail a healthy run because of one bad response. +func transientPollError(err error) bool { + var apiErr *apierror.APIError + if errors.As(err, &apiErr) { + return apiErr.StatusCode >= http.StatusInternalServerError || apiErr.StatusCode == http.StatusTooManyRequests + } + return true +} + +// pollAutofix polls the autofix status route until the watched phase ends or the +// deadline passes. On the deadline it returns the last status it read and +// context.DeadlineExceeded, or ErrAutofixStatusUnreadable when its latest read failed. +// sawPRPhase records across phases that the run reached a pull-request state. +func pollAutofix(ctx context.Context, c *api.Client, t Type, findingID string, watchPR bool, earlier []string, deadline time.Time, sawPRPhase *bool) (AutofixStatus, error) { + var last AutofixStatus + var readErr error + for { + status, err := readAutofixStatus(ctx, c, t, findingID) + readErr = err + switch { + case err == nil: + last = status + *sawPRPhase = *sawPRPhase || slices.Contains(autofixPRPhaseStates, status.State) + if autofixPhaseDone(status, watchPR, earlier) || (watchPR && *sawPRPhase && status.State == autoFixStateCached) { + return status, nil + } + case ctx.Err() != nil || !transientPollError(err): + return last, err + } + + if time.Now().After(deadline) { + if readErr != nil { + return last, fmt.Errorf("%w: %w", ErrAutofixStatusUnreadable, readErr) + } + return last, context.DeadlineExceeded + } + select { + case <-ctx.Done(): + return last, ctx.Err() + case <-time.After(autofixPollInterval): + } + } +} diff --git a/internal/findings/search.go b/internal/findings/search.go new file mode 100644 index 0000000..8740599 --- /dev/null +++ b/internal/findings/search.go @@ -0,0 +1,177 @@ +package findings + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "strings" + "time" + + "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/api/models" +) + +// Errors that Search returns before it calls the API. +var ( + ErrInvalidLimit = errors.New("limit must be greater than zero") + ErrInvalidStatus = errors.New("invalid status") + ErrInvalidTime = errors.New("invalid time") +) + +// Statuses are the values that SearchOptions.Status accepts. +var Statuses = []string{"open", "fixed", "false_positive", "accepted_risk"} + +// SearchOptions are the filters of the unified /admin/findings search. +type SearchOptions struct { + // APITypes are FindingType values. Empty means all types. + APITypes []string + // Severity is a lower-case value, which is sent upper-case. + Severity string + Repository string + Status string + // From and To are RFC 3339 bounds on the finding date. + From string + To string + // Limit is the most findings to collect across pages. + Limit int + // Debug receives one line per page when it is not nil. + Debug io.Writer +} + +// SearchResult holds the collected findings and their completeness signals. An +// empty result has Total 0 and Truncated false. A failure to read is an error +// and never an empty result. +type SearchResult struct { + Findings []json.RawMessage `json:"findings"` + // Total is the count that the server reports for the filters. + Total int `json:"total"` + // Returned is the number of entries in Findings. + Returned int `json:"returned"` + // Truncated is true when the server holds more findings than Findings has. + Truncated bool `json:"truncated"` +} + +// searchPage holds the parts of a response that Search reads. Each finding stays as +// the server sent it. +type searchPage struct { + Findings []json.RawMessage `json:"findings"` + Total int `json:"total"` + HasMoreData bool `json:"hasMoreData"` +} + +// Search collects findings from POST /admin/findings up to opts.Limit. The page +// size stays constant across pages, because the server computes its offset from +// page and pageSize. The number of pages is bounded because every page must add +// a finding. +func Search(ctx context.Context, c *api.Client, opts SearchOptions) (SearchResult, error) { + if opts.Limit <= 0 { + return SearchResult{}, fmt.Errorf("%w: %d", ErrInvalidLimit, opts.Limit) + } + + query, err := opts.query() + if err != nil { + return SearchResult{}, err + } + + pageSize := min(max(opts.Limit, 20), 100) + result := SearchResult{Findings: make([]json.RawMessage, 0)} + hasMore := true + + for page := 1; hasMore && len(result.Findings) < opts.Limit; page++ { + query.Page, query.PageSize = &page, &pageSize + + body, err := c.CreateAdminFindingsRaw(ctx, query) + if err != nil { + return SearchResult{}, err + } + + var out searchPage + if err := json.Unmarshal(body, &out); err != nil { + return SearchResult{}, fmt.Errorf("%w: %w", ErrUnreadableResponse, err) + } + if out.Findings == nil { + return SearchResult{}, fmt.Errorf("%w: no findings field", ErrUnreadableResponse) + } + + if opts.Debug != nil { + fmt.Fprintf(opts.Debug, "[debug] POST /admin/findings page %d: %d findings, hasMoreData=%v, total=%d\n", page, len(out.Findings), out.HasMoreData, out.Total) + } + + result.Findings = append(result.Findings, out.Findings...) + result.Total = out.Total + hasMore = out.HasMoreData + if len(out.Findings) == 0 { + break + } + } + + if len(result.Findings) > opts.Limit { + result.Findings = result.Findings[:opts.Limit] + } + result.Returned = len(result.Findings) + result.Truncated = hasMore || result.Total > result.Returned + return result, nil +} + +func (o SearchOptions) query() (models.ModelsUnifiedFindingsQuery, error) { + query := models.ModelsUnifiedFindingsQuery{Type: o.APITypes} + if o.Repository != "" { + query.Repository = repositoryNames(o.Repository) + } + if o.Severity != "" { + query.Severity = []string{strings.ToUpper(o.Severity)} + } + if o.From != "" { + if err := checkFilterTime("from", o.From); err != nil { + return query, err + } + query.FromDate = &o.From + } + if o.To != "" { + if err := checkFilterTime("to", o.To); err != nil { + return query, err + } + query.ToDate = &o.To + } + + yes, no := true, false + switch o.Status { + case "": + case "open": + query.IsResolved = &no + case "fixed": + query.IsFixed = &yes + case "false_positive": + query.IsFalsePositive = &yes + case "accepted_risk": + query.IsAllowlisted = &yes + default: + return query, fmt.Errorf("%w %q, valid statuses: %s", ErrInvalidStatus, o.Status, strings.Join(Statuses, ", ")) + } + return query, nil +} + +// checkFilterTime rejects a time that the server cannot parse. The server ignores +// such a filter, and the search then returns findings outside the window. A plain +// date is rejected, because it does not say which end of the day "to" means. +func checkFilterTime(name, value string) error { + for _, layout := range []string{time.RFC3339, "2006-01-02T15:04:05"} { + if _, err := time.Parse(layout, value); err == nil { + return nil + } + } + return fmt.Errorf("%w for %s: %q, use RFC 3339 such as 2026-11-01T00:00:00Z", ErrInvalidTime, name, value) +} + +// repositoryNames returns the filter values for a repository. The server matches +// them exactly: most findings hold the bare name, and a pentest finding holds the +// full name if it has one. With only one of the two, the other findings do not match. +func repositoryNames(repo string) []string { + name := repo[strings.LastIndex(repo, "/")+1:] + if name == repo { + return []string{repo} + } + return []string{repo, name} +} diff --git a/internal/findings/types.go b/internal/findings/types.go new file mode 100644 index 0000000..f2e2081 --- /dev/null +++ b/internal/findings/types.go @@ -0,0 +1,339 @@ +// Package findings holds the per-type table of finding operations, and the verbs +// that the CLI and the MCP server both expose from it. +package findings + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/url" + "slices" + "sort" + "strings" + + "github.com/nullify-platform/cli/internal/api" +) + +// ErrUnknownType is returned for a finding type that is not in the table. +var ErrUnknownType = errors.New("unknown finding type") + +// ErrUnreadableResponse is returned for a successful response without the expected +// shape. It must never read as an empty result. +var ErrUnreadableResponse = errors.New("unreadable findings response") + +// Action calls one finding operation. Operations that take no request body +// ignore body. The result is the JSON response of the API. +type Action func(ctx context.Context, c *api.Client, findingID string, body []byte) (json.RawMessage, error) + +// Type holds the operations of one finding type. A nil Action means that the +// API does not support the operation for the type. +type Type struct { + // APITypes are the values of the /admin/findings "type" filter. + APITypes []string + // AllowOnPatch marks a type whose allowlist state is set by one PATCH with + // the body {allow, reason}. Other types use separate POST routes. + AllowOnPatch bool + // AllowlistTypeUnrecorded marks a type for which the server may not record the + // allowlist type. + AllowlistTypeUnrecorded bool + // UnallowlistReasonUnrecorded marks a type whose unallowlist route ignores the reason. + UnallowlistReasonUnrecorded bool + + Get Action + Triage Action + CreateTicket Action + DeleteTicket Action + Allowlist Action + Unallowlist Action + Archive Action + Unarchive Action + MarkFalsePositive Action + UnmarkFalsePositive Action + AutofixFix Action + AutofixStatus Action + AutofixDiff Action +} + +type findingInput[I any] interface { + *I + SetFindingID(id string) +} + +func read[I any, P findingInput[I], O any](call func(*api.Client, context.Context, I) (*O, error)) Action { + return func(ctx context.Context, c *api.Client, id string, _ []byte) (json.RawMessage, error) { + var in I + P(&in).SetFindingID(id) + out, err := call(c, ctx, in) + if err != nil { + return nil, err + } + return json.Marshal(out) + } +} + +func write[I any, P findingInput[I], O any](call func(*api.Client, context.Context, I) (*O, error)) Action { + return func(ctx context.Context, c *api.Client, id string, body []byte) (json.RawMessage, error) { + var in I + if len(body) > 0 { + if err := json.Unmarshal(body, &in); err != nil { + return nil, err + } + } + P(&in).SetFindingID(id) + out, err := call(c, ctx, in) + if err != nil { + return nil, err + } + return json.Marshal(out) + } +} + +// writeRaw adapts a method whose response has no schema in the spec. An empty +// response becomes an empty JSON object, so that every Action returns JSON. +func writeRaw[I any, P findingInput[I]](call func(*api.Client, context.Context, I) ([]byte, error)) Action { + return func(ctx context.Context, c *api.Client, id string, body []byte) (json.RawMessage, error) { + var in I + if len(body) > 0 { + if err := json.Unmarshal(body, &in); err != nil { + return nil, err + } + } + P(&in).SetFindingID(id) + out, err := call(c, ctx, in) + if err != nil { + return nil, err + } + if len(out) == 0 { + return json.RawMessage(`{}`), nil + } + return out, nil + } +} + +// readRaw reads a route and returns the response as the server sent it. pathFormat +// holds the finding ID as %s. +func readRaw(pathFormat string) Action { + return func(ctx context.Context, c *api.Client, id string, _ []byte) (json.RawMessage, error) { + return c.GetRaw(ctx, fmt.Sprintf(pathFormat, url.PathEscape(id))) + } +} + +// Types is the table of finding types, keyed by the slug that users pass. +var Types = map[string]Type{ + "sast": { + APITypes: []string{"Code"}, + Get: read((*api.Client).GetSastFindingsFindingId), + Triage: read((*api.Client).ListSastFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateSastFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteSastFindingsFindingIdTicket), + Allowlist: write((*api.Client).CreateSastFindingsFindingIdAllowlist), + Unallowlist: writeRaw((*api.Client).CreateSastFindingsFindingIdUnallowlist), + AutofixFix: write((*api.Client).CreateSastFindingsFindingIdAutofixFix), + AutofixStatus: read((*api.Client).ListSastFindingsFindingIdAutofixStatus), + AutofixDiff: readRaw("/sast/findings/%s/autofix/cache/diff"), + }, + "sca_dependencies": { + APITypes: []string{"Dependencies"}, + AllowlistTypeUnrecorded: true, + Get: read((*api.Client).GetScaDependenciesFindingsFindingId), + Triage: read((*api.Client).ListScaDependenciesFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateScaDependenciesFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteScaDependenciesFindingsFindingIdTicket), + Allowlist: writeRaw((*api.Client).CreateScaDependenciesFindingsFindingIdAllowlist), + Unallowlist: writeRaw((*api.Client).CreateScaDependenciesFindingsFindingIdUnallowlist), + AutofixFix: write((*api.Client).CreateScaDependenciesFindingsFindingIdAutofixFix), + AutofixStatus: read((*api.Client).ListScaDependenciesFindingsFindingIdAutofixStatus), + AutofixDiff: readRaw("/sca/dependencies/findings/%s/autofix/cache/diff"), + }, + "sca_containers": { + APITypes: []string{"Containers"}, + AllowlistTypeUnrecorded: true, + Get: read((*api.Client).GetScaContainersFindingsFindingId), + Triage: read((*api.Client).ListScaContainersFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateScaContainersFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteScaContainersFindingsFindingIdTicket), + Allowlist: writeRaw((*api.Client).CreateScaContainersFindingsFindingIdAllowlist), + Unallowlist: writeRaw((*api.Client).CreateScaContainersFindingsFindingIdUnallowlist), + AutofixFix: write((*api.Client).CreateScaContainersFindingsFindingIdAutofixFix), + AutofixStatus: read((*api.Client).ListScaContainersFindingsFindingIdAutofixStatus), + }, + "secrets": { + APITypes: []string{"SecretsCredentials", "SecretsSensitiveData"}, + Get: read((*api.Client).GetSecretsFindingsFindingId), + Triage: read((*api.Client).ListSecretsFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateSecretsFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteSecretsFindingsFindingIdTicket), + Allowlist: writeRaw((*api.Client).CreateSecretsFindingsFindingIdAllowlist), + Unallowlist: writeRaw((*api.Client).CreateSecretsFindingsFindingIdUnallowlist), + }, + "secrets_sensitive_data": { + APITypes: []string{"SecretsSensitiveData"}, + AllowlistTypeUnrecorded: true, + Get: read((*api.Client).GetSecretsSensitivedataFindingsFindingId), + Triage: read((*api.Client).ListSecretsSensitivedataFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateSecretsSensitivedataFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteSecretsSensitivedataFindingsFindingIdTicket), + Allowlist: writeRaw((*api.Client).CreateSecretsSensitivedataFindingsFindingIdAllowlist), + Unallowlist: writeRaw((*api.Client).CreateSecretsSensitivedataFindingsFindingIdUnallowlist), + }, + "pentest": { + APITypes: []string{"Pentest"}, + Get: read((*api.Client).GetDastPentestFindingsFindingId), + Triage: read((*api.Client).ListDastPentestFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateDastPentestFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteDastPentestFindingsFindingIdTicket), + Allowlist: writeRaw((*api.Client).CreateDastPentestFindingsFindingIdAllowlist), + Unallowlist: writeRaw((*api.Client).CreateDastPentestFindingsFindingIdUnallowlist), + AutofixFix: write((*api.Client).CreateDastPentestFindingsFindingIdAutofixFix), + AutofixStatus: read((*api.Client).ListDastPentestFindingsFindingIdAutofixStatus), + }, + "bughunt": { + APITypes: []string{"BugHunt"}, + AllowOnPatch: true, + AllowlistTypeUnrecorded: true, + Get: read((*api.Client).GetDastBughuntFindingsFindingId), + Triage: read((*api.Client).ListDastBughuntFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateDastBughuntFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteDastBughuntFindingsFindingIdTicket), + Allowlist: write((*api.Client).PatchDastBughuntFindingsFindingIdAllowlist), + Unallowlist: write((*api.Client).PatchDastBughuntFindingsFindingIdAllowlist), + }, + "cspm": { + APITypes: []string{"Cloud"}, + UnallowlistReasonUnrecorded: true, + Get: read((*api.Client).GetCspmFindingsFindingId), + Triage: read((*api.Client).ListCspmFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateCspmFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteCspmFindingsFindingIdTicket), + Allowlist: write((*api.Client).CreateCspmFindingsFindingIdAllowlist), + Unallowlist: write((*api.Client).CreateCspmFindingsFindingIdUnallowlist), + Archive: write((*api.Client).CreateCspmFindingsFindingIdArchive), + Unarchive: write((*api.Client).CreateCspmFindingsFindingIdUnarchive), + MarkFalsePositive: write((*api.Client).CreateCspmFindingsFindingIdMarkFalsePositive), + UnmarkFalsePositive: write((*api.Client).CreateCspmFindingsFindingIdUnmarkFalsePositive), + AutofixFix: write((*api.Client).CreateCspmFindingsFindingIdAutofixFix), + AutofixStatus: read((*api.Client).ListCspmFindingsFindingIdAutofixStatus), + }, + "scpm": { + APITypes: []string{"SupplyChain"}, + Get: read((*api.Client).GetScpmFindingsFindingId), + Triage: read((*api.Client).ListScpmFindingsFindingIdTriage), + CreateTicket: write((*api.Client).CreateScpmFindingsFindingIdTicket), + DeleteTicket: read((*api.Client).DeleteScpmFindingsFindingIdTicket), + Allowlist: write((*api.Client).CreateScpmFindingsFindingIdAllowlist), + Unallowlist: writeRaw((*api.Client).CreateScpmFindingsFindingIdUnallowlist), + UnmarkFalsePositive: write((*api.Client).CreateScpmFindingsFindingIdUnmarkFalsePositive), + AutofixFix: write((*api.Client).CreateScpmFindingsFindingIdAutofixFix), + AutofixStatus: read((*api.Client).ListScpmFindingsFindingIdAutofixStatus), + }, +} + +var typeAliases = map[string]string{ + "sca": "sca_dependencies", + "dependencies": "sca_dependencies", + "containers": "sca_containers", + // The monorepo FindingType names. Its other names are already slugs. + "secrets_credentials": "SecretsCredentials", + "dast_bughunt": "BugHunt", + "dast_pentest": "Pentest", + // The API accepts Platform as a type filter, but it matches no finding. + "Platform": "scpm", +} + +// rowTypes maps the "type" value of a listed finding to its slug, so that a row +// from `--type secrets` can go straight to a verb. +var rowTypes = map[string]string{ + "Code": "sast", + "Dependencies": "sca_dependencies", + "Containers": "sca_containers", + "SecretsCredentials": "secrets", + "SecretsSensitiveData": "secrets_sensitive_data", + "Pentest": "pentest", + "BugHunt": "bughunt", + "Cloud": "cspm", + "SupplyChain": "scpm", +} + +// Names returns the sorted slugs of all finding types. +func Names() []string { + names := make([]string, 0, len(Types)) + for name := range Types { + names = append(names, name) + } + sort.Strings(names) + return names +} + +// NamesWith returns the sorted slugs of the types for which pick reports support. +func NamesWith(pick func(Type) bool) []string { + var names []string + for _, name := range Names() { + if pick(Types[name]) { + names = append(names, name) + } + } + return names +} + +// AcceptedNames returns every sorted name that Lookup resolves to a type for which +// pick reports support: slugs, aliases and the type values of listed findings. +func AcceptedNames(pick func(Type) bool) []string { + names := NamesWith(pick) + for _, table := range []map[string]string{typeAliases, rowTypes} { + for name := range table { + if t, err := Lookup(name); err == nil && pick(t) { + names = append(names, name) + } + } + } + slices.Sort(names) + return names +} + +// Lookup resolves a slug, an alias or the type value of a listed finding to its +// type. +func Lookup(name string) (Type, error) { + if alias, ok := typeAliases[name]; ok { + name = alias + } + if slug, ok := rowTypes[name]; ok { + name = slug + } + t, ok := Types[name] + if !ok { + return Type{}, fmt.Errorf("%w %q, valid types: %s", ErrUnknownType, name, strings.Join(Names(), ", ")) + } + return t, nil +} + +// APITypesFor resolves a slug, an alias or a raw API value to the values of the +// /admin/findings "type" filter. "sca" is both SCA types here, because a filter that +// keeps only one would hide the other. A verb acts on one finding, so for a verb +// "sca" is the dependency route (see Lookup). +func APITypesFor(name string) ([]string, error) { + if name == "sca" { + return []string{"Dependencies", "Containers"}, nil + } + if alias, ok := typeAliases[name]; ok { + name = alias + } + if _, ok := rowTypes[name]; ok { + return []string{name}, nil + } + t, err := Lookup(name) + if err != nil { + return nil, err + } + return t.APITypes, nil +} + +// HasRepository reports whether findings of the API types can belong to a +// repository. Cloud and bug hunt findings have none, so a repository filter removes +// all of them. A repository detected from the working directory must not filter a +// search for them, because that search would then always be empty. +func HasRepository(apiTypes []string) bool { + return len(apiTypes) == 0 || slices.ContainsFunc(apiTypes, func(t string) bool { + return t != "Cloud" && t != "BugHunt" + }) +} diff --git a/internal/findings/verbs.go b/internal/findings/verbs.go new file mode 100644 index 0000000..7988124 --- /dev/null +++ b/internal/findings/verbs.go @@ -0,0 +1,307 @@ +package findings + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "slices" + "strings" + + "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/api/models" +) + +// Errors that a verb returns before it calls the API. +var ( + ErrUnsupported = errors.New("operation is not supported for this finding type") + ErrFindingIDRequired = errors.New("a finding ID is required") + ErrReasonRequired = errors.New("a reason is required") + ErrInvalidAllowlistType = errors.New("invalid allowlist type") + ErrInvalidVerdict = errors.New("invalid feedback verdict") +) + +// AllowlistTypeWarning is the warning for a type with AllowlistTypeUnrecorded. +const AllowlistTypeWarning = "The server may not record the allowlist type for this finding type yet. The reason is recorded." + +// UnallowlistReasonWarning is the warning for a type with UnallowlistReasonUnrecorded. +const UnallowlistReasonWarning = "The server does not record the reason for this finding type. The finding is re-opened." + +// AllowlistTypes are the allowlist types that a user can submit. Friendly commands +// and MCP tools require one for every finding type, so that the interface is the +// same for all of them. Type.AllowlistTypeUnrecorded marks the types for which the +// server may not record it. +var AllowlistTypes = []string{ + string(models.ModelsAllowlistTypeUserfixed), + string(models.ModelsAllowlistTypeUserassumerisk), + string(models.ModelsAllowlistTypeUserfalsepositive), + string(models.ModelsAllowlistTypeUserother), +} + +// FeedbackVerdicts are the verdicts that POST /findings/{id}/feedback accepts. +var FeedbackVerdicts = []string{ + string(models.EndpointsFindingFeedbackVerdictUp), + string(models.EndpointsFindingFeedbackVerdictDown), + string(models.EndpointsFindingFeedbackVerdictHelpful), + string(models.EndpointsFindingFeedbackVerdictWrong), + string(models.EndpointsFindingFeedbackVerdictNoisy), + string(models.EndpointsFindingFeedbackVerdictFixGood), + string(models.EndpointsFindingFeedbackVerdictFixBad), + string(models.EndpointsFindingFeedbackVerdictWorthFixing), + string(models.EndpointsFindingFeedbackVerdictExplanationClear), + string(models.EndpointsFindingFeedbackVerdictExplanationUnclear), + string(models.EndpointsFindingFeedbackVerdictSeverityRight), + string(models.EndpointsFindingFeedbackVerdictSeverityWrong), +} + +// Params are the inputs that a verb can take in addition to the finding. +type Params struct { + Reason string + AllowlistType string +} + +// Verb is one finding operation, exposed as a `nullify findings` subcommand and +// as an MCP tool. +type Verb struct { + Name string + Tool string + Description string + // NeedsReason makes Params.Reason mandatory. + NeedsReason bool + // NeedsAllowlistType makes Params.AllowlistType mandatory. + NeedsAllowlistType bool + // Write marks a verb that changes the finding or its ticket. + Write bool + // OptIn keeps the MCP tool out of the default tool set. + OptIn bool + method func(Type) Action + body func(Type, Params) ([]byte, error) +} + +// Verbs lists the finding operations in the order that help shows them. +var Verbs = []Verb{ + { + Name: "get", + Tool: "nullify_get_finding", + Description: "Get details of a specific finding by type and ID.", + method: func(t Type) Action { return t.Get }, + }, + { + Name: "triage", + Tool: "nullify_get_finding_triage", + Description: "Get the AI-triage analysis for a finding: the model's assessment of exploitability, severity, and recommended disposition.", + method: func(t Type) Action { return t.Triage }, + }, + { + Name: "fix-status", + Tool: "nullify_get_fix_status", + Description: "Get the state of the autofix run of a finding: its state, whether it has ended, and its pull requests.", + method: func(t Type) Action { return t.AutofixStatus }, + }, + { + Name: "fix-diff", + Tool: "nullify_get_fix_diff", + Description: "Get the proposed change of a finished autofix run.", + method: func(t Type) Action { return t.AutofixDiff }, + }, + { + Name: "allowlist", + Write: true, + Tool: "nullify_allowlist_finding", + Description: "Allowlist a finding: suppress it as fixed, accepted risk, false positive, or other. This is how a finding is triaged out of the open queue.", + NeedsReason: true, + NeedsAllowlistType: true, + method: func(t Type) Action { return t.Allowlist }, + body: allowlistBody, + }, + { + Name: "unallowlist", + Write: true, + Tool: "nullify_unallowlist_finding", + Description: "Remove a finding from the allowlist, re-opening it.", + NeedsReason: true, + method: func(t Type) Action { return t.Unallowlist }, + body: unallowlistBody, + }, + { + Name: "archive", + Write: true, + OptIn: true, + Tool: "nullify_archive_finding", + Description: "Archive a finding, removing it from the open queue without recording a verdict.", + method: func(t Type) Action { return t.Archive }, + }, + { + Name: "unarchive", + Write: true, + OptIn: true, + Tool: "nullify_unarchive_finding", + Description: "Restore an archived finding to the open queue.", + method: func(t Type) Action { return t.Unarchive }, + }, + { + Name: "mark-false-positive", + Write: true, + OptIn: true, + Tool: "nullify_mark_false_positive", + Description: "Mark a finding as a false positive.", + NeedsReason: true, + method: func(t Type) Action { return t.MarkFalsePositive }, + body: falsePositiveBody, + }, + { + Name: "unmark-false-positive", + Write: true, + OptIn: true, + Tool: "nullify_unmark_false_positive", + Description: "Remove the false positive mark from a finding.", + method: func(t Type) Action { return t.UnmarkFalsePositive }, + }, + { + Name: "create-ticket", + Write: true, + Tool: "nullify_create_ticket", + Description: "Create a ticket (e.g. Jira, GitHub issue) for a finding.", + method: func(t Type) Action { return t.CreateTicket }, + }, + { + Name: "delete-ticket", + Write: true, + OptIn: true, + Tool: "nullify_delete_ticket", + Description: "Close the ticket of a finding on its integration and clear the link to it. The API does not record a reason for this.", + method: func(t Type) Action { return t.DeleteTicket }, + }, +} + +// Run calls the verb for one finding after it validates the inputs. +func (v Verb) Run(ctx context.Context, c *api.Client, typeName, findingID string, params Params) (json.RawMessage, error) { + t, err := Lookup(typeName) + if err != nil { + return nil, err + } + + action := v.method(t) + if action == nil { + return nil, fmt.Errorf("%s of type %q: %w, supported types: %s", v.Name, typeName, ErrUnsupported, strings.Join(v.Types(), ", ")) + } + if findingID == "" { + return nil, ErrFindingIDRequired + } + if v.NeedsReason && strings.TrimSpace(params.Reason) == "" { + return nil, ErrReasonRequired + } + if v.NeedsAllowlistType && !slices.Contains(AllowlistTypes, params.AllowlistType) { + return nil, fmt.Errorf("%w %q, valid types: %s", ErrInvalidAllowlistType, params.AllowlistType, strings.Join(AllowlistTypes, ", ")) + } + + var body []byte + if v.body != nil { + body, err = v.body(t, params) + if err != nil { + return nil, err + } + } + + data, err := action(ctx, c, findingID, body) + if err != nil { + return nil, err + } + if warning := v.Warning(typeName); warning != "" { + return addWarning(data, warning) + } + return data, nil +} + +// Warning returns what a successful run of the verb for the type must tell the +// caller, or an empty string. +func (v Verb) Warning(typeName string) string { + t, err := Lookup(typeName) + switch { + case err != nil: + return "" + case v.NeedsAllowlistType && t.AllowlistTypeUnrecorded: + return AllowlistTypeWarning + case v.Name == "unallowlist" && t.UnallowlistReasonUnrecorded: + return UnallowlistReasonWarning + } + return "" +} + +// addWarning adds a warning field to a response. The write has already happened, +// so a response that is not a JSON object is kept as a string in a response field. +func addWarning(data json.RawMessage, warning string) (json.RawMessage, error) { + fields := map[string]any{} + if err := json.Unmarshal(data, &fields); err != nil { + fields = map[string]any{"response": string(data)} + } + fields["warning"] = warning + return json.Marshal(fields) +} + +// Types returns the finding types that support the verb. +func (v Verb) Types() []string { + return NamesWith(func(t Type) bool { return v.method(t) != nil }) +} + +// TypeValues returns the values that the verb accepts for a type: the slugs, the +// aliases and the type values of listed findings. +func (v Verb) TypeValues() []string { + return AcceptedNames(func(t Type) bool { return v.method(t) != nil }) +} + +func allowlistBody(t Type, p Params) ([]byte, error) { + if t.AllowOnPatch { + return json.Marshal(map[string]any{"allow": true, "reason": p.Reason}) + } + return json.Marshal(map[string]string{"allowlistReason": p.Reason, "allowlistType": p.AllowlistType}) +} + +// unallowlistBody always names the type UserOther, as the dashboard does. The +// secrets routes require the field and the input of every other type drops it. +func unallowlistBody(t Type, p Params) ([]byte, error) { + if t.AllowOnPatch { + return json.Marshal(map[string]any{"allow": false, "reason": p.Reason}) + } + return json.Marshal(map[string]string{"unallowlistReason": p.Reason, "unallowlistType": string(models.ModelsAllowlistTypeUserother)}) +} + +func falsePositiveBody(_ Type, p Params) ([]byte, error) { + return json.Marshal(map[string]string{"falsePositiveReason": p.Reason}) +} + +// SubmitFeedback records a verdict on a finding of any type. It never changes +// the finding. +func SubmitFeedback(ctx context.Context, c *api.Client, findingID, verdict, comment string) (json.RawMessage, error) { + if findingID == "" { + return nil, ErrFindingIDRequired + } + if !slices.Contains(FeedbackVerdicts, verdict) { + return nil, fmt.Errorf("%w %q, valid verdicts: %s", ErrInvalidVerdict, verdict, strings.Join(FeedbackVerdicts, ", ")) + } + + in := api.CreateFindingsFindingIdFeedbackInput{ + FindingID: findingID, + Verdict: models.EndpointsFindingFeedbackVerdict(verdict), + } + if comment != "" { + in.CommentText = &comment + } + out, err := c.CreateFindingsFindingIdFeedback(ctx, in) + if err != nil { + return nil, err + } + return json.Marshal(out) +} + +// ListFeedback returns the feedback recorded on a finding. +func ListFeedback(ctx context.Context, c *api.Client, findingID string) (json.RawMessage, error) { + if findingID == "" { + return nil, ErrFindingIDRequired + } + out, err := c.ListFindingsFindingIdFeedback(ctx, api.ListFindingsFindingIdFeedbackInput{FindingID: findingID}) + if err != nil { + return nil, err + } + return json.Marshal(out) +} diff --git a/internal/lib/git.go b/internal/lib/git.go index cc15c82..d8a2cc5 100644 --- a/internal/lib/git.go +++ b/internal/lib/git.go @@ -2,14 +2,27 @@ package lib import ( "bufio" + "net/url" "os" "path/filepath" "strings" ) // DetectRepoFromGit reads the git remote origin URL from the nearest .git/config -// and extracts the repository name. +// and returns the repository name. func DetectRepoFromGit() string { + return ParseRepoFromGitConfig(nearestGitConfig()) +} + +// DetectRepoFullNameFromGit is DetectRepoFromGit for callers that also need the +// owner. It returns owner/name when the remote URL holds both, otherwise the name. +func DetectRepoFullNameFromGit() string { + return ExtractRepoFullName(originURLFromGitConfig(nearestGitConfig())) +} + +// nearestGitConfig returns the path of the .git/config file at or above the working +// directory, or an empty string if there is none. +func nearestGitConfig() string { dir, err := os.Getwd() if err != nil { return "" @@ -18,21 +31,24 @@ func DetectRepoFromGit() string { for { gitConfig := filepath.Join(dir, ".git", "config") if _, err := os.Stat(gitConfig); err == nil { - return ParseRepoFromGitConfig(gitConfig) + return gitConfig } parent := filepath.Dir(dir) if parent == dir { - break + return "" } dir = parent } - - return "" } // ParseRepoFromGitConfig extracts the repo name from a .git/config file. func ParseRepoFromGitConfig(path string) string { + return ExtractRepoName(originURLFromGitConfig(path)) +} + +// originURLFromGitConfig returns the URL of the origin remote in a .git/config file. +func originURLFromGitConfig(path string) string { f, err := os.Open(path) if err != nil { return "" @@ -57,7 +73,7 @@ func ParseRepoFromGitConfig(path string) string { if inOrigin && strings.HasPrefix(line, "url") { parts := strings.SplitN(line, "=", 2) if len(parts) == 2 { - return ExtractRepoName(strings.TrimSpace(parts[1])) + return strings.TrimSpace(parts[1]) } } } @@ -65,6 +81,23 @@ func ParseRepoFromGitConfig(path string) string { return "" } +// ExtractRepoFullName extracts the path of the repository from a git remote URL: +// owner/name for most hosts. It returns an empty string for an empty URL. +func ExtractRepoFullName(remoteURL string) string { + remoteURL = strings.TrimSuffix(remoteURL, ".git") + + if strings.HasPrefix(remoteURL, "git@") { + _, path, _ := strings.Cut(remoteURL, ":") + return path + } + + parsed, err := url.Parse(remoteURL) + if err != nil { + return ExtractRepoName(remoteURL) + } + return strings.Trim(parsed.Path, "/") +} + // ExtractRepoName extracts the repository name from a git remote URL. // Handles both SSH (git@github.com:org/repo.git) and HTTPS (https://github.com/org/repo.git) formats. func ExtractRepoName(remoteURL string) string { diff --git a/internal/lib/git_test.go b/internal/lib/git_test.go index 9bd21bf..026e8d1 100644 --- a/internal/lib/git_test.go +++ b/internal/lib/git_test.go @@ -56,3 +56,23 @@ func TestExtractRepoName(t *testing.T) { }) } } + +func TestExtractRepoFullName(t *testing.T) { + tests := []struct { + name string + remoteURL string + want string + }{ + {name: "SSH", remoteURL: "git@github.com:nullify-platform/cli.git", want: "nullify-platform/cli"}, + {name: "HTTPS", remoteURL: "https://github.com/nullify-platform/cli.git", want: "nullify-platform/cli"}, + {name: "HTTPS with a token", remoteURL: "https://x-access-token:abc@github.com/nullify-platform/cli", want: "nullify-platform/cli"}, + {name: "SSH URL", remoteURL: "ssh://git@github.com/nullify-platform/cli.git", want: "nullify-platform/cli"}, + {name: "nested GitLab group", remoteURL: "https://gitlab.com/group/sub/cli.git", want: "group/sub/cli"}, + {name: "no remote", remoteURL: "", want: ""}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, ExtractRepoFullName(tt.remoteURL)) + }) + } +} diff --git a/internal/mcp/prompts.go b/internal/mcp/prompts.go index e19bfc6..32fc8e8 100644 --- a/internal/mcp/prompts.go +++ b/internal/mcp/prompts.go @@ -190,7 +190,7 @@ func registerPrompts(s *server.MCPServer) { return promptResult( "Fix critical findings", "Search for all critical severity findings using nullify_search_findings with severity=critical. "+ - "For each finding that supports autofix (e.g. sast, sca_dependencies), call nullify_fix_finding to generate a fix. "+ + "For each finding that supports autofix (e.g. sast, sca_dependencies), call nullify_fix_finding to start a fix, then follow it with nullify_get_fix_status until it has ended. "+ "Report the results: which findings were fixed, which PRs were created, and which findings need manual attention.", ), nil }, diff --git a/internal/mcp/server.go b/internal/mcp/server.go index f5cc2b8..009a0e3 100644 --- a/internal/mcp/server.go +++ b/internal/mcp/server.go @@ -50,6 +50,11 @@ func registerTools(s *server.MCPServer, c *api.Client, toolSet ToolSet) { registerUnifiedTools(s, c) registerCompositeTools(s, c) + case ToolSetFindingsWrite: + registerUnifiedTools(s, c) + registerOptInFindingTools(s, c) + registerCompositeTools(s, c) + case ToolSetAdmin: registerAdminTools(s, c) registerContextTools(s, c) @@ -58,6 +63,7 @@ func registerTools(s *server.MCPServer, c *api.Client, toolSet ToolSet) { case ToolSetAll: registerUnifiedTools(s, c) + registerOptInFindingTools(s, c) registerCompositeTools(s, c) registerContextTools(s, c) registerManagerTools(s, c) @@ -76,6 +82,17 @@ func registerTools(s *server.MCPServer, c *api.Client, toolSet ToolSet) { } } +// readOnlyTool builds a tool that changes nothing on the server. +func readOnlyTool(name string, options ...mcp.ToolOption) mcp.Tool { + return mcp.NewTool(name, append(options, mcp.WithReadOnlyHintAnnotation(true), mcp.WithDestructiveHintAnnotation(false))...) +} + +// writeTool builds a tool that changes state on the server. The destructive hint +// tells the client to ask a person before it calls the tool. +func writeTool(name string, options ...mcp.ToolOption) mcp.Tool { + return mcp.NewTool(name, append(options, mcp.WithReadOnlyHintAnnotation(false), mcp.WithDestructiveHintAnnotation(true))...) +} + func getStringArg(args map[string]any, key string) string { v, ok := args[key] if !ok { diff --git a/internal/mcp/surface.go b/internal/mcp/surface.go new file mode 100644 index 0000000..3c9bf7c --- /dev/null +++ b/internal/mcp/surface.go @@ -0,0 +1,124 @@ +package mcp + +import ( + "errors" + "fmt" + "slices" + "strings" + + "github.com/mark3labs/mcp-go/mcp" + "github.com/mark3labs/mcp-go/server" +) + +// Errors for a change to the MCP tools with no recorded decision. +var ( + ErrToolDisappeared = errors.New("MCP tool disappeared without a recorded decision") + ErrToolChanged = errors.New("MCP tool changed its annotation or tool sets without a recorded decision") +) + +// ToolDecisions records each deliberate break of the MCP tool surface, with the evidence. +type ToolDecisions struct { + // Removed are tools that left. + Removed map[string]string + // Changed are tools that changed their annotation or their tool sets. + Changed map[string]string +} + +// Decisions holds the recorded decisions for the MCP tools. +var Decisions = ToolDecisions{ + Removed: map[string]string{ + "list_escalations": "GET /manager/escalations is gone from prod (#5596), so the tool only returned errors. list_action_items returns a different schema, so it is not an alias.", + }, +} + +// ToolEntry is one line of the MCP tool snapshot. +type ToolEntry struct { + Name string + // Annotation is read-only, destructive, or write for a tool that changes state + // but is not marked destructive. + Annotation string + Sets []string +} + +// ToolSurface returns every MCP tool with its access and its tool sets, sorted by name. +func ToolSurface() []ToolEntry { + entries := map[string]*ToolEntry{} + for _, set := range ValidToolSets() { + s := server.NewMCPServer("surface", "0", server.WithToolCapabilities(true)) + registerTools(s, nil, ToolSet(set)) + + for name, tool := range s.ListTools() { + if entries[name] == nil { + entries[name] = &ToolEntry{Name: name, Annotation: annotationOf(tool.Tool.Annotations)} + } + entries[name].Sets = append(entries[name].Sets, set) + } + } + + var surface []ToolEntry + for _, entry := range entries { + slices.Sort(entry.Sets) + surface = append(surface, *entry) + } + slices.SortFunc(surface, func(a, b ToolEntry) int { return strings.Compare(a.Name, b.Name) }) + return surface +} + +func annotationOf(a mcp.ToolAnnotation) string { + switch { + case a.ReadOnlyHint != nil && *a.ReadOnlyHint: + return "read-only" + case a.DestructiveHint != nil && *a.DestructiveHint: + return "destructive" + default: + return "write" + } +} + +// FormatToolSurface renders entries as the tab-separated snapshot text. +func FormatToolSurface(entries []ToolEntry) string { + var sb strings.Builder + for _, e := range entries { + fmt.Fprintf(&sb, "%s\t%s\t%s\n", e.Name, e.Annotation, strings.Join(e.Sets, ",")) + } + return sb.String() +} + +// ParseToolSurface reads the snapshot text. An empty text has no tools. +func ParseToolSurface(text string) ([]ToolEntry, error) { + var entries []ToolEntry + for i, line := range strings.Split(strings.TrimSpace(text), "\n") { + if line == "" { + continue + } + fields := strings.Split(line, "\t") + if len(fields) != 3 { + return nil, fmt.Errorf("tool surface line %d: want 3 fields, got %d", i+1, len(fields)) + } + entries = append(entries, ToolEntry{Name: fields[0], Annotation: fields[1], Sets: strings.Split(fields[2], ",")}) + } + return entries, nil +} + +// CheckToolSurface reports every tool in base that live does not have, or that +// has another annotation or other tool sets in live, unless decisions records it. +func CheckToolSurface(base, live []ToolEntry, decisions ToolDecisions) error { + liveByName := map[string]ToolEntry{} + for _, e := range live { + liveByName[e.Name] = e + } + + var errs []error + for _, want := range base { + got, ok := liveByName[want.Name] + _, removed := decisions.Removed[want.Name] + _, changed := decisions.Changed[want.Name] + switch { + case !ok && !removed: + errs = append(errs, fmt.Errorf("%w: %s", ErrToolDisappeared, want.Name)) + case ok && !changed && (got.Annotation != want.Annotation || !slices.Equal(got.Sets, want.Sets)): + errs = append(errs, fmt.Errorf("%w: %s: %s %v to %s %v", ErrToolChanged, want.Name, want.Annotation, want.Sets, got.Annotation, got.Sets)) + } + } + return errors.Join(errs...) +} diff --git a/internal/mcp/surface_test.go b/internal/mcp/surface_test.go new file mode 100644 index 0000000..95a4c12 --- /dev/null +++ b/internal/mcp/surface_test.go @@ -0,0 +1,95 @@ +package mcp + +import ( + "os" + "testing" + + "github.com/stretchr/testify/require" +) + +const toolSnapshot = "../../spec/mcp-tools.tsv" + +func TestToolSurfaceMatchesSnapshot(t *testing.T) { + content, err := os.ReadFile(toolSnapshot) + require.ErrorIs(t, err, nil) + + require.Equal(t, string(content), FormatToolSurface(ToolSurface()), "run make command-surface") +} + +func TestCheckToolSurface(t *testing.T) { + readOnly := ToolEntry{Name: "a", Annotation: "read-only", Sets: []string{"all", "default"}} + destructive := ToolEntry{Name: "a", Annotation: "destructive", Sets: []string{"all", "default"}} + optIn := ToolEntry{Name: "a", Annotation: "read-only", Sets: []string{"all"}} + evidence := map[string]string{"a": "evidence"} + + tests := []struct { + name string + base []ToolEntry + live []ToolEntry + decisions ToolDecisions + want error + }{ + {name: "kept", base: []ToolEntry{readOnly}, live: []ToolEntry{readOnly}}, + {name: "added", live: []ToolEntry{readOnly}}, + {name: "gone", base: []ToolEntry{readOnly}, want: ErrToolDisappeared}, + {name: "gone with a decision", base: []ToolEntry{readOnly}, decisions: ToolDecisions{Removed: evidence}}, + {name: "annotation changed", base: []ToolEntry{destructive}, live: []ToolEntry{readOnly}, want: ErrToolChanged}, + {name: "tool sets changed", base: []ToolEntry{optIn}, live: []ToolEntry{readOnly}, want: ErrToolChanged}, + {name: "changed with a decision", base: []ToolEntry{destructive}, live: []ToolEntry{readOnly}, decisions: ToolDecisions{Changed: evidence}}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.ErrorIs(t, CheckToolSurface(tt.base, tt.live, tt.decisions), tt.want) + }) + } +} + +func TestParseToolSurface(t *testing.T) { + entries := []ToolEntry{{Name: "a", Annotation: "read-only", Sets: []string{"all", "default"}}, {Name: "b", Annotation: "destructive", Sets: []string{"all"}}} + + got, err := ParseToolSurface(FormatToolSurface(entries)) + require.ErrorIs(t, err, nil) + require.Equal(t, entries, got) + + empty, err := ParseToolSurface("") + require.ErrorIs(t, err, nil) + require.Empty(t, empty) +} + +func TestToolAccess(t *testing.T) { + tests := []struct { + tool string + annotation string + sets []string + }{ + {tool: "nullify_search_findings", annotation: "read-only", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_get_finding", annotation: "read-only", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "get_security_trends", annotation: "read-only", sets: []string{"admin", "all", "default", "findings", "findings-write", "minimal"}}, + {tool: "nullify_get_fix_status", annotation: "read-only", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_get_fix_diff", annotation: "read-only", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_allowlist_finding", annotation: "destructive", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_unallowlist_finding", annotation: "destructive", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_create_ticket", annotation: "destructive", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_fix_finding", annotation: "destructive", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_submit_finding_feedback", annotation: "destructive", sets: []string{"all", "default", "findings", "findings-write"}}, + {tool: "nullify_archive_finding", annotation: "destructive", sets: []string{"all", "findings-write"}}, + {tool: "nullify_unarchive_finding", annotation: "destructive", sets: []string{"all", "findings-write"}}, + {tool: "nullify_mark_false_positive", annotation: "destructive", sets: []string{"all", "findings-write"}}, + {tool: "nullify_unmark_false_positive", annotation: "destructive", sets: []string{"all", "findings-write"}}, + {tool: "nullify_delete_ticket", annotation: "destructive", sets: []string{"all", "findings-write"}}, + {tool: "nullify_start_cloud_scan", annotation: "destructive", sets: []string{"all", "default"}}, + {tool: "nullify_create_threat_investigation", annotation: "destructive", sets: []string{"all", "default"}}, + {tool: "start_pentest", annotation: "destructive", sets: []string{"all"}}, + {tool: "stop_pentest_scan", annotation: "destructive", sets: []string{"all"}}, + } + + live := map[string]ToolEntry{} + for _, e := range ToolSurface() { + live[e.Name] = e + } + for _, tt := range tests { + t.Run(tt.tool, func(t *testing.T) { + require.Equal(t, ToolEntry{Name: tt.tool, Annotation: tt.annotation, Sets: tt.sets}, live[tt.tool]) + }) + } +} diff --git a/internal/mcp/tools_admin.go b/internal/mcp/tools_admin.go index 4e791bd..e649557 100644 --- a/internal/mcp/tools_admin.go +++ b/internal/mcp/tools_admin.go @@ -66,7 +66,7 @@ func metricsOverTimeInput(period string) api.CreateAdminMetricsOverTimeInput { func registerAdminTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("get_metrics_overview", + readOnlyTool("get_metrics_overview", mcp.WithDescription("Get a high-level security posture overview: counts of findings by severity and type."), ), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { @@ -80,7 +80,7 @@ func registerAdminTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_metrics_over_time", + readOnlyTool("get_metrics_over_time", mcp.WithDescription("Get security metrics trends over time."), mcp.WithString("period", mcp.Description("Time period"), mcp.Enum("7d", "30d", "90d", "365d")), ), @@ -99,7 +99,7 @@ func registerAdminTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("list_teams", + readOnlyTool("list_teams", mcp.WithDescription("List teams in the organization (used for assigning findings and access)."), mcp.WithNumber("limit", mcp.Description("Max results")), ), @@ -118,7 +118,7 @@ func registerAdminTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("list_sla_policies", + readOnlyTool("list_sla_policies", mcp.WithDescription("List SLA policies defining expected remediation timeframes by severity."), ), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { @@ -132,7 +132,7 @@ func registerAdminTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_organization", + readOnlyTool("get_organization", mcp.WithDescription("Get organization details including name and plan."), ), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { diff --git a/internal/mcp/tools_composite.go b/internal/mcp/tools_composite.go index 160a2a9..3fae5a7 100644 --- a/internal/mcp/tools_composite.go +++ b/internal/mcp/tools_composite.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/nullify-platform/cli/internal/api" + "github.com/nullify-platform/cli/internal/findings" "github.com/mark3labs/mcp-go/mcp" "github.com/mark3labs/mcp-go/server" @@ -74,11 +75,17 @@ var scannerListers = []scannerLister{ return marshalOut(c.ListCspmFindings(ctx, api.ListCspmFindingsInput{Limit: limitPtr(1)})) }, }, + { + name: "scpm", + peek: func(ctx context.Context, c *api.Client) (json.RawMessage, error) { + return marshalOut(c.ListScpmFindings(ctx, api.ListScpmFindingsInput{Limit: limitPtr(1)})) + }, + }, } func registerCompositeTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("get_security_posture_summary", + readOnlyTool("get_security_posture_summary", mcp.WithDescription("High-level security posture across all scanner types. Typically the first tool to call to understand overall state."), ), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { @@ -102,9 +109,9 @@ func registerCompositeTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_findings_for_repo", - mcp.WithDescription("Get findings for a specific repository across all scanner types."), - mcp.WithString("repository", mcp.Required(), mcp.Description("Repository name")), + readOnlyTool("get_findings_for_repo", + mcp.WithDescription("Get findings for a specific repository across all scanner types. "+findingsSearchScope), + mcp.WithString("repository", mcp.Required(), mcp.Description(repositoryFilterHelp)), mcp.WithString("severity", mcp.Description("Filter by severity"), mcp.Enum("critical", "high", "medium", "low")), mcp.WithNumber("limit", mcp.Description("Max results per scanner (default 20)")), ), @@ -118,17 +125,23 @@ func registerCompositeTools(s *server.MCPServer, c *api.Client) { // repository/severity are honored there (the per-scanner GET list // endpoints silently drop both). for _, sc := range scannerListers { - findings, _, err := searchFindings(ctx, c, findingSearchOpts{ - apiTypes: findingTypes[sc.name].apiTypes, - severity: severity, - repository: repo, - limit: limit, + apiTypes := findings.Types[sc.name].APITypes + if !findings.HasRepository(apiTypes) { + parts = append(parts, fmt.Sprintf("--- %s ---\nNot listed: these findings have no repository.", sc.name)) + continue + } + + result, err := findings.Search(ctx, c, findings.SearchOptions{ + APITypes: apiTypes, + Severity: severity, + Repository: repo, + Limit: limit, }) if err != nil { parts = append(parts, fmt.Sprintf("--- %s ---\nError: %v", sc.name, err)) continue } - b, _ := json.MarshalIndent(findings, "", " ") + b, _ := json.MarshalIndent(result, "", " ") parts = append(parts, fmt.Sprintf("--- %s ---\n%s", sc.name, string(b))) } return toolResult(strings.Join(parts, "\n\n")), nil @@ -136,25 +149,29 @@ func registerCompositeTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_critical_path", - mcp.WithDescription("Get critical and high severity findings across all scanner types — the most urgent issues."), + readOnlyTool("get_critical_path", + mcp.WithDescription("Get critical and high severity findings across all scanner types — the most urgent issues. "+findingsSearchScope), mcp.WithNumber("limit", mcp.Description("Max results per scanner per severity (default 10)")), ), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { limit := getIntArg(req.GetArguments(), "limit", 10) var parts []string for _, sc := range scannerListers { - apiTypes := findingTypes[sc.name].apiTypes + apiTypes := findings.Types[sc.name].APITypes for _, sev := range []string{"critical", "high"} { - findings, _, err := searchFindings(ctx, c, findingSearchOpts{ - apiTypes: apiTypes, - severity: sev, - limit: limit, + result, err := findings.Search(ctx, c, findings.SearchOptions{ + APITypes: apiTypes, + Severity: sev, + Limit: limit, }) - if err != nil || len(findings) == 0 { + if err != nil { + parts = append(parts, fmt.Sprintf("--- %s (%s) ---\nError: %v", sc.name, sev, err)) + continue + } + if len(result.Findings) == 0 { continue } - b, _ := json.MarshalIndent(findings, "", " ") + b, _ := json.MarshalIndent(result.Findings, "", " ") parts = append(parts, fmt.Sprintf("--- %s (%s) ---\n%s", sc.name, sev, string(b))) } } @@ -166,7 +183,7 @@ func registerCompositeTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_security_trends", + readOnlyTool("get_security_trends", mcp.WithDescription("Security metrics: current posture overview plus how it has changed over time."), mcp.WithString("period", mcp.Description("Time period"), mcp.Enum("7d", "30d", "90d", "365d")), ), diff --git a/internal/mcp/tools_context.go b/internal/mcp/tools_context.go index 9c4ad77..1e1eb41 100644 --- a/internal/mcp/tools_context.go +++ b/internal/mcp/tools_context.go @@ -15,7 +15,7 @@ import ( // commit SHA) and are intentionally left to `nullify api context`. func registerContextTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("list_repositories", + readOnlyTool("list_repositories", mcp.WithDescription("List repositories Nullify monitors for the authenticated installation."), mcp.WithNumber("limit", mcp.Description("Max results")), ), @@ -29,7 +29,7 @@ func registerContextTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_repository", + readOnlyTool("get_repository", mcp.WithDescription("Get a repository by its internal repository ID."), mcp.WithString("repository_id", mcp.Required(), mcp.Description("Internal repository ID")), ), @@ -41,7 +41,7 @@ func registerContextTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("list_applications", + readOnlyTool("list_applications", mcp.WithDescription("List applications (logical groupings of repositories) in the org."), mcp.WithNumber("limit", mcp.Description("Max results")), ), @@ -55,7 +55,7 @@ func registerContextTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_application", + readOnlyTool("get_application", mcp.WithDescription("Get an application by its ID."), mcp.WithString("application_id", mcp.Required(), mcp.Description("Application ID")), ), @@ -67,7 +67,7 @@ func registerContextTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_latest_sbom", + readOnlyTool("get_latest_sbom", mcp.WithDescription("Get the latest CycloneDX SBOM for a repository."), mcp.WithString("repository_id", mcp.Required(), mcp.Description("Internal repository ID")), ), @@ -79,7 +79,7 @@ func registerContextTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_sbom", + readOnlyTool("get_sbom", mcp.WithDescription("Get the SBOM for a specific repository project."), mcp.WithString("repository_id", mcp.Required(), mcp.Description("Internal repository ID")), mcp.WithString("project_id", mcp.Required(), mcp.Description("Project ID within the repository")), @@ -94,7 +94,7 @@ func registerContextTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("list_dependencies", + readOnlyTool("list_dependencies", mcp.WithDescription("List third-party dependencies across all monitored repositories. Useful for understanding the supply chain. Paginated via cursor."), mcp.WithNumber("pageSize", mcp.Description("Max results per page")), mcp.WithString("cursor", mcp.Description("Pagination cursor from a previous response")), @@ -114,7 +114,7 @@ func registerContextTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_dependency_exposure", + readOnlyTool("get_dependency_exposure", mcp.WithDescription("Get exposure analysis for a specific dependency: which repositories use it and how (internet-facing vs internal)."), mcp.WithString("ecosystem", mcp.Required(), mcp.Description("Package ecosystem (e.g. npm, pypi, maven, go, nuget)")), mcp.WithString("name", mcp.Required(), mcp.Description("Dependency name to check exposure for")), diff --git a/internal/mcp/tools_cspm.go b/internal/mcp/tools_cspm.go index c1caad1..be347e4 100644 --- a/internal/mcp/tools_cspm.go +++ b/internal/mcp/tools_cspm.go @@ -9,11 +9,11 @@ import ( "github.com/mark3labs/mcp-go/server" ) -// registerCSPMTools registers CSPM scan tools. CSPM findings are reachable via -// the unified tools (type=cspm), so only scan history lives here. +// registerCSPMTools registers CSPM scan tools. The unified tools (type=cspm) hold +// all finding operations. func registerCSPMTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("list_cspm_scans", + readOnlyTool("list_cspm_scans", mcp.WithDescription("List CSPM (Cloud Security Posture Management) scan history."), mcp.WithNumber("limit", mcp.Description("Max results")), ), diff --git a/internal/mcp/tools_manager.go b/internal/mcp/tools_manager.go index 654fff9..2a70a9d 100644 --- a/internal/mcp/tools_manager.go +++ b/internal/mcp/tools_manager.go @@ -11,7 +11,7 @@ import ( func registerManagerTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("list_campaigns", + readOnlyTool("list_campaigns", mcp.WithDescription("List remediation campaigns — coordinated efforts to fix groups of related findings."), mcp.WithNumber("limit", mcp.Description("Max results")), ), @@ -25,7 +25,7 @@ func registerManagerTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_campaign", + readOnlyTool("get_campaign", mcp.WithDescription("Get a remediation campaign by ID, including progress and assigned findings."), mcp.WithString("campaign_id", mcp.Required(), mcp.Description("The campaign ID")), ), @@ -37,16 +37,16 @@ func registerManagerTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("list_escalations", - mcp.WithDescription("List current escalations — findings flagged for urgent attention."), + readOnlyTool("list_action_items", + mcp.WithDescription("List action items: decisions and questions that need a person, ordered by priority."), mcp.WithNumber("limit", mcp.Description("Max results")), ), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { - in := api.ListManagerEscalationsInput{} + in := api.ListManagerActionItemsInput{} if n := getIntArg(req.GetArguments(), "limit", 0); n > 0 { in.PageSize = &n } - return wrapTyped(c.ListManagerEscalations(ctx, in)) + return wrapTyped(c.ListManagerActionItems(ctx, in)) }, ) } diff --git a/internal/mcp/tools_pentest.go b/internal/mcp/tools_pentest.go index 3daef44..b35cb01 100644 --- a/internal/mcp/tools_pentest.go +++ b/internal/mcp/tools_pentest.go @@ -13,7 +13,7 @@ import ( // findings are reachable via the unified tools (type=pentest). func registerPentestTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("list_pentest_scans", + readOnlyTool("list_pentest_scans", mcp.WithDescription("List pentest scan history (past and in-progress scans)."), mcp.WithNumber("limit", mcp.Description("Max results")), ), @@ -27,7 +27,7 @@ func registerPentestTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_pentest_scan", + readOnlyTool("get_pentest_scan", mcp.WithDescription("Get status and details of a specific pentest scan."), mcp.WithString("scan_id", mcp.Required(), mcp.Description("The scan ID")), ), @@ -43,7 +43,7 @@ func registerPentestTools(s *server.MCPServer, c *api.Client) { // {appName, targetHost} — wrong shape, 400'd silently. The typed input // makes that mistake a compile error now.) s.AddTool( - mcp.NewTool("start_pentest", + writeTool("start_pentest", mcp.WithDescription("Start a new pentest scan for a configured application. Use list_applications to find the application_id."), mcp.WithString("application_id", mcp.Required(), mcp.Description("The application ID to scan")), ), @@ -55,7 +55,7 @@ func registerPentestTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("stop_pentest_scan", + writeTool("stop_pentest_scan", mcp.WithDescription("Stop a running pentest scan."), mcp.WithString("scan_id", mcp.Required(), mcp.Description("The scan ID")), ), @@ -67,7 +67,7 @@ func registerPentestTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("get_pentest_report", + readOnlyTool("get_pentest_report", mcp.WithDescription("Get the report for a completed pentest scan."), mcp.WithString("scan_id", mcp.Required(), mcp.Description("The scan ID")), ), diff --git a/internal/mcp/tools_scans.go b/internal/mcp/tools_scans.go index 32880d4..6d56059 100644 --- a/internal/mcp/tools_scans.go +++ b/internal/mcp/tools_scans.go @@ -45,7 +45,7 @@ var scanRunMethods = map[string]scanRunLister{ func registerScanTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("nullify_start_cloud_scan", + writeTool("nullify_start_cloud_scan", mcp.WithDescription("Start a cloud security scan (CSPM / cloud reconnaissance) for the authenticated installation. Returns a scanId; poll nullify_get_cloud_scan_status."), ), func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { @@ -59,7 +59,7 @@ func registerScanTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("nullify_get_cloud_scan_status", + readOnlyTool("nullify_get_cloud_scan_status", mcp.WithDescription("Get the status of a cloud scan started with nullify_start_cloud_scan."), mcp.WithString("scan_id", mcp.Required(), mcp.Description("The scan ID")), ), @@ -76,7 +76,7 @@ func registerScanTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("nullify_list_scan_runs", + readOnlyTool("nullify_list_scan_runs", mcp.WithDescription("List scan run history for a code scanner (SAST, SCA, or secrets) on a repository. Use list_repositories / get_repository to resolve a repository_id."), mcp.WithString("type", mcp.Required(), mcp.Description("Scanner type"), mcp.Enum("sast", "sca", "secrets")), mcp.WithString("repository_id", mcp.Required(), mcp.Description("Internal repository ID")), diff --git a/internal/mcp/tools_threat.go b/internal/mcp/tools_threat.go index fd4cc92..b54e49f 100644 --- a/internal/mcp/tools_threat.go +++ b/internal/mcp/tools_threat.go @@ -16,7 +16,7 @@ import ( // browsing analyzed CVEs/advisories and recording a new investigation. func registerThreatTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool("nullify_list_threat_investigations", + readOnlyTool("nullify_list_threat_investigations", mcp.WithDescription("List threat investigations (the org's threat-intelligence catalog). Paginates automatically up to limit."), mcp.WithNumber("limit", mcp.Description("Max total investigations across pages (default 100)")), ), @@ -32,7 +32,7 @@ func registerThreatTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("nullify_get_threat_investigation", + readOnlyTool("nullify_get_threat_investigation", mcp.WithDescription("Get a single threat investigation by ID."), mcp.WithString("id", mcp.Required(), mcp.Description("The threat investigation ID")), ), @@ -44,7 +44,7 @@ func registerThreatTools(s *server.MCPServer, c *api.Client) { ) s.AddTool( - mcp.NewTool("nullify_create_threat_investigation", + writeTool("nullify_create_threat_investigation", mcp.WithDescription("Create a threat investigation entry in the threat-intelligence catalog."), mcp.WithString("title", mcp.Required(), mcp.Description("Short title of the threat")), mcp.WithString("description", mcp.Description("Detailed description")), diff --git a/internal/mcp/tools_unified.go b/internal/mcp/tools_unified.go index f6e9d47..896c5c5 100644 --- a/internal/mcp/tools_unified.go +++ b/internal/mcp/tools_unified.go @@ -3,570 +3,87 @@ package mcp import ( "context" "encoding/json" - "errors" - "fmt" - "sort" - "strings" - "time" "github.com/nullify-platform/cli/internal/api" - "github.com/nullify-platform/cli/internal/api/models" + "github.com/nullify-platform/cli/internal/findings" "github.com/mark3labs/mcp-go/mcp" "github.com/mark3labs/mcp-go/server" ) -// findingMethodGet adapts a typed no-body generated client method to a uniform -// "fetch by finding-id, return JSON bytes" shape so the per-finding-type -// dispatch table can route a single tool to the right typed endpoint. -type findingMethodGet = func(c *api.Client, ctx context.Context, findingID string) (json.RawMessage, error) - -// findingMethodAction adapts a typed body-taking generated client method. The -// body is supplied as already-marshalled JSON bytes; the closure decodes them -// into the typed input struct (path/url fields are tagged json:"-" so they -// don't conflict), sets the FindingID, calls the typed method, and re-marshals -// the typed response. -type findingMethodAction = func(c *api.Client, ctx context.Context, findingID string, body []byte) (json.RawMessage, error) - -// findingType bundles the typed-client capabilities for one finding-type slug. -// A nil method means the platform does not support that capability for the -// type, and the unified tool will not offer it for that type. -type findingType struct { - apiTypes []string // values for the /admin/findings + /admin/events "type" filter - get findingMethodGet - triage findingMethodGet // GET .../triage — AI-triage detail (read-only) - ticket findingMethodAction - allowlist findingMethodAction - unallowlist findingMethodAction - autofixFix findingMethodAction - autofixState findingMethodGet - autofixDiff findingMethodGet - autofixCreatePR findingMethodAction - - // allowlistPatchStyle marks types whose allowlist endpoint is the bughunt - // PATCH contract — body {allow, reason} — rather than the POST contract - // {allowlistReason, allowlistType} every other type uses. See - // hyperdrive PatchBugHuntFindingAllowlistInput vs the per-service POST inputs. - allowlistPatchStyle bool -} - -// marshalOut is a tiny helper that turns any (*T, error) typed-method result -// into a (json.RawMessage, error) for the adapter signature. -func marshalOut[T any](out *T, err error) (json.RawMessage, error) { - if err != nil { - return nil, err - } - return json.Marshal(out) -} - -// rawOut passes through a ([]byte, error) result. Some endpoints have no $ref -// in their 2xx response schema, so the generator falls back to a raw-bytes -// return; this adapter avoids re-marshalling. -func rawOut(data []byte, err error) (json.RawMessage, error) { - if err != nil { - return nil, err - } - return json.RawMessage(data), nil -} - -// decodeBody unmarshals body bytes into a typed input struct. Empty body is -// treated as "no body fields"; the typed method's body marshal will then send -// an empty JSON object (or whatever the omitempty pattern dictates). -func decodeBody[T any](body []byte, in *T) error { - if len(body) == 0 { - return nil - } - return json.Unmarshal(body, in) -} - -var findingTypes = map[string]findingType{ - "sast": { - apiTypes: []string{"Code"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetSastFindingsFindingId(ctx, api.GetSastFindingsFindingIdInput{FindingID: id})) - }, - triage: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListSastFindingsFindingIdTriage(ctx, api.ListSastFindingsFindingIdTriageInput{FindingID: id})) - }, - ticket: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateSastFindingsFindingIdTicketInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateSastFindingsFindingIdTicket(ctx, in)) - }, - allowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateSastFindingsFindingIdAllowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateSastFindingsFindingIdAllowlist(ctx, in)) - }, - unallowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateSastFindingsFindingIdUnallowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateSastFindingsFindingIdUnallowlist(ctx, in)) - }, - autofixFix: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateSastFindingsFindingIdAutofixFixInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateSastFindingsFindingIdAutofixFix(ctx, in)) - }, - autofixState: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListSastFindingsFindingIdAutofixStatus(ctx, api.ListSastFindingsFindingIdAutofixStatusInput{FindingID: id})) - }, - autofixDiff: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListSastFindingsFindingIdAutofixCacheDiff(ctx, api.ListSastFindingsFindingIdAutofixCacheDiffInput{FindingID: id})) - }, - }, - "sca_dependencies": { - apiTypes: []string{"Dependencies"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetScaDependenciesFindingsFindingId(ctx, api.GetScaDependenciesFindingsFindingIdInput{FindingID: id})) - }, - triage: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScaDependenciesFindingsFindingIdTriage(ctx, api.ListScaDependenciesFindingsFindingIdTriageInput{FindingID: id})) - }, - ticket: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaDependenciesFindingsFindingIdTicketInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateScaDependenciesFindingsFindingIdTicket(ctx, in)) - }, - allowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaDependenciesFindingsFindingIdAllowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateScaDependenciesFindingsFindingIdAllowlist(ctx, in)) - }, - unallowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaDependenciesFindingsFindingIdUnallowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateScaDependenciesFindingsFindingIdUnallowlist(ctx, in)) - }, - autofixFix: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaDependenciesFindingsFindingIdAutofixFixInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateScaDependenciesFindingsFindingIdAutofixFix(ctx, in)) - }, - autofixState: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScaDependenciesFindingsFindingIdAutofixStatus(ctx, api.ListScaDependenciesFindingsFindingIdAutofixStatusInput{FindingID: id})) - }, - autofixDiff: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScaDependenciesFindingsFindingIdAutofixCacheDiff(ctx, api.ListScaDependenciesFindingsFindingIdAutofixCacheDiffInput{FindingID: id})) - }, - }, - "sca_containers": { - apiTypes: []string{"Containers"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetScaContainersFindingsFindingId(ctx, api.GetScaContainersFindingsFindingIdInput{FindingID: id})) - }, - triage: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScaContainersFindingsFindingIdTriage(ctx, api.ListScaContainersFindingsFindingIdTriageInput{FindingID: id})) - }, - ticket: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaContainersFindingsFindingIdTicketInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateScaContainersFindingsFindingIdTicket(ctx, in)) - }, - allowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaContainersFindingsFindingIdAllowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateScaContainersFindingsFindingIdAllowlist(ctx, in)) - }, - unallowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaContainersFindingsFindingIdUnallowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateScaContainersFindingsFindingIdUnallowlist(ctx, in)) - }, - autofixFix: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScaContainersFindingsFindingIdAutofixFixInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateScaContainersFindingsFindingIdAutofixFix(ctx, in)) - }, - autofixState: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScaContainersFindingsFindingIdAutofixStatus(ctx, api.ListScaContainersFindingsFindingIdAutofixStatusInput{FindingID: id})) - }, - // containers expose no cache-diff endpoint - }, - "secrets": { - apiTypes: []string{"SecretsCredentials", "SecretsSensitiveData"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetSecretsFindingsFindingId(ctx, api.GetSecretsFindingsFindingIdInput{FindingID: id})) - }, - triage: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListSecretsFindingsFindingIdTriage(ctx, api.ListSecretsFindingsFindingIdTriageInput{FindingID: id})) - }, - ticket: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateSecretsFindingsFindingIdTicketInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateSecretsFindingsFindingIdTicket(ctx, in)) - }, - allowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateSecretsFindingsFindingIdAllowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateSecretsFindingsFindingIdAllowlist(ctx, in)) - }, - unallowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateSecretsFindingsFindingIdUnallowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateSecretsFindingsFindingIdUnallowlist(ctx, in)) - }, - // secrets have no autofix - }, - "pentest": { - apiTypes: []string{"Pentest"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetDastPentestFindingsFindingId(ctx, api.GetDastPentestFindingsFindingIdInput{FindingID: id})) - }, - triage: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListDastPentestFindingsFindingIdTriage(ctx, api.ListDastPentestFindingsFindingIdTriageInput{FindingID: id})) - }, - ticket: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateDastPentestFindingsFindingIdTicketInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateDastPentestFindingsFindingIdTicket(ctx, in)) - }, - allowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateDastPentestFindingsFindingIdAllowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateDastPentestFindingsFindingIdAllowlist(ctx, in)) - }, - unallowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateDastPentestFindingsFindingIdUnallowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateDastPentestFindingsFindingIdUnallowlist(ctx, in)) - }, - autofixFix: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateDastPentestFindingsFindingIdAutofixFixInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateDastPentestFindingsFindingIdAutofixFix(ctx, in)) - }, - autofixState: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListDastPentestFindingsFindingIdAutofixStatus(ctx, api.ListDastPentestFindingsFindingIdAutofixStatusInput{FindingID: id})) - }, - autofixDiff: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListDastPentestFindingsFindingIdAutofixCacheDiff(ctx, api.ListDastPentestFindingsFindingIdAutofixCacheDiffInput{FindingID: id})) - }, - }, - "bughunt": { - apiTypes: []string{"BugHunt"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetDastBughuntFindingsFindingId(ctx, api.GetDastBughuntFindingsFindingIdInput{FindingID: id})) - }, - triage: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListDastBughuntFindingsFindingIdTriage(ctx, api.ListDastBughuntFindingsFindingIdTriageInput{FindingID: id})) - }, - allowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.PatchDastBughuntFindingsFindingIdAllowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.PatchDastBughuntFindingsFindingIdAllowlist(ctx, in)) - }, - allowlistPatchStyle: true, - // bughunt has no ticket/unallowlist/autofix; its PATCH allowlist takes - // {allow, reason} (see allowlistPatchStyle). - }, - "cspm": { - apiTypes: []string{"Cloud"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetCspmFindingsFindingId(ctx, api.GetCspmFindingsFindingIdInput{FindingID: id})) - }, - ticket: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateCspmFindingsFindingIdTicketInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateCspmFindingsFindingIdTicket(ctx, in)) - }, - autofixFix: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateCspmFindingsFindingIdAutofixFixInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateCspmFindingsFindingIdAutofixFix(ctx, in)) - }, - autofixState: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListCspmFindingsFindingIdAutofixStatus(ctx, api.ListCspmFindingsFindingIdAutofixStatusInput{FindingID: id})) - }, - autofixDiff: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListCspmFindingsFindingIdAutofixCacheDiff(ctx, api.ListCspmFindingsFindingIdAutofixCacheDiffInput{FindingID: id})) - }, - // cspm has no events/allowlist; triage endpoint not exposed - }, - "scpm": { - apiTypes: []string{"Platform"}, - get: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.GetScpmFindingsFindingId(ctx, api.GetScpmFindingsFindingIdInput{FindingID: id})) - }, - triage: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScpmFindingsFindingIdTriage(ctx, api.ListScpmFindingsFindingIdTriageInput{FindingID: id})) - }, - allowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScpmFindingsFindingIdAllowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateScpmFindingsFindingIdAllowlist(ctx, in)) - }, - unallowlist: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScpmFindingsFindingIdUnallowlistInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return rawOut(c.CreateScpmFindingsFindingIdUnallowlist(ctx, in)) - }, - autofixFix: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScpmFindingsFindingIdAutofixFixInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateScpmFindingsFindingIdAutofixFix(ctx, in)) - }, - autofixState: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScpmFindingsFindingIdAutofixStatus(ctx, api.ListScpmFindingsFindingIdAutofixStatusInput{FindingID: id})) - }, - autofixDiff: func(c *api.Client, ctx context.Context, id string) (json.RawMessage, error) { - return marshalOut(c.ListScpmFindingsFindingIdAutofixCacheDiff(ctx, api.ListScpmFindingsFindingIdAutofixCacheDiffInput{FindingID: id})) - }, - autofixCreatePR: func(c *api.Client, ctx context.Context, id string, body []byte) (json.RawMessage, error) { - var in api.CreateScpmFindingsFindingIdAutofixCacheCreatePrInput - if err := decodeBody(body, &in); err != nil { - return nil, err - } - in.FindingID = id - return marshalOut(c.CreateScpmFindingsFindingIdAutofixCacheCreatePr(ctx, in)) - }, - // scpm has no ticket endpoint - }, -} - -func allFindingTypeNames() []string { - names := make([]string, 0, len(findingTypes)) - for name := range findingTypes { - names = append(names, name) - } - sort.Strings(names) - return names -} - -// typesWith returns the sorted type slugs for which pick reports a supported -// capability, used to scope a tool's `type` enum to what actually works. -func typesWith(pick func(findingType) bool) []string { - var names []string - for name, ft := range findingTypes { - if pick(ft) { - names = append(names, name) +func registerUnifiedTools(s *server.MCPServer, c *api.Client) { + registerSearchTool(s, c) + registerFindingEventsTool(s, c) + for _, verb := range findings.Verbs { + if !verb.OptIn { + registerVerbTool(s, c, verb) } } - sort.Strings(names) - return names -} - -func resolveFindingType(name string) (findingType, error) { - ft, ok := findingTypes[name] - if !ok { - return findingType{}, fmt.Errorf("unknown finding type %q. Valid types: %s", name, strings.Join(allFindingTypeNames(), ", ")) - } - return ft, nil -} - -// findingSearchOpts are the filters the unified /admin/findings search accepts. -type findingSearchOpts struct { - apiTypes []string // FindingType values; empty means all types - severity string // lowercase enum value; uppercased for the API - repository string // repository name - status string // open | fixed | false_positive | accepted_risk - limit int // max findings to collect across pages + registerFeedbackTools(s, c) + registerFixTool(s, c) } -// searchFindings queries the unified POST /admin/findings endpoint, paginating -// (with a constant page size) up to opts.limit and returning the collected -// findings plus the server's reported total. This is the single place finding -// filters are mapped to the API query, so every search/composite tool stays -// consistent — in particular, `repository` and `severity` ride in the request -// body here, whereas the per-scanner GET list endpoints silently ignore them. -// -// The endpoint accepts an open-ended Query field; we keep it as a typed -// map[string]any to preserve the existing wire shape while taking advantage of -// the typed Input/Output structs around it. -func searchFindings(ctx context.Context, c *api.Client, opts findingSearchOpts) ([]json.RawMessage, int, error) { - // pageSize is chosen once per call and held constant across pages: - // /admin/findings is page/offset paginated, so shrinking pageSize on the - // final page would corrupt offset (page*pageSize) and skip/duplicate - // rows. Composite tools call with limits as low as 10, so we clamp - // instead of hard-pinning at 100 to avoid fetching 100× the rows we keep. - pageSize := opts.limit - if pageSize > 100 { - pageSize = 100 - } - if pageSize < 20 { - pageSize = 20 - } - all := make([]json.RawMessage, 0) - var lastTotal int - for page := 1; len(all) < opts.limit; page++ { - p, ps := page, pageSize - query := models.ModelsUnifiedFindingsQuery{ - Page: &p, - PageSize: &ps, - } - if opts.repository != "" { - query.Repository = []string{opts.repository} - } - if opts.severity != "" { - query.Severity = []string{strings.ToUpper(opts.severity)} - } - if len(opts.apiTypes) > 0 { - query.Type = opts.apiTypes - } - boolPtr := func(b bool) *bool { return &b } - switch opts.status { - case "open": - query.IsResolved = boolPtr(false) - case "fixed": - query.IsFixed = boolPtr(true) - case "false_positive": - query.IsFalsePositive = boolPtr(true) - case "accepted_risk": - query.IsAllowlisted = boolPtr(true) - } - - out, err := c.CreateAdminFindings(ctx, api.CreateAdminFindingsInput{Query: query}) - if err != nil { - return nil, 0, err - } - lastTotal = out.Total - // The Findings field is a typed slice of finding models; re-marshal each - // element so callers can keep treating them as opaque JSON. (We don't - // destructure individual finding fields here.) - for _, f := range out.Findings { - b, err := json.Marshal(f) - if err != nil { - return nil, 0, err - } - all = append(all, b) - } - if !out.HasMoreData || len(out.Findings) == 0 { - break +func registerOptInFindingTools(s *server.MCPServer, c *api.Client) { + for _, verb := range findings.Verbs { + if verb.OptIn { + registerVerbTool(s, c, verb) } } - if len(all) > opts.limit { - all = all[:opts.limit] - } - return all, lastTotal, nil } -func registerUnifiedTools(s *server.MCPServer, c *api.Client) { - allTypes := allFindingTypeNames() +// findingsSearchScope tells a caller what the unified search leaves out. +const findingsSearchScope = "The search returns triaged findings only: a finding whose triage has not finished or has failed is not listed." - // 1. search across all/one type via the unified /admin/findings endpoint. +// repositoryFilterHelp describes how the unified search matches a repository. +const repositoryFilterHelp = "Repository, owner/name preferred. It must match the stored name exactly, so a wrong name returns nothing. A bare name misses pentest findings that hold the full name. Cloud and bug hunt findings have no repository, so this filter excludes them." + +func registerSearchTool(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool( + readOnlyTool( "nullify_search_findings", - mcp.WithDescription("Search security findings across all or a specific scanner type. Paginates automatically up to limit."), - mcp.WithString("type", mcp.Description("Finding type to search"), mcp.Enum(allTypes...)), + mcp.WithDescription("Search security findings across all or a specific scanner type. Paginates automatically up to limit. The result reports total, returned and truncated, so that an empty result can be told apart from a cut-off one. An access failure is an error, never an empty result. "+findingsSearchScope), + mcp.WithString("type", mcp.Description("Finding type to search"), mcp.Enum(findings.AcceptedNames(func(findings.Type) bool { return true })...)), mcp.WithString("severity", mcp.Description("Filter by severity"), mcp.Enum("critical", "high", "medium", "low")), - mcp.WithString("status", mcp.Description("Filter by status"), mcp.Enum("open", "fixed", "false_positive", "accepted_risk")), - mcp.WithString("repository", mcp.Description("Filter by repository name")), + mcp.WithString("status", mcp.Description("Filter by status"), mcp.Enum(findings.Statuses...)), + mcp.WithString("repository", mcp.Description(repositoryFilterHelp)), + mcp.WithString("from", mcp.Description("Only findings at or after this RFC 3339 time, such as 2026-11-01T00:00:00Z. Any other format is an error.")), + mcp.WithString("to", mcp.Description("Only findings at or before this RFC 3339 time, such as 2026-11-01T00:00:00Z. Any other format is an error.")), mcp.WithNumber("limit", mcp.Description("Max total findings across pages (default 100)")), ), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { args := request.GetArguments() - opts := findingSearchOpts{ - severity: getStringArg(args, "severity"), - repository: getStringArg(args, "repository"), - status: getStringArg(args, "status"), - limit: getIntArg(args, "limit", 100), + opts := findings.SearchOptions{ + Severity: getStringArg(args, "severity"), + Repository: getStringArg(args, "repository"), + Status: getStringArg(args, "status"), + From: getStringArg(args, "from"), + To: getStringArg(args, "to"), + Limit: getIntArg(args, "limit", 100), } if name := getStringArg(args, "type"); name != "" { - ft, err := resolveFindingType(name) + apiTypes, err := findings.APITypesFor(name) if err != nil { return toolError(err), nil } - opts.apiTypes = ft.apiTypes + opts.APITypes = apiTypes } - findings, total, err := searchFindings(ctx, c, opts) + + result, err := findings.Search(ctx, c, opts) + if err != nil { + return toolError(err), nil + } + out, err := json.MarshalIndent(result, "", " ") if err != nil { return toolError(err), nil } - out, _ := json.MarshalIndent(map[string]any{"findings": findings, "total": total}, "", " ") return toolResult(string(out)), nil }, ) +} - // 2. get one finding. - s.AddTool( - mcp.NewTool( - "nullify_get_finding", - mcp.WithDescription("Get details of a specific finding by type and ID."), - mcp.WithString("type", mcp.Required(), mcp.Description("Finding type"), mcp.Enum(allTypes...)), - mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), - ), - findingByIDHandler(c, func(ft findingType) findingMethodGet { return ft.get }, "get"), - ) - - // 3. event history via the unified /admin/events feed (filtered by finding). +func registerFindingEventsTool(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool( + readOnlyTool( "nullify_get_finding_events", mcp.WithDescription("Get the event history for a finding (status changes, triage, autofix activity)."), mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), @@ -589,197 +106,90 @@ func registerUnifiedTools(s *server.MCPServer, c *api.Client) { return toolResult(string(b)), nil }, ) +} - // 3b. AI-triage detail (read-only) per finding type. - s.AddTool( - mcp.NewTool( - "nullify_get_finding_triage", - mcp.WithDescription("Get the AI-triage analysis for a finding: the model's assessment of exploitability, severity, and recommended disposition."), - mcp.WithString("type", mcp.Required(), mcp.Description("Finding type"), mcp.Enum(typesWith(func(ft findingType) bool { return ft.triage != nil })...)), - mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), - ), - findingByIDHandler(c, func(ft findingType) findingMethodGet { return ft.triage }, "triage"), - ) +func registerVerbTool(s *server.MCPServer, c *api.Client, verb findings.Verb) { + options := []mcp.ToolOption{ + mcp.WithDescription(verb.Description), + mcp.WithString("type", mcp.Required(), mcp.Description("Finding type. The type value of a search result is accepted as it is."), mcp.Enum(verb.TypeValues()...)), + mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), + } + if verb.NeedsAllowlistType { + options = append(options, mcp.WithString("allowlist_type", mcp.Required(), mcp.Description("Why the finding is being allowlisted. Use UserFalsePositive when triage was wrong and UserAssumeRisk only when the risk is real and accepted. For a CSPM false positive use nullify_mark_false_positive, because this tool does not set is_false_positive on a CSPM finding."), mcp.Enum(findings.AllowlistTypes...))) + } + if verb.NeedsReason { + options = append(options, mcp.WithString("reason", mcp.Required(), mcp.Description("Human-readable reason"))) + } + + newTool := readOnlyTool + if verb.Write { + newTool = writeTool + } - // 4. create a ticket. s.AddTool( - mcp.NewTool( - "nullify_create_ticket", - mcp.WithDescription("Create a ticket (e.g. Jira, GitHub issue) for a finding."), - mcp.WithString("type", mcp.Required(), mcp.Description("Finding type"), mcp.Enum(typesWith(func(ft findingType) bool { return ft.ticket != nil })...)), - mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), - ), + newTool(verb.Tool, options...), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { args := request.GetArguments() - ft, err := resolveFindingType(getStringArg(args, "type")) - if err != nil { - return toolError(err), nil - } - if ft.ticket == nil { - return toolError(fmt.Errorf("ticketing is not supported for type %q", getStringArg(args, "type"))), nil - } - return wrapRaw(ft.ticket(c, ctx, getStringArg(args, "id"), nil)) + return wrapRaw(verb.Run(ctx, c, getStringArg(args, "type"), getStringArg(args, "id"), findings.Params{ + Reason: getStringArg(args, "reason"), + AllowlistType: getStringArg(args, "allowlist_type"), + })) }, ) +} - // 5. allowlist (suppress: fixed / accepted-risk / false-positive / other). +func registerFeedbackTools(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool( - "nullify_allowlist_finding", - mcp.WithDescription("Allowlist a finding: suppress it as fixed, accepted risk, false positive, or other. This is how a finding is triaged out of the open queue."), - mcp.WithString("type", mcp.Required(), mcp.Description("Finding type"), mcp.Enum(typesWith(func(ft findingType) bool { return ft.allowlist != nil })...)), + writeTool( + "nullify_submit_finding_feedback", + mcp.WithDescription("Record feedback on a finding of any type. This never changes the finding."), mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), - mcp.WithString("allowlist_type", mcp.Required(), mcp.Description("Why the finding is being allowlisted"), mcp.Enum("UserFixed", "UserAssumeRisk", "UserFalsePositive", "UserOther")), - mcp.WithString("reason", mcp.Required(), mcp.Description("Human-readable reason")), + mcp.WithString("verdict", mcp.Required(), mcp.Description("Feedback verdict"), mcp.Enum(findings.FeedbackVerdicts...)), + mcp.WithString("comment", mcp.Description("Optional comment")), ), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { args := request.GetArguments() - ft, err := resolveFindingType(getStringArg(args, "type")) - if err != nil { - return toolError(err), nil - } - if ft.allowlist == nil { - return toolError(fmt.Errorf("allowlisting is not supported for type %q", getStringArg(args, "type"))), nil - } - body := allowlistBody(ft, getStringArg(args, "reason"), getStringArg(args, "allowlist_type")) - return wrapRaw(ft.allowlist(c, ctx, getStringArg(args, "id"), body)) + return wrapRaw(findings.SubmitFeedback(ctx, c, getStringArg(args, "id"), getStringArg(args, "verdict"), getStringArg(args, "comment"))) }, ) - // 6. unallowlist (re-open a suppressed finding). s.AddTool( - mcp.NewTool( - "nullify_unallowlist_finding", - mcp.WithDescription("Remove a finding from the allowlist, re-opening it."), - mcp.WithString("type", mcp.Required(), mcp.Description("Finding type"), mcp.Enum(typesWith(func(ft findingType) bool { return ft.unallowlist != nil })...)), + readOnlyTool( + "nullify_get_finding_feedback", + mcp.WithDescription("List the feedback recorded on a finding of any type."), mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), - mcp.WithString("reason", mcp.Required(), mcp.Description("Human-readable reason for re-opening")), ), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - args := request.GetArguments() - ft, err := resolveFindingType(getStringArg(args, "type")) - if err != nil { - return toolError(err), nil - } - if ft.unallowlist == nil { - return toolError(fmt.Errorf("unallowlisting is not supported for type %q", getStringArg(args, "type"))), nil - } - body, _ := json.Marshal(map[string]string{"unallowlistReason": getStringArg(args, "reason")}) - return wrapRaw(ft.unallowlist(c, ctx, getStringArg(args, "id"), body)) + return wrapRaw(findings.ListFeedback(ctx, c, getStringArg(request.GetArguments(), "id"))) }, ) +} - // 7. autofix: trigger, poll to completion, return the diff, and (where a - // create-PR endpoint exists) optionally open the pull request. +func registerFixTool(s *server.MCPServer, c *api.Client) { s.AddTool( - mcp.NewTool( + writeTool( "nullify_fix_finding", - mcp.WithDescription("Generate an autofix for a finding: triggers the fix agent, waits for it to finish, and returns the resulting diff. Autofix runs asynchronously server-side. For finding types whose fix flow opens a pull request (e.g. sast, sca) the PR is created as part of the run; set create_pr=true to also wait for and report the resulting PR."), - mcp.WithString("type", mcp.Required(), mcp.Description("Finding type"), mcp.Enum(typesWith(func(ft findingType) bool { return ft.autofixFix != nil })...)), + mcp.WithDescription("Start an autofix run for a finding and return at once. A run can take up to 45 minutes and opens any pull request itself. Call nullify_get_fix_status to follow the run and nullify_get_fix_diff to read its change."), + mcp.WithString("type", mcp.Required(), mcp.Description("Finding type"), mcp.Enum(findings.AcceptedNames(func(t findings.Type) bool { return t.AutofixFix != nil })...)), mcp.WithString("id", mcp.Required(), mcp.Description("Finding ID")), - mcp.WithBoolean("create_pr", mcp.Description("Wait for and report pull-request creation. The fix flow opens the PR for supported types; scpm uses a dedicated create-PR endpoint.")), ), func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { args := request.GetArguments() - ft, err := resolveFindingType(getStringArg(args, "type")) + start, err := findings.StartFix(ctx, c, getStringArg(args, "type"), getStringArg(args, "id")) if err != nil { return toolError(err), nil } - if ft.autofixFix == nil { - return toolError(fmt.Errorf("autofix is not supported for type %q", getStringArg(args, "type"))), nil - } - findingID := getStringArg(args, "id") - - if _, err := ft.autofixFix(c, ctx, findingID, nil); err != nil { - return toolError(fmt.Errorf("trigger autofix: %w", err)), nil - } - - // Phase 1: wait for the fix to generate. Autofix is an async - // Step-Function/Fargate job, so we poll rather than read a possibly- - // empty cache immediately. On timeout the fix may still be running - // — return now with what we have rather than hiding the in-progress - // state behind a "diff failed" error from the unfetched cache. - var parts []string - if ft.autofixState != nil { - if _, err := pollAutofix(ctx, c, ft, findingID, false); err != nil { - if errors.Is(err, context.DeadlineExceeded) { - return toolResult("Autofix triggered but did not finish within the poll deadline; check the finding in the dashboard."), nil - } - return toolError(err), nil - } - } - - if ft.autofixDiff != nil { - diff, err := ft.autofixDiff(c, ctx, findingID) - if err != nil { - return toolError(fmt.Errorf("get autofix diff: %w", err)), nil - } - parts = append(parts, "--- diff ---\n"+string(diff)) - } - if createPR, _ := args["create_pr"].(bool); createPR { - // Some types have an explicit create-PR endpoint; for the rest the - // fix run opens the PR itself. Either way, poll PR-creation status - // and surface the resulting URL for a complete experience. - if ft.autofixCreatePR != nil { - if _, err := ft.autofixCreatePR(c, ctx, findingID, nil); err != nil { - return toolError(fmt.Errorf("create PR: %w", err)), nil - } - } - if ft.autofixState != nil { - st, err := pollAutofix(ctx, c, ft, findingID, true) - switch { - case errors.Is(err, context.DeadlineExceeded): - parts = append(parts, "--- pull request ---\nStill running after the poll deadline; check the finding in the dashboard.") - case err != nil: - return toolError(err), nil - default: - parts = append(parts, formatPRResult(st)) - } - } else { - parts = append(parts, "--- pull request ---\nPR requested; check the finding in the dashboard for status.") - } - } - - if len(parts) == 0 { - return toolResult("Autofix triggered; no diff endpoint is available for this finding type. Check the finding in the dashboard."), nil + out, err := json.Marshal(map[string]string{"state": start.State, "run_id": start.RunID, "check_with": "nullify_get_fix_status"}) + if err != nil { + return toolError(err), nil } - return toolResult(strings.Join(parts, "\n\n")), nil + return toolResult(string(out)), nil }, ) } -// formatPRResult renders the PR phase of an autofix status for the tool output. -func formatPRResult(st autofixStatus) string { - switch { - case st.PullRequestURL != "": - return "--- pull request ---\nOpened: " + st.PullRequestURL - case st.PullRequestState != "": - return "--- pull request ---\nState: " + st.PullRequestState + " (no URL yet; check the dashboard)" - default: - return "--- pull request ---\nPR creation in progress; no URL reported yet." - } -} - -// findingByIDHandler builds a handler for a no-body, by-ID finding method. -func findingByIDHandler(c *api.Client, pick func(findingType) findingMethodGet, capability string) server.ToolHandlerFunc { - return func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - args := request.GetArguments() - ft, err := resolveFindingType(getStringArg(args, "type")) - if err != nil { - return toolError(err), nil - } - method := pick(ft) - if method == nil { - return toolError(fmt.Errorf("%s is not supported for type %q", capability, getStringArg(args, "type"))), nil - } - return wrapRaw(method(c, ctx, getStringArg(args, "id"))) - } -} - -// wrapRaw converts a (json.RawMessage, error) from a typed-method closure into -// an MCP tool result. The bytes are passed through verbatim as the tool's -// textual output. +// wrapRaw converts an API response into an MCP tool result. func wrapRaw(data json.RawMessage, err error) (*mcp.CallToolResult, error) { if err != nil { return toolError(err), nil @@ -787,99 +197,10 @@ func wrapRaw(data json.RawMessage, err error) (*mcp.CallToolResult, error) { return toolResult(string(data)), nil } -// autofixStatus is the subset of the autofix/status payload we poll on. The -// endpoint reports the fix-generation state, a server-computed `terminal` flag -// (the authoritative "stop polling" signal), and, once a PR is requested, the -// pull-request state and URL. -type autofixStatus struct { - State string `json:"state"` - Terminal bool `json:"terminal"` - PullRequestState string `json:"pullRequestState"` - PullRequestURL string `json:"pullRequestUrl"` -} - -// autofixStatusResp mirrors the wire shape of every per-service autofix-status -// endpoint: the payload is wrapped under "status". See -// hyperdrive/pkg/endpoints/autofix_status_output.go — the generator preserves -// the named field rather than embedding so typed-string enums survive in the -// OpenAPI schema, which means clients must unwrap. -type autofixStatusResp struct { - Status autofixStatus `json:"status"` -} - -// autoFixStateCached is the one terminal fix-generation state that carries no -// PR ("proposed changes are available in S3 but no PR has been created"). -// Mirrors models.AutoFixStateCached in hyperdrive; the generated client returns -// the raw status JSON, so we match the literal. When waiting on PR creation we -// must not stop here even though the server reports terminal=true. -const autoFixStateCached = "cached" - -// allowlistBody builds the allowlist request body for a finding type. bughunt's -// PATCH endpoint takes {allow, reason}; every other type's POST endpoint takes -// {allowlistReason, allowlistType}. allowlistType has no bughunt equivalent. -func allowlistBody(ft findingType, reason, allowlistType string) []byte { - if ft.allowlistPatchStyle { - body, _ := json.Marshal(map[string]any{"allow": true, "reason": reason}) - return body - } - body, _ := json.Marshal(map[string]string{ - "allowlistReason": reason, - "allowlistType": allowlistType, - }) - return body -} - -// autofixPhaseDone reports whether the watched autofix phase has finished, using -// the server-computed `terminal` flag as the authority. The fix-generation phase -// is done once terminal. The PR phase is done once a PR URL exists, or the run -// reaches a terminal state other than "cached" — "cached" is terminal but means -// the fix was generated without a PR, so we keep waiting for PR creation. -func autofixPhaseDone(st autofixStatus, watchPR bool) bool { - if watchPR { - return st.PullRequestURL != "" || (st.Terminal && st.State != autoFixStateCached) - } - return st.Terminal -} - -// autofixPollDeadline is the default per-call timeout for pollAutofix. Tests -// shorten it via the override hook below. -var autofixPollDeadline = 5 * time.Minute - -// autofixPollInterval is the gap between polls. Tests shorten it to keep the -// timeout-path test fast. -var autofixPollInterval = 3 * time.Second - -// pollAutofix polls the autofix status endpoint until the watched phase is done -// or the deadline passes. It trusts the server-computed `terminal` flag rather -// than inferring terminality from the state string. When watchPR is false it -// waits for fix generation to finish; when true it waits for PR creation (a -// non-empty pullRequestUrl, or a terminal state other than "cached", which is -// terminal but has no PR). On deadline it returns context.DeadlineExceeded so -// callers can render "still running, check the dashboard" instead of fake -// empty-PR output. -func pollAutofix(ctx context.Context, c *api.Client, ft findingType, findingID string, watchPR bool) (autofixStatus, error) { - deadline := time.Now().Add(autofixPollDeadline) - var last autofixStatus - for { - data, err := ft.autofixState(c, ctx, findingID) - if err != nil { - return last, fmt.Errorf("poll autofix status: %w", err) - } - var wrapper autofixStatusResp - if err := json.Unmarshal(data, &wrapper); err == nil { - last = wrapper.Status - } - - if autofixPhaseDone(last, watchPR) { - return last, nil - } - if time.Now().After(deadline) { - return last, context.DeadlineExceeded - } - select { - case <-ctx.Done(): - return last, ctx.Err() - case <-time.After(autofixPollInterval): - } +// marshalOut turns a typed generated-client result into JSON. +func marshalOut[T any](out *T, err error) (json.RawMessage, error) { + if err != nil { + return nil, err } + return json.Marshal(out) } diff --git a/internal/mcp/tools_unified_extra_test.go b/internal/mcp/tools_unified_extra_test.go index 5583add..ac88c6c 100644 --- a/internal/mcp/tools_unified_extra_test.go +++ b/internal/mcp/tools_unified_extra_test.go @@ -2,15 +2,12 @@ package mcp import ( "context" - "encoding/json" - "errors" "fmt" "io" "net/http" "strings" "sync" "testing" - "time" "github.com/nullify-platform/cli/internal/api" ) @@ -56,166 +53,6 @@ func testClient(ft *fakeTransport) *api.Client { return api.NewClient("acme.nullify.ai", "tok", map[string]string{}, api.WithHTTPClient(&http.Client{Transport: ft})) } -// findingsPage renders an /admin/findings page response with n findings. -func findingsPage(n, total int, hasMore bool) string { - items := make([]string, n) - for i := range items { - items[i] = "{}" - } - return fmt.Sprintf(`{"findings":[%s],"total":%d,"hasMoreData":%t}`, strings.Join(items, ","), total, hasMore) -} - -// reqQuery decodes the {"query": {...}} body the search sends. -func reqQuery(t *testing.T, body []byte) map[string]any { - t.Helper() - var wrapper struct { - Query map[string]any `json:"query"` - } - if err := json.Unmarshal(body, &wrapper); err != nil { - t.Fatalf("unmarshal body %q: %v", body, err) - } - return wrapper.Query -} - -// Fix 3: pageSize must stay constant across pages — shrinking it would corrupt -// the page/offset math and skip or duplicate rows. -func TestSearchFindingsConstantPageSize(t *testing.T) { - ft := &fakeTransport{respond: func(capturedReq) (int, string) { - return 200, findingsPage(100, 1000, true) - }} - findings, total, err := searchFindings(context.Background(), testClient(ft), findingSearchOpts{limit: 250}) - if err != nil { - t.Fatalf("searchFindings: %v", err) - } - if len(findings) != 250 { - t.Errorf("got %d findings, want 250 (trimmed to limit)", len(findings)) - } - if total != 1000 { - t.Errorf("got total %d, want 1000", total) - } - if len(ft.requests) != 3 { - t.Fatalf("got %d page requests, want 3", len(ft.requests)) - } - for i, r := range ft.requests { - q := reqQuery(t, r.body) - if q["pageSize"] != float64(100) { - t.Errorf("request %d pageSize = %v, want 100", i, q["pageSize"]) - } - if q["page"] != float64(i+1) { - t.Errorf("request %d page = %v, want %d", i, q["page"], i+1) - } - } -} - -// Fix 2: repository and severity must reach the unified endpoint (the per-scanner -// GET listers silently drop both). Severity is uppercased for the API. -func TestSearchFindingsForwardsFilters(t *testing.T) { - ft := &fakeTransport{respond: func(capturedReq) (int, string) { - return 200, findingsPage(3, 3, false) - }} - _, _, err := searchFindings(context.Background(), testClient(ft), findingSearchOpts{ - apiTypes: []string{"Code"}, - severity: "critical", - repository: "my-repo", - status: "open", - limit: 20, - }) - if err != nil { - t.Fatalf("searchFindings: %v", err) - } - if len(ft.requests) != 1 { - t.Fatalf("got %d requests, want 1", len(ft.requests)) - } - r := ft.requests[0] - if r.path != "/admin/findings" { - t.Errorf("path = %q, want /admin/findings", r.path) - } - q := reqQuery(t, r.body) - assertStringSlice(t, "repository", q["repository"], []string{"my-repo"}) - assertStringSlice(t, "severity", q["severity"], []string{"CRITICAL"}) - assertStringSlice(t, "type", q["type"], []string{"Code"}) - if q["isResolved"] != false { - t.Errorf("status=open should set isResolved=false, got %v", q["isResolved"]) - } -} - -func assertStringSlice(t *testing.T, name string, got any, want []string) { - t.Helper() - raw, ok := got.([]any) - if !ok { - t.Errorf("%s: not a slice: %v", name, got) - return - } - if len(raw) != len(want) { - t.Errorf("%s = %v, want %v", name, got, want) - return - } - for i := range want { - if raw[i] != want[i] { - t.Errorf("%s[%d] = %v, want %q", name, i, raw[i], want[i]) - } - } -} - -// Fix 1: terminal detection must use the server's `terminal` flag, not substring -// matching. In particular "cached" (the normal SAST/SCA success state) is -// terminal for fix generation but must NOT end the PR-wait phase (no PR yet). -func TestAutofixPhaseDone(t *testing.T) { - cases := []struct { - name string - st autofixStatus - watchPR bool - want bool - }{ - {"agent in progress", autofixStatus{State: "in_progress_agent", Terminal: false}, false, false}, - {"cached is terminal for fix", autofixStatus{State: "cached", Terminal: true}, false, true}, - {"pending_review terminal for fix", autofixStatus{State: "pending_review", Terminal: true}, false, true}, - {"failed_retry not terminal", autofixStatus{State: "failed_retry", Terminal: false}, false, false}, - - {"cached without PR keeps waiting", autofixStatus{State: "cached", Terminal: true}, true, false}, - {"cached with PR url done", autofixStatus{State: "cached", Terminal: true, PullRequestURL: "http://pr"}, true, true}, - {"pending_review with url done", autofixStatus{State: "pending_review", Terminal: true, PullRequestURL: "http://pr"}, true, true}, - {"pr_merged terminal done", autofixStatus{State: "pr_merged", Terminal: true}, true, true}, - {"failed_pr_creation done", autofixStatus{State: "failed_pr_creation", Terminal: true}, true, true}, - {"creating_pr still waiting", autofixStatus{State: "in_progress_creating_pr", Terminal: false}, true, false}, - } - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - if got := autofixPhaseDone(tc.st, tc.watchPR); got != tc.want { - t.Errorf("autofixPhaseDone(%+v, watchPR=%t) = %t, want %t", tc.st, tc.watchPR, got, tc.want) - } - }) - } -} - -// Fix 6: bughunt's PATCH allowlist takes {allow, reason}; every other type's POST -// takes {allowlistReason, allowlistType}. -func TestAllowlistBody(t *testing.T) { - std := allowlistBody(findingTypes["sast"], "looks fine", "UserFalsePositive") - var stdBody map[string]any - if err := json.Unmarshal(std, &stdBody); err != nil { - t.Fatalf("unmarshal std body: %v", err) - } - if stdBody["allowlistReason"] != "looks fine" || stdBody["allowlistType"] != "UserFalsePositive" { - t.Errorf("std allowlist body = %v, want {allowlistReason, allowlistType}", stdBody) - } - if _, ok := stdBody["allow"]; ok { - t.Errorf("std allowlist body must not contain 'allow': %v", stdBody) - } - - bug := allowlistBody(findingTypes["bughunt"], "looks fine", "UserFalsePositive") - var bugBody map[string]any - if err := json.Unmarshal(bug, &bugBody); err != nil { - t.Fatalf("unmarshal bughunt body: %v", err) - } - if bugBody["allow"] != true || bugBody["reason"] != "looks fine" { - t.Errorf("bughunt allowlist body = %v, want {allow:true, reason}", bugBody) - } - if _, ok := bugBody["allowlistType"]; ok { - t.Errorf("bughunt allowlist body must not contain 'allowlistType': %v", bugBody) - } -} - // listThreatInvestigations must paginate past the first page even though the // server returns `numItems = len(page)` — the per-page count, not the total // (manager/internal/endpoints/threatinvestigations_get.go). The previous break @@ -253,85 +90,3 @@ func TestListThreatInvestigationsPaginatesPastPageOne(t *testing.T) { t.Errorf("got %d page requests, want 2 (limit hit after page 2)", len(ft.requests)) } } - -// pollAutofix must unwrap the server's `{status: {...}}` envelope. The -// per-service endpoints (see hyperdrive's AutofixStatusOutput) wrap the -// state/terminal/pullRequestUrl fields under a named "status" key so the -// generator preserves typed-string enums. A flat unmarshal yields zero values, -// Terminal stays false, and the poll loop runs to the 5-minute deadline on -// every fix call. -func TestPollAutofixUnwrapsStatusEnvelope(t *testing.T) { - ft := &fakeTransport{respond: func(capturedReq) (int, string) { - return 200, `{"status":{"state":"cached","terminal":true},"version":"1"}` - }} - st, err := pollAutofix(context.Background(), testClient(ft), findingTypes["sast"], "f1", false) - if err != nil { - t.Fatalf("pollAutofix: %v", err) - } - if !st.Terminal { - t.Errorf("Terminal = false, want true (envelope not unwrapped)") - } - if st.State != "cached" { - t.Errorf("State = %q, want %q", st.State, "cached") - } - if len(ft.requests) != 1 { - t.Errorf("got %d polls, want 1 (terminal on first poll)", len(ft.requests)) - } -} - -// On deadline, pollAutofix must return context.DeadlineExceeded so the tool -// can render a "still running" message instead of silently falling through to -// empty PR-URL output. -func TestPollAutofixSignalsDeadlineExceeded(t *testing.T) { - t.Cleanup(func() { - autofixPollDeadline = 5 * time.Minute - autofixPollInterval = 3 * time.Second - }) - autofixPollDeadline = 50 * time.Millisecond - autofixPollInterval = 5 * time.Millisecond - - ft := &fakeTransport{respond: func(capturedReq) (int, string) { - // Server never reports terminal — the polling loop runs to the deadline. - return 200, `{"status":{"state":"in_progress_agent","terminal":false},"version":"1"}` - }} - _, err := pollAutofix(context.Background(), testClient(ft), findingTypes["sast"], "f1", false) - if !errors.Is(err, context.DeadlineExceeded) { - t.Fatalf("err = %v, want context.DeadlineExceeded", err) - } - if len(ft.requests) < 2 { - t.Errorf("got %d polls, want >= 2 (loop ran at least one interval)", len(ft.requests)) - } -} - -// searchFindings used to hard-pin pageSize=100, fetching ~100× the rows when -// composite tools requested a small limit. The clamp keeps pageSize within -// [20, 100] and constant across pages so the offset math stays valid. -func TestSearchFindingsClampsPageSize(t *testing.T) { - cases := []struct { - name string - limit int - wantPage int - }{ - {"small limit clamps up to 20", 10, 20}, - {"medium limit uses limit", 40, 40}, - {"large limit clamps to 100", 250, 100}, - } - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - ft := &fakeTransport{respond: func(capturedReq) (int, string) { - return 200, findingsPage(0, 0, false) - }} - _, _, err := searchFindings(context.Background(), testClient(ft), findingSearchOpts{limit: tc.limit}) - if err != nil { - t.Fatalf("searchFindings: %v", err) - } - if len(ft.requests) == 0 { - t.Fatalf("no requests") - } - q := reqQuery(t, ft.requests[0].body) - if q["pageSize"] != float64(tc.wantPage) { - t.Errorf("pageSize = %v, want %d", q["pageSize"], tc.wantPage) - } - }) - } -} diff --git a/internal/mcp/tools_unified_test.go b/internal/mcp/tools_unified_test.go index b8e0ca7..93a3362 100644 --- a/internal/mcp/tools_unified_test.go +++ b/internal/mcp/tools_unified_test.go @@ -1,87 +1,201 @@ package mcp import ( - "reflect" + "context" + "encoding/json" "testing" + + "github.com/mark3labs/mcp-go/mcp" + "github.com/mark3labs/mcp-go/server" + "github.com/stretchr/testify/require" ) -func TestResolveFindingType(t *testing.T) { - for _, name := range []string{"sast", "sca_dependencies", "sca_containers", "secrets", "pentest", "bughunt", "cspm", "scpm"} { - ft, err := resolveFindingType(name) - if err != nil { - t.Errorf("unexpected error for type %q: %v", name, err) - continue - } - if len(ft.apiTypes) == 0 { - t.Errorf("expected non-empty apiTypes for %q", name) - } - if ft.get == nil { - t.Errorf("expected a get method for %q", name) - } - } - for _, bad := range []string{"invalid", ""} { - if _, err := resolveFindingType(bad); err == nil { - t.Errorf("expected error for type %q, got nil", bad) - } +func callTool(t *testing.T, s *server.MCPServer, name string, args map[string]any) mcp.CallToolResult { + t.Helper() + message, err := json.Marshal(map[string]any{ + "jsonrpc": "2.0", + "id": 1, + "method": "tools/call", + "params": map[string]any{"name": name, "arguments": args}, + }) + require.NoError(t, err) + + raw, err := json.Marshal(s.HandleMessage(context.Background(), message)) + require.NoError(t, err) + + var response struct { + Result json.RawMessage `json:"result"` } + require.NoError(t, json.Unmarshal(raw, &response)) + result, err := mcp.ParseCallToolResult(&response.Result) + require.NoError(t, err) + return *result } -func TestTypesWithCapability(t *testing.T) { - cases := []struct { - name string - pick func(findingType) bool - want []string +func TestFindingTools(t *testing.T) { + falsePositive := map[string]any{"type": "cspm", "id": "f1", "allowlist_type": "UserFalsePositive", "reason": "public by design"} + + tests := []struct { + name string + tool string + args map[string]any + isError bool + requests []capturedReq }{ { - name: "allowlist", - pick: func(ft findingType) bool { return ft.allowlist != nil }, - want: []string{"bughunt", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm", "secrets"}, + name: "allowlist cspm", tool: "nullify_allowlist_finding", args: falsePositive, + requests: []capturedReq{{"POST", "/cspm/findings/f1/allowlist", []byte(`{"allowlistReason":"public by design","allowlistType":"UserFalsePositive"}`)}}, + }, + { + name: "unallowlist cspm", tool: "nullify_unallowlist_finding", args: map[string]any{"type": "cspm", "id": "f1", "reason": "reopen"}, + requests: []capturedReq{{"POST", "/cspm/findings/f1/unallowlist", []byte(`{"unallowlistReason":"reopen"}`)}}, + }, + { + name: "allowlist bughunt keeps the PATCH body", tool: "nullify_allowlist_finding", args: map[string]any{"type": "bughunt", "id": "f1", "allowlist_type": "UserOther", "reason": "r"}, + requests: []capturedReq{{"PATCH", "/dast/bughunt/findings/f1/allowlist", []byte(`{"allow":true,"reason":"r"}`)}}, + }, + { + name: "unallowlist bughunt", tool: "nullify_unallowlist_finding", args: map[string]any{"type": "bughunt", "id": "f1", "reason": "r"}, + requests: []capturedReq{{"PATCH", "/dast/bughunt/findings/f1/allowlist", []byte(`{"allow":false,"reason":"r"}`)}}, }, { - name: "autofix", - pick: func(ft findingType) bool { return ft.autofixFix != nil }, - want: []string{"cspm", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm"}, + name: "archive cspm", tool: "nullify_archive_finding", args: map[string]any{"type": "cspm", "id": "f1"}, + requests: []capturedReq{{"POST", "/cspm/findings/f1/archive", []byte(`{}`)}}, }, { - name: "ticket", - pick: func(ft findingType) bool { return ft.ticket != nil }, - want: []string{"cspm", "pentest", "sast", "sca_containers", "sca_dependencies", "secrets"}, + name: "mark false positive", tool: "nullify_mark_false_positive", args: map[string]any{"type": "cspm", "id": "f1", "reason": "r"}, + requests: []capturedReq{{"POST", "/cspm/findings/f1/mark-false-positive", []byte(`{"falsePositiveReason":"r"}`)}}, }, { - name: "triage", - pick: func(ft findingType) bool { return ft.triage != nil }, - want: []string{"bughunt", "pentest", "sast", "sca_containers", "sca_dependencies", "scpm", "secrets"}, + name: "triage cspm", tool: "nullify_get_finding_triage", args: map[string]any{"type": "cspm", "id": "f1"}, + requests: []capturedReq{{"GET", "/cspm/findings/f1/triage", nil}}, }, { - name: "autofix create-PR", - pick: func(ft findingType) bool { return ft.autofixCreatePR != nil }, - want: []string{"scpm"}, + name: "delete ticket", tool: "nullify_delete_ticket", args: map[string]any{"type": "scpm", "id": "f1"}, + requests: []capturedReq{{"DELETE", "/scpm/findings/f1/ticket", nil}}, }, + { + name: "submit feedback", tool: "nullify_submit_finding_feedback", args: map[string]any{"id": "f1", "verdict": "wrong", "comment": "not reachable"}, + requests: []capturedReq{{"POST", "/findings/f1/feedback", []byte(`{"commentText":"not reachable","verdict":"wrong"}`)}}, + }, + { + name: "get feedback", tool: "nullify_get_finding_feedback", args: map[string]any{"id": "f1"}, + requests: []capturedReq{{"GET", "/findings/f1/feedback", nil}}, + }, + {name: "allowlist without a type sends nothing", tool: "nullify_allowlist_finding", args: map[string]any{"type": "cspm", "id": "f1", "reason": "r"}, isError: true}, + {name: "allowlist without a reason sends nothing", tool: "nullify_allowlist_finding", args: map[string]any{"type": "cspm", "id": "f1", "allowlist_type": "UserFixed"}, isError: true}, + {name: "archive on sast sends nothing", tool: "nullify_archive_finding", args: map[string]any{"type": "sast", "id": "f1"}, isError: true}, } - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - if got := typesWith(tc.pick); !reflect.DeepEqual(got, tc.want) { - t.Errorf("typesWith(%s) = %v, want %v", tc.name, got, tc.want) - } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{} + s := server.NewMCPServer("test", "1", server.WithToolCapabilities(true)) + registerUnifiedTools(s, testClient(ft)) + registerOptInFindingTools(s, testClient(ft)) + + result := callTool(t, s, tt.tool, tt.args) + + require.Equal(t, tt.isError, result.IsError) + require.Equal(t, tt.requests, ft.requests) }) } } -func TestAllFindingTypeNames(t *testing.T) { - if names := allFindingTypeNames(); len(names) != 8 { - t.Errorf("expected 8 finding types, got %d: %v", len(names), names) +func TestSearchToolReportsCompleteness(t *testing.T) { + tests := []struct { + name string + args map[string]any + body string + want string + sent string + }{ + { + name: "scpm uses its API type and an empty result is reported as complete", + args: map[string]any{"type": "scpm"}, + body: `{"findings":[],"total":0,"hasMoreData":false,"page":1}`, + want: `{"findings":[],"total":0,"returned":0,"truncated":false}`, + sent: `"type":["SupplyChain"]`, + }, + { + name: "a cut-off result is reported as truncated", + args: map[string]any{"type": "cspm", "limit": 1}, + body: `{"findings":[{}],"total":9,"hasMoreData":true,"page":1}`, + want: `{"total":9,"returned":1,"truncated":true}`, + sent: `"type":["Cloud"]`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(capturedReq) (int, string) { return 200, tt.body }} + s := server.NewMCPServer("test", "1", server.WithToolCapabilities(true)) + registerUnifiedTools(s, testClient(ft)) + + result := callTool(t, s, "nullify_search_findings", tt.args) + + require.False(t, result.IsError) + text, ok := result.Content[0].(mcp.TextContent) + require.True(t, ok) + require.JSONEqf(t, withoutFindings(t, tt.want), withoutFindings(t, text.Text), "tool result %s", text.Text) + require.Contains(t, string(ft.requests[0].body), tt.sent) + }) } } -func TestValidToolSets(t *testing.T) { - sets := ValidToolSets() - expected := map[string]bool{"default": true, "all": true, "minimal": true, "findings": true, "admin": true} - if len(sets) != len(expected) { - t.Errorf("expected %d tool sets, got %d: %v", len(expected), len(sets), sets) +func withoutFindings(t *testing.T, doc string) string { + t.Helper() + var fields map[string]any + require.NoError(t, json.Unmarshal([]byte(doc), &fields)) + delete(fields, "findings") + out, err := json.Marshal(fields) + require.NoError(t, err) + return string(out) +} + +func TestFixToolStartsTheRunAndReturns(t *testing.T) { + ft := &fakeTransport{respond: func(capturedReq) (int, string) { + return 200, `{"autoFixState":"in_progress_requested","runId":"r1"}` + }} + s := server.NewMCPServer("test", "1", server.WithToolCapabilities(true)) + registerUnifiedTools(s, testClient(ft)) + + result := callTool(t, s, "nullify_fix_finding", map[string]any{"type": "sast", "id": "f1"}) + + require.False(t, result.IsError) + require.JSONEq(t, `{"state":"in_progress_requested","run_id":"r1","check_with":"nullify_get_fix_status"}`, result.Content[0].(mcp.TextContent).Text) + require.Equal(t, []capturedReq{{"POST", "/sast/findings/f1/autofix/fix", []byte(`{}`)}}, ft.requests) +} + +func TestFindingsForRepo(t *testing.T) { + tests := []struct { + name string + want []string + never string + }{ + {name: "cloud findings have no repository", want: []string{"--- cspm ---\nNot listed: these findings have no repository."}, never: `"Cloud"`}, + {name: "bug hunt findings have no repository", want: []string{"--- bughunt ---\nNot listed: these findings have no repository."}, never: `"BugHunt"`}, + {name: "a section reports truncation", want: []string{`"truncated": true`, `"total": 9`, `"returned": 1`}, never: `"Cloud"`}, } - for _, s := range sets { - if !expected[s] { - t.Errorf("unexpected tool set %q", s) - } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := &fakeTransport{respond: func(capturedReq) (int, string) { + return 200, `{"findings":[{}],"total":9,"hasMoreData":true}` + }} + s := server.NewMCPServer("test", "1", server.WithToolCapabilities(true)) + registerCompositeTools(s, testClient(ft)) + + result := callTool(t, s, "get_findings_for_repo", map[string]any{"repository": "acme/app", "limit": 1}) + + text := result.Content[0].(mcp.TextContent).Text + for _, want := range tt.want { + require.Contains(t, text, want) + } + for _, r := range ft.requests { + require.NotContains(t, string(r.body), tt.never) + } + }) } } + +func TestValidToolSets(t *testing.T) { + require.ElementsMatch(t, []string{"default", "all", "minimal", "findings", "admin", "findings-write"}, ValidToolSets()) +} diff --git a/internal/mcp/toolset.go b/internal/mcp/toolset.go index c622f9c..deae12e 100644 --- a/internal/mcp/toolset.go +++ b/internal/mcp/toolset.go @@ -9,6 +9,9 @@ const ( ToolSetMinimal ToolSet = "minimal" ToolSetFindings ToolSet = "findings" ToolSetAdmin ToolSet = "admin" + // ToolSetFindingsWrite adds the finding tools that are kept out of the default + // set: archive, unarchive, mark and unmark false positive, and delete ticket. + ToolSetFindingsWrite ToolSet = "findings-write" ) // ValidToolSets returns all valid tool set names for flag validation. @@ -19,5 +22,6 @@ func ValidToolSets() []string { string(ToolSetMinimal), string(ToolSetFindings), string(ToolSetAdmin), + string(ToolSetFindingsWrite), } } diff --git a/scripts/commandsurface/main.go b/scripts/commandsurface/main.go new file mode 100644 index 0000000..51dce52 --- /dev/null +++ b/scripts/commandsurface/main.go @@ -0,0 +1,69 @@ +// commandsurface checks the CLI command tree and the MCP tools against committed +// snapshots, and writes new snapshots when the check passes. +// +// Usage: go run ./scripts/commandsurface [--base ] [--base-tools ] [--write] +package main + +import ( + "flag" + "fmt" + "os" + + "github.com/nullify-platform/cli/cmd/cli/cmd" + "github.com/nullify-platform/cli/internal/commands" + "github.com/nullify-platform/cli/internal/mcp" +) + +const ( + snapshotPath = "spec/command-surface.tsv" + toolSnapshotPath = "spec/mcp-tools.tsv" +) + +func main() { + base := flag.String("base", snapshotPath, "snapshot to check the command tree against") + baseTools := flag.String("base-tools", toolSnapshotPath, "snapshot to check the MCP tools against") + write := flag.Bool("write", false, "write the snapshots if the check passes") + flag.Parse() + + if err := run(*base, *baseTools, *write); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func run(base, baseTools string, write bool) error { + content, err := os.ReadFile(base) + if err != nil { + return err + } + snapshot, err := commands.ParseSurface(string(content)) + if err != nil { + return err + } + + live := commands.Surface(cmd.Root()) + if err := commands.CheckSurface(snapshot, live, commands.Decisions); err != nil { + return err + } + + toolContent, err := os.ReadFile(baseTools) + if err != nil { + return err + } + toolSnapshot, err := mcp.ParseToolSurface(string(toolContent)) + if err != nil { + return err + } + liveTools := mcp.ToolSurface() + if err := mcp.CheckToolSurface(toolSnapshot, liveTools, mcp.Decisions); err != nil { + return err + } + + if !write { + return nil + } + if err := os.WriteFile(snapshotPath, []byte(commands.FormatSurface(live)), 0644); err != nil { + return err + } + return os.WriteFile(toolSnapshotPath, []byte(mcp.FormatToolSurface(liveTools)), 0644) +} diff --git a/scripts/generate/main.go b/scripts/generate/main.go index bf618cd..6ae9634 100644 --- a/scripts/generate/main.go +++ b/scripts/generate/main.go @@ -83,57 +83,51 @@ type Schema struct { // Service grouping based on path prefix. // -// NOTE: prefixes are matched against the full request path, so any path whose -// prefix is absent here is silently dropped from the generated CLI. Keep this in -// sync with the services published in the OpenAPI bundle. +// Prefixes are matched against the full request path. A path whose prefix is in +// neither this map nor excludePrefixes fails generation with ErrUnmappedPath. var serviceMapping = map[string]string{ - "/sast/": "sast", - "/sca/": "sca", - "/secrets/": "secrets", - "/dast/": "dast", - "/admin/": "admin", - "/manager/": "manager", - "/context/": "context", - "/cspm/": "cspm", - "/scpm/": "scpm", - "/orchestrator/": "orchestrator", - "/asset-graph/": "asset-graph", - "/infrastructure/": "infrastructure", - "/ticket/": "ticket", + "/sast/": "sast", + "/sca/": "sca", + "/secrets/": "secrets", + "/dast/": "dast", + "/admin/": "admin", + "/manager/": "manager", + "/context/": "context", + "/cspm/": "cspm", + "/scpm/": "scpm", + "/orchestrator/": "orchestrator", + "/findings/": "findings", } // serviceDescriptions maps service names to human-readable descriptions. var serviceDescriptions = map[string]string{ - "sast": "Static Application Security Testing (SAST)", - "sca": "Software Composition Analysis (SCA)", - "secrets": "Secrets Detection", - "dast": "Dynamic Application Security Testing (DAST)", - "admin": "Administration and Metrics", - "manager": "Finding Lifecycle Management", - "context": "Repository and Code Classification", - "cspm": "Cloud Security Posture Management (CSPM)", - "scpm": "SaaS Security Posture Management (SCPM)", - "orchestrator": "Scan Orchestration (autofix batches, code reviews, retriage, onboarding)", - "asset-graph": "Asset Graph (reachability, search, subgraph, summary)", - "infrastructure": "Infrastructure Graphs", - "ticket": "Ticket Integration", + "sast": "Static Application Security Testing (SAST)", + "sca": "Software Composition Analysis (SCA)", + "secrets": "Secrets Detection", + "dast": "Dynamic Application Security Testing (DAST)", + "admin": "Administration and Metrics", + "manager": "Finding Lifecycle Management", + "context": "Repository, Asset Graph and Infrastructure Context", + "cspm": "Cloud Security Posture Management (CSPM)", + "scpm": "SaaS Security Posture Management (SCPM)", + "orchestrator": "Scan Orchestration (autofix batches, code reviews, retriage, onboarding)", + "findings": "Findings across all scanner types (feedback)", } // Paths to exclude from CLI generation. // -// Prefer this list over silent absence from serviceMapping: a path whose prefix -// is in neither map is dropped anyway, but listing it here records the intent -// so a future spec audit doesn't rediscover it as a "missing service". // These are all paths the published bundle does carry but that aren't useful // CLI commands: /auth/* are the auth handshake endpoints (access/refresh/github -// tokens, logout) the CLI drives through internal/auth, and /core/{bitbucket,jira}/* -// are integration webhooks/descriptors. Genuinely internal endpoints are kept -// out of the published bundle at the source (each service's openapi-public.yml), -// so they never reach here. +// tokens, logout) the CLI drives through internal/auth, /core/{bitbucket,jira}/* +// are integration webhooks/descriptors, and /public/* are the unauthenticated +// feedback-link and workspace bootstrap flows that a browser drives. Genuinely +// internal endpoints are kept out of the published bundle at the source (each +// service's openapi-public.yml), so they never reach here. var excludePrefixes = []string{ "/auth/", "/core/bitbucket/", "/core/jira/", + "/public/", } type Endpoint struct { @@ -156,6 +150,7 @@ func main() { specPath := "spec/nullify-openapi-bundle.yaml" outputDir := "internal/api" cmdOutputDir := "internal/commands" + namesPath := "spec/command-names.lock" for i, arg := range os.Args { if arg == "--spec" && i+1 < len(os.Args) { @@ -167,6 +162,9 @@ func main() { if arg == "--cmd-output" && i+1 < len(os.Args) { cmdOutputDir = os.Args[i+1] } + if arg == "--names" && i+1 < len(os.Args) { + namesPath = os.Args[i+1] + } } data, err := os.ReadFile(specPath) @@ -187,9 +185,23 @@ func main() { os.Exit(1) } - endpoints := extractEndpoints(spec) + endpoints, err := extractEndpoints(spec) + if err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) + os.Exit(1) + } grouped := groupByService(endpoints) - assignCobraUses(grouped) + + names, err := loadCommandNames(namesPath) + if err != nil { + fmt.Fprintf(os.Stderr, "Error reading command names: %v\n", err) + os.Exit(1) + } + assignCobraUses(grouped, names) + if err := names.write(namesPath); err != nil { + fmt.Fprintf(os.Stderr, "Error writing command names: %v\n", err) + os.Exit(1) + } registry := buildModelRegistry(spec, endpoints) @@ -202,6 +214,11 @@ func main() { os.Exit(1) } + if err := removeGeneratedFiles(outputDir, filepath.Join(outputDir, "models"), cmdOutputDir); err != nil { + fmt.Fprintf(os.Stderr, "Error removing stale output: %v\n", err) + os.Exit(1) + } + generateModelsPackage(outputDir, registry) generateClient(outputDir, grouped, registry) generateCommands(cmdOutputDir, grouped, registry) @@ -212,8 +229,9 @@ func main() { } } -func extractEndpoints(spec OpenAPISpec) []Endpoint { +func extractEndpoints(spec OpenAPISpec) ([]Endpoint, error) { var endpoints []Endpoint + var unmapped []string for path, methods := range spec.Paths { // Skip excluded paths @@ -228,12 +246,13 @@ func extractEndpoints(spec OpenAPISpec) []Endpoint { continue } - for method, op := range methods { - service := classifyService(path) - if service == "" { - continue - } + service := classifyService(path) + if service == "" { + unmapped = append(unmapped, path) + continue + } + for method, op := range methods { ep := Endpoint{ Path: path, Method: strings.ToUpper(method), @@ -265,6 +284,11 @@ func extractEndpoints(spec OpenAPISpec) []Endpoint { } } + if len(unmapped) > 0 { + sort.Strings(unmapped) + return nil, fmt.Errorf("%w: %s", ErrUnmappedPath, strings.Join(unmapped, ", ")) + } + // Sort fully deterministically. The spec's paths/methods are decoded from YAML // maps (random iteration order), so we must tie-break all the way down to the // method; otherwise two operations on the same path can swap order between runs @@ -279,7 +303,7 @@ func extractEndpoints(spec OpenAPISpec) []Endpoint { return endpoints[i].Method < endpoints[j].Method }) - return endpoints + return endpoints, nil } func classifyService(path string) string { @@ -433,9 +457,7 @@ import ( "context" "io" "net/http" - "os" "strings" - "time" "github.com/nullify-platform/cli/internal/apierror" "github.com/nullify-platform/cli/internal/client" @@ -444,22 +466,6 @@ import ( // Version is set at build time via ldflags. var Version = "dev" -// defaultTimeout is the request timeout used when NULLIFY_HTTP_TIMEOUT is unset -// or invalid. 30s is too short for long-running calls (scan-start, autofix), so -// callers can raise it via the env var (e.g. "120s"). -const defaultTimeout = 30 * time.Second - -// httpTimeout returns the request timeout, overridable via the -// NULLIFY_HTTP_TIMEOUT env var (a Go duration string such as "120s"). -func httpTimeout() time.Duration { - if v := os.Getenv("NULLIFY_HTTP_TIMEOUT"); v != "" { - if d, err := time.ParseDuration(v); err == nil && d > 0 { - return d - } - } - return defaultTimeout -} - // Client is a typed HTTP client for the Nullify API. type Client struct { BaseURL string @@ -489,7 +495,7 @@ func NewClient(host string, token string, defaultParams map[string]string, opts Token: token, DefaultParams: defaultParams, HTTPClient: &http.Client{ - Timeout: httpTimeout(), + Timeout: client.HTTPTimeout(), Transport: client.NewRetryTransport(http.DefaultTransport), }, } @@ -539,6 +545,32 @@ func generateCommands(outputDir string, grouped map[string][]Endpoint, registry for service, endpoints := range grouped { generateCommandFile(outputDir, service, endpoints, registry) } + generateServiceRegistry(outputDir, grouped) +} + +// generateServiceRegistry writes the single function that mounts every service, +// so that a service added to serviceMapping cannot be left out of the CLI. +func generateServiceRegistry(outputDir string, grouped map[string][]Endpoint) { + services := make([]string, 0, len(grouped)) + for service := range grouped { + services = append(services, service) + } + sort.Strings(services) + + var sb strings.Builder + sb.WriteString(generatedFileMarker + "\npackage commands\n\nimport \"github.com/spf13/cobra\"\n\n") + sb.WriteString("// RegisterAPICommands adds the generated command group of every service to parent.\n") + sb.WriteString("func RegisterAPICommands(parent *cobra.Command, getClient ClientFactory) {\n") + for _, service := range services { + fmt.Fprintf(&sb, "\tRegister%sCommands(parent, getClient)\n", toPascalCase(service)) + } + sb.WriteString("}\n") + + filePath := filepath.Join(outputDir, "api_services.go") + if err := os.WriteFile(filePath, []byte(sb.String()), 0644); err != nil { + fmt.Fprintf(os.Stderr, "Error writing file %s: %v\n", filePath, err) + os.Exit(1) + } } func generateCommandFile(outputDir string, service string, endpoints []Endpoint, registry *modelRegistry) { @@ -587,7 +619,7 @@ func generateCommandFile(outputDir string, service string, endpoints []Endpoint, // invoking the typed client method, and printing the typed response. func emitCobraCommand(sb *strings.Builder, ep Endpoint, r *modelRegistry) { cobraUse := ep.CobraUse - summary := strings.ReplaceAll(ep.Summary, `"`, `\"`) + summary := ep.Summary pathNames := extractPathParamNames(ep.Path) pathLookup := map[string]Parameter{} @@ -680,10 +712,11 @@ func emitCobraCommand(sb *strings.Builder, ep Endpoint, r *modelRegistry) { } sb.WriteString("\t\t\t},\n\t\t}\n") sb.WriteString("\t\tpreserveRuntimeUsage(cmd)\n") + fmt.Fprintf(sb, "\t\tsetRoute(cmd, %q)\n", ep.Method+" "+ep.Path) // Flag declarations. for _, p := range queryParams { - desc := strings.ReplaceAll(p.Description, `"`, `\"`) + desc := p.Description flagName := toKebabCase(p.Name) fmt.Fprintf(sb, "\t\tcmd.Flags().String(%q, \"\", %q)\n", flagName, desc) } @@ -850,30 +883,39 @@ func disambiguatedUse(ep Endpoint) string { } // assignCobraUses sets a unique CobraUse on every endpoint within each service. -// Non-colliding endpoints keep the short name; colliding ones are expanded to -// include their distinguishing path segments, and any residual duplicates get a -// numeric suffix as a last resort. This guarantees no two commands under one -// service parent share a Use (which would silently shadow each other in cobra). -func assignCobraUses(grouped map[string][]Endpoint) { - for _, endpoints := range grouped { - base := make([]string, len(endpoints)) +// A route in the lock keeps its recorded name whatever its siblings are. A new +// route takes the short name if no other route holds it, otherwise its fully +// qualified name, and a numeric suffix as a last resort. New names are added to +// the lock, so they do not change on a later regeneration. +func assignCobraUses(grouped map[string][]Endpoint, names *commandNames) { + for service, endpoints := range grouped { + taken := names.takenIn(service) + counts := map[string]int{} for i := range endpoints { - base[i] = generateCobraUse(endpoints[i]) - counts[base[i]]++ + if _, locked := names.useByRoute[routeKey(endpoints[i].Method, endpoints[i].Path)]; !locked { + counts[generateCobraUse(endpoints[i])]++ + } } - seen := map[string]int{} + for i := range endpoints { - use := base[i] - if counts[use] > 1 { + route := routeKey(endpoints[i].Method, endpoints[i].Path) + if use, locked := names.useByRoute[route]; locked { + endpoints[i].CobraUse = use + continue + } + + use := generateCobraUse(endpoints[i]) + if counts[use] > 1 || taken[use] { use = disambiguatedUse(endpoints[i]) } - if n := seen[use]; n > 0 { - seen[use] = n + 1 - use = fmt.Sprintf("%s-%d", use, n+1) - } else { - seen[use] = 1 + for n, base := 2, use; taken[use]; n++ { + use = fmt.Sprintf("%s-%d", base, n) } + + taken[use] = true + names.useByRoute[route] = use + names.service[route] = service endpoints[i].CobraUse = use } } diff --git a/scripts/generate/stability.go b/scripts/generate/stability.go new file mode 100644 index 0000000..be16ecd --- /dev/null +++ b/scripts/generate/stability.go @@ -0,0 +1,112 @@ +// Generator safety: stale output removal, unmapped path rejection and the +// committed route to command name lock. +package main + +import ( + "errors" + "fmt" + "os" + "path/filepath" + "regexp" + "sort" + "strings" +) + +const generatedFileMarker = "// Code generated by scripts/generate/main.go. DO NOT EDIT." + +// ErrUnmappedPath is returned when the spec has a path whose prefix is in +// neither serviceMapping nor excludePrefixes. +var ErrUnmappedPath = errors.New("path prefix is in neither serviceMapping nor excludePrefixes") + +// removeGeneratedFiles deletes every Go file in dirs that the generator wrote, +// so that a service or model file the spec no longer produces cannot survive a +// regeneration. Hand-written files in the same directories are left alone. +func removeGeneratedFiles(dirs ...string) error { + for _, dir := range dirs { + files, err := filepath.Glob(filepath.Join(dir, "*.go")) + if err != nil { + return err + } + for _, file := range files { + content, err := os.ReadFile(file) + if err != nil { + return err + } + if !strings.HasPrefix(string(content), generatedFileMarker) { + continue + } + if err := os.Remove(file); err != nil { + return err + } + } + } + return nil +} + +var pathParamPattern = regexp.MustCompile(`\{[^}]+\}`) + +// routeKey identifies an operation independently of its path parameter names, +// so that renaming {id} to {findingId} does not rename the command. +func routeKey(method, path string) string { + return strings.ToUpper(method) + " " + pathParamPattern.ReplaceAllString(path, "{}") +} + +// commandNames is the committed record of the command name given to each route. +// A row stays after its route leaves the spec, so a later route cannot reuse the +// name with a different meaning. +type commandNames struct { + useByRoute map[string]string + service map[string]string +} + +func newCommandNames() *commandNames { + return &commandNames{useByRoute: map[string]string{}, service: map[string]string{}} +} + +// loadCommandNames reads the lock file. A missing file gives an empty lock. +func loadCommandNames(path string) (*commandNames, error) { + names := newCommandNames() + content, err := os.ReadFile(path) + if errors.Is(err, os.ErrNotExist) { + return names, nil + } + if err != nil { + return nil, err + } + for i, line := range strings.Split(strings.TrimSpace(string(content)), "\n") { + if line == "" { + continue + } + fields := strings.Split(line, "\t") + if len(fields) != 3 { + return nil, fmt.Errorf("%s:%d: want route, service and command name", path, i+1) + } + names.useByRoute[fields[0]] = fields[2] + names.service[fields[0]] = fields[1] + } + return names, nil +} + +func (n *commandNames) write(path string) error { + routes := make([]string, 0, len(n.useByRoute)) + for route := range n.useByRoute { + routes = append(routes, route) + } + sort.Strings(routes) + + var sb strings.Builder + for _, route := range routes { + fmt.Fprintf(&sb, "%s\t%s\t%s\n", route, n.service[route], n.useByRoute[route]) + } + return os.WriteFile(path, []byte(sb.String()), 0644) +} + +func (n *commandNames) takenIn(service string) map[string]bool { + taken := map[string]bool{} + for route, use := range n.useByRoute { + if n.service[route] == service { + taken[use] = true + } + } + return taken +} diff --git a/scripts/generate/stability_test.go b/scripts/generate/stability_test.go new file mode 100644 index 0000000..87d27a3 --- /dev/null +++ b/scripts/generate/stability_test.go @@ -0,0 +1,150 @@ +package main + +import ( + "errors" + "os" + "path/filepath" + "testing" +) + +func TestRemoveGeneratedFiles(t *testing.T) { + tests := []struct { + name string + content string + survives bool + }{ + {name: "stale generated file", content: generatedFileMarker + "\npackage api\n", survives: false}, + {name: "hand-written file", content: "package api\n", survives: true}, + {name: "marker not on the first line", content: "package api\n\n" + generatedFileMarker + "\n", survives: true}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dir := t.TempDir() + file := filepath.Join(dir, "asset-graph.go") + if err := os.WriteFile(file, []byte(tt.content), 0644); err != nil { + t.Fatal(err) + } + + if err := removeGeneratedFiles(dir); !errors.Is(err, nil) { + t.Fatalf("removeGeneratedFiles: %v", err) + } + + _, statErr := os.Stat(file) + if survived := statErr == nil; survived != tt.survives { + t.Errorf("file survived = %v, want %v", survived, tt.survives) + } + }) + } +} + +func TestExtractEndpointsRejectsUnmappedPaths(t *testing.T) { + tests := []struct { + name string + path string + want error + }{ + {name: "mapped service", path: "/cspm/findings", want: nil}, + {name: "cross-service feedback", path: "/findings/{findingId}/feedback", want: nil}, + {name: "explicitly excluded", path: "/public/workspace/bootstrap/start", want: nil}, + {name: "unmapped prefix", path: "/newservice/widgets", want: ErrUnmappedPath}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + spec := OpenAPISpec{Paths: map[string]map[string]Operation{tt.path: {"get": {}}}} + + _, err := extractEndpoints(spec) + + if !errors.Is(err, tt.want) { + t.Errorf("extractEndpoints(%s) error = %v, want %v", tt.path, err, tt.want) + } + }) + } +} + +func TestAssignCobraUsesKeepsNamesStable(t *testing.T) { + tests := []struct { + name string + locked [][3]string + method string + path string + sibling string + want string + }{ + { + name: "a locked name survives a new colliding sibling", + locked: [][3]string{{"POST /context/cloud-recon/scans", "context", "create-scans"}}, + method: "POST", + path: "/context/cloud-recon/scans", + sibling: "/context/repo-scope/scans", + want: "create-scans", + }, + { + name: "a locked name survives a path parameter rename", + locked: [][3]string{{"GET /context/memories/{}/versions", "context", "get-versions"}}, + method: "GET", + path: "/context/memories/{renamed}/versions", + sibling: "/context/other/{id}/versions", + want: "get-versions", + }, + { + name: "a name whose route left the spec is not reused", + locked: [][3]string{{"POST /admin/repositories/initialize", "admin", "create-initialize"}}, + method: "POST", + path: "/admin/operator/external-writes/initialize", + sibling: "/admin/unrelated", + want: "create-operator-external-writes-initialize", + }, + { + name: "a new route with a free name takes the short name", + method: "POST", + path: "/cspm/findings/{findingId}/allowlist", + sibling: "/cspm/findings/{findingId}/archive", + want: "create-allowlist-by-id", + }, + { + name: "new routes that collide take qualified names", + method: "GET", + path: "/dast/pentest/scans", + sibling: "/dast/bughunt/scans", + want: "list-pentest-scans", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + names := newCommandNames() + for _, row := range tt.locked { + names.useByRoute[row[0]] = row[2] + names.service[row[0]] = row[1] + } + endpoints := []Endpoint{ + {Method: tt.method, Path: tt.path}, + {Method: tt.method, Path: tt.sibling}, + } + + assignCobraUses(map[string][]Endpoint{classifyService(tt.path): endpoints}, names) + + if endpoints[0].CobraUse != tt.want { + t.Errorf("CobraUse = %q, want %q", endpoints[0].CobraUse, tt.want) + } + }) + } +} + +func TestCommandNamesRoundTrip(t *testing.T) { + names := newCommandNames() + names.useByRoute["GET /asset-graph/search"] = "list-search" + names.service["GET /asset-graph/search"] = "asset-graph" + path := filepath.Join(t.TempDir(), "command-names.lock") + + if err := names.write(path); !errors.Is(err, nil) { + t.Fatalf("write: %v", err) + } + loaded, err := loadCommandNames(path) + if !errors.Is(err, nil) { + t.Fatalf("load: %v", err) + } + + if loaded.useByRoute["GET /asset-graph/search"] != "list-search" || loaded.service["GET /asset-graph/search"] != "asset-graph" { + t.Errorf("loaded = %+v", loaded) + } +} diff --git a/scripts/generate/typed.go b/scripts/generate/typed.go index 59aa47b..03a4b16 100644 --- a/scripts/generate/typed.go +++ b/scripts/generate/typed.go @@ -687,7 +687,7 @@ func emitInputStruct(sb *strings.Builder, ep Endpoint, r *modelRegistry) { _, required := reqSet[p] typ := r.goFieldType(ref, required, "models.") tag := jsonTag(p, required, ref.Nullable) - fmt.Fprintf(sb, "\t%s %s %s\n", fieldName(p), typ, tag) + fmt.Fprintf(sb, "\t%s %s %s\n", bodyFieldName(ep, p), typ, tag) } } } @@ -698,6 +698,26 @@ func emitInputStruct(sb *strings.Builder, ep Endpoint, r *modelRegistry) { } sb.WriteString("}\n\n") + + if p, ok := pathLookup["findingId"]; ok && pathParamGoType(p) == "string" { + fmt.Fprintf(sb, "// SetFindingID sets the finding that the request targets.\nfunc (in *%s) SetFindingID(id string) { in.FindingID = id }\n\n", inputStructName(ep)) + } +} + +// bodyFieldName returns the input struct field for a body property. A property +// that shares its name with a path or query parameter takes a "Body" suffix, +// because both must be separate fields on one struct. +func bodyFieldName(ep Endpoint, prop string) string { + name := fieldName(prop) + for _, p := range ep.Parameters { + if _, scope := requestScopeParams[p.Name]; scope && p.In == "query" { + continue + } + if fieldName(p.Name) == name { + return name + "Body" + } + } + return name } // pathParamGoType picks the Go type for a path param. Most are string; a few @@ -880,7 +900,7 @@ func emitBodyMarshal(sb *strings.Builder, ep Endpoint, r *modelRegistry) { } sb.WriteString("\t}{\n") for _, p := range props { - fmt.Fprintf(sb, "\t\t%s: in.%s,\n", fieldName(p), fieldName(p)) + fmt.Fprintf(sb, "\t\t%s: in.%s,\n", fieldName(p), bodyFieldName(ep, p)) } sb.WriteString("\t})\n") sb.WriteString("\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshal body: %w\", err)\n\t}\n") diff --git a/spec/command-names.lock b/spec/command-names.lock new file mode 100644 index 0000000..cae0807 --- /dev/null +++ b/spec/command-names.lock @@ -0,0 +1,886 @@ +DELETE /admin/identity/entra admin delete-entra +DELETE /admin/identity/entra/handoff/{} admin delete-handoff +DELETE /admin/identity/scim/credentials/{} admin delete-credentials +DELETE /admin/integrations/azure/connect admin delete-connect +DELETE /admin/integrations/azure/installations admin delete-installations +DELETE /admin/integrations/buildkite admin delete-buildkite +DELETE /admin/integrations/circleci admin delete-circleci +DELETE /admin/integrations/cloud/aws/settings admin delete-integrations-cloud-aws-settings +DELETE /admin/integrations/cloud/azure/settings admin delete-integrations-cloud-azure-settings +DELETE /admin/integrations/cloud/gcp/settings admin delete-integrations-cloud-gcp-settings +DELETE /admin/integrations/cloud/k8s/clusters/{} admin delete-clusters +DELETE /admin/integrations/cloud/k8s/settings admin delete-settings +DELETE /admin/integrations/connections/{} admin delete-connections +DELETE /admin/integrations/jenkins admin delete-jenkins +DELETE /admin/integrations/{}/{}/disconnect admin delete-disconnect +DELETE /admin/repository-property-team-keys admin delete-repository-property-team-keys +DELETE /admin/service_accounts admin delete-service_accounts +DELETE /admin/support-access admin delete-support-access +DELETE /admin/teams/{} admin delete-teams +DELETE /admin/ticketing/saved-filters/{} admin delete-saved-filters +DELETE /admin/ui/preferences admin delete-preferences +DELETE /admin/ui/savedViews/{} admin delete-savedViews +DELETE /admin/user/mapping/{} admin delete-mapping +DELETE /admin/users/{}/erasure admin delete-erasure +DELETE /context/applications/{} context delete-applications +DELETE /context/artifacts/{} context delete-artifacts +DELETE /context/asset-inventory/{}/{} context delete-asset-inventory +DELETE /context/cicd-pipelines/{} context delete-cicd-pipelines +DELETE /context/deps context delete-deps +DELETE /context/entrypoints/{} context delete-entrypoints +DELETE /context/memories/{} context delete-memories +DELETE /context/repositories/{} context delete-repositories +DELETE /context/repositories/{}/projects/{} context delete-projects +DELETE /context/sboms context delete-sboms +DELETE /context/vault/file/{} context delete-file +DELETE /cspm/findings/{}/ticket cspm delete-ticket +DELETE /dast/applications/{} dast delete-applications-2 +DELETE /dast/bughunt/findings/{}/ticket dast delete-bughunt-findings-ticket +DELETE /dast/credentials/{} dast delete-credentials +DELETE /dast/exploit-validation/policies/{} dast delete-policies +DELETE /dast/pentest/applications/{} dast delete-applications +DELETE /dast/pentest/findings/{}/ticket dast delete-pentest-findings-ticket +DELETE /dast/targets/{} dast delete-targets +DELETE /dast/targets/{}/exploit-validation-consent dast delete-exploit-validation-consent +DELETE /dast/web-services/{} dast delete-web-services +DELETE /dast/web-services/{}/credentials/{} dast delete-web-services-credentials +DELETE /manager/action-items/{} manager delete-action-items +DELETE /manager/campaigns/{} manager delete-campaigns +DELETE /manager/chat/sessions/{} manager delete-sessions +DELETE /manager/customer-questions manager delete-customer-questions +DELETE /manager/customer-questions/{} manager delete-customer-questions-2 +DELETE /manager/customer-questions/{}/questions/{} manager delete-questions +DELETE /manager/events/{} manager delete-events +DELETE /manager/identity-classifications/{}/{} manager delete-identity-classifications +DELETE /sast/findings/{}/ticket sast delete-ticket +DELETE /sca/containers/findings/{}/ticket sca delete-containers-findings-ticket +DELETE /sca/dependencies/findings/{}/ticket sca delete-dependencies-findings-ticket +DELETE /scpm/findings/{}/ticket scpm delete-ticket +DELETE /secrets/credentials/findings/{}/ticket secrets delete-credentials-findings-ticket +DELETE /secrets/findings/{}/ticket secrets delete-findings-ticket +DELETE /secrets/sensitivedata/findings/{}/ticket secrets delete-sensitivedata-findings-ticket +GET /admin/access/me admin list-me +GET /admin/access/preferences admin list-access-preferences +GET /admin/access/users admin list-access-users +GET /admin/access/users/org-owners admin list-org-owners +GET /admin/assessments/scan-coverage admin list-scan-coverage +GET /admin/assessments/scan-coverage/findings admin list-assessments-scan-coverage-findings +GET /admin/checklist admin list-checklist +GET /admin/config/routing-exclusions admin list-routing-exclusions +GET /admin/config/security-owner admin list-security-owner +GET /admin/external-writes admin list-external-writes +GET /admin/finding/{} admin get-finding +GET /admin/fix-effort admin list-fix-effort +GET /admin/getFileContents admin list-getFileContents +GET /admin/getPullRequest admin list-getPullRequest +GET /admin/identity/entra admin list-entra +GET /admin/identity/entra/handoff admin list-handoff +GET /admin/identity/entra/policy admin list-policy +GET /admin/identity/scim admin list-scim +GET /admin/installations admin list-installations +GET /admin/integrations/asana/oauth admin list-integrations-asana-oauth +GET /admin/integrations/atlassian admin list-atlassian +GET /admin/integrations/azure admin list-azure +GET /admin/integrations/azure/connect/{} admin get-connect +GET /admin/integrations/azure/installations admin list-integrations-azure-installations +GET /admin/integrations/buildkite admin list-buildkite +GET /admin/integrations/catalog admin list-catalog +GET /admin/integrations/circleci admin list-circleci +GET /admin/integrations/cloud/aws/settings admin list-integrations-cloud-aws-settings +GET /admin/integrations/cloud/azure/settings admin list-integrations-cloud-azure-settings +GET /admin/integrations/cloud/gcp/settings admin list-integrations-cloud-gcp-settings +GET /admin/integrations/cloud/gcp/setup admin list-setup +GET /admin/integrations/cloud/k8s/settings admin list-integrations-cloud-k8s-settings +GET /admin/integrations/cloud/k8s/whitelist admin list-whitelist +GET /admin/integrations/connections admin list-connections +GET /admin/integrations/github/app-settings admin list-app-settings +GET /admin/integrations/gitlab/connect/status admin list-status +GET /admin/integrations/jenkins admin list-jenkins +GET /admin/integrations/jira admin list-jira +GET /admin/integrations/jira/forge admin list-forge +GET /admin/integrations/jira/install admin list-install +GET /admin/integrations/linear admin list-linear +GET /admin/integrations/linear/install admin list-integrations-linear-install +GET /admin/integrations/linear/members admin list-members +GET /admin/integrations/linear/oauth admin list-oauth +GET /admin/integrations/linear/teams admin list-integrations-linear-teams +GET /admin/integrations/notifications admin list-notifications +GET /admin/integrations/slack admin list-slack +GET /admin/integrations/slack/install admin list-integrations-slack-install +GET /admin/integrations/teams admin list-integrations-teams +GET /admin/integrations/threat-intel/destinations admin list-destinations +GET /admin/integrations/users admin list-integrations-users +GET /admin/integrations/{}/{}/install admin get-install +GET /admin/manager/settings admin list-manager-settings +GET /admin/metrics/interactions admin list-interactions +GET /admin/metrics/usage/aggregate admin list-aggregate +GET /admin/metrics/usage/ledger admin list-ledger +GET /admin/metrics/usage/timeseries admin list-timeseries +GET /admin/network/ip-allowlist admin list-ip-allowlist +GET /admin/operator/package-feeds admin list-package-feeds +GET /admin/operator/scan-entitlement admin list-scan-entitlement +GET /admin/operator/scan-scope/repositories admin list-operator-scan-scope-repositories +GET /admin/operator/tenant-capabilities admin list-operator-tenant-capabilities +GET /admin/operator/workspace-bootstrap/operation admin list-operation +GET /admin/operator/workspace-bootstrap/requests admin list-requests +GET /admin/organization admin list-organization +GET /admin/pr-gate-settings admin list-pr-gate-settings +GET /admin/privacy/acknowledgment admin list-acknowledgment +GET /admin/pullrequests admin list-pullrequests +GET /admin/repositories admin list-repositories +GET /admin/repositories/recommendations admin list-recommendations +GET /admin/repositories/{}/directories admin get-directories +GET /admin/repository-property-team-keys admin list-repository-property-team-keys +GET /admin/runs/{}/{} admin get-runs +GET /admin/scan-scope admin list-scan-scope +GET /admin/scans/orchestrator admin list-orchestrator +GET /admin/service_accounts admin list-service_accounts +GET /admin/settings/cspm-scan-cadence admin list-cspm-scan-cadence +GET /admin/settings/inference-region admin list-inference-region +GET /admin/sla admin list-sla +GET /admin/support-access admin list-support-access +GET /admin/team-source-preferences admin list-team-source-preferences +GET /admin/team-sync-runs admin list-team-sync-runs +GET /admin/team/{} admin get-team +GET /admin/teams admin list-teams +GET /admin/teams/appzip admin list-appzip +GET /admin/teams/findings admin list-teams-findings +GET /admin/teams/{}/findings admin get-findings +GET /admin/tenant-capabilities admin list-tenant-capabilities +GET /admin/ticketing/activity admin list-activity +GET /admin/ticketing/bulk-operations/{} admin get-bulk-operations +GET /admin/ticketing/saved-filters admin list-saved-filters +GET /admin/ticketing/settings/{}/history admin get-history +GET /admin/ticketing/tickets admin list-tickets +GET /admin/ticketing/tickets/counts admin list-counts +GET /admin/ticketing/tickets/{} admin get-tickets +GET /admin/ui/preferences admin list-ui-preferences +GET /admin/ui/savedViews admin list-savedViews +GET /admin/user/current admin list-current +GET /admin/user/mapping admin list-mapping +GET /admin/user/mapping/suggestions admin list-suggestions +GET /admin/user/mappings admin list-mappings +GET /admin/user/{} admin get-user +GET /admin/users admin list-users +GET /admin/users/identity/{}/{} admin get-identity +GET /admin/users/{} admin get-users +GET /admin/users/{}/export admin get-export +GET /admin/users/{}/{} admin get-users-2 +GET /asset-graph/reachability asset-graph list-reachability +GET /asset-graph/search asset-graph list-search +GET /asset-graph/subgraph asset-graph list-subgraph +GET /asset-graph/summary asset-graph list-summary +GET /context/applications context list-applications +GET /context/applications/rebuilds/{} context get-rebuilds +GET /context/applications/{} context get-applications +GET /context/applications/{}/execution-recipe context get-applications-execution-recipe +GET /context/applications/{}/schema context get-applications-schema +GET /context/artifact-deployments context list-artifact-deployments +GET /context/artifact-deployments/{} context get-artifact-deployments +GET /context/artifacts context list-artifacts +GET /context/artifacts/{} context get-artifacts +GET /context/asset-graph/attack-paths context list-attack-paths +GET /context/asset-graph/landing context list-landing +GET /context/asset-graph/node context list-node +GET /context/asset-graph/nodes context list-nodes +GET /context/asset-graph/reachability context list-reachability +GET /context/asset-graph/retrieve context list-retrieve +GET /context/asset-graph/search context list-search +GET /context/asset-graph/subgraph context list-subgraph +GET /context/asset-graph/summary context list-asset-graph-summary +GET /context/asset-inventory context list-asset-inventory +GET /context/asset-inventory/ai-ml context list-ai-ml +GET /context/asset-inventory/ai-ml/{} context get-ai-ml +GET /context/asset-inventory/artifact-repositories context list-artifact-repositories +GET /context/asset-inventory/artifact-repositories/{} context get-artifact-repositories +GET /context/asset-inventory/artifacts context list-asset-inventory-artifacts +GET /context/asset-inventory/artifacts/{} context get-asset-inventory-artifacts +GET /context/asset-inventory/cdn-and-dns context list-cdn-and-dns +GET /context/asset-inventory/cdn-and-dns/{} context get-cdn-and-dns +GET /context/asset-inventory/ci-cd context list-ci-cd +GET /context/asset-inventory/ci-cd/{} context get-ci-cd +GET /context/asset-inventory/cloud-accounts context list-cloud-accounts +GET /context/asset-inventory/cloud-resources context list-cloud-resources +GET /context/asset-inventory/cluster context list-cluster +GET /context/asset-inventory/cluster/{} context get-cluster +GET /context/asset-inventory/compute context list-compute +GET /context/asset-inventory/compute/{} context get-compute +GET /context/asset-inventory/connectivity context list-connectivity +GET /context/asset-inventory/connectivity/{} context get-connectivity +GET /context/asset-inventory/container context list-container +GET /context/asset-inventory/container/{} context get-container +GET /context/asset-inventory/data-pipeline context list-data-pipeline +GET /context/asset-inventory/data-pipeline/{} context get-data-pipeline +GET /context/asset-inventory/database context list-database +GET /context/asset-inventory/database/{} context get-database +GET /context/asset-inventory/endpoints context list-endpoints +GET /context/asset-inventory/endpoints/{} context get-endpoints +GET /context/asset-inventory/identity context list-identity +GET /context/asset-inventory/identity/{} context get-identity +GET /context/asset-inventory/load-balancer context list-load-balancer +GET /context/asset-inventory/load-balancer/{} context get-load-balancer +GET /context/asset-inventory/messaging context list-messaging +GET /context/asset-inventory/messaging/{} context get-messaging +GET /context/asset-inventory/network context list-network +GET /context/asset-inventory/network/{} context get-network +GET /context/asset-inventory/observability context list-observability +GET /context/asset-inventory/observability/{} context get-observability +GET /context/asset-inventory/pipelines context list-pipelines +GET /context/asset-inventory/pipelines/{} context get-pipelines +GET /context/asset-inventory/projects context list-projects +GET /context/asset-inventory/projects/{} context get-projects +GET /context/asset-inventory/public context list-public +GET /context/asset-inventory/public-facing context list-public-facing +GET /context/asset-inventory/repos context list-repos +GET /context/asset-inventory/repos/{} context get-repos +GET /context/asset-inventory/resources context list-resources +GET /context/asset-inventory/security context list-security +GET /context/asset-inventory/security/{} context get-security +GET /context/asset-inventory/serverless context list-serverless +GET /context/asset-inventory/serverless/{} context get-serverless +GET /context/asset-inventory/storage-and-backup context list-storage-and-backup +GET /context/asset-inventory/storage-and-backup/{} context get-storage-and-backup +GET /context/cicd-pipelines context list-cicd-pipelines +GET /context/cicd-pipelines/{} context get-cicd-pipelines +GET /context/cloud-connector-pr/runs/{} context get-cloud-connector-pr-runs +GET /context/cloud-connector-pr/runs/{}/proposal context get-cloud-connector-pr-runs-proposal +GET /context/cloud-connector-pr/status context list-cloud-connector-pr-status +GET /context/cloud-recon/accounts/{}/cross-account-relationships context get-cross-account-relationships +GET /context/cloud-recon/accounts/{}/discovered-nodes context get-discovered-nodes +GET /context/cloud-recon/accounts/{}/graph-gaps context get-graph-gaps +GET /context/cloud-recon/accounts/{}/hotspots context get-hotspots +GET /context/cloud-recon/accounts/{}/iam-posture context get-iam-posture +GET /context/cloud-recon/accounts/{}/network-exposures context get-network-exposures +GET /context/cloud-recon/accounts/{}/overview context get-overview +GET /context/cloud-recon/accounts/{}/scans/latest context get-cloud-recon-accounts-scans-latest +GET /context/cloud-recon/accounts/{}/security-boundaries context get-security-boundaries +GET /context/cloud-recon/accounts/{}/synthesis/latest context get-latest +GET /context/cloud-recon/accounts/{}/topology context get-topology +GET /context/cloud-recon/accounts/{}/traffic-flows context get-traffic-flows +GET /context/cloud-recon/accounts/{}/trusted-services context get-trusted-services +GET /context/cloud-recon/organization/synthesis/latest context list-latest +GET /context/cloud-recon/tenants/cross-account-trusts context list-cross-account-trusts +GET /context/cloud-scan/{}/status context get-status +GET /context/deps context list-deps +GET /context/deps/active context list-active +GET /context/deps/active/summary context list-summary +GET /context/deps/by-ref/{} context get-by-ref +GET /context/deps/dependents/{} context get-dependents +GET /context/deps/exposure context list-exposure +GET /context/deps/repository/{}/project/{}/active context get-active +GET /context/deps/repository/{}/project/{}/at/{} context get-at +GET /context/deps/repository/{}/project/{}/diff context get-diff +GET /context/deps/repository/{}/project/{}/exposure context get-exposure +GET /context/deps/repository/{}/project/{}/history context get-history +GET /context/deps/without-lockfile context list-without-lockfile +GET /context/entrypoints context list-entrypoints +GET /context/entrypoints/{} context get-entrypoints +GET /context/infrastructure/graphs context list-graphs +GET /context/infrastructure/graphs/info context list-info +GET /context/infrastructure/graphs/summary context list-infrastructure-graphs-summary +GET /context/infrastructure/graphs/{} context get-graphs +GET /context/infrastructure/graphs/{}/download context get-download +GET /context/infrastructure/graphs/{}/versions context get-infrastructure-graphs-versions +GET /context/infrastructure/graphs/{}/versions/{} context get-infrastructure-graphs-versions-2 +GET /context/k8s/collector-clusters context list-collector-clusters +GET /context/memories context list-memories +GET /context/memories/document/{} context get-document +GET /context/memories/document/{}/type context get-type +GET /context/memories/type context list-type +GET /context/memories/{} context get-memories +GET /context/memories/{}/findings context get-findings +GET /context/memories/{}/versions context get-versions +GET /context/organization context list-organization +GET /context/organization/runs/{} context get-organization-runs +GET /context/repo-scans context list-repo-scans +GET /context/repo-scans/{} context get-repo-scans +GET /context/repo-scope/scans/{} context get-scans +GET /context/reports/{} context get-reports +GET /context/repositories context list-repositories +GET /context/repositories/{} context get-repositories +GET /context/repositories/{}/projects context get-repositories-projects +GET /context/repositories/{}/projects/{} context get-repositories-projects-2 +GET /context/repositories/{}/projects/{}/execution-recipe context get-repositories-projects-execution-recipe +GET /context/repositories/{}/projects/{}/execution-recipe/validations context get-validations +GET /context/repositories/{}/projects/{}/execution-recipe/versions context get-repositories-projects-execution-recipe-versions +GET /context/repositories/{}/projects/{}/schema context get-repositories-projects-schema +GET /context/repositories/{}/projects/{}/schema/metadata context get-metadata +GET /context/repositories/{}/projects/{}/schema/raw context get-raw +GET /context/sboms/repository/{}/latest context get-sboms-repository-latest +GET /context/sboms/repository/{}/project/{} context get-project +GET /context/sboms/tree context list-tree +GET /context/schemas context list-schemas +GET /context/setup-recommendations/pentest-assessments context list-pentest-assessments +GET /context/setup-recommendations/pentest-targets context list-pentest-targets +GET /context/vault/document/{}/text context get-text +GET /context/vault/file/{} context get-file +GET /context/vault/files context list-files +GET /context/vault/files/list context list-list +GET /context/waf-allowlist-pr/runs/{} context get-waf-allowlist-pr-runs +GET /context/waf-allowlist-pr/runs/{}/proposal context get-waf-allowlist-pr-runs-proposal +GET /context/waf-allowlist-pr/status context list-waf-allowlist-pr-status +GET /cspm/findings cspm list-findings +GET /cspm/findings/{} cspm get-findings +GET /cspm/findings/{}/autofix/activity cspm get-activity +GET /cspm/findings/{}/autofix/cache/diff cspm get-diff +GET /cspm/findings/{}/autofix/state cspm get-state +GET /cspm/findings/{}/autofix/status cspm get-status +GET /cspm/findings/{}/triage cspm get-triage +GET /cspm/scans cspm list-scans +GET /cspm/scans/{} cspm get-scans +GET /dast/applications dast list-applications-2 +GET /dast/applications/{} dast get-applications-2 +GET /dast/bughunt/config dast list-config +GET /dast/bughunt/findings dast list-bughunt-findings +GET /dast/bughunt/findings/{} dast get-bughunt-findings +GET /dast/bughunt/findings/{}/events dast get-bughunt-findings-events +GET /dast/bughunt/findings/{}/triage dast get-bughunt-findings-triage +GET /dast/bughunt/scans dast list-bughunt-scans +GET /dast/bughunt/scans/{} dast get-bughunt-scans +GET /dast/bughunt/scans/{}/activity dast get-bughunt-scans-activity +GET /dast/bughunt/scans/{}/diff dast get-bughunt-scans-diff +GET /dast/bughunt/scans/{}/findings dast get-bughunt-scans-findings +GET /dast/bughunt/scans/{}/logs dast get-bughunt-scans-logs +GET /dast/bughunt/scans/{}/status dast get-bughunt-scans-status +GET /dast/bughunt/suite-runs dast list-suite-runs +GET /dast/credentials dast list-credentials +GET /dast/credentials/{} dast get-credentials +GET /dast/credentials/{}/validations dast get-credentials-validations +GET /dast/credentials/{}/validations/status dast get-credentials-validations-status +GET /dast/exploit-validation/attempts dast list-attempts +GET /dast/exploit-validation/findings/{}/evidence/{} dast get-exploit-validation-findings-evidence +GET /dast/exploit-validation/policies dast list-policies +GET /dast/exploit-validation/runs/{} dast get-runs +GET /dast/pentest/applications dast list-applications +GET /dast/pentest/applications/{} dast get-applications +GET /dast/pentest/applications/{}/estimate dast get-estimate +GET /dast/pentest/applications/{}/preflight/latest dast get-latest +GET /dast/pentest/applications/{}/preflight/quota dast get-quota +GET /dast/pentest/budget dast list-budget +GET /dast/pentest/findings dast list-pentest-findings +GET /dast/pentest/findings/{} dast get-pentest-findings +GET /dast/pentest/findings/{}/autofix/activity dast get-activity +GET /dast/pentest/findings/{}/autofix/cache/diff dast get-pentest-findings-autofix-cache-diff +GET /dast/pentest/findings/{}/autofix/state dast get-state +GET /dast/pentest/findings/{}/autofix/status dast get-status +GET /dast/pentest/findings/{}/events dast get-pentest-findings-events +GET /dast/pentest/findings/{}/full dast get-full +GET /dast/pentest/findings/{}/triage dast get-pentest-findings-triage +GET /dast/pentest/mutation-warning dast list-mutation-warning +GET /dast/pentest/preflights/{} dast get-preflights +GET /dast/pentest/preflights/{}/events dast get-pentest-preflights-events +GET /dast/pentest/scans dast list-pentest-scans +GET /dast/pentest/scans/{} dast get-pentest-scans +GET /dast/pentest/scans/{}/activity dast get-pentest-scans-activity +GET /dast/pentest/scans/{}/auth-matrix/cases dast get-cases +GET /dast/pentest/scans/{}/auth-matrix/evidence dast get-pentest-scans-auth-matrix-evidence +GET /dast/pentest/scans/{}/events dast get-events +GET /dast/pentest/scans/{}/findings dast get-pentest-scans-findings +GET /dast/pentest/scans/{}/findings/links dast get-links +GET /dast/pentest/scans/{}/hypotheses dast get-hypotheses +GET /dast/pentest/scans/{}/logs dast get-pentest-scans-logs +GET /dast/pentest/scans/{}/logs/transactions dast get-transactions +GET /dast/pentest/scans/{}/report dast get-report +GET /dast/pentest/scans/{}/report/download dast get-download +GET /dast/pentest/scans/{}/report/external/pdf dast get-pentest-scans-report-external-pdf +GET /dast/pentest/scans/{}/report/pdf dast get-pentest-scans-report-pdf +GET /dast/pentest/scans/{}/status dast get-pentest-scans-status +GET /dast/scans/status/last dast list-last +GET /dast/sourceips dast list-sourceips +GET /dast/targets dast list-targets +GET /dast/targets/{} dast get-targets +GET /dast/targets/{}/exploit-validation-consent dast get-exploit-validation-consent +GET /dast/targets/{}/validations dast get-targets-validations +GET /dast/web-services dast list-web-services +GET /dast/web-services/{} dast get-web-services +GET /dast/web-services/{}/access-validations dast get-access-validations +GET /dast/web-services/{}/credentials dast get-web-services-credentials +GET /dast/web-services/{}/status-validations dast get-status-validations +GET /findings/{}/feedback findings get-feedback +GET /infrastructure/graphs infrastructure list-graphs +GET /infrastructure/graphs/info infrastructure list-info +GET /infrastructure/graphs/summary infrastructure list-summary +GET /infrastructure/graphs/{} infrastructure get-graphs +GET /infrastructure/graphs/{}/download infrastructure get-download +GET /infrastructure/graphs/{}/versions infrastructure get-graphs-versions +GET /infrastructure/graphs/{}/versions/{} infrastructure get-graphs-versions-2 +GET /manager/action-items manager list-action-items +GET /manager/action-items/summary manager list-summary +GET /manager/action-items/{} manager get-action-items +GET /manager/action-items/{}/messages manager get-messages +GET /manager/campaigns manager list-campaigns +GET /manager/campaigns/default manager list-default +GET /manager/campaigns/findings manager list-findings +GET /manager/campaigns/metrics/refresh manager list-refresh +GET /manager/campaigns/previews manager list-previews +GET /manager/campaigns/summaries manager list-summaries +GET /manager/campaigns/{} manager get-campaigns +GET /manager/campaigns/{}/events manager get-campaigns-events +GET /manager/campaigns/{}/findings manager get-findings +GET /manager/campaigns/{}/preview manager get-preview +GET /manager/campaigns/{}/runs manager get-campaigns-runs +GET /manager/campaigns/{}/runs/{} manager get-campaigns-runs-2 +GET /manager/chat/sessions manager list-sessions +GET /manager/chat/sessions/{} manager get-sessions +GET /manager/chat/sessions/{}/actions manager get-actions +GET /manager/chat/sessions/{}/audit manager get-audit +GET /manager/chat/sessions/{}/history manager get-history +GET /manager/config manager list-config +GET /manager/credits manager list-credits +GET /manager/customer-questions manager list-customer-questions +GET /manager/customer-questions/{} manager get-customer-questions +GET /manager/engagement/users manager list-users +GET /manager/escalation-recipients manager list-escalation-recipients +GET /manager/escalations manager list-escalations +GET /manager/escalations/config manager list-escalations-config +GET /manager/events manager list-events +GET /manager/findings/{}/events manager get-findings-events +GET /manager/fix-prs/{}/nudge manager get-nudge +GET /manager/groundrules manager list-groundrules +GET /manager/identity-classifications manager list-identity-classifications +GET /manager/metrics manager list-metrics +GET /manager/plans manager list-plans +GET /manager/program manager list-program +GET /manager/proposals manager list-proposals +GET /manager/runs/{} manager get-runs +GET /manager/state manager list-state +GET /manager/state/latest manager list-latest +GET /manager/states manager list-states +GET /manager/strategy manager list-strategy +GET /manager/strategy/proposal manager list-proposal +GET /manager/strategy/versions manager list-versions +GET /manager/threat-investigations manager list-threat-investigations +GET /manager/threat-investigations/{} manager get-threat-investigations +GET /manager/threat-investigations/{}/progress manager get-progress +GET /manager/threat-reports manager list-threat-reports +GET /manager/threat-reports/{} manager get-threat-reports +GET /manager/threats manager list-threats +GET /orchestrator/autofix/batch/{} orchestrator get-batch +GET /orchestrator/checkruns orchestrator list-checkruns +GET /orchestrator/codereviews orchestrator list-codereviews +GET /orchestrator/codereviews/{} orchestrator get-codereviews +GET /orchestrator/findings/retriage/{} orchestrator get-retriage +GET /orchestrator/findings/{}/autofix-iterations orchestrator get-autofix-iterations +GET /orchestrator/onboarding/requirements orchestrator list-requirements +GET /orchestrator/onboarding/status orchestrator list-status +GET /orchestrator/repositories/{}/scans/{} orchestrator get-scans +GET /orchestrator/runs/{}/{}/control/capabilities orchestrator get-capabilities +GET /sast/events sast list-events +GET /sast/findings sast list-findings +GET /sast/findings/detailed sast list-detailed +GET /sast/findings/preview sast list-preview +GET /sast/findings/{} sast get-findings +GET /sast/findings/{}/autofix/activity sast get-activity +GET /sast/findings/{}/autofix/cache/diff sast get-diff +GET /sast/findings/{}/autofix/state sast get-state +GET /sast/findings/{}/autofix/status sast get-status +GET /sast/findings/{}/events sast get-events +GET /sast/findings/{}/triage sast get-triage +GET /sast/findings/{}/users sast get-users +GET /sast/repositories sast list-repositories +GET /sast/repositories/{} sast get-repositories +GET /sast/scan-runs sast list-scan-runs +GET /sca/containers/findings sca list-containers-findings +GET /sca/containers/findings/detailed sca list-containers-findings-detailed +GET /sca/containers/findings/preview sca list-containers-findings-preview +GET /sca/containers/findings/{} sca get-containers-findings +GET /sca/containers/findings/{}/autofix/activity sca get-containers-findings-autofix-activity +GET /sca/containers/findings/{}/autofix/state sca get-containers-findings-autofix-state +GET /sca/containers/findings/{}/autofix/status sca get-containers-findings-autofix-status +GET /sca/containers/findings/{}/events sca get-containers-findings-events +GET /sca/containers/findings/{}/triage sca get-containers-findings-triage +GET /sca/containers/findings/{}/triage/activity sca get-containers-findings-triage-activity +GET /sca/containers/findings/{}/triage/status sca get-containers-findings-triage-status +GET /sca/containers/findings/{}/users sca get-containers-findings-users +GET /sca/dependencies/findings sca list-dependencies-findings +GET /sca/dependencies/findings/detailed sca list-dependencies-findings-detailed +GET /sca/dependencies/findings/preview sca list-dependencies-findings-preview +GET /sca/dependencies/findings/{} sca get-dependencies-findings +GET /sca/dependencies/findings/{}/autofix/activity sca get-dependencies-findings-autofix-activity +GET /sca/dependencies/findings/{}/autofix/cache/diff sca get-diff +GET /sca/dependencies/findings/{}/autofix/state sca get-dependencies-findings-autofix-state +GET /sca/dependencies/findings/{}/autofix/status sca get-dependencies-findings-autofix-status +GET /sca/dependencies/findings/{}/events sca get-dependencies-findings-events +GET /sca/dependencies/findings/{}/triage sca get-dependencies-findings-triage +GET /sca/dependencies/findings/{}/triage/activity sca get-dependencies-findings-triage-activity +GET /sca/dependencies/findings/{}/triage/status sca get-dependencies-findings-triage-status +GET /sca/dependencies/findings/{}/users sca get-dependencies-findings-users +GET /sca/events sca list-events +GET /sca/repositories sca list-repositories +GET /sca/repositories/{} sca get-repositories +GET /sca/repositories/{}/sbom sca get-sbom +GET /sca/scan-runs sca list-scan-runs +GET /sca/threat-feed sca list-threat-feed +GET /sca/threat-feed/{} sca get-threat-feed +GET /sca/vulnerabilities sca list-vulnerabilities +GET /sca/vulnerabilities/{} sca get-vulnerabilities +GET /sca/vulnerabilities/{}/findings sca get-findings +GET /sca/vulnerabilities/{}/packages sca get-packages +GET /scpm/dependencies scpm list-dependencies +GET /scpm/events scpm list-events +GET /scpm/findings scpm list-findings +GET /scpm/findings/detailed scpm list-detailed +GET /scpm/findings/preview scpm list-preview +GET /scpm/findings/{} scpm get-findings +GET /scpm/findings/{}/autofix/activity scpm get-activity +GET /scpm/findings/{}/autofix/cache/diff scpm get-diff +GET /scpm/findings/{}/autofix/state scpm get-state +GET /scpm/findings/{}/autofix/status scpm get-status +GET /scpm/findings/{}/events scpm get-events +GET /scpm/findings/{}/triage scpm get-triage +GET /scpm/findings/{}/users scpm get-users +GET /scpm/repositories scpm list-repositories +GET /scpm/scan-runs scpm list-scan-runs +GET /scpm/settings scpm list-settings +GET /secrets/credentials/findings secrets list-credentials-findings +GET /secrets/credentials/findings/detailed secrets list-credentials-findings-detailed +GET /secrets/credentials/findings/{} secrets get-credentials-findings +GET /secrets/credentials/findings/{}/events secrets get-credentials-findings-events +GET /secrets/credentials/findings/{}/triage secrets get-credentials-findings-triage +GET /secrets/credentials/findings/{}/users secrets get-credentials-findings-users +GET /secrets/events secrets list-events +GET /secrets/findings secrets list-findings +GET /secrets/findings/detailed secrets list-findings-detailed +GET /secrets/findings/preview secrets list-preview +GET /secrets/findings/{} secrets get-findings +GET /secrets/findings/{}/events secrets get-findings-events +GET /secrets/findings/{}/triage secrets get-findings-triage +GET /secrets/findings/{}/users secrets get-findings-users +GET /secrets/scan-runs secrets list-scan-runs +GET /secrets/sensitivedata/findings secrets list-sensitivedata-findings +GET /secrets/sensitivedata/findings/{} secrets get-sensitivedata-findings +GET /secrets/sensitivedata/findings/{}/triage secrets get-sensitivedata-findings-triage +GET /secrets/sensitivedata/findings/{}/users secrets get-sensitivedata-findings-users +PATCH /admin/sla/{} admin patch-sla +PATCH /admin/teams/{} admin patch-teams +PATCH /admin/ticketing/saved-filters/{} admin patch-saved-filters +PATCH /admin/ui/savedViews/{} admin patch-savedViews +PATCH /context/applications/{} context patch-applications +PATCH /context/asset-inventory/{}/{}/flags context patch-flags +PATCH /context/asset-inventory/{}/{}/tags context patch-tags +PATCH /context/memories/{} context patch-memories +PATCH /context/organization context patch-organization +PATCH /context/repo-scans/{} context patch-repo-scans +PATCH /context/repositories/{} context patch-repositories +PATCH /context/repositories/{}/projects/{} context patch-projects +PATCH /context/vault/file/{} context patch-file +PATCH /cspm/findings/{} cspm patch-findings +PATCH /dast/bughunt/findings/{}/allowlist dast patch-allowlist +PATCH /dast/pentest/applications/{} dast patch-applications +PATCH /manager/action-items/{} manager patch-action-items +PATCH /manager/campaigns/{} manager patch-campaigns +PATCH /manager/chat/sessions/{} manager patch-sessions +PATCH /manager/customer-questions/{}/answers/{} manager patch-answers +PATCH /manager/escalations/{} manager patch-escalations +PATCH /manager/groundrules manager patch-groundrules +PATCH /manager/program manager patch-program +PATCH /manager/strategy manager patch-strategy +PATCH /manager/threat-investigations/{} manager patch-threat-investigations +PATCH /sast/findings/{} sast patch-findings +PATCH /sca/containers/findings/{} sca patch-containers-findings +PATCH /sca/dependencies/findings/{} sca patch-dependencies-findings +PATCH /scpm/findings/{} scpm patch-findings +PATCH /secrets/credentials/findings/{} secrets patch-credentials-findings +PATCH /secrets/findings/{} secrets patch-findings +PATCH /secrets/sensitivedata/findings/{} secrets patch-sensitivedata-findings +POST /admin/context/ingest admin create-ingest +POST /admin/events admin create-events +POST /admin/findings admin create-findings +POST /admin/findings/download admin create-download +POST /admin/findings/groups admin create-groups +POST /admin/findings/progress admin create-progress +POST /admin/getFileOwners admin create-getFileOwners +POST /admin/identity/entra/connect admin create-identity-entra-connect +POST /admin/identity/entra/handoff admin create-handoff +POST /admin/identity/entra/link admin create-link +POST /admin/identity/entra/sign-in admin create-sign-in +POST /admin/identity/scim/credentials admin create-identity-scim-credentials +POST /admin/integrations/asana/ticket-config admin create-integrations-asana-ticket-config +POST /admin/integrations/atlassian admin create-atlassian +POST /admin/integrations/azure admin create-azure +POST /admin/integrations/azure/codeowners/preview admin create-integrations-azure-codeowners-preview +POST /admin/integrations/azure/connect admin create-integrations-azure-connect +POST /admin/integrations/azure/connect/{}/confirm admin create-confirm-by-id +POST /admin/integrations/azure/connect/{}/recheck admin create-recheck-by-id +POST /admin/integrations/azure/connect/{}/retry admin create-retry-by-id +POST /admin/integrations/azure/credentials admin create-credentials +POST /admin/integrations/azure/installations admin create-installations +POST /admin/integrations/azure/installations/suspend admin create-suspend +POST /admin/integrations/azure/installations/test admin create-test +POST /admin/integrations/buildkite/organizations admin create-organizations +POST /admin/integrations/buildkite/token admin create-integrations-buildkite-token +POST /admin/integrations/circleci/token admin create-integrations-circleci-token +POST /admin/integrations/cloud/aws/settings admin create-integrations-cloud-aws-settings +POST /admin/integrations/cloud/aws/validate-role admin create-validate-role +POST /admin/integrations/cloud/azure/settings admin create-integrations-cloud-azure-settings +POST /admin/integrations/cloud/azure/validate admin create-integrations-cloud-azure-validate +POST /admin/integrations/cloud/gcp/access-token admin create-access-token +POST /admin/integrations/cloud/gcp/settings admin create-integrations-cloud-gcp-settings +POST /admin/integrations/cloud/gcp/validate admin create-validate +POST /admin/integrations/cloud/k8s/clusters admin create-clusters +POST /admin/integrations/cloud/k8s/settings admin create-settings +POST /admin/integrations/cloud/k8s/whitelist admin create-whitelist +POST /admin/integrations/connections/{}/test admin create-integrations-connections-test-by-id +POST /admin/integrations/github-packages/discover admin create-discover +POST /admin/integrations/gitlab/connect admin create-integrations-gitlab-connect +POST /admin/integrations/gitlab/connect/confirm admin create-confirm +POST /admin/integrations/jenkins/token admin create-integrations-jenkins-token +POST /admin/integrations/jira admin create-jira +POST /admin/integrations/linear/ticket-config admin create-integrations-linear-ticket-config +POST /admin/integrations/slack/key admin create-key +POST /admin/integrations/{}/{}/connect admin create-connect-by-id +POST /admin/integrations/{}/{}/connections admin create-connections-by-id +POST /admin/integrations/{}/{}/test admin create-integrations-test-by-id +POST /admin/metrics/findings admin create-metrics-findings +POST /admin/metrics/findings/by-repository admin create-by-repository +POST /admin/metrics/findings/frameworks admin create-frameworks +POST /admin/metrics/over-time admin create-over-time +POST /admin/metrics/overview admin create-overview +POST /admin/metrics/pullrequests admin create-metrics-pullrequests +POST /admin/metrics/raw admin create-raw +POST /admin/metrics/tickets admin create-tickets +POST /admin/network/ip-allowlist/preview admin create-network-ip-allowlist-preview +POST /admin/operator/external-writes/initialize admin create-operator-external-writes-initialize +POST /admin/operator/github-tenant/route admin create-operator-github-tenant-route +POST /admin/operator/native-tenant/route admin create-operator-native-tenant-route +POST /admin/operator/package-feeds admin create-package-feeds +POST /admin/operator/workspace-bootstrap/approve admin create-approve +POST /admin/operator/workspace-bootstrap/invitation admin create-invitation +POST /admin/operator/workspace-bootstrap/renew admin create-renew +POST /admin/operator/workspace-bootstrap/revoke admin create-revoke +POST /admin/privacy/acknowledgment admin create-acknowledgment +POST /admin/pullrequests admin create-pullrequests +POST /admin/pullrequests/refresh-ci admin create-refresh-ci +POST /admin/repositories/initialize admin create-initialize +POST /admin/repositories/uninitialize admin create-uninitialize +POST /admin/repository-property-team-keys admin create-repository-property-team-keys +POST /admin/service_accounts admin create-service_accounts +POST /admin/sla admin create-sla +POST /admin/support-access admin create-support-access +POST /admin/team-sync-runs admin create-team-sync-runs +POST /admin/teams admin create-teams +POST /admin/teams/compass admin create-compass +POST /admin/teams/findings admin create-teams-findings +POST /admin/teams/findings/sync admin create-sync +POST /admin/teams/merge admin create-merge +POST /admin/teams/sla-breakdown admin create-sla-breakdown +POST /admin/teams/{}/code-ownership admin create-code-ownership-by-id +POST /admin/teams/{}/events admin create-events-by-id +POST /admin/ticketing/bulk-operations/{}/cancel admin create-cancel-by-id +POST /admin/ticketing/saved-filters admin create-saved-filters +POST /admin/ticketing/settings/{} admin create-settings-by-id +POST /admin/ticketing/settings/{}/preview admin create-preview-by-id +POST /admin/ticketing/tickets/bulk-add-comment admin create-bulk-add-comment +POST /admin/ticketing/tickets/bulk-close admin create-bulk-close +POST /admin/ticketing/tickets/bulk-move admin create-bulk-move +POST /admin/ticketing/tickets/bulk-reassign-assignee admin create-bulk-reassign-assignee +POST /admin/ticketing/tickets/bulk-reassign-team admin create-bulk-reassign-team +POST /admin/ticketing/tickets/bulk-relabel admin create-bulk-relabel +POST /admin/ticketing/tickets/bulk-reopen admin create-bulk-reopen +POST /admin/ticketing/tickets/bulk-resync admin create-bulk-resync +POST /admin/ticketing/tickets/bulk-set-priority admin create-bulk-set-priority +POST /admin/triage/context-census admin create-context-census +POST /admin/ui/savedViews admin create-savedViews +POST /admin/user/mapping admin create-mapping +POST /admin/users admin create-users +POST /admin/users/activate admin create-activate +POST /admin/users/bulkSearchMappings admin create-bulkSearchMappings +POST /admin/users/deactivate admin create-deactivate +POST /admin/users/reactivate admin create-reactivate +POST /context/applications context create-applications +POST /context/applications/rebuild context create-rebuild +POST /context/cloud-connector-pr/runs context create-cloud-connector-pr-runs +POST /context/cloud-connector-pr/runs/{}/approve context create-cloud-connector-pr-runs-approve-by-id +POST /context/cloud-connector-pr/runs/{}/recover context create-cloud-connector-pr-runs-recover-by-id +POST /context/cloud-recon/scans context create-scans +POST /context/cloud-scan/start context create-start +POST /context/memories context create-memories +POST /context/memories/grep context create-grep +POST /context/memories/search context create-memories-search +POST /context/memories/{}/retract context create-retract-by-id +POST /context/rag/resync context create-resync +POST /context/repo-scans context create-repo-scans +POST /context/repo-scope/scans context create-repo-scope-scans +POST /context/reports context create-reports +POST /context/repositories/{}/execution-recipes/discover context create-discover-by-id +POST /context/repositories/{}/projects/{}/schema context create-schema-by-id +POST /context/repositories/{}/projects/{}/schema/trigger context create-repositories-projects-schema-trigger-by-id +POST /context/repositories/{}/repo-context/trigger context create-repositories-repo-context-trigger-by-id +POST /context/sbomingestor/replay context create-replay +POST /context/sboms/generate context create-generate +POST /context/sboms/resolve context create-resolve +POST /context/sboms/runs context create-sboms-runs +POST /context/sboms/scan context create-scan +POST /context/setup-recommendations/pentest-assessments/refresh context create-setup-recommendations-pentest-assessments-refresh +POST /context/setup-recommendations/pentest-assessments/{}/accept context create-setup-recommendations-pentest-assessments-accept-by-id +POST /context/setup-recommendations/pentest-assessments/{}/dismiss context create-setup-recommendations-pentest-assessments-dismiss-by-id +POST /context/setup-recommendations/pentest-targets/refresh context create-setup-recommendations-pentest-targets-refresh +POST /context/setup-recommendations/pentest-targets/{}/accept context create-setup-recommendations-pentest-targets-accept-by-id +POST /context/setup-recommendations/pentest-targets/{}/dismiss context create-setup-recommendations-pentest-targets-dismiss-by-id +POST /context/vault/file context create-file +POST /context/vault/index context create-index +POST /context/vault/onboard context create-onboard +POST /context/vault/search context create-vault-search +POST /context/waf-allowlist-pr/runs context create-waf-allowlist-pr-runs +POST /context/waf-allowlist-pr/runs/{}/approve context create-waf-allowlist-pr-runs-approve-by-id +POST /context/waf-allowlist-pr/runs/{}/recover context create-waf-allowlist-pr-runs-recover-by-id +POST /cspm/findings/{}/allowlist cspm create-allowlist-by-id +POST /cspm/findings/{}/archive cspm create-archive-by-id +POST /cspm/findings/{}/autofix/fix cspm create-fix-by-id +POST /cspm/findings/{}/mark-false-positive cspm create-mark-false-positive-by-id +POST /cspm/findings/{}/ticket cspm create-ticket-by-id +POST /cspm/findings/{}/unallowlist cspm create-unallowlist-by-id +POST /cspm/findings/{}/unarchive cspm create-unarchive-by-id +POST /cspm/findings/{}/unmark-false-positive cspm create-unmark-false-positive-by-id +POST /cspm/scans/start cspm create-start +POST /dast/applications dast create-applications-2 +POST /dast/applications/from-context dast create-from-context +POST /dast/applications/readiness dast create-readiness +POST /dast/bughunt/config/validate dast create-validate +POST /dast/bughunt/findings/{}/ticket dast create-bughunt-findings-ticket-by-id +POST /dast/bughunt/program/import dast create-import +POST /dast/bughunt/scans dast create-scans +POST /dast/bughunt/scans/{}/stop dast create-bughunt-scans-stop-by-id +POST /dast/bughunt/suites/{}/run-now dast create-run-now-by-id +POST /dast/credentials dast create-credentials +POST /dast/credentials/validate dast create-credentials-validate +POST /dast/credentials/{}/validate dast create-validate-by-id +POST /dast/credentials/{}/validations dast create-validations-by-id +POST /dast/exploit-validation/findings/{}/validate dast create-exploit-validation-findings-validate-by-id +POST /dast/exploit-validation/policies dast create-policies +POST /dast/exploit-validation/policies/{}/arm dast create-arm-by-id +POST /dast/exploit-validation/policies/{}/disarm dast create-disarm-by-id +POST /dast/pentest/applications dast create-applications +POST /dast/pentest/applications/{}/preflight dast create-preflight-by-id +POST /dast/pentest/findings/{}/allowlist dast create-allowlist-by-id +POST /dast/pentest/findings/{}/autofix/fix dast create-fix-by-id +POST /dast/pentest/findings/{}/ticket dast create-ticket-by-id +POST /dast/pentest/findings/{}/unallowlist dast create-unallowlist-by-id +POST /dast/pentest/scans/{}/stop dast create-pentest-scans-stop-by-id +POST /dast/pentest/start dast create-start +POST /dast/targets dast create-targets +POST /dast/targets/validate dast create-targets-validate +POST /dast/targets/{}/validate dast create-targets-validate-by-id +POST /dast/web-services dast create-web-services +POST /dast/web-services/{}/access-validation dast create-access-validation-by-id +POST /dast/web-services/{}/credentials dast create-credentials-by-id +POST /dast/web-services/{}/status-validation dast create-status-validation-by-id +POST /findings/{}/feedback findings create-feedback-by-id +POST /manager/action-items/{}/answer manager create-answer-by-id +POST /manager/action-items/{}/assign-repo manager create-assign-repo-by-id +POST /manager/action-items/{}/assign-team manager create-assign-team-by-id +POST /manager/action-items/{}/dismiss manager create-dismiss-by-id +POST /manager/action-items/{}/map-user manager create-map-user-by-id +POST /manager/action-items/{}/nudge manager create-action-items-nudge-by-id +POST /manager/action-items/{}/reopen manager create-reopen-by-id +POST /manager/action-items/{}/snooze manager create-snooze-by-id +POST /manager/campaigns manager create-campaigns +POST /manager/campaigns/default/generate manager create-generate +POST /manager/config manager create-config +POST /manager/credits manager create-credits +POST /manager/daily-summary/trigger manager create-daily-summary-trigger +POST /manager/events/deduplicate manager create-deduplicate +POST /manager/fix-prs/{}/nudge manager create-fix-prs-nudge-by-id +POST /manager/groundrules manager create-groundrules +POST /manager/identity-classifications manager create-identity-classifications +POST /manager/onboarding/wizard-progress manager create-wizard-progress +POST /manager/proposals/decision manager create-proposals-decision +POST /manager/strategy/proposal/decision manager create-strategy-proposal-decision +POST /manager/strategy/trigger manager create-strategy-trigger +POST /manager/tacit-knowledge/trigger manager create-tacit-knowledge-trigger +POST /manager/threat-investigations manager create-threat-investigations +POST /manager/threat-reports manager create-threat-reports +POST /manager/threat-reports/{}/resubmit manager create-resubmit-by-id +POST /manager/threat-reports/{}/withdraw manager create-withdraw-by-id +POST /manager/threats/{}/investigate manager create-investigate-by-id +POST /manager/trigger manager create-trigger +POST /orchestrator/autofix/batch orchestrator create-batch +POST /orchestrator/autofix/iterate-pr orchestrator create-iterate-pr +POST /orchestrator/checkruns/override orchestrator create-override +POST /orchestrator/findings/retriage orchestrator create-retriage +POST /orchestrator/findings/{}/ticket/close orchestrator create-close-by-id +POST /orchestrator/onboarding/complete orchestrator create-complete +POST /orchestrator/onboarding/start orchestrator create-start +POST /orchestrator/repositories/{}/pull-requests/{}/reviews orchestrator create-reviews-by-id +POST /orchestrator/repositories/{}/scans orchestrator create-scans-by-id +POST /orchestrator/runs/{}/{}/control orchestrator create-control-by-id +POST /sast/findings/allowlist sast create-allowlist +POST /sast/findings/{}/allowlist sast create-allowlist-by-id +POST /sast/findings/{}/autofix/fix sast create-fix-by-id +POST /sast/findings/{}/ticket sast create-ticket-by-id +POST /sast/findings/{}/unallowlist sast create-unallowlist-by-id +POST /sca/containers/findings/{}/allowlist sca create-containers-findings-allowlist-by-id +POST /sca/containers/findings/{}/autofix/fix sca create-containers-findings-autofix-fix-by-id +POST /sca/containers/findings/{}/ticket sca create-containers-findings-ticket-by-id +POST /sca/containers/findings/{}/unallowlist sca create-containers-findings-unallowlist-by-id +POST /sca/dependencies/findings/{}/allowlist sca create-dependencies-findings-allowlist-by-id +POST /sca/dependencies/findings/{}/autofix/fix sca create-dependencies-findings-autofix-fix-by-id +POST /sca/dependencies/findings/{}/ticket sca create-dependencies-findings-ticket-by-id +POST /sca/dependencies/findings/{}/unallowlist sca create-dependencies-findings-unallowlist-by-id +POST /scpm/containers/analyze scpm create-containers-analyze +POST /scpm/dependencies/analyze scpm create-dependencies-analyze +POST /scpm/dependencies/query/batch scpm create-batch +POST /scpm/findings/allowlist scpm create-allowlist +POST /scpm/findings/retriage scpm create-retriage +POST /scpm/findings/upload scpm create-upload +POST /scpm/findings/{}/allowlist scpm create-allowlist-by-id +POST /scpm/findings/{}/autofix/cache scpm create-cache-by-id +POST /scpm/findings/{}/autofix/cache/create_pr scpm create-create_pr-by-id +POST /scpm/findings/{}/autofix/fix scpm create-fix-by-id +POST /scpm/findings/{}/ticket scpm create-ticket-by-id +POST /scpm/findings/{}/unallowlist scpm create-unallowlist-by-id +POST /scpm/findings/{}/unmark-false-positive scpm create-unmark-false-positive-by-id +POST /secrets/credentials/findings/allowlist/batch secrets create-credentials-findings-allowlist-batch +POST /secrets/credentials/findings/{}/allowlist secrets create-credentials-findings-allowlist-by-id +POST /secrets/credentials/findings/{}/ticket secrets create-credentials-findings-ticket-by-id +POST /secrets/credentials/findings/{}/unallowlist secrets create-credentials-findings-unallowlist-by-id +POST /secrets/findings/allowlist/batch secrets create-findings-allowlist-batch +POST /secrets/findings/{}/allowlist secrets create-findings-allowlist-by-id +POST /secrets/findings/{}/ticket secrets create-findings-ticket-by-id +POST /secrets/findings/{}/unallowlist secrets create-findings-unallowlist-by-id +POST /secrets/sensitivedata/findings/allowlist/batch secrets create-sensitivedata-findings-allowlist-batch +POST /secrets/sensitivedata/findings/{}/allowlist secrets create-sensitivedata-findings-allowlist-by-id +POST /secrets/sensitivedata/findings/{}/ticket secrets create-sensitivedata-findings-ticket-by-id +POST /secrets/sensitivedata/findings/{}/unallowlist secrets create-sensitivedata-findings-unallowlist-by-id +PUT /admin/access/preferences admin update-access-preferences +PUT /admin/access/users/roles admin update-roles +PUT /admin/config/routing-exclusions admin update-routing-exclusions +PUT /admin/config/security-owner admin update-security-owner +PUT /admin/external-writes admin update-external-writes +PUT /admin/fix-effort admin update-fix-effort +PUT /admin/identity/entra/policy admin update-policy +PUT /admin/integrations/connections/{}/rotate admin update-rotate +PUT /admin/integrations/notifications admin update-notifications +PUT /admin/integrations/threat-intel/destinations admin update-destinations +PUT /admin/integrations/{}/{}/configure admin update-configure +PUT /admin/manager/settings admin update-settings +PUT /admin/network/ip-allowlist admin update-ip-allowlist +PUT /admin/operator/scan-entitlement admin update-scan-entitlement +PUT /admin/operator/scan-scope/repositories admin update-repositories +PUT /admin/operator/tenant-capabilities admin update-operator-tenant-capabilities +PUT /admin/pr-gate-settings admin update-pr-gate-settings +PUT /admin/repositories/scan-scope admin update-repositories-scan-scope +PUT /admin/scan-scope admin update-scan-scope +PUT /admin/settings/cspm-scan-cadence admin update-cspm-scan-cadence +PUT /admin/settings/inference-region admin update-inference-region +PUT /admin/sla/bulk admin update-bulk +PUT /admin/team-source-preferences admin update-team-source-preferences +PUT /admin/tenant-capabilities/{} admin update-tenant-capabilities +PUT /admin/ui/preferences admin update-ui-preferences +PUT /admin/user/mapping/{} admin update-mapping +PUT /context/organization context update-organization +PUT /dast/applications/{} dast update-applications-2 +PUT /dast/bughunt/config dast update-config +PUT /dast/credentials/{} dast update-credentials +PUT /dast/credentials/{}/active dast update-active +PUT /dast/exploit-validation/policies/{} dast update-policies +PUT /dast/pentest/applications/{} dast update-applications +PUT /dast/pentest/applications/{}/mutation-consent dast update-mutation-consent +PUT /dast/targets/{} dast update-targets +PUT /dast/targets/{}/classification dast update-classification +PUT /dast/targets/{}/exploit-validation-consent dast update-exploit-validation-consent +PUT /dast/web-services/{} dast update-web-services +PUT /manager/action-items/{}/chat manager update-chat +PUT /manager/chat/general manager update-general +PUT /manager/escalations/config manager update-config +PUT /scpm/settings scpm update-settings diff --git a/spec/command-surface.tsv b/spec/command-surface.tsv new file mode 100644 index 0000000..2bf898d --- /dev/null +++ b/spec/command-surface.tsv @@ -0,0 +1,1013 @@ +nullify debug,github-token,host,no-color,nullify-token,output,quiet,verbose active +nullify api active +nullify api admin active +nullify api admin create-access-token POST /admin/integrations/cloud/gcp/access-token github-installation-id active +nullify api admin create-acknowledgment POST /admin/privacy/acknowledgment data,data-file,github-installation-id active +nullify api admin create-activate POST /admin/users/activate data,data-file,github-installation-id active +nullify api admin create-approve POST /admin/operator/workspace-bootstrap/approve data,data-file active +nullify api admin create-atlassian POST /admin/integrations/atlassian data,data-file,github-installation-id active +nullify api admin create-azure POST /admin/integrations/azure dry-run,github-installation-id,reconcile active +nullify api admin create-bulk-add-comment POST /admin/ticketing/tickets/bulk-add-comment data,data-file,github-installation-id active +nullify api admin create-bulk-close POST /admin/ticketing/tickets/bulk-close data,data-file,github-installation-id active +nullify api admin create-bulk-move POST /admin/ticketing/tickets/bulk-move data,data-file,github-installation-id active +nullify api admin create-bulk-reassign-assignee POST /admin/ticketing/tickets/bulk-reassign-assignee data,data-file,github-installation-id active +nullify api admin create-bulk-reassign-team POST /admin/ticketing/tickets/bulk-reassign-team data,data-file,github-installation-id active +nullify api admin create-bulk-relabel POST /admin/ticketing/tickets/bulk-relabel data,data-file,github-installation-id active +nullify api admin create-bulk-reopen POST /admin/ticketing/tickets/bulk-reopen data,data-file,github-installation-id active +nullify api admin create-bulk-resync POST /admin/ticketing/tickets/bulk-resync data,data-file,github-installation-id active +nullify api admin create-bulk-set-priority POST /admin/ticketing/tickets/bulk-set-priority data,data-file,github-installation-id active +nullify api admin create-bulkSearchMappings POST /admin/users/bulkSearchMappings data,data-file,github-installation-id active +nullify api admin create-by-repository POST /admin/metrics/findings/by-repository data,data-file,github-installation-id active +nullify api admin create-cancel-by-id POST /admin/ticketing/bulk-operations/{operationId}/cancel github-installation-id active +nullify api admin create-clusters POST /admin/integrations/cloud/k8s/clusters data,data-file,github-installation-id active +nullify api admin create-code-ownership-by-id POST /admin/teams/{teamID}/code-ownership data,data-file,github-installation-id active +nullify api admin create-compass POST /admin/teams/compass data,data-file,github-installation-id active +nullify api admin create-confirm POST /admin/integrations/gitlab/connect/confirm data,data-file,github-installation-id active +nullify api admin create-confirm-by-id POST /admin/integrations/azure/connect/{handle}/confirm data,data-file,github-installation-id active +nullify api admin create-connect-by-id POST /admin/integrations/{providerId}/{capability}/connect data,data-file,github-installation-id active +nullify api admin create-connections-by-id POST /admin/integrations/{providerId}/{capability}/connections data,data-file,github-installation-id active +nullify api admin create-context-census POST /admin/triage/context-census data,data-file,github-installation-id active +nullify api admin create-credentials POST /admin/integrations/azure/credentials data,data-file,github-installation-id active +nullify api admin create-deactivate POST /admin/users/deactivate data,data-file,github-installation-id active +nullify api admin create-discover POST /admin/integrations/github-packages/discover data,data-file,github-installation-id active +nullify api admin create-download POST /admin/findings/download data,data-file,github-installation-id active +nullify api admin create-events POST /admin/events data,data-file,github-installation-id active +nullify api admin create-events-by-id POST /admin/teams/{teamID}/events data,data-file,github-installation-id active +nullify api admin create-findings POST /admin/findings data,data-file,github-installation-id active +nullify api admin create-frameworks POST /admin/metrics/findings/frameworks github-installation-id active +nullify api admin create-getFileOwners POST /admin/getFileOwners data,data-file,github-installation-id active +nullify api admin create-groups POST /admin/findings/groups data,data-file,github-installation-id active +nullify api admin create-handoff POST /admin/identity/entra/handoff data,data-file,github-installation-id active +nullify api admin create-identity-entra-connect POST /admin/identity/entra/connect github-installation-id active +nullify api admin create-identity-scim-credentials POST /admin/identity/scim/credentials github-installation-id active +nullify api admin create-ingest POST /admin/context/ingest data,data-file,github-installation-id active +nullify api admin create-installations POST /admin/integrations/azure/installations data,data-file,github-installation-id active +nullify api admin create-integrations-asana-ticket-config POST /admin/integrations/asana/ticket-config data,data-file,github-installation-id active +nullify api admin create-integrations-azure-codeowners-preview POST /admin/integrations/azure/codeowners/preview data,data-file,github-installation-id active +nullify api admin create-integrations-azure-connect POST /admin/integrations/azure/connect data,data-file,github-installation-id active +nullify api admin create-integrations-buildkite-token POST /admin/integrations/buildkite/token data,data-file,github-installation-id active +nullify api admin create-integrations-circleci-token POST /admin/integrations/circleci/token data,data-file,github-installation-id active +nullify api admin create-integrations-cloud-aws-settings POST /admin/integrations/cloud/aws/settings data,data-file,github-installation-id active +nullify api admin create-integrations-cloud-azure-settings POST /admin/integrations/cloud/azure/settings data,data-file,github-installation-id active +nullify api admin create-integrations-cloud-azure-validate POST /admin/integrations/cloud/azure/validate data,data-file,github-installation-id active +nullify api admin create-integrations-cloud-gcp-settings POST /admin/integrations/cloud/gcp/settings data,data-file,github-installation-id active +nullify api admin create-integrations-connections-test-by-id POST /admin/integrations/connections/{connectionId}/test github-installation-id active +nullify api admin create-integrations-gitlab-connect POST /admin/integrations/gitlab/connect github-installation-id active +nullify api admin create-integrations-jenkins-token POST /admin/integrations/jenkins/token data,data-file,github-installation-id active +nullify api admin create-integrations-linear-ticket-config POST /admin/integrations/linear/ticket-config data,data-file,github-installation-id active +nullify api admin create-integrations-test-by-id POST /admin/integrations/{providerId}/{capability}/test github-installation-id active +nullify api admin create-invitation POST /admin/operator/workspace-bootstrap/invitation data,data-file active +nullify api admin create-jira POST /admin/integrations/jira data,data-file,github-installation-id active +nullify api admin create-key POST /admin/integrations/slack/key data,data-file,github-installation-id active +nullify api admin create-link POST /admin/identity/entra/link github-installation-id active +nullify api admin create-mapping POST /admin/user/mapping data,data-file,github-installation-id active +nullify api admin create-merge POST /admin/teams/merge data,data-file,github-installation-id active +nullify api admin create-metrics-findings POST /admin/metrics/findings data,data-file,github-installation-id active +nullify api admin create-metrics-pullrequests POST /admin/metrics/pullrequests data,data-file,github-installation-id active +nullify api admin create-network-ip-allowlist-preview POST /admin/network/ip-allowlist/preview data,data-file,github-installation-id active +nullify api admin create-operator-external-writes-initialize POST /admin/operator/external-writes/initialize data,data-file,github-installation-id active +nullify api admin create-operator-github-tenant-route POST /admin/operator/github-tenant/route data,data-file active +nullify api admin create-operator-native-tenant-route POST /admin/operator/native-tenant/route data,data-file active +nullify api admin create-organizations POST /admin/integrations/buildkite/organizations data,data-file,github-installation-id active +nullify api admin create-over-time POST /admin/metrics/over-time data,data-file,github-installation-id,resolution active +nullify api admin create-overview POST /admin/metrics/overview data,data-file,github-installation-id active +nullify api admin create-package-feeds POST /admin/operator/package-feeds data,data-file,github-installation-id active +nullify api admin create-preview-by-id POST /admin/ticketing/settings/{findingType}/preview data,data-file,github-installation-id active +nullify api admin create-progress POST /admin/findings/progress data,data-file,github-installation-id active +nullify api admin create-pullrequests POST /admin/pullrequests data,data-file,github-installation-id active +nullify api admin create-raw POST /admin/metrics/raw data,data-file,github-installation-id active +nullify api admin create-reactivate POST /admin/users/reactivate data,data-file,github-installation-id active +nullify api admin create-recheck-by-id POST /admin/integrations/azure/connect/{handle}/recheck github-installation-id active +nullify api admin create-refresh-ci POST /admin/pullrequests/refresh-ci data,data-file,github-installation-id active +nullify api admin create-renew POST /admin/operator/workspace-bootstrap/renew data,data-file active +nullify api admin create-repository-property-team-keys POST /admin/repository-property-team-keys data,data-file,github-installation-id active +nullify api admin create-retry-by-id POST /admin/integrations/azure/connect/{handle}/retry data,data-file,github-installation-id active +nullify api admin create-revoke POST /admin/operator/workspace-bootstrap/revoke data,data-file active +nullify api admin create-saved-filters POST /admin/ticketing/saved-filters data,data-file,github-installation-id active +nullify api admin create-savedViews POST /admin/ui/savedViews data,data-file,github-installation-id active +nullify api admin create-service_accounts POST /admin/service_accounts data,data-file,github-installation-id active +nullify api admin create-settings POST /admin/integrations/cloud/k8s/settings data,data-file,github-installation-id active +nullify api admin create-settings-by-id POST /admin/ticketing/settings/{findingType} data,data-file,github-installation-id active +nullify api admin create-sign-in POST /admin/identity/entra/sign-in github-installation-id active +nullify api admin create-sla POST /admin/sla data,data-file,github-installation-id active +nullify api admin create-sla-breakdown POST /admin/teams/sla-breakdown data,data-file,github-installation-id active +nullify api admin create-support-access POST /admin/support-access data,data-file,github-installation-id active +nullify api admin create-suspend POST /admin/integrations/azure/installations/suspend data,data-file,github-installation-id active +nullify api admin create-sync POST /admin/teams/findings/sync data,data-file,github-installation-id active +nullify api admin create-team-sync-runs POST /admin/team-sync-runs data,data-file,github-installation-id active +nullify api admin create-teams POST /admin/teams data,data-file,github-installation-id active +nullify api admin create-teams-findings POST /admin/teams/findings data,data-file,github-installation-id active +nullify api admin create-test POST /admin/integrations/azure/installations/test data,data-file,github-installation-id active +nullify api admin create-tickets POST /admin/metrics/tickets data,data-file,github-installation-id active +nullify api admin create-users POST /admin/users data,data-file,github-installation-id active +nullify api admin create-validate POST /admin/integrations/cloud/gcp/validate data,data-file,github-installation-id active +nullify api admin create-validate-role POST /admin/integrations/cloud/aws/validate-role data,data-file,github-installation-id active +nullify api admin create-whitelist POST /admin/integrations/cloud/k8s/whitelist data,data-file,github-installation-id active +nullify api admin delete-buildkite DELETE /admin/integrations/buildkite github-installation-id active +nullify api admin delete-circleci DELETE /admin/integrations/circleci github-installation-id active +nullify api admin delete-clusters DELETE /admin/integrations/cloud/k8s/clusters/{clusterId} github-installation-id active +nullify api admin delete-connect DELETE /admin/integrations/azure/connect github-installation-id,organization-id active +nullify api admin delete-connections DELETE /admin/integrations/connections/{connectionId} github-installation-id active +nullify api admin delete-credentials DELETE /admin/identity/scim/credentials/{id} github-installation-id active +nullify api admin delete-disconnect DELETE /admin/integrations/{providerId}/{capability}/disconnect github-installation-id active +nullify api admin delete-entra DELETE /admin/identity/entra github-installation-id active +nullify api admin delete-erasure DELETE /admin/users/{userId}/erasure github-installation-id active +nullify api admin delete-handoff DELETE /admin/identity/entra/handoff/{id} github-installation-id active +nullify api admin delete-installations DELETE /admin/integrations/azure/installations github-installation-id,organization-id,project-id active +nullify api admin delete-integrations-cloud-aws-settings DELETE /admin/integrations/cloud/aws/settings github-installation-id active +nullify api admin delete-integrations-cloud-azure-settings DELETE /admin/integrations/cloud/azure/settings github-installation-id active +nullify api admin delete-integrations-cloud-gcp-settings DELETE /admin/integrations/cloud/gcp/settings github-installation-id active +nullify api admin delete-jenkins DELETE /admin/integrations/jenkins github-installation-id active +nullify api admin delete-mapping DELETE /admin/user/mapping/{userId} github-installation-id,hard active +nullify api admin delete-preferences DELETE /admin/ui/preferences github-installation-id active +nullify api admin delete-repository-property-team-keys DELETE /admin/repository-property-team-keys github-installation-id,key-id active +nullify api admin delete-saved-filters DELETE /admin/ticketing/saved-filters/{id} github-installation-id active +nullify api admin delete-savedViews DELETE /admin/ui/savedViews/{savedViewId} github-installation-id active +nullify api admin delete-service_accounts DELETE /admin/service_accounts github-installation-id,service-account-id active +nullify api admin delete-settings DELETE /admin/integrations/cloud/k8s/settings github-installation-id active +nullify api admin delete-support-access DELETE /admin/support-access github-installation-id active +nullify api admin delete-teams DELETE /admin/teams/{teamID} github-installation-id active +nullify api admin get-bulk-operations GET /admin/ticketing/bulk-operations/{operationId} github-installation-id active +nullify api admin get-connect GET /admin/integrations/azure/connect/{handle} github-installation-id active +nullify api admin get-directories GET /admin/repositories/{repositoryId}/directories github-installation-id,path active +nullify api admin get-export GET /admin/users/{userId}/export format,github-installation-id active +nullify api admin get-finding GET /admin/finding/{findingId} github-installation-id active +nullify api admin get-findings GET /admin/teams/{teamID}/findings github-installation-id active +nullify api admin get-history GET /admin/ticketing/settings/{findingType}/history github-installation-id,limit,offset active +nullify api admin get-identity GET /admin/users/identity/{providerID}/{providerUserID} github-installation-id active +nullify api admin get-install GET /admin/integrations/{providerId}/{capability}/install github-installation-id active +nullify api admin get-runs GET /admin/runs/{kind}/{id} github-installation-id active +nullify api admin get-team GET /admin/team/{teamID} github-installation-id active +nullify api admin get-tickets GET /admin/ticketing/tickets/{ticketId} github-installation-id active +nullify api admin get-user GET /admin/user/{userID} github-installation-id active +nullify api admin get-users GET /admin/users/{providerID} github-installation-id active +nullify api admin get-users-2 GET /admin/users/{providerID}/{userID} github-installation-id active +nullify api admin list-access-preferences GET /admin/access/preferences github-installation-id active +nullify api admin list-access-users GET /admin/access/users github-installation-id,limit,offset,search,start-key active +nullify api admin list-acknowledgment GET /admin/privacy/acknowledgment github-installation-id,policy-version active +nullify api admin list-activity GET /admin/ticketing/activity actor,event-type,from-time,github-installation-id,limit,offset,to-time active +nullify api admin list-aggregate GET /admin/metrics/usage/aggregate agent,branch-type,class,from,github-installation-id,to,window active +nullify api admin list-app-settings GET /admin/integrations/github/app-settings github-installation-id active +nullify api admin list-appzip GET /admin/teams/appzip github-installation-id active +nullify api admin list-assessments-scan-coverage-findings GET /admin/assessments/scan-coverage/findings github-installation-id,limit,offset,repository-id,type active +nullify api admin list-atlassian GET /admin/integrations/atlassian github-installation-id active +nullify api admin list-azure GET /admin/integrations/azure github-installation-id active +nullify api admin list-buildkite GET /admin/integrations/buildkite github-installation-id active +nullify api admin list-catalog GET /admin/integrations/catalog github-installation-id active +nullify api admin list-checklist GET /admin/checklist github-installation-id active +nullify api admin list-circleci GET /admin/integrations/circleci github-installation-id active +nullify api admin list-connections GET /admin/integrations/connections capability,github-installation-id active +nullify api admin list-counts GET /admin/ticketing/tickets/counts finding-type,github-installation-id,platform,source,status active +nullify api admin list-cspm-scan-cadence GET /admin/settings/cspm-scan-cadence github-installation-id active +nullify api admin list-current GET /admin/user/current github-installation-id active +nullify api admin list-destinations GET /admin/integrations/threat-intel/destinations github-installation-id active +nullify api admin list-entra GET /admin/identity/entra github-installation-id active +nullify api admin list-external-writes GET /admin/external-writes github-installation-id active +nullify api admin list-fix-effort GET /admin/fix-effort github-installation-id active +nullify api admin list-forge GET /admin/integrations/jira/forge github-installation-id active +nullify api admin list-getFileContents GET /admin/getFileContents end-line,file-path,github-installation-id,project-id,reference,repository-id,scan-family,start-line active +nullify api admin list-getPullRequest GET /admin/getPullRequest github-installation-id,pr-id,repository-id active +nullify api admin list-handoff GET /admin/identity/entra/handoff github-installation-id active +nullify api admin list-inference-region GET /admin/settings/inference-region github-installation-id active +nullify api admin list-install GET /admin/integrations/jira/install github-installation-id,site-url active +nullify api admin list-installations GET /admin/installations github-installation-id active +nullify api admin list-integrations-asana-oauth GET /admin/integrations/asana/oauth github-installation-id active +nullify api admin list-integrations-azure-installations GET /admin/integrations/azure/installations github-installation-id active +nullify api admin list-integrations-cloud-aws-settings GET /admin/integrations/cloud/aws/settings github-installation-id active +nullify api admin list-integrations-cloud-azure-settings GET /admin/integrations/cloud/azure/settings github-installation-id active +nullify api admin list-integrations-cloud-gcp-settings GET /admin/integrations/cloud/gcp/settings github-installation-id active +nullify api admin list-integrations-cloud-k8s-settings GET /admin/integrations/cloud/k8s/settings github-installation-id active +nullify api admin list-integrations-linear-install GET /admin/integrations/linear/install github-installation-id active +nullify api admin list-integrations-linear-teams GET /admin/integrations/linear/teams github-installation-id active +nullify api admin list-integrations-slack-install GET /admin/integrations/slack/install github-installation-id active +nullify api admin list-integrations-teams GET /admin/integrations/teams github-installation-id,provider active +nullify api admin list-integrations-users GET /admin/integrations/users github-installation-id,provider active +nullify api admin list-interactions GET /admin/metrics/interactions from-date,github-installation-id,to-date active +nullify api admin list-ip-allowlist GET /admin/network/ip-allowlist github-installation-id active +nullify api admin list-jenkins GET /admin/integrations/jenkins github-installation-id active +nullify api admin list-jira GET /admin/integrations/jira github-installation-id active +nullify api admin list-ledger GET /admin/metrics/usage/ledger agent,branch-type,class,cursor,finding-id,from,github-installation-id,limit,query,run-id,to active +nullify api admin list-linear GET /admin/integrations/linear github-installation-id active +nullify api admin list-manager-settings GET /admin/manager/settings github-installation-id active +nullify api admin list-mapping GET /admin/user/mapping github-installation-id,provider-id,user-id active +nullify api admin list-mappings GET /admin/user/mappings github-installation-id active +nullify api admin list-me GET /admin/access/me github-installation-id active +nullify api admin list-members GET /admin/integrations/linear/members github-installation-id,q,team-id active +nullify api admin list-notifications GET /admin/integrations/notifications github-installation-id active +nullify api admin list-oauth GET /admin/integrations/linear/oauth github-installation-id active +nullify api admin list-operation GET /admin/operator/workspace-bootstrap/operation operation-id active +nullify api admin list-operator-scan-scope-repositories GET /admin/operator/scan-scope/repositories github-installation-id active +nullify api admin list-operator-tenant-capabilities GET /admin/operator/tenant-capabilities github-installation-id active +nullify api admin list-orchestrator GET /admin/scans/orchestrator from,github-installation-id,limit,offset,scan-type,status,to active +nullify api admin list-org-owners GET /admin/access/users/org-owners github-installation-id active +nullify api admin list-organization GET /admin/organization github-installation-id,include-directory active +nullify api admin list-package-feeds GET /admin/operator/package-feeds connection-id,github-installation-id active +nullify api admin list-policy GET /admin/identity/entra/policy github-installation-id active +nullify api admin list-pr-gate-settings GET /admin/pr-gate-settings github-installation-id active +nullify api admin list-pullrequests GET /admin/pullrequests github-installation-id,id active +nullify api admin list-recommendations GET /admin/repositories/recommendations github-installation-id active +nullify api admin list-repositories GET /admin/repositories github-installation-id,ids,include-archived,include-archived-enrolled,limit,next-token,offset,search,team-i-ds active +nullify api admin list-repository-property-team-keys GET /admin/repository-property-team-keys github-installation-id active +nullify api admin list-requests GET /admin/operator/workspace-bootstrap/requests before-request-id active +nullify api admin list-routing-exclusions GET /admin/config/routing-exclusions github-installation-id active +nullify api admin list-saved-filters GET /admin/ticketing/saved-filters github-installation-id active +nullify api admin list-savedViews GET /admin/ui/savedViews github-installation-id active +nullify api admin list-scan-coverage GET /admin/assessments/scan-coverage github-installation-id,limit,offset,search,sort-by,sort-order,type active +nullify api admin list-scan-entitlement GET /admin/operator/scan-entitlement github-installation-id active +nullify api admin list-scan-scope GET /admin/scan-scope github-installation-id active +nullify api admin list-scim GET /admin/identity/scim github-installation-id active +nullify api admin list-security-owner GET /admin/config/security-owner github-installation-id active +nullify api admin list-service_accounts GET /admin/service_accounts github-installation-id active +nullify api admin list-setup GET /admin/integrations/cloud/gcp/setup github-installation-id active +nullify api admin list-sla GET /admin/sla github-installation-id active +nullify api admin list-slack GET /admin/integrations/slack github-installation-id active +nullify api admin list-status GET /admin/integrations/gitlab/connect/status github-installation-id,handle active +nullify api admin list-suggestions GET /admin/user/mapping/suggestions github-installation-id active +nullify api admin list-support-access GET /admin/support-access github-installation-id,limit active +nullify api admin list-team-source-preferences GET /admin/team-source-preferences github-installation-id active +nullify api admin list-team-sync-runs GET /admin/team-sync-runs github-installation-id,limit,source active +nullify api admin list-teams GET /admin/teams github-installation-id,limit,next-token,offset,repository-id,search,skip-user-enrichment active +nullify api admin list-teams-findings GET /admin/teams/findings github-installation-id active +nullify api admin list-tenant-capabilities GET /admin/tenant-capabilities github-installation-id active +nullify api admin list-tickets GET /admin/ticketing/tickets board-id,closed-after,closed-before,created-after,created-before,finding-type,github-installation-id,has-sync-error,last-synced-before,limit,offset,out-of-eligibility-since-after,platform,q,saved-filter-id,source,status active +nullify api admin list-timeseries GET /admin/metrics/usage/timeseries agent,class,from,github-installation-id,granularity,to active +nullify api admin list-ui-preferences GET /admin/ui/preferences github-installation-id active +nullify api admin list-users GET /admin/users github-installation-id active +nullify api admin list-whitelist GET /admin/integrations/cloud/k8s/whitelist github-installation-id active +nullify api admin patch-saved-filters PATCH /admin/ticketing/saved-filters/{id} data,data-file,github-installation-id active +nullify api admin patch-savedViews PATCH /admin/ui/savedViews/{savedViewId} data,data-file,github-installation-id active +nullify api admin patch-sla PATCH /admin/sla/{slaId} data,data-file,github-installation-id active +nullify api admin patch-teams PATCH /admin/teams/{teamID} data,data-file,github-installation-id active +nullify api admin update-access-preferences PUT /admin/access/preferences data,data-file,github-installation-id active +nullify api admin update-bulk PUT /admin/sla/bulk data,data-file,github-installation-id active +nullify api admin update-configure PUT /admin/integrations/{providerId}/{capability}/configure data,data-file,github-installation-id active +nullify api admin update-cspm-scan-cadence PUT /admin/settings/cspm-scan-cadence data,data-file,github-installation-id active +nullify api admin update-destinations PUT /admin/integrations/threat-intel/destinations data,data-file,github-installation-id active +nullify api admin update-external-writes PUT /admin/external-writes data,data-file,github-installation-id active +nullify api admin update-fix-effort PUT /admin/fix-effort data,data-file,github-installation-id active +nullify api admin update-inference-region PUT /admin/settings/inference-region data,data-file,github-installation-id active +nullify api admin update-ip-allowlist PUT /admin/network/ip-allowlist data,data-file,github-installation-id active +nullify api admin update-mapping PUT /admin/user/mapping/{userId} data,data-file,github-installation-id active +nullify api admin update-notifications PUT /admin/integrations/notifications data,data-file,github-installation-id active +nullify api admin update-operator-tenant-capabilities PUT /admin/operator/tenant-capabilities data,data-file,github-installation-id active +nullify api admin update-policy PUT /admin/identity/entra/policy data,data-file,github-installation-id active +nullify api admin update-pr-gate-settings PUT /admin/pr-gate-settings data,data-file,github-installation-id active +nullify api admin update-repositories PUT /admin/operator/scan-scope/repositories data,data-file,github-installation-id active +nullify api admin update-repositories-scan-scope PUT /admin/repositories/scan-scope data,data-file,github-installation-id active +nullify api admin update-roles PUT /admin/access/users/roles data,data-file,github-installation-id active +nullify api admin update-rotate PUT /admin/integrations/connections/{connectionId}/rotate data,data-file,github-installation-id active +nullify api admin update-routing-exclusions PUT /admin/config/routing-exclusions data,data-file,github-installation-id active +nullify api admin update-scan-entitlement PUT /admin/operator/scan-entitlement data,data-file,github-installation-id active +nullify api admin update-scan-scope PUT /admin/scan-scope data,data-file,github-installation-id active +nullify api admin update-security-owner PUT /admin/config/security-owner data,data-file,github-installation-id active +nullify api admin update-settings PUT /admin/manager/settings data,data-file,github-installation-id active +nullify api admin update-team-source-preferences PUT /admin/team-source-preferences data,data-file,github-installation-id active +nullify api admin update-tenant-capabilities PUT /admin/tenant-capabilities/{capability} data,data-file,github-installation-id active +nullify api admin update-ui-preferences PUT /admin/ui/preferences data,data-file,github-installation-id active +nullify api asset-graph active +nullify api asset-graph list-reachability GET /context/asset-graph/reachability account-id,github-installation-id,node-id,port,protocol deprecated +nullify api asset-graph list-search GET /context/asset-graph/search github-installation-id,max-results,object-types,q deprecated +nullify api asset-graph list-subgraph GET /context/asset-graph/subgraph account-id,depth,edge-types,github-installation-id,max-nodes,object-types,root-node-id deprecated +nullify api asset-graph list-summary GET /context/asset-graph/summary github-installation-id deprecated +nullify api context active +nullify api context create-applications POST /context/applications data,data-file,github-installation-id active +nullify api context create-cloud-connector-pr-runs POST /context/cloud-connector-pr/runs data,data-file,github-installation-id active +nullify api context create-cloud-connector-pr-runs-approve-by-id POST /context/cloud-connector-pr/runs/{runId}/approve data,data-file,github-installation-id active +nullify api context create-cloud-connector-pr-runs-recover-by-id POST /context/cloud-connector-pr/runs/{runId}/recover data,data-file,github-installation-id active +nullify api context create-discover-by-id POST /context/repositories/{repositoryId}/execution-recipes/discover data,data-file,github-installation-id active +nullify api context create-file POST /context/vault/file data,data-file,github-installation-id active +nullify api context create-generate POST /context/sboms/generate data,data-file,github-installation-id active +nullify api context create-grep POST /context/memories/grep data,data-file,github-installation-id active +nullify api context create-index POST /context/vault/index data,data-file,github-installation-id active +nullify api context create-memories POST /context/memories data,data-file,github-installation-id active +nullify api context create-memories-search POST /context/memories/search data,data-file,github-installation-id active +nullify api context create-onboard POST /context/vault/onboard data,data-file,github-installation-id active +nullify api context create-rebuild POST /context/applications/rebuild data,data-file,github-installation-id active +nullify api context create-replay POST /context/sbomingestor/replay data,data-file,github-installation-id active +nullify api context create-repo-scans POST /context/repo-scans data,data-file,github-installation-id active +nullify api context create-repo-scope-scans POST /context/repo-scope/scans data,data-file,github-installation-id,include-archived active +nullify api context create-reports POST /context/reports data,data-file,github-installation-id active +nullify api context create-repositories-projects-schema-trigger-by-id POST /context/repositories/{repositoryId}/projects/{projectId}/schema/trigger data,data-file,github-installation-id active +nullify api context create-repositories-repo-context-trigger-by-id POST /context/repositories/{repositoryId}/repo-context/trigger data,data-file,github-installation-id active +nullify api context create-resolve POST /context/sboms/resolve data,data-file,github-installation-id active +nullify api context create-resync POST /context/rag/resync data,data-file,github-installation-id active +nullify api context create-retract-by-id POST /context/memories/{memoryId}/retract data,data-file,github-installation-id active +nullify api context create-sboms-runs POST /context/sboms/runs data,data-file,github-installation-id active +nullify api context create-scan POST /context/sboms/scan data,data-file,github-installation-id active +nullify api context create-scans POST /context/cloud-recon/scans data,data-file,github-installation-id active +nullify api context create-schema-by-id POST /context/repositories/{repositoryId}/projects/{projectId}/schema data,data-file,github-installation-id active +nullify api context create-setup-recommendations-pentest-assessments-accept-by-id POST /context/setup-recommendations/pentest-assessments/{recommendationId}/accept data,data-file,github-installation-id active +nullify api context create-setup-recommendations-pentest-assessments-dismiss-by-id POST /context/setup-recommendations/pentest-assessments/{recommendationId}/dismiss github-installation-id active +nullify api context create-setup-recommendations-pentest-assessments-refresh POST /context/setup-recommendations/pentest-assessments/refresh github-installation-id active +nullify api context create-setup-recommendations-pentest-targets-accept-by-id POST /context/setup-recommendations/pentest-targets/{recommendationId}/accept data,data-file,github-installation-id active +nullify api context create-setup-recommendations-pentest-targets-dismiss-by-id POST /context/setup-recommendations/pentest-targets/{recommendationId}/dismiss github-installation-id active +nullify api context create-setup-recommendations-pentest-targets-refresh POST /context/setup-recommendations/pentest-targets/refresh github-installation-id active +nullify api context create-start POST /context/cloud-scan/start account-ids,cluster-ids,github-installation-id,provider,rebuild-infra-graph active +nullify api context create-vault-search POST /context/vault/search data,data-file,github-installation-id active +nullify api context create-waf-allowlist-pr-runs POST /context/waf-allowlist-pr/runs data,data-file,github-installation-id active +nullify api context create-waf-allowlist-pr-runs-approve-by-id POST /context/waf-allowlist-pr/runs/{runId}/approve data,data-file,github-installation-id active +nullify api context create-waf-allowlist-pr-runs-recover-by-id POST /context/waf-allowlist-pr/runs/{runId}/recover data,data-file,github-installation-id active +nullify api context delete-applications DELETE /context/applications/{applicationId} github-installation-id active +nullify api context delete-artifacts DELETE /context/artifacts/{artifactId} github-installation-id active +nullify api context delete-asset-inventory DELETE /context/asset-inventory/{category}/{id} github-installation-id active +nullify api context delete-cicd-pipelines DELETE /context/cicd-pipelines/{pipelineId} github-installation-id active +nullify api context delete-deps DELETE /context/deps ecosystem,github-installation-id,global,introduced-at,name,project-id,repository-id active +nullify api context delete-entrypoints DELETE /context/entrypoints/{entrypointId} github-installation-id active +nullify api context delete-file DELETE /context/vault/file/{fileId} github-installation-id active +nullify api context delete-memories DELETE /context/memories/{memoryId} github-installation-id,reason active +nullify api context delete-projects DELETE /context/repositories/{repositoryId}/projects/{projectId} github-installation-id active +nullify api context delete-repositories DELETE /context/repositories/{repositoryId} github-installation-id active +nullify api context delete-sboms DELETE /context/sboms dry-run,github-installation-id,invalid-only,project-id,repository-id active +nullify api context get-active GET /context/deps/repository/{repositoryId}/project/{projectId}/active direct,ecosystem,github-installation-id,search active +nullify api context get-ai-ml GET /context/asset-inventory/ai-ml/{id} github-installation-id active +nullify api context get-applications GET /context/applications/{applicationId} github-installation-id active +nullify api context get-applications-execution-recipe GET /context/applications/{applicationId}/execution-recipe allow-edits,capabilities,commit-sha,docker,github-installation-id,input-hash active +nullify api context get-applications-schema GET /context/applications/{applicationId}/schema github-installation-id active +nullify api context get-artifact-deployments GET /context/artifact-deployments/{deploymentId} github-installation-id active +nullify api context get-artifact-repositories GET /context/asset-inventory/artifact-repositories/{id} github-installation-id active +nullify api context get-artifacts GET /context/artifacts/{artifactId} github-installation-id active +nullify api context get-asset-inventory-artifacts GET /context/asset-inventory/artifacts/{id} github-installation-id active +nullify api context get-at GET /context/deps/repository/{repositoryId}/project/{projectId}/at/{commit} github-installation-id active +nullify api context get-by-ref GET /context/deps/by-ref/{bomRef} cursor,github-installation-id,page-size active +nullify api context get-cdn-and-dns GET /context/asset-inventory/cdn-and-dns/{id} github-installation-id active +nullify api context get-ci-cd GET /context/asset-inventory/ci-cd/{id} github-installation-id active +nullify api context get-cicd-pipelines GET /context/cicd-pipelines/{pipelineId} github-installation-id active +nullify api context get-cloud-connector-pr-runs GET /context/cloud-connector-pr/runs/{runId} github-installation-id active +nullify api context get-cloud-connector-pr-runs-proposal GET /context/cloud-connector-pr/runs/{runId}/proposal github-installation-id active +nullify api context get-cloud-recon-accounts-scans-latest GET /context/cloud-recon/accounts/{accountId}/scans/latest github-installation-id,scan-id active +nullify api context get-cluster GET /context/asset-inventory/cluster/{id} github-installation-id active +nullify api context get-compute GET /context/asset-inventory/compute/{id} github-installation-id active +nullify api context get-connectivity GET /context/asset-inventory/connectivity/{id} github-installation-id active +nullify api context get-container GET /context/asset-inventory/container/{id} github-installation-id active +nullify api context get-cross-account-relationships GET /context/cloud-recon/accounts/{accountId}/cross-account-relationships github-installation-id active +nullify api context get-data-pipeline GET /context/asset-inventory/data-pipeline/{id} github-installation-id active +nullify api context get-database GET /context/asset-inventory/database/{id} github-installation-id active +nullify api context get-dependents GET /context/deps/dependents/{bomRef} cursor,github-installation-id,page-size active +nullify api context get-diff GET /context/deps/repository/{repositoryId}/project/{projectId}/diff from-commit,github-installation-id,to-commit active +nullify api context get-discovered-nodes GET /context/cloud-recon/accounts/{accountId}/discovered-nodes github-installation-id,limit,object-type,offset,source active +nullify api context get-document GET /context/memories/document/{documentId} github-installation-id,limit,pagination-token active +nullify api context get-download GET /context/infrastructure/graphs/{accountId}/download github-installation-id active +nullify api context get-endpoints GET /context/asset-inventory/endpoints/{id} github-installation-id active +nullify api context get-entrypoints GET /context/entrypoints/{entrypointId} github-installation-id active +nullify api context get-exposure GET /context/deps/repository/{repositoryId}/project/{projectId}/exposure ecosystem,github-installation-id,name,range active +nullify api context get-file GET /context/vault/file/{fileId} github-installation-id active +nullify api context get-findings GET /context/memories/{memoryId}/findings github-installation-id,limit active +nullify api context get-graph-gaps GET /context/cloud-recon/accounts/{accountId}/graph-gaps github-installation-id active +nullify api context get-graphs GET /context/infrastructure/graphs/{accountId} github-installation-id active +nullify api context get-history GET /context/deps/repository/{repositoryId}/project/{projectId}/history ecosystem,github-installation-id,name active +nullify api context get-hotspots GET /context/cloud-recon/accounts/{accountId}/hotspots github-installation-id,limit,offset,severity active +nullify api context get-iam-posture GET /context/cloud-recon/accounts/{accountId}/iam-posture github-installation-id active +nullify api context get-identity GET /context/asset-inventory/identity/{id} github-installation-id active +nullify api context get-infrastructure-graphs-versions GET /context/infrastructure/graphs/{accountId}/versions github-installation-id active +nullify api context get-infrastructure-graphs-versions-2 GET /context/infrastructure/graphs/{accountId}/versions/{version} github-installation-id active +nullify api context get-latest GET /context/cloud-recon/accounts/{accountId}/synthesis/latest github-installation-id,scan-id active +nullify api context get-load-balancer GET /context/asset-inventory/load-balancer/{id} github-installation-id active +nullify api context get-memories GET /context/memories/{memoryId} github-installation-id active +nullify api context get-messaging GET /context/asset-inventory/messaging/{id} github-installation-id active +nullify api context get-metadata GET /context/repositories/{repositoryId}/projects/{projectId}/schema/metadata github-installation-id active +nullify api context get-network GET /context/asset-inventory/network/{id} github-installation-id active +nullify api context get-network-exposures GET /context/cloud-recon/accounts/{accountId}/network-exposures github-installation-id active +nullify api context get-observability GET /context/asset-inventory/observability/{id} github-installation-id active +nullify api context get-organization-runs GET /context/organization/runs/{runId} github-installation-id,include-result active +nullify api context get-overview GET /context/cloud-recon/accounts/{accountId}/overview github-installation-id active +nullify api context get-pipelines GET /context/asset-inventory/pipelines/{id} github-installation-id active +nullify api context get-project GET /context/sboms/repository/{repositoryId}/project/{projectId} from-commit,from-time,github-installation-id,page,page-size,until-commit,until-time active +nullify api context get-projects GET /context/asset-inventory/projects/{id} github-installation-id active +nullify api context get-raw GET /context/repositories/{repositoryId}/projects/{projectId}/schema/raw github-installation-id active +nullify api context get-rebuilds GET /context/applications/rebuilds/{runId} github-installation-id active +nullify api context get-repo-scans GET /context/repo-scans/{scanId} github-installation-id active +nullify api context get-reports GET /context/reports/{jobId} github-installation-id active +nullify api context get-repos GET /context/asset-inventory/repos/{id} github-installation-id active +nullify api context get-repositories GET /context/repositories/{repositoryId} github-installation-id,prefer-url active +nullify api context get-repositories-projects GET /context/repositories/{repositoryId}/projects github-installation-id,include-deleted,limit,next-token active +nullify api context get-repositories-projects-2 GET /context/repositories/{repositoryId}/projects/{projectId} github-installation-id active +nullify api context get-repositories-projects-execution-recipe GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe allow-edits,capabilities,commit-sha,docker,github-installation-id,input-hash active +nullify api context get-repositories-projects-execution-recipe-versions GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/versions github-installation-id,limit,offset active +nullify api context get-repositories-projects-schema GET /context/repositories/{repositoryId}/projects/{projectId}/schema github-installation-id active +nullify api context get-sboms-repository-latest GET /context/sboms/repository/{repositoryId}/latest github-installation-id active +nullify api context get-scans GET /context/repo-scope/scans/{scanId} execution-arn,github-installation-id active +nullify api context get-security GET /context/asset-inventory/security/{id} github-installation-id active +nullify api context get-security-boundaries GET /context/cloud-recon/accounts/{accountId}/security-boundaries github-installation-id active +nullify api context get-serverless GET /context/asset-inventory/serverless/{id} github-installation-id active +nullify api context get-status GET /context/cloud-scan/{scanId}/status github-installation-id active +nullify api context get-storage-and-backup GET /context/asset-inventory/storage-and-backup/{id} github-installation-id active +nullify api context get-text GET /context/vault/document/{documentId}/text end-page,github-installation-id,max-chars,next-token,start-page active +nullify api context get-topology GET /context/cloud-recon/accounts/{accountId}/topology github-installation-id active +nullify api context get-traffic-flows GET /context/cloud-recon/accounts/{accountId}/traffic-flows github-installation-id active +nullify api context get-trusted-services GET /context/cloud-recon/accounts/{accountId}/trusted-services github-installation-id active +nullify api context get-type GET /context/memories/document/{documentId}/type github-installation-id,limit,memory-type,pagination-token active +nullify api context get-validations GET /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/validations github-installation-id,limit,offset active +nullify api context get-versions GET /context/memories/{memoryId}/versions github-installation-id,limit active +nullify api context get-waf-allowlist-pr-runs GET /context/waf-allowlist-pr/runs/{runId} github-installation-id active +nullify api context get-waf-allowlist-pr-runs-proposal GET /context/waf-allowlist-pr/runs/{runId}/proposal github-installation-id active +nullify api context list-active GET /context/deps/active cursor,direct,ecosystem,github-installation-id,name,page-size,project-id,range,repository-id,search active +nullify api context list-ai-ml GET /context/asset-inventory/ai-ml account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-applications GET /context/applications github-installation-id,limit,offset,search active +nullify api context list-artifact-deployments GET /context/artifact-deployments artifact-id,cloud-resource-id,compute-type,github-installation-id,include-deleted,limit,next-token,repository-id active +nullify api context list-artifact-repositories GET /context/asset-inventory/artifact-repositories account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-artifacts GET /context/artifacts github-installation-id,include-deleted,limit,next-token,offset,project-id,repository-id,search,type active +nullify api context list-asset-graph-summary GET /context/asset-graph/summary github-installation-id active +nullify api context list-asset-inventory GET /context/asset-inventory account-id,active,category,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,q,region,sub-type,updated-after active +nullify api context list-asset-inventory-artifacts GET /context/asset-inventory/artifacts account-id,active,github-installation-id,internet-reachable,limit,next-token,project-id,provider,public-facing,region,sub-type active +nullify api context list-attack-paths GET /context/asset-graph/attack-paths github-installation-id,has-critical-finding,limit,offset,terminal-node-kind active +nullify api context list-cdn-and-dns GET /context/asset-inventory/cdn-and-dns account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-ci-cd GET /context/asset-inventory/ci-cd account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-cicd-pipelines GET /context/cicd-pipelines github-installation-id,include-deleted,limit,next-token,platform,project-id,repository-id active +nullify api context list-cloud-connector-pr-status GET /context/cloud-connector-pr/status github-installation-id active +nullify api context list-cluster GET /context/asset-inventory/cluster account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-collector-clusters GET /context/k8s/collector-clusters github-installation-id active +nullify api context list-compute GET /context/asset-inventory/compute account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-connectivity GET /context/asset-inventory/connectivity account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-container GET /context/asset-inventory/container account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-cross-account-trusts GET /context/cloud-recon/tenants/cross-account-trusts github-installation-id active +nullify api context list-data-pipeline GET /context/asset-inventory/data-pipeline account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-database GET /context/asset-inventory/database account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-deps GET /context/deps cursor,github-installation-id,page-size active +nullify api context list-endpoints GET /context/asset-inventory/endpoints active,aws-service,github-installation-id,host-category,host-id,limit,next-token,q,source-type active +nullify api context list-entrypoints GET /context/entrypoints github-installation-id,include-deleted,kind,limit,next-token,project-id,repository-id active +nullify api context list-exposure GET /context/deps/exposure ecosystem,github-installation-id,name,range active +nullify api context list-files GET /context/vault/files github-installation-id,limit,offset,search active +nullify api context list-graphs GET /context/infrastructure/graphs github-installation-id active +nullify api context list-identity GET /context/asset-inventory/identity account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-info GET /context/infrastructure/graphs/info github-installation-id active +nullify api context list-infrastructure-graphs-summary GET /context/infrastructure/graphs/summary github-installation-id active +nullify api context list-landing GET /context/asset-graph/landing github-installation-id,per-category active +nullify api context list-latest GET /context/cloud-recon/organization/synthesis/latest github-installation-id,scan-run-id active +nullify api context list-list GET /context/vault/files/list github-installation-id active +nullify api context list-load-balancer GET /context/asset-inventory/load-balancer account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-memories GET /context/memories created-by,github-installation-id,is-latest,limit,memory-class,memory-type,min-trust-tier,next-token,offset,priority,resource-id,resource-type,status active +nullify api context list-messaging GET /context/asset-inventory/messaging account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-network GET /context/asset-inventory/network account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-node GET /context/asset-graph/node github-installation-id,node-id active +nullify api context list-nodes GET /context/asset-graph/nodes child-counts,github-installation-id,kinds,limit,offset active +nullify api context list-observability GET /context/asset-inventory/observability account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-organization GET /context/organization github-installation-id active +nullify api context list-pentest-assessments GET /context/setup-recommendations/pentest-assessments github-installation-id active +nullify api context list-pentest-targets GET /context/setup-recommendations/pentest-targets github-installation-id active +nullify api context list-pipelines GET /context/asset-inventory/pipelines account-id,active,github-installation-id,internet-reachable,limit,next-token,project-id,provider,public-facing,region,repo-id,sub-type active +nullify api context list-projects GET /context/asset-inventory/projects account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,repo-id,sub-type active +nullify api context list-public GET /context/asset-inventory/public account-id,category,github-installation-id,limit,next-token,policy,provider active +nullify api context list-reachability GET /context/asset-graph/reachability github-installation-id,node-id,port,protocol active +nullify api context list-repo-scans GET /context/repo-scans commit-sha,github-installation-id,page,page-size,repository-id,status,versions-only active +nullify api context list-repos GET /context/asset-inventory/repos account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-repositories GET /context/repositories github-installation-id,limit,next-token,sort,sort-by active +nullify api context list-retrieve GET /context/asset-graph/retrieve github-installation-id,max-results,q active +nullify api context list-schemas GET /context/schemas github-installation-id active +nullify api context list-search GET /context/asset-graph/search github-installation-id,max-results,object-types,q active +nullify api context list-security GET /context/asset-inventory/security account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-serverless GET /context/asset-inventory/serverless account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-storage-and-backup GET /context/asset-inventory/storage-and-backup account-id,active,github-installation-id,internet-reachable,limit,next-token,provider,public-facing,region,sub-type active +nullify api context list-subgraph GET /context/asset-graph/subgraph depth,edge-types,github-installation-id,max-nodes,object-types,root-node-id active +nullify api context list-summary GET /context/deps/active/summary direct,ecosystem,github-installation-id,name,project-id,range,repository-id,search active +nullify api context list-tree GET /context/sboms/tree github-installation-id,verbose active +nullify api context list-type GET /context/memories/type created-by,github-installation-id,is-latest,limit,memory-type,offset,pagination-token,resource-id active +nullify api context list-waf-allowlist-pr-status GET /context/waf-allowlist-pr/status github-installation-id active +nullify api context list-without-lockfile GET /context/deps/without-lockfile github-installation-id,level active +nullify api context patch-applications PATCH /context/applications/{applicationId} data,data-file,github-installation-id active +nullify api context patch-file PATCH /context/vault/file/{fileName} data,data-file,github-installation-id active +nullify api context patch-flags PATCH /context/asset-inventory/{category}/{id}/flags data,data-file,github-installation-id active +nullify api context patch-memories PATCH /context/memories/{memoryId} data,data-file,github-installation-id active +nullify api context patch-organization PATCH /context/organization data,data-file,github-installation-id active +nullify api context patch-projects PATCH /context/repositories/{repositoryId}/projects/{projectId} data,data-file,github-installation-id active +nullify api context patch-repo-scans PATCH /context/repo-scans/{scanId} data,data-file,github-installation-id active +nullify api context patch-repositories PATCH /context/repositories/{repositoryId} data,data-file,github-installation-id active +nullify api context patch-tags PATCH /context/asset-inventory/{category}/{id}/tags data,data-file,github-installation-id active +nullify api context push [file] branch,dry-run,environment,from-pr,name,pr-number,repository,type active +nullify api context update-organization PUT /context/organization data,data-file,github-installation-id active +nullify api cspm active +nullify api cspm create-allowlist-by-id POST /cspm/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api cspm create-archive-by-id POST /cspm/findings/{findingId}/archive data,data-file,github-installation-id active +nullify api cspm create-fix-by-id POST /cspm/findings/{findingId}/autofix/fix data,data-file,github-installation-id active +nullify api cspm create-mark-false-positive-by-id POST /cspm/findings/{findingId}/mark-false-positive data,data-file,github-installation-id active +nullify api cspm create-start POST /cspm/scans/start github-installation-id active +nullify api cspm create-ticket-by-id POST /cspm/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api cspm create-unallowlist-by-id POST /cspm/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api cspm create-unarchive-by-id POST /cspm/findings/{findingId}/unarchive data,data-file,github-installation-id active +nullify api cspm create-unmark-false-positive-by-id POST /cspm/findings/{findingId}/unmark-false-positive data,data-file,github-installation-id active +nullify api cspm delete-ticket DELETE /cspm/findings/{findingId}/ticket github-installation-id active +nullify api cspm get-activity GET /cspm/findings/{findingId}/autofix/activity github-installation-id,limit,since-id active +nullify api cspm get-findings GET /cspm/findings/{findingId} github-installation-id active +nullify api cspm get-scans GET /cspm/scans/{scanId} github-installation-id active +nullify api cspm get-state GET /cspm/findings/{findingId}/autofix/state github-installation-id active +nullify api cspm get-status GET /cspm/findings/{findingId}/autofix/status github-installation-id active +nullify api cspm get-triage GET /cspm/findings/{findingId}/triage github-installation-id active +nullify api cspm list-findings GET /cspm/findings account-id,category,cloud-provider,github-installation-id,is-allowlisted,is-archived,is-false-positive,limit,next-token,offset,region,resource-type,rule-id,scan-id,search,severity,sort,sort-by,status active +nullify api cspm list-scans GET /cspm/scans account-id,cloud-provider,github-installation-id,is-archived,limit,next-token,offset,region,scan-type,search,status active +nullify api cspm patch-findings PATCH /cspm/findings/{findingId} data,data-file,github-installation-id active +nullify api dast active +nullify api dast create-access-validation-by-id POST /dast/web-services/{webServiceId}/access-validation data,data-file,github-installation-id active +nullify api dast create-allowlist-by-id POST /dast/pentest/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api dast create-applications POST /dast/pentest/applications data,data-file,github-installation-id active +nullify api dast create-applications-2 POST /dast/applications data,data-file,github-installation-id active +nullify api dast create-arm-by-id POST /dast/exploit-validation/policies/{policyId}/arm data,data-file,github-installation-id active +nullify api dast create-bughunt-findings-ticket-by-id POST /dast/bughunt/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api dast create-bughunt-scans-stop-by-id POST /dast/bughunt/scans/{scanId}/stop github-installation-id active +nullify api dast create-credentials POST /dast/credentials data,data-file,github-installation-id active +nullify api dast create-credentials-by-id POST /dast/web-services/{webServiceId}/credentials data,data-file,github-installation-id active +nullify api dast create-credentials-validate POST /dast/credentials/validate data,data-file,github-installation-id active +nullify api dast create-disarm-by-id POST /dast/exploit-validation/policies/{policyId}/disarm github-installation-id active +nullify api dast create-exploit-validation-findings-validate-by-id POST /dast/exploit-validation/findings/{findingId}/validate github-installation-id active +nullify api dast create-fix-by-id POST /dast/pentest/findings/{findingId}/autofix/fix data,data-file,github-installation-id active +nullify api dast create-from-context POST /dast/applications/from-context data,data-file,github-installation-id active +nullify api dast create-import POST /dast/bughunt/program/import data,data-file,github-installation-id active +nullify api dast create-pentest-scans-stop-by-id POST /dast/pentest/scans/{scanId}/stop github-installation-id active +nullify api dast create-policies POST /dast/exploit-validation/policies data,data-file,github-installation-id active +nullify api dast create-preflight-by-id POST /dast/pentest/applications/{applicationId}/preflight data,data-file,github-installation-id active +nullify api dast create-readiness POST /dast/applications/readiness data,data-file,github-installation-id active +nullify api dast create-run-now-by-id POST /dast/bughunt/suites/{suite}/run-now data,data-file,github-installation-id active +nullify api dast create-scans POST /dast/bughunt/scans data,data-file,github-installation-id active +nullify api dast create-start POST /dast/pentest/start data,data-file,github-installation-id active +nullify api dast create-status-validation-by-id POST /dast/web-services/{webServiceId}/status-validation github-installation-id active +nullify api dast create-targets POST /dast/targets data,data-file,github-installation-id active +nullify api dast create-targets-validate POST /dast/targets/validate data,data-file,github-installation-id active +nullify api dast create-targets-validate-by-id POST /dast/targets/{targetId}/validate github-installation-id active +nullify api dast create-ticket-by-id POST /dast/pentest/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api dast create-unallowlist-by-id POST /dast/pentest/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api dast create-validate POST /dast/bughunt/config/validate data,data-file,github-installation-id active +nullify api dast create-validate-by-id POST /dast/credentials/{credentialId}/validate data,data-file,github-installation-id active +nullify api dast create-validations-by-id POST /dast/credentials/{credentialId}/validations data,data-file,github-installation-id active +nullify api dast create-web-services POST /dast/web-services data,data-file,github-installation-id active +nullify api dast delete-applications DELETE /dast/pentest/applications/{applicationId} github-installation-id active +nullify api dast delete-applications-2 DELETE /dast/applications/{applicationId} github-installation-id active +nullify api dast delete-bughunt-findings-ticket DELETE /dast/bughunt/findings/{findingId}/ticket github-installation-id active +nullify api dast delete-credentials DELETE /dast/credentials/{credentialId} github-installation-id active +nullify api dast delete-exploit-validation-consent DELETE /dast/targets/{targetId}/exploit-validation-consent github-installation-id active +nullify api dast delete-pentest-findings-ticket DELETE /dast/pentest/findings/{findingId}/ticket github-installation-id active +nullify api dast delete-policies DELETE /dast/exploit-validation/policies/{policyId} github-installation-id active +nullify api dast delete-targets DELETE /dast/targets/{targetId} github-installation-id active +nullify api dast delete-web-services DELETE /dast/web-services/{webServiceId} github-installation-id active +nullify api dast delete-web-services-credentials DELETE /dast/web-services/{webServiceId}/credentials/{credentialId} github-installation-id active +nullify api dast get-access-validations GET /dast/web-services/{webServiceId}/access-validations github-installation-id,limit,next-token active +nullify api dast get-activity GET /dast/pentest/findings/{findingId}/autofix/activity github-installation-id,limit,since-id active +nullify api dast get-applications GET /dast/pentest/applications/{applicationId} github-installation-id active +nullify api dast get-applications-2 GET /dast/applications/{applicationId} github-installation-id active +nullify api dast get-bughunt-findings GET /dast/bughunt/findings/{findingId} github-installation-id active +nullify api dast get-bughunt-findings-events GET /dast/bughunt/findings/{findingId}/events github-installation-id active +nullify api dast get-bughunt-findings-triage GET /dast/bughunt/findings/{findingId}/triage github-installation-id active +nullify api dast get-bughunt-scans GET /dast/bughunt/scans/{scanId} github-installation-id active +nullify api dast get-bughunt-scans-activity GET /dast/bughunt/scans/{scanId}/activity github-installation-id,limit,since-id active +nullify api dast get-bughunt-scans-diff GET /dast/bughunt/scans/{scanId}/diff against,github-installation-id active +nullify api dast get-bughunt-scans-findings GET /dast/bughunt/scans/{scanId}/findings github-installation-id,limit,offset active +nullify api dast get-bughunt-scans-logs GET /dast/bughunt/scans/{scanId}/logs github-installation-id active +nullify api dast get-bughunt-scans-status GET /dast/bughunt/scans/{scanId}/status github-installation-id active +nullify api dast get-cases GET /dast/pentest/scans/{scanId}/auth-matrix/cases github-installation-id,hide-not-run,identity,limit,offset,outcome active +nullify api dast get-credentials GET /dast/credentials/{credentialId} github-installation-id active +nullify api dast get-credentials-validations GET /dast/credentials/{credentialId}/validations github-installation-id,limit,next-token active +nullify api dast get-credentials-validations-status GET /dast/credentials/{credentialId}/validations/status github-installation-id active +nullify api dast get-download GET /dast/pentest/scans/{scanId}/report/download github-installation-id active +nullify api dast get-estimate GET /dast/pentest/applications/{applicationId}/estimate github-installation-id active +nullify api dast get-events GET /dast/pentest/scans/{scanId}/events after-seq,github-installation-id,limit active +nullify api dast get-exploit-validation-consent GET /dast/targets/{targetId}/exploit-validation-consent github-installation-id active +nullify api dast get-exploit-validation-findings-evidence GET /dast/exploit-validation/findings/{findingId}/evidence/{evidenceId} finding-type,github-installation-id active +nullify api dast get-full GET /dast/pentest/findings/{findingId}/full github-installation-id active +nullify api dast get-hypotheses GET /dast/pentest/scans/{scanId}/hypotheses github-installation-id active +nullify api dast get-latest GET /dast/pentest/applications/{applicationId}/preflight/latest github-installation-id,target-id,web-service-id active +nullify api dast get-links GET /dast/pentest/scans/{scanId}/findings/links github-installation-id active +nullify api dast get-pentest-findings GET /dast/pentest/findings/{findingId} github-installation-id active +nullify api dast get-pentest-findings-events GET /dast/pentest/findings/{findingId}/events github-installation-id active +nullify api dast get-pentest-findings-triage GET /dast/pentest/findings/{findingId}/triage github-installation-id active +nullify api dast get-pentest-preflights-events GET /dast/pentest/preflights/{preflightId}/events after-seq,github-installation-id,limit active +nullify api dast get-pentest-scans GET /dast/pentest/scans/{scanId} github-installation-id active +nullify api dast get-pentest-scans-activity GET /dast/pentest/scans/{scanId}/activity github-installation-id,limit,since-id active +nullify api dast get-pentest-scans-auth-matrix-evidence GET /dast/pentest/scans/{scanId}/auth-matrix/evidence attempt-id,cursor,evidence-ref,github-installation-id,identity-id,method,path,since,stage,until active +nullify api dast get-pentest-scans-findings GET /dast/pentest/scans/{scanId}/findings github-installation-id active +nullify api dast get-pentest-scans-logs GET /dast/pentest/scans/{scanId}/logs github-installation-id active +nullify api dast get-pentest-scans-report-external-pdf GET /dast/pentest/scans/{scanId}/report/external/pdf github-installation-id active +nullify api dast get-pentest-scans-report-pdf GET /dast/pentest/scans/{scanId}/report/pdf github-installation-id active +nullify api dast get-pentest-scans-status GET /dast/pentest/scans/{scanId}/status github-installation-id active +nullify api dast get-preflights GET /dast/pentest/preflights/{preflightId} github-installation-id active +nullify api dast get-quota GET /dast/pentest/applications/{applicationId}/preflight/quota github-installation-id active +nullify api dast get-report GET /dast/pentest/scans/{scanId}/report exclude,github-installation-id active +nullify api dast get-runs GET /dast/exploit-validation/runs/{runId} execution-arn,github-installation-id active +nullify api dast get-state GET /dast/pentest/findings/{findingId}/autofix/state github-installation-id active +nullify api dast get-status GET /dast/pentest/findings/{findingId}/autofix/status github-installation-id active +nullify api dast get-status-validations GET /dast/web-services/{webServiceId}/status-validations github-installation-id,limit,next-token active +nullify api dast get-targets GET /dast/targets/{targetId} github-installation-id active +nullify api dast get-targets-validations GET /dast/targets/{targetId}/validations github-installation-id,limit,next-token active +nullify api dast get-transactions GET /dast/pentest/scans/{scanId}/logs/transactions cursor,evidence-ref,github-installation-id,identity-id,method,path,since,stage,until active +nullify api dast get-web-services GET /dast/web-services/{webServiceId} github-installation-id active +nullify api dast get-web-services-credentials GET /dast/web-services/{webServiceId}/credentials github-installation-id active +nullify api dast list-applications GET /dast/pentest/applications github-installation-id,limit,next-token active +nullify api dast list-applications-2 GET /dast/applications github-installation-id,limit,next-token active +nullify api dast list-attempts GET /dast/exploit-validation/attempts github-installation-id,limit,next-token active +nullify api dast list-budget GET /dast/pentest/budget github-installation-id active +nullify api dast list-bughunt-findings GET /dast/bughunt/findings github-installation-id active +nullify api dast list-bughunt-scans GET /dast/bughunt/scans github-installation-id,limit,next-token,offset,search active +nullify api dast list-config GET /dast/bughunt/config github-installation-id active +nullify api dast list-credentials GET /dast/credentials github-installation-id,limit,offset,search active +nullify api dast list-last GET /dast/scans/status/last github-installation-id active +nullify api dast list-mutation-warning GET /dast/pentest/mutation-warning github-installation-id active +nullify api dast list-pentest-findings GET /dast/pentest/findings github-installation-id,is-allowlisted,is-false-positive,is-latest,is-resolved,limit,next-token,priority-label,scan-id,sort,sort-by active +nullify api dast list-pentest-scans GET /dast/pentest/scans github-installation-id,limit,next-token,offset,search active +nullify api dast list-policies GET /dast/exploit-validation/policies github-installation-id active +nullify api dast list-sourceips GET /dast/sourceips github-installation-id active +nullify api dast list-suite-runs GET /dast/bughunt/suite-runs github-installation-id active +nullify api dast list-targets GET /dast/targets github-installation-id,limit,next-token active +nullify api dast list-web-services GET /dast/web-services github-installation-id,limit,next-token active +nullify api dast patch-allowlist PATCH /dast/bughunt/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api dast patch-applications PATCH /dast/pentest/applications/{applicationId} data,data-file,github-installation-id active +nullify api dast update-active PUT /dast/credentials/{credentialId}/active data,data-file,github-installation-id active +nullify api dast update-applications PUT /dast/pentest/applications/{applicationId} data,data-file,github-installation-id active +nullify api dast update-applications-2 PUT /dast/applications/{applicationId} data,data-file,github-installation-id active +nullify api dast update-classification PUT /dast/targets/{targetId}/classification data,data-file,github-installation-id active +nullify api dast update-config PUT /dast/bughunt/config data,data-file,github-installation-id active +nullify api dast update-credentials PUT /dast/credentials/{credentialId} data,data-file,github-installation-id active +nullify api dast update-exploit-validation-consent PUT /dast/targets/{targetId}/exploit-validation-consent data,data-file,github-installation-id active +nullify api dast update-mutation-consent PUT /dast/pentest/applications/{applicationId}/mutation-consent data,data-file,github-installation-id active +nullify api dast update-policies PUT /dast/exploit-validation/policies/{policyId} data,data-file,github-installation-id active +nullify api dast update-targets PUT /dast/targets/{targetId} data,data-file,github-installation-id active +nullify api dast update-web-services PUT /dast/web-services/{webServiceId} data,data-file,github-installation-id active +nullify api findings active +nullify api findings create-feedback-by-id POST /findings/{findingId}/feedback data,data-file,github-installation-id active +nullify api findings get-feedback GET /findings/{findingId}/feedback github-installation-id active +nullify api infrastructure active +nullify api infrastructure get-download GET /context/infrastructure/graphs/{accountId}/download github-installation-id deprecated +nullify api infrastructure get-graphs GET /context/infrastructure/graphs/{accountId} github-installation-id deprecated +nullify api infrastructure get-graphs-versions GET /context/infrastructure/graphs/{accountId}/versions github-installation-id deprecated +nullify api infrastructure get-graphs-versions-2 GET /context/infrastructure/graphs/{accountId}/versions/{version} github-installation-id deprecated +nullify api infrastructure list-graphs GET /context/infrastructure/graphs github-installation-id deprecated +nullify api infrastructure list-info GET /context/infrastructure/graphs/info github-installation-id deprecated +nullify api infrastructure list-summary GET /context/infrastructure/graphs/summary github-installation-id deprecated +nullify api manager active +nullify api manager create-action-items-nudge-by-id POST /manager/action-items/{actionItemId}/nudge data,data-file,github-installation-id active +nullify api manager create-answer-by-id POST /manager/action-items/{actionItemId}/answer data,data-file,github-installation-id active +nullify api manager create-assign-repo-by-id POST /manager/action-items/{actionItemId}/assign-repo data,data-file,github-installation-id active +nullify api manager create-assign-team-by-id POST /manager/action-items/{actionItemId}/assign-team data,data-file,github-installation-id active +nullify api manager create-campaigns POST /manager/campaigns data,data-file,github-installation-id active +nullify api manager create-config POST /manager/config data,data-file,github-installation-id active +nullify api manager create-daily-summary-trigger POST /manager/daily-summary/trigger data,data-file,github-installation-id active +nullify api manager create-deduplicate POST /manager/events/deduplicate data,data-file,github-installation-id active +nullify api manager create-dismiss-by-id POST /manager/action-items/{actionItemId}/dismiss data,data-file,github-installation-id active +nullify api manager create-fix-prs-nudge-by-id POST /manager/fix-prs/{recordId}/nudge data,data-file,github-installation-id active +nullify api manager create-generate POST /manager/campaigns/default/generate github-installation-id,page,page-size active +nullify api manager create-groundrules POST /manager/groundrules data,data-file,github-installation-id active +nullify api manager create-identity-classifications POST /manager/identity-classifications data,data-file,github-installation-id active +nullify api manager create-investigate-by-id POST /manager/threats/{threatId}/investigate data,data-file,github-installation-id active +nullify api manager create-map-user-by-id POST /manager/action-items/{actionItemId}/map-user data,data-file,github-installation-id active +nullify api manager create-proposals-decision POST /manager/proposals/decision data,data-file,github-installation-id active +nullify api manager create-reopen-by-id POST /manager/action-items/{actionItemId}/reopen data,data-file,github-installation-id active +nullify api manager create-resubmit-by-id POST /manager/threat-reports/{requestId}/resubmit github-installation-id active +nullify api manager create-snooze-by-id POST /manager/action-items/{actionItemId}/snooze data,data-file,github-installation-id active +nullify api manager create-strategy-proposal-decision POST /manager/strategy/proposal/decision data,data-file,github-installation-id active +nullify api manager create-strategy-trigger POST /manager/strategy/trigger github-installation-id active +nullify api manager create-tacit-knowledge-trigger POST /manager/tacit-knowledge/trigger github-installation-id active +nullify api manager create-threat-investigations POST /manager/threat-investigations data,data-file,github-installation-id active +nullify api manager create-threat-reports POST /manager/threat-reports data,data-file,github-installation-id active +nullify api manager create-trigger POST /manager/trigger data,data-file,github-installation-id active +nullify api manager create-withdraw-by-id POST /manager/threat-reports/{requestId}/withdraw github-installation-id active +nullify api manager create-wizard-progress POST /manager/onboarding/wizard-progress data,data-file,github-installation-id active +nullify api manager delete-action-items DELETE /manager/action-items/{actionItemId} github-installation-id active +nullify api manager delete-campaigns DELETE /manager/campaigns/{campaignId} github-installation-id active +nullify api manager delete-events DELETE /manager/events/{eventId} github-installation-id active +nullify api manager delete-identity-classifications DELETE /manager/identity-classifications/{provider}/{providerUserId} github-installation-id,reason active +nullify api manager delete-sessions DELETE /manager/chat/sessions/{chatID} github-installation-id active +nullify api manager get-action-items GET /manager/action-items/{actionItemId} github-installation-id active +nullify api manager get-actions GET /manager/chat/sessions/{chatID}/actions github-installation-id active +nullify api manager get-audit GET /manager/chat/sessions/{chatID}/audit github-installation-id,limit,next-token active +nullify api manager get-campaigns GET /manager/campaigns/{campaignId} github-installation-id active +nullify api manager get-campaigns-events GET /manager/campaigns/{campaignId}/events action-types,github-installation-id,page,page-size,statuses active +nullify api manager get-campaigns-runs GET /manager/campaigns/{campaignId}/runs cursor,github-installation-id,limit,offset active +nullify api manager get-campaigns-runs-2 GET /manager/campaigns/{campaignId}/runs/{runId} github-installation-id active +nullify api manager get-findings GET /manager/campaigns/{campaignId}/findings github-installation-id active +nullify api manager get-findings-events GET /manager/findings/{findingId}/events action-types,cursor,github-installation-id,limit,statuses active +nullify api manager get-history GET /manager/chat/sessions/{chatID}/history github-installation-id,include-replay,page,page-size active +nullify api manager get-messages GET /manager/action-items/{actionItemId}/messages github-installation-id,include-replay,page,page-size active +nullify api manager get-nudge GET /manager/fix-prs/{recordId}/nudge github-installation-id active +nullify api manager get-preview GET /manager/campaigns/{campaignId}/preview github-installation-id active +nullify api manager get-progress GET /manager/threat-investigations/{threatInvestigationId}/progress github-installation-id active +nullify api manager get-runs GET /manager/runs/{runId} github-installation-id active +nullify api manager get-sessions GET /manager/chat/sessions/{chatID} github-installation-id active +nullify api manager get-threat-investigations GET /manager/threat-investigations/{threatInvestigationId} github-installation-id,include-versions,version-limit,version-offset active +nullify api manager get-threat-reports GET /manager/threat-reports/{requestId} github-installation-id active +nullify api manager list-action-items GET /manager/action-items answer-type,finding-id,finding-type,github-installation-id,group-key,kind,page,page-size,sort,state,status,team-id,unassigned-only active +nullify api manager list-campaigns GET /manager/campaigns github-installation-id,page,page-size active +nullify api manager list-config GET /manager/config github-installation-id active +nullify api manager list-default GET /manager/campaigns/default github-installation-id active +nullify api manager list-escalation-recipients GET /manager/escalation-recipients github-installation-id active +nullify api manager list-escalations-config GET /manager/escalations/config github-installation-id active +nullify api manager list-events GET /manager/events github-installation-id,page,page-size active +nullify api manager list-findings GET /manager/campaigns/findings github-installation-id active +nullify api manager list-groundrules GET /manager/groundrules github-installation-id active +nullify api manager list-identity-classifications GET /manager/identity-classifications decision,github-installation-id active +nullify api manager list-latest GET /manager/state/latest github-installation-id active +nullify api manager list-metrics GET /manager/metrics as-of,github-installation-id active +nullify api manager list-plans GET /manager/plans campaign-id,github-installation-id,page,page-size active +nullify api manager list-previews GET /manager/campaigns/previews github-installation-id,limit,offset,page,page-size active +nullify api manager list-program GET /manager/program github-installation-id active +nullify api manager list-proposal GET /manager/strategy/proposal github-installation-id active +nullify api manager list-proposals GET /manager/proposals github-installation-id active +nullify api manager list-refresh GET /manager/campaigns/metrics/refresh github-installation-id,include-expired active +nullify api manager list-sessions GET /manager/chat/sessions github-installation-id,limit,next-token active +nullify api manager list-state GET /manager/state github-installation-id active +nullify api manager list-states GET /manager/states github-installation-id,page,page-size active +nullify api manager list-strategy GET /manager/strategy github-installation-id active +nullify api manager list-summaries GET /manager/campaigns/summaries github-installation-id,page,page-size active +nullify api manager list-summary GET /manager/action-items/summary github-installation-id active +nullify api manager list-threat-investigations GET /manager/threat-investigations affected-only,ecosystem,github-installation-id,limit,offset,page,page-size,search,severity,sort,status active +nullify api manager list-threat-reports GET /manager/threat-reports github-installation-id,page,page-size active +nullify api manager list-threats GET /manager/threats advisory-id,cve-id,ecosystem,github-installation-id,kind,page,page-size,published-after,published-before,q,severity,sort,verdict active +nullify api manager list-users GET /manager/engagement/users campaign-id,cursor,github-installation-id,since active +nullify api manager list-versions GET /manager/strategy/versions github-installation-id,page,page-size active +nullify api manager patch-action-items PATCH /manager/action-items/{actionItemId} data,data-file,github-installation-id active +nullify api manager patch-campaigns PATCH /manager/campaigns/{campaignId} data,data-file,github-installation-id active +nullify api manager patch-groundrules PATCH /manager/groundrules data,data-file,github-installation-id active +nullify api manager patch-program PATCH /manager/program data,data-file,github-installation-id active +nullify api manager patch-sessions PATCH /manager/chat/sessions/{chatID} data,data-file,github-installation-id active +nullify api manager patch-strategy PATCH /manager/strategy data,data-file,github-installation-id active +nullify api manager patch-threat-investigations PATCH /manager/threat-investigations/{threatInvestigationId} data,data-file,github-installation-id active +nullify api manager update-chat PUT /manager/action-items/{actionItemId}/chat github-installation-id active +nullify api manager update-config PUT /manager/escalations/config data,data-file,github-installation-id active +nullify api manager update-general PUT /manager/chat/general github-installation-id active +nullify api orchestrator active +nullify api orchestrator create-batch POST /orchestrator/autofix/batch data,data-file,github-installation-id active +nullify api orchestrator create-close-by-id POST /orchestrator/findings/{findingID}/ticket/close data,data-file,github-installation-id active +nullify api orchestrator create-control-by-id POST /orchestrator/runs/{kind}/{runId}/control data,data-file,github-installation-id active +nullify api orchestrator create-iterate-pr POST /orchestrator/autofix/iterate-pr data,data-file,github-installation-id active +nullify api orchestrator create-override POST /orchestrator/checkruns/override data,data-file,github-installation-id active +nullify api orchestrator create-retriage POST /orchestrator/findings/retriage data,data-file,github-installation-id active +nullify api orchestrator create-reviews-by-id POST /orchestrator/repositories/{repositoryId}/pull-requests/{number}/reviews github-installation-id active +nullify api orchestrator create-scans-by-id POST /orchestrator/repositories/{repositoryId}/scans data,data-file,github-installation-id active +nullify api orchestrator create-start POST /orchestrator/onboarding/start data,data-file,github-installation-id active +nullify api orchestrator get-autofix-iterations GET /orchestrator/findings/{findingID}/autofix-iterations finding-type,github-installation-id active +nullify api orchestrator get-batch GET /orchestrator/autofix/batch/{executionId} github-installation-id active +nullify api orchestrator get-capabilities GET /orchestrator/runs/{kind}/{runId}/control/capabilities github-installation-id active +nullify api orchestrator get-codereviews GET /orchestrator/codereviews/{id} github-installation-id active +nullify api orchestrator get-retriage GET /orchestrator/findings/retriage/{activityId} github-installation-id active +nullify api orchestrator get-scans GET /orchestrator/repositories/{repositoryId}/scans/{runId} github-installation-id,services active +nullify api orchestrator list-checkruns GET /orchestrator/checkruns github-installation-id,include-default-branch,max-repositories,repository-commit,repository-id,since active +nullify api orchestrator list-codereviews GET /orchestrator/codereviews blocked,github-installation-id,limit,next-token,offset,since active +nullify api orchestrator list-requirements GET /orchestrator/onboarding/requirements github-installation-id active +nullify api orchestrator list-status GET /orchestrator/onboarding/status github-installation-id active +nullify api sast active +nullify api sast create-allowlist POST /sast/findings/allowlist data,data-file,github-installation-id active +nullify api sast create-allowlist-by-id POST /sast/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api sast create-fix-by-id POST /sast/findings/{findingId}/autofix/fix data,data-file,github-installation-id active +nullify api sast create-ticket-by-id POST /sast/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api sast create-unallowlist-by-id POST /sast/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api sast delete-ticket DELETE /sast/findings/{findingId}/ticket github-installation-id active +nullify api sast get-activity GET /sast/findings/{findingId}/autofix/activity github-installation-id,limit,since-id active +nullify api sast get-diff GET /sast/findings/{findingId}/autofix/cache/diff github-installation-id active +nullify api sast get-events GET /sast/findings/{findingId}/events github-installation-id,next-token active +nullify api sast get-findings GET /sast/findings/{findingId} github-installation-id active +nullify api sast get-repositories GET /sast/repositories/{repositoryId} github-installation-id active +nullify api sast get-state GET /sast/findings/{findingId}/autofix/state github-installation-id active +nullify api sast get-status GET /sast/findings/{findingId}/autofix/status github-installation-id active +nullify api sast get-triage GET /sast/findings/{findingId}/triage github-installation-id active +nullify api sast get-users GET /sast/findings/{findingId}/users github-installation-id active +nullify api sast list-detailed GET /sast/findings/detailed ai-generated,branch,file-owner-name,file-path,github-installation-id,has-pull-request,is-allowlisted,is-archived,is-false-positive,is-fixed,is-resolved,language,limit,next-token,priority-label,repository-id,severity,sort,sort-by,workflow active +nullify api sast list-events GET /sast/events event-type,file-owner-name,finding-id,from-time,github-installation-id,limit,next-token,sort active +nullify api sast list-findings GET /sast/findings ai-generated,auto-fix-state,branch,file-owner-name,github-installation-id,has-pull-request,is-allowlisted,is-archived,is-false-positive,is-fixed,is-latest,is-resolved,limit,next-token,priority-label,repository-ids,severity,sort,sort-by,workflow active +nullify api sast list-preview GET /sast/findings/preview ai-generated,auto-fix-state,branch,file-owner-name,github-installation-id,has-pull-request,is-allowlisted,is-archived,is-false-positive,is-fixed,is-latest,is-resolved,limit,next-token,priority-label,repository-ids,severity,sort,sort-by,workflow active +nullify api sast list-repositories GET /sast/repositories github-installation-id,limit,next-token active +nullify api sast list-scan-runs GET /sast/scan-runs from,github-installation-id,limit,offset,repository-id,sort,to active +nullify api sast patch-findings PATCH /sast/findings/{findingId} data,data-file,github-installation-id active +nullify api sca active +nullify api sca create-containers-findings-allowlist-by-id POST /sca/containers/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api sca create-containers-findings-autofix-fix-by-id POST /sca/containers/findings/{findingId}/autofix/fix data,data-file,github-installation-id active +nullify api sca create-containers-findings-ticket-by-id POST /sca/containers/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api sca create-containers-findings-unallowlist-by-id POST /sca/containers/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api sca create-dependencies-findings-allowlist-by-id POST /sca/dependencies/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api sca create-dependencies-findings-autofix-fix-by-id POST /sca/dependencies/findings/{findingId}/autofix/fix data,data-file,github-installation-id active +nullify api sca create-dependencies-findings-ticket-by-id POST /sca/dependencies/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api sca create-dependencies-findings-unallowlist-by-id POST /sca/dependencies/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api sca delete-containers-findings-ticket DELETE /sca/containers/findings/{findingId}/ticket github-installation-id active +nullify api sca delete-dependencies-findings-ticket DELETE /sca/dependencies/findings/{findingId}/ticket github-installation-id active +nullify api sca get-containers-findings GET /sca/containers/findings/{findingId} github-installation-id active +nullify api sca get-containers-findings-autofix-activity GET /sca/containers/findings/{findingId}/autofix/activity github-installation-id,limit,since-id active +nullify api sca get-containers-findings-autofix-state GET /sca/containers/findings/{findingId}/autofix/state github-installation-id active +nullify api sca get-containers-findings-autofix-status GET /sca/containers/findings/{findingId}/autofix/status github-installation-id active +nullify api sca get-containers-findings-events GET /sca/containers/findings/{findingId}/events github-installation-id,next-token active +nullify api sca get-containers-findings-triage GET /sca/containers/findings/{findingId}/triage github-installation-id active +nullify api sca get-containers-findings-triage-activity GET /sca/containers/findings/{findingId}/triage/activity github-installation-id,limit,since-id active +nullify api sca get-containers-findings-triage-status GET /sca/containers/findings/{findingId}/triage/status github-installation-id active +nullify api sca get-containers-findings-users GET /sca/containers/findings/{findingId}/users github-installation-id active +nullify api sca get-dependencies-findings GET /sca/dependencies/findings/{findingId} github-installation-id active +nullify api sca get-dependencies-findings-autofix-activity GET /sca/dependencies/findings/{findingId}/autofix/activity github-installation-id,limit,since-id active +nullify api sca get-dependencies-findings-autofix-state GET /sca/dependencies/findings/{findingId}/autofix/state github-installation-id active +nullify api sca get-dependencies-findings-autofix-status GET /sca/dependencies/findings/{findingId}/autofix/status github-installation-id active +nullify api sca get-dependencies-findings-events GET /sca/dependencies/findings/{findingId}/events github-installation-id,next-token active +nullify api sca get-dependencies-findings-triage GET /sca/dependencies/findings/{findingId}/triage github-installation-id active +nullify api sca get-dependencies-findings-triage-activity GET /sca/dependencies/findings/{findingId}/triage/activity github-installation-id,limit,since-id active +nullify api sca get-dependencies-findings-triage-status GET /sca/dependencies/findings/{findingId}/triage/status github-installation-id active +nullify api sca get-dependencies-findings-users GET /sca/dependencies/findings/{findingId}/users github-installation-id,source-owner-only active +nullify api sca get-diff GET /sca/dependencies/findings/{findingId}/autofix/cache/diff github-installation-id active +nullify api sca get-findings GET /sca/vulnerabilities/{cveId}/findings branch,file-owner-name,github-installation-id,is-resolved,limit,offset,type active +nullify api sca get-packages GET /sca/vulnerabilities/{cveId}/packages github-installation-id active +nullify api sca get-repositories GET /sca/repositories/{repositoryId} github-installation-id active +nullify api sca get-threat-feed GET /sca/threat-feed/{threatId} github-installation-id active +nullify api sca get-vulnerabilities GET /sca/vulnerabilities/{cveId} github-installation-id active +nullify api sca list-containers-findings GET /sca/containers/findings auto-fix-state,branch,file-owner-name,github-installation-id,is-allowlisted,is-false-positive,is-fixed,is-resolved,limit,next-token,package,sort,sort-by,workflow active +nullify api sca list-containers-findings-detailed GET /sca/containers/findings/detailed branch,file-owner-name,github-installation-id,is-allowlisted,is-false-positive,is-fixed,is-resolved,limit,next-token,package,repository-id,sort,sort-by,workflow active +nullify api sca list-containers-findings-preview GET /sca/containers/findings/preview auto-fix-state,branch,file-owner-name,github-installation-id,is-allowlisted,is-false-positive,is-fixed,is-resolved,limit,next-token,package,sort,sort-by,workflow active +nullify api sca list-dependencies-findings GET /sca/dependencies/findings auto-fix-state,branch,file-owner-name,github-installation-id,has-multiple-versions,is-allowlisted,is-false-positive,is-fixed,is-resolved,limit,next-token,package,sort,sort-by,workflow active +nullify api sca list-dependencies-findings-detailed GET /sca/dependencies/findings/detailed branch,file-owner-name,github-installation-id,has-multiple-versions,is-allowlisted,is-false-positive,is-fixed,is-resolved,limit,next-token,package,repository-id,sort,sort-by,workflow active +nullify api sca list-dependencies-findings-preview GET /sca/dependencies/findings/preview auto-fix-state,branch,file-owner-name,github-installation-id,has-multiple-versions,is-allowlisted,is-false-positive,is-fixed,is-resolved,limit,next-token,package,sort,sort-by,workflow active +nullify api sca list-events GET /sca/events event-type,file-owner-name,finding-id,from-time,github-installation-id,limit,next-token,sort active +nullify api sca list-repositories GET /sca/repositories github-installation-id,limit,next-token active +nullify api sca list-scan-runs GET /sca/scan-runs from,github-installation-id,limit,offset,repository-id,scan-type,sort,to active +nullify api sca list-threat-feed GET /sca/threat-feed cve-id,ecosystem,github-installation-id,limit,offset,severity active +nullify api sca list-vulnerabilities GET /sca/vulnerabilities github-installation-id,kev-only,limit,offset,open-only,package,sort-by active +nullify api sca patch-containers-findings PATCH /sca/containers/findings/{findingId} data,data-file,github-installation-id active +nullify api sca patch-dependencies-findings PATCH /sca/dependencies/findings/{findingId} data,data-file,github-installation-id active +nullify api scpm active +nullify api scpm create-allowlist POST /scpm/findings/allowlist data,data-file,github-installation-id active +nullify api scpm create-allowlist-by-id POST /scpm/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api scpm create-batch POST /scpm/dependencies/query/batch data,data-file,github-installation-id active +nullify api scpm create-containers-analyze POST /scpm/containers/analyze data,data-file,github-installation-id active +nullify api scpm create-dependencies-analyze POST /scpm/dependencies/analyze data,data-file,github-installation-id active +nullify api scpm create-fix-by-id POST /scpm/findings/{findingId}/autofix/fix data,data-file,github-installation-id active +nullify api scpm create-ticket-by-id POST /scpm/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api scpm create-unallowlist-by-id POST /scpm/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api scpm create-unmark-false-positive-by-id POST /scpm/findings/{findingId}/unmark-false-positive github-installation-id active +nullify api scpm create-upload POST /scpm/findings/upload data,data-file,github-installation-id active +nullify api scpm delete-ticket DELETE /scpm/findings/{findingId}/ticket github-installation-id active +nullify api scpm get-activity GET /scpm/findings/{findingId}/autofix/activity github-installation-id,limit,since-id active +nullify api scpm get-events GET /scpm/findings/{findingId}/events github-installation-id,next-token active +nullify api scpm get-findings GET /scpm/findings/{findingId} github-installation-id active +nullify api scpm get-state GET /scpm/findings/{findingId}/autofix/state github-installation-id active +nullify api scpm get-status GET /scpm/findings/{findingId}/autofix/status github-installation-id active +nullify api scpm get-triage GET /scpm/findings/{findingId}/triage github-installation-id active +nullify api scpm get-users GET /scpm/findings/{findingId}/users github-installation-id active +nullify api scpm list-detailed GET /scpm/findings/detailed branch,file-owner-name,finding-type,gate-base,github-installation-id,has-pull-request,is-allowlisted,is-archived,is-false-positive,is-fixed,is-resolved,language,limit,next-token,priority-label,repository-id,rule-id,severity,sort,sort-by,workflow active +nullify api scpm list-events GET /scpm/events event-type,finding-id,from-time,github-installation-id,limit,next-token,sort active +nullify api scpm list-findings GET /scpm/findings branch,file-owner-name,finding-type,github-installation-id,has-pull-request,is-allowlisted,is-archived,is-false-positive,is-fixed,is-resolved,language,limit,next-token,priority-label,repository-ids,rule-id,severity,sort,sort-by,workflow active +nullify api scpm list-preview GET /scpm/findings/preview branch,file-owner-name,finding-type,github-installation-id,has-pull-request,is-allowlisted,is-archived,is-false-positive,is-fixed,is-resolved,language,limit,next-token,priority-label,repository-ids,rule-id,severity,sort,sort-by,workflow active +nullify api scpm list-repositories GET /scpm/repositories github-installation-id,limit,next-token active +nullify api scpm list-scan-runs GET /scpm/scan-runs from,github-installation-id,limit,offset,repository-id,sort,to active +nullify api scpm list-settings GET /scpm/settings github-installation-id active +nullify api scpm patch-findings PATCH /scpm/findings/{findingId} data,data-file,github-installation-id active +nullify api scpm update-settings PUT /scpm/settings data,data-file,github-installation-id active +nullify api secrets active +nullify api secrets create-credentials-findings-allowlist-batch POST /secrets/credentials/findings/allowlist/batch data,data-file,github-installation-id active +nullify api secrets create-credentials-findings-allowlist-by-id POST /secrets/credentials/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api secrets create-credentials-findings-ticket-by-id POST /secrets/credentials/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api secrets create-credentials-findings-unallowlist-by-id POST /secrets/credentials/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api secrets create-findings-allowlist-batch POST /secrets/findings/allowlist/batch data,data-file,github-installation-id active +nullify api secrets create-findings-allowlist-by-id POST /secrets/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api secrets create-findings-ticket-by-id POST /secrets/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api secrets create-findings-unallowlist-by-id POST /secrets/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api secrets create-sensitivedata-findings-allowlist-batch POST /secrets/sensitivedata/findings/allowlist/batch data,data-file,github-installation-id active +nullify api secrets create-sensitivedata-findings-allowlist-by-id POST /secrets/sensitivedata/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify api secrets create-sensitivedata-findings-ticket-by-id POST /secrets/sensitivedata/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify api secrets create-sensitivedata-findings-unallowlist-by-id POST /secrets/sensitivedata/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify api secrets delete-credentials-findings-ticket DELETE /secrets/credentials/findings/{findingId}/ticket github-installation-id active +nullify api secrets delete-findings-ticket DELETE /secrets/findings/{findingId}/ticket github-installation-id active +nullify api secrets delete-sensitivedata-findings-ticket DELETE /secrets/sensitivedata/findings/{findingId}/ticket github-installation-id active +nullify api secrets get-credentials-findings GET /secrets/credentials/findings/{findingId} github-installation-id active +nullify api secrets get-credentials-findings-events GET /secrets/credentials/findings/{findingId}/events github-installation-id,next-token active +nullify api secrets get-credentials-findings-triage GET /secrets/credentials/findings/{findingId}/triage github-installation-id active +nullify api secrets get-credentials-findings-users GET /secrets/credentials/findings/{findingId}/users github-installation-id active +nullify api secrets get-findings GET /secrets/findings/{findingId} github-installation-id active +nullify api secrets get-findings-events GET /secrets/findings/{findingId}/events github-installation-id,next-token active +nullify api secrets get-findings-triage GET /secrets/findings/{findingId}/triage github-installation-id active +nullify api secrets get-findings-users GET /secrets/findings/{findingId}/users github-installation-id active +nullify api secrets get-sensitivedata-findings GET /secrets/sensitivedata/findings/{findingId} github-installation-id active +nullify api secrets get-sensitivedata-findings-triage GET /secrets/sensitivedata/findings/{findingId}/triage github-installation-id active +nullify api secrets get-sensitivedata-findings-users GET /secrets/sensitivedata/findings/{findingId}/users github-installation-id active +nullify api secrets list-credentials-findings GET /secrets/credentials/findings branch,file-owner-name,github-installation-id,is-allowlisted,is-false-positive,is-resolved,limit,next-token,secret-type,sort,sort-by active +nullify api secrets list-credentials-findings-detailed GET /secrets/credentials/findings/detailed branch,file-owner-name,file-path,github-installation-id,is-allowlisted,is-false-positive,is-resolved,limit,next-token,repository-id,secret-type,sort,sort-by active +nullify api secrets list-events GET /secrets/events branch,event-type,file-owner-name,finding-id,from-time,github-installation-id,limit,next-token,num-items,sort active +nullify api secrets list-findings GET /secrets/findings branch,file-owner-name,github-installation-id,is-allowlisted,is-false-positive,is-resolved,limit,next-token,secret-type,sort,sort-by active +nullify api secrets list-findings-detailed GET /secrets/findings/detailed branch,file-owner-name,file-path,github-installation-id,is-allowlisted,is-false-positive,is-resolved,limit,next-token,repository-id,secret-type,sort,sort-by active +nullify api secrets list-preview GET /secrets/findings/preview branch,file-owner-name,github-installation-id,is-allowlisted,is-false-positive,is-resolved,limit,next-token,secret-type,sort,sort-by active +nullify api secrets list-scan-runs GET /secrets/scan-runs from,github-installation-id,limit,offset,repository-id,sort,to active +nullify api secrets list-sensitivedata-findings GET /secrets/sensitivedata/findings branch,file-owner-name,github-installation-id,is-allowlisted,is-false-positive,is-resolved,limit,next-token,secret-type,sort,sort-by active +nullify api secrets patch-credentials-findings PATCH /secrets/credentials/findings/{findingId} data,data-file,github-installation-id active +nullify api secrets patch-findings PATCH /secrets/findings/{findingId} data,data-file,github-installation-id active +nullify api secrets patch-sensitivedata-findings PATCH /secrets/sensitivedata/findings/{findingId} data,data-file,github-installation-id active +nullify auth active +nullify auth config active +nullify auth login installation active +nullify auth logout active +nullify auth status active +nullify auth switch installation active +nullify auth token active +nullify bughunt active +nullify bughunt create-bughunt-findings-ticket-by-id POST /dast/bughunt/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify bughunt create-bughunt-scans-stop-by-id POST /dast/bughunt/scans/{scanId}/stop github-installation-id active +nullify bughunt create-import POST /dast/bughunt/program/import data,data-file,github-installation-id active +nullify bughunt create-run-now-by-id POST /dast/bughunt/suites/{suite}/run-now data,data-file,github-installation-id active +nullify bughunt create-scans POST /dast/bughunt/scans data,data-file,github-installation-id active +nullify bughunt create-validate POST /dast/bughunt/config/validate data,data-file,github-installation-id active +nullify bughunt delete-bughunt-findings-ticket DELETE /dast/bughunt/findings/{findingId}/ticket github-installation-id active +nullify bughunt get-bughunt-findings GET /dast/bughunt/findings/{findingId} github-installation-id active +nullify bughunt get-bughunt-findings-events GET /dast/bughunt/findings/{findingId}/events github-installation-id active +nullify bughunt get-bughunt-scans GET /dast/bughunt/scans/{scanId} github-installation-id active +nullify bughunt get-bughunt-scans-activity GET /dast/bughunt/scans/{scanId}/activity github-installation-id,limit,since-id active +nullify bughunt get-bughunt-scans-diff GET /dast/bughunt/scans/{scanId}/diff against,github-installation-id active +nullify bughunt get-bughunt-scans-findings GET /dast/bughunt/scans/{scanId}/findings github-installation-id,limit,offset active +nullify bughunt get-bughunt-scans-logs GET /dast/bughunt/scans/{scanId}/logs github-installation-id active +nullify bughunt get-bughunt-scans-status GET /dast/bughunt/scans/{scanId}/status github-installation-id active +nullify bughunt list-bughunt-findings GET /dast/bughunt/findings github-installation-id active +nullify bughunt list-bughunt-scans GET /dast/bughunt/scans github-installation-id,limit,next-token,offset,search active +nullify bughunt list-config GET /dast/bughunt/config github-installation-id active +nullify bughunt list-suite-runs GET /dast/bughunt/suite-runs github-installation-id active +nullify bughunt patch-allowlist PATCH /dast/bughunt/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify bughunt update-config PUT /dast/bughunt/config data,data-file,github-installation-id active +nullify ci active +nullify ci gate repo,severity-threshold,type active +nullify ci report format,repo active +nullify completion [bash|zsh|fish|powershell] active +nullify deps active +nullify deps analyze base,fail-on,format,head,idempotency-seed,repo,wait,wait-interval,wait-timeout active +nullify findings debug,from,limit,repo,severity,status,to,type active +nullify findings allowlist allowlist-type,reason,type active +nullify findings archive type active +nullify findings create-ticket type active +nullify findings delete-ticket type active +nullify findings feedback comment,verdict active +nullify findings fix-diff type active +nullify findings fix-status type active +nullify findings get type active +nullify findings get-feedback active +nullify findings list debug,from,limit,repo,severity,status,to,type active +nullify findings mark-false-positive reason,type active +nullify findings triage type active +nullify findings unallowlist reason,type active +nullify findings unarchive type active +nullify findings unmark-false-positive type active +nullify fix create-pr,no-wait,timeout,type active +nullify init active +nullify mcp active +nullify mcp serve repo,tools active +nullify open active +nullify pentest app-name,auth-config,force-pull,github-owner,github-repo,header,image-label,local,spec-path,target-host,use-host-network active +nullify pentest create-allowlist-by-id POST /dast/pentest/findings/{findingId}/allowlist data,data-file,github-installation-id active +nullify pentest create-applications POST /dast/pentest/applications data,data-file,github-installation-id active +nullify pentest create-applications-2 POST /dast/applications data,data-file,github-installation-id active +nullify pentest create-credentials POST /dast/credentials data,data-file,github-installation-id active +nullify pentest create-credentials-by-id POST /dast/web-services/{webServiceId}/credentials data,data-file,github-installation-id active +nullify pentest create-credentials-validate POST /dast/credentials/validate data,data-file,github-installation-id active +nullify pentest create-fix-by-id POST /dast/pentest/findings/{findingId}/autofix/fix data,data-file,github-installation-id active +nullify pentest create-from-context POST /dast/applications/from-context data,data-file,github-installation-id active +nullify pentest create-pentest-scans-stop-by-id POST /dast/pentest/scans/{scanId}/stop github-installation-id active +nullify pentest create-preflight-by-id POST /dast/pentest/applications/{applicationId}/preflight data,data-file,github-installation-id active +nullify pentest create-readiness POST /dast/applications/readiness data,data-file,github-installation-id active +nullify pentest create-start POST /dast/pentest/start data,data-file,github-installation-id active +nullify pentest create-ticket-by-id POST /dast/pentest/findings/{findingId}/ticket data,data-file,github-installation-id active +nullify pentest create-unallowlist-by-id POST /dast/pentest/findings/{findingId}/unallowlist data,data-file,github-installation-id active +nullify pentest create-validate-by-id POST /dast/credentials/{credentialId}/validate data,data-file,github-installation-id active +nullify pentest create-validations-by-id POST /dast/credentials/{credentialId}/validations data,data-file,github-installation-id active +nullify pentest delete-applications DELETE /dast/pentest/applications/{applicationId} github-installation-id active +nullify pentest delete-applications-2 DELETE /dast/applications/{applicationId} github-installation-id active +nullify pentest delete-credentials DELETE /dast/credentials/{credentialId} github-installation-id active +nullify pentest delete-pentest-findings-ticket DELETE /dast/pentest/findings/{findingId}/ticket github-installation-id active +nullify pentest delete-web-services-credentials DELETE /dast/web-services/{webServiceId}/credentials/{credentialId} github-installation-id active +nullify pentest get-activity GET /dast/pentest/findings/{findingId}/autofix/activity github-installation-id,limit,since-id active +nullify pentest get-applications GET /dast/pentest/applications/{applicationId} github-installation-id active +nullify pentest get-applications-2 GET /dast/applications/{applicationId} github-installation-id active +nullify pentest get-cases GET /dast/pentest/scans/{scanId}/auth-matrix/cases github-installation-id,hide-not-run,identity,limit,offset,outcome active +nullify pentest get-credentials GET /dast/credentials/{credentialId} github-installation-id active +nullify pentest get-credentials-validations GET /dast/credentials/{credentialId}/validations github-installation-id,limit,next-token active +nullify pentest get-credentials-validations-status GET /dast/credentials/{credentialId}/validations/status github-installation-id active +nullify pentest get-download GET /dast/pentest/scans/{scanId}/report/download github-installation-id active +nullify pentest get-estimate GET /dast/pentest/applications/{applicationId}/estimate github-installation-id active +nullify pentest get-events GET /dast/pentest/scans/{scanId}/events after-seq,github-installation-id,limit active +nullify pentest get-full GET /dast/pentest/findings/{findingId}/full github-installation-id active +nullify pentest get-latest GET /dast/pentest/applications/{applicationId}/preflight/latest github-installation-id,target-id,web-service-id active +nullify pentest get-links GET /dast/pentest/scans/{scanId}/findings/links github-installation-id active +nullify pentest get-pentest-findings GET /dast/pentest/findings/{findingId} github-installation-id active +nullify pentest get-pentest-findings-events GET /dast/pentest/findings/{findingId}/events github-installation-id active +nullify pentest get-pentest-findings-triage GET /dast/pentest/findings/{findingId}/triage github-installation-id active +nullify pentest get-pentest-preflights-events GET /dast/pentest/preflights/{preflightId}/events after-seq,github-installation-id,limit active +nullify pentest get-pentest-scans GET /dast/pentest/scans/{scanId} github-installation-id active +nullify pentest get-pentest-scans-activity GET /dast/pentest/scans/{scanId}/activity github-installation-id,limit,since-id active +nullify pentest get-pentest-scans-auth-matrix-evidence GET /dast/pentest/scans/{scanId}/auth-matrix/evidence attempt-id,cursor,evidence-ref,github-installation-id,identity-id,method,path,since,stage,until active +nullify pentest get-pentest-scans-findings GET /dast/pentest/scans/{scanId}/findings github-installation-id active +nullify pentest get-pentest-scans-report-external-pdf GET /dast/pentest/scans/{scanId}/report/external/pdf github-installation-id active +nullify pentest get-pentest-scans-report-pdf GET /dast/pentest/scans/{scanId}/report/pdf github-installation-id active +nullify pentest get-pentest-scans-status GET /dast/pentest/scans/{scanId}/status github-installation-id active +nullify pentest get-preflights GET /dast/pentest/preflights/{preflightId} github-installation-id active +nullify pentest get-quota GET /dast/pentest/applications/{applicationId}/preflight/quota github-installation-id active +nullify pentest get-report GET /dast/pentest/scans/{scanId}/report exclude,github-installation-id active +nullify pentest get-state GET /dast/pentest/findings/{findingId}/autofix/state github-installation-id active +nullify pentest get-status GET /dast/pentest/findings/{findingId}/autofix/status github-installation-id active +nullify pentest get-transactions GET /dast/pentest/scans/{scanId}/logs/transactions cursor,evidence-ref,github-installation-id,identity-id,method,path,since,stage,until active +nullify pentest get-web-services-credentials GET /dast/web-services/{webServiceId}/credentials github-installation-id active +nullify pentest list-applications GET /dast/pentest/applications github-installation-id,limit,next-token active +nullify pentest list-applications-2 GET /dast/applications github-installation-id,limit,next-token active +nullify pentest list-budget GET /dast/pentest/budget github-installation-id active +nullify pentest list-credentials GET /dast/credentials github-installation-id,limit,offset,search active +nullify pentest list-last GET /dast/scans/status/last github-installation-id active +nullify pentest list-pentest-findings GET /dast/pentest/findings github-installation-id,is-allowlisted,is-false-positive,is-latest,is-resolved,limit,next-token,priority-label,scan-id,sort,sort-by active +nullify pentest list-pentest-scans GET /dast/pentest/scans github-installation-id,limit,next-token,offset,search active +nullify pentest patch-applications PATCH /dast/pentest/applications/{applicationId} data,data-file,github-installation-id active +nullify pentest update-active PUT /dast/credentials/{credentialId}/active data,data-file,github-installation-id active +nullify pentest update-applications PUT /dast/pentest/applications/{applicationId} data,data-file,github-installation-id active +nullify pentest update-applications-2 PUT /dast/applications/{applicationId} data,data-file,github-installation-id active +nullify pentest update-credentials PUT /dast/credentials/{credentialId} data,data-file,github-installation-id active +nullify repos active +nullify sbom active +nullify sbom get project-id,repository-id active +nullify scan active +nullify scan runs limit,repository-id,type active +nullify scan start active +nullify scan status active +nullify status active +nullify threat active +nullify threat create advice,article-links,cve-ids,cvss,description,ecosystem,keywords,severity,title active +nullify threat get active +nullify threat list active +nullify update active +nullify version active +nullify whoami active diff --git a/spec/mcp-tools.tsv b/spec/mcp-tools.tsv new file mode 100644 index 0000000..27636af --- /dev/null +++ b/spec/mcp-tools.tsv @@ -0,0 +1,49 @@ +get_application read-only admin,all,default +get_campaign read-only admin,all +get_critical_path read-only admin,all,default,findings,findings-write,minimal +get_dependency_exposure read-only admin,all,default +get_findings_for_repo read-only admin,all,default,findings,findings-write,minimal +get_latest_sbom read-only admin,all,default +get_metrics_over_time read-only admin,all +get_metrics_overview read-only admin,all +get_organization read-only admin,all +get_pentest_report read-only all +get_pentest_scan read-only all +get_repository read-only admin,all,default +get_sbom read-only admin,all,default +get_security_posture_summary read-only admin,all,default,findings,findings-write,minimal +get_security_trends read-only admin,all,default,findings,findings-write,minimal +list_action_items read-only admin,all +list_applications read-only admin,all,default +list_campaigns read-only admin,all +list_cspm_scans read-only all +list_dependencies read-only admin,all,default +list_pentest_scans read-only all +list_repositories read-only admin,all,default +list_sla_policies read-only admin,all +list_teams read-only admin,all +nullify_allowlist_finding destructive all,default,findings,findings-write +nullify_archive_finding destructive all,findings-write +nullify_create_threat_investigation destructive all,default +nullify_create_ticket destructive all,default,findings,findings-write +nullify_delete_ticket destructive all,findings-write +nullify_fix_finding destructive all,default,findings,findings-write +nullify_get_cloud_scan_status read-only all,default +nullify_get_finding read-only all,default,findings,findings-write +nullify_get_finding_events read-only all,default,findings,findings-write +nullify_get_finding_feedback read-only all,default,findings,findings-write +nullify_get_finding_triage read-only all,default,findings,findings-write +nullify_get_fix_diff read-only all,default,findings,findings-write +nullify_get_fix_status read-only all,default,findings,findings-write +nullify_get_threat_investigation read-only all,default +nullify_list_scan_runs read-only all,default +nullify_list_threat_investigations read-only all,default +nullify_mark_false_positive destructive all,findings-write +nullify_search_findings read-only all,default,findings,findings-write +nullify_start_cloud_scan destructive all,default +nullify_submit_finding_feedback destructive all,default,findings,findings-write +nullify_unallowlist_finding destructive all,default,findings,findings-write +nullify_unarchive_finding destructive all,findings-write +nullify_unmark_false_positive destructive all,findings-write +start_pentest destructive all +stop_pentest_scan destructive all diff --git a/spec/nullify-openapi-bundle.yaml b/spec/nullify-openapi-bundle.yaml index eab653e..27fc436 100644 --- a/spec/nullify-openapi-bundle.yaml +++ b/spec/nullify-openapi-bundle.yaml @@ -8,43 +8,10 @@ servers: description: Your single-tenant Nullify API endpoint tags: [] paths: - /admin/assessments/scan-coverage: + /admin/access/me: get: - description: Returns scan coverage data per repository for a given scanner type + description: Return the calling user's resolved RBAC role and team membership parameters: - - description: Scanner type - in: query - name: type - required: true - schema: - description: Scanner type - enum: - - sast - - sca_dependencies - - sca_containers - - secrets - type: string - - description: Max repos per page (default 50) - in: query - name: limit - schema: - description: Max repos per page (default 50) - nullable: true - type: integer - - description: Pagination offset (default 0) - in: query - name: offset - schema: - description: Pagination offset (default 0) - nullable: true - type: integer - - description: Case-insensitive substring filter on repository name or owner - in: query - name: search - schema: - description: Case-insensitive substring filter on repository name or owner - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -64,6 +31,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -114,64 +92,37 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetScanCoverageOutput' + $ref: '#/components/schemas/EndpointsAdminGetCallerAccessOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '401': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Scan Coverage - /admin/assessments/scan-coverage/findings: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Caller Access + /admin/access/preferences: get: - description: Returns individual findings for a repository in the scan coverage context + description: Return the tenant's RBAC preferences parameters: - - description: Scanner type - in: query - name: type - required: true - schema: - description: Scanner type - enum: - - sast - - sca_dependencies - - sca_containers - - secrets - type: string - - description: Repository ID to drill into - in: query - name: repositoryId - required: true - schema: - description: Repository ID to drill into - type: string - - description: Max findings per page (default 50, max 500) - in: query - name: limit - schema: - description: Max findings per page (default 50, max 500) - nullable: true - type: integer - - description: Pagination offset (default 0) - in: query - name: offset - schema: - description: Pagination offset (default 0) - nullable: true - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -191,6 +142,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -241,30 +203,29 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetScanCoverageFindingsOutput' + $ref: '#/components/schemas/EndpointsAdminGetRBACPreferencesOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '401': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Scan Coverage Findings - /admin/checklist: - get: - description: Get a checklist of post-install items + summary: Get RBAC Preferences + put: + description: Set the tenant's RBAC preferences parameters: - description: The Azure organization ID in: query @@ -285,6 +246,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -330,40 +302,154 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPutRBACPreferencesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminChecklistOutput' + $ref: '#/components/schemas/EndpointsAdminPutRBACPreferencesOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Checklist - /admin/context/ingest: - post: - description: Returns scoped STS credentials for uploading context data to S3 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsContextIngestInput' + summary: Set RBAC Preferences + /admin/access/users: + get: + description: List the tenant's users with their assigned RBAC roles + parameters: + - description: Max users to return (default 100, max 500) + in: query + name: limit + schema: + description: Max users to return (default 100, max 500) + format: int32 + type: integer + - description: Row offset into the filtered set; overrides startKey when set + in: query + name: offset + schema: + description: Row offset into the filtered set; overrides startKey when set + format: int32 + type: integer + - description: Pagination offset cursor from a prior response + in: query + name: startKey + schema: + description: Pagination offset cursor from a prior response + type: string + - description: Case-insensitive filter across name, username and email + in: query + name: search + schema: + description: Case-insensitive filter across name, username and email + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsContextIngestOutput' + $ref: '#/components/schemas/EndpointsAdminListUserRolesOutput' description: OK '400': content: @@ -377,16 +463,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Context Upload Credentials - /admin/events: - post: - description: Cross-service unified event feed with filtering and cursor pagination + summary: List User Roles + /admin/access/users/org-owners: + get: + description: >- + The tenant's members who own its GitHub organization, proposed as admins during onboarding. Grants nothing; + empty when the owners cannot be read. parameters: - description: The Azure organization ID in: query @@ -407,6 +501,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -452,24 +557,13 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsOutput' + $ref: '#/components/schemas/EndpointsAdminListOrgOwnersOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -488,10 +582,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Unified Events - /admin/finding/{findingId}: - get: - description: Get a single finding by ID from the metrics store + summary: List Organization Owners + /admin/access/users/roles: + put: + description: Assign an RBAC role to one or more users, creating Nullify accounts for unsynced provider members (admin only) parameters: - description: The Azure organization ID in: query @@ -512,6 +606,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -557,19 +662,17 @@ paths: items: type: string type: array - - description: The finding ID - in: path - name: findingId - required: true - schema: - description: The finding ID - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminBatchSetUserRolesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetFindingOutput' + $ref: '#/components/schemas/EndpointsAdminBatchSetUserRolesOutput' description: OK '400': content: @@ -577,6 +680,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -589,17 +698,84 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding - /admin/findings: - post: - description: Query paginated findings with filtering and sorting + summary: Set User Roles + /admin/assessments/scan-coverage: + get: + description: Returns scan coverage data per repository for a given scanner type parameters: + - description: Scanner type + in: query + name: type + required: true + schema: + description: Scanner type + enum: + - sast + - sca_dependencies + - sca_containers + - secrets + - scpm + type: string + - description: Max repos per page (default 50) + in: query + name: limit + schema: + description: Max repos per page (default 50) + nullable: true + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + nullable: true + type: integer + - description: Case-insensitive substring filter on repository name or owner + in: query + name: search + schema: + description: Case-insensitive substring filter on repository name or owner + nullable: true + type: string + - description: Sort column (default lastCommitAt) + in: query + name: sortBy + schema: + description: Sort column (default lastCommitAt) + enum: + - name + - lastCommitAt + - lastScanAt + - critical + - high + - medium + - low + - info + - total + nullable: true + type: string + - description: Sort direction (default desc) + in: query + name: sortOrder + schema: + description: Sort direction (default desc) + enum: + - asc + - desc + nullable: true + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -619,6 +795,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -664,17 +851,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminQueryFindingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminQueryFindingsOutput' + $ref: '#/components/schemas/EndpointsGetScanCoverageOutput' description: OK '400': content: @@ -682,23 +864,57 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Query Findings - /admin/findings/download: - post: - description: Download filtered findings as a CSV file + summary: Get Scan Coverage + /admin/assessments/scan-coverage/findings: + get: + description: Returns individual findings for a repository in the scan coverage context parameters: + - description: Scanner type + in: query + name: type + required: true + schema: + description: Scanner type + enum: + - sast + - sca_dependencies + - sca_containers + - secrets + - scpm + type: string + - description: Repository ID to drill into + in: query + name: repositoryId + required: true + schema: + description: Repository ID to drill into + type: string + - description: Max findings per page (default 50, max 500) + in: query + name: limit + schema: + description: Max findings per page (default 50, max 500) + nullable: true + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + nullable: true + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -718,6 +934,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -763,17 +990,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminFindingsDownloadInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminFindingsDownloadOutput' + $ref: '#/components/schemas/EndpointsGetScanCoverageFindingsOutput' description: OK '400': content: @@ -781,22 +1003,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Download Findings - /admin/fix-effort: + summary: Get Scan Coverage Findings + /admin/checklist: get: - description: Get Fix Effort Mapping that have been created for the organization + description: Get a checklist of post-install items parameters: - description: The Azure organization ID in: query @@ -817,6 +1039,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -867,7 +1100,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetFixEffortOutput' + $ref: '#/components/schemas/EndpointsAdminChecklistOutput' description: OK '401': content: @@ -881,9 +1114,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Fix Effort Mapping - put: - description: Upsert Fix Effort Mapping for the organization + summary: Get Checklist + /admin/config/routing-exclusions: + get: + description: >- + People Nullify must not choose as fix-PR reviewer or direct-message recipient, each expanded to the identities + it is matched on, and the security owner that replaces them. parameters: - description: The Azure organization ID in: query @@ -904,6 +1140,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -949,17 +1196,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminPutFixEffortInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminPutFixEffortOutput' + $ref: '#/components/schemas/EndpointsAdminRoutingExclusionsOutput' description: OK '401': content: @@ -967,22 +1209,27 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Put Fix Effort Mapping - /admin/getFileContents: - get: - description: Gets contents of a file from source control + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Routing Exclusions + put: + description: Replace the tenant's don't-route-to list. An empty list clears it; the current security owner cannot be listed. parameters: - description: The Azure organization ID in: query @@ -1003,6 +1250,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1048,39 +1306,17 @@ paths: items: type: string type: array - - in: query - name: repositoryId - required: true - schema: - type: string - - in: query - name: reference - required: true - schema: - type: string - - in: query - name: filePath - required: true - schema: - type: string - - in: query - name: projectId - schema: - type: string - - in: query - name: startLine - schema: - type: integer - - in: query - name: endLine - schema: - type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPutRoutingExclusionsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminFileContentsOutput' + $ref: '#/components/schemas/EndpointsAdminRoutingExclusionsOutput' description: OK '400': content: @@ -1094,22 +1330,27 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get File Contents - /admin/getFileOwners: - post: - description: Gets the owners of a file path from previously cached codeowners files for a repo + branch + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Set Routing Exclusions + /admin/config/security-owner: + get: parameters: - description: The Azure organization ID in: query @@ -1130,6 +1371,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1175,24 +1427,13 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminFileOwnersInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminFileOwnersOutput' + $ref: '#/components/schemas/EndpointsAdminSecurityOwnerOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -1205,21 +1446,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get File Owners - /admin/getPullRequest: - get: - description: Gets the current state of a pull request + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Security Owner + put: parameters: - - in: query - name: repositoryId - required: true - schema: - type: string - - in: query - name: prId - required: true - schema: - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -1239,6 +1480,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1284,12 +1536,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPutSecurityOwnerInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPullRequestStateOutput' + $ref: '#/components/schemas/EndpointsAdminSecurityOwnerOutput' description: OK '400': content: @@ -1303,22 +1560,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get PR State - /admin/installations: - get: - description: Get a list of app installations the current user has access to + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Set Security Owner + /admin/context/ingest: + post: + description: Returns scoped STS credentials for uploading context data to S3 parameters: - description: The Azure organization ID in: query @@ -1339,6 +1602,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1384,23 +1658,40 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextIngestInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetUserInstallationsOutput' + $ref: '#/components/schemas/EndpointsContextIngestOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get App Installations - /admin/integrations/azure: - get: - description: Get Azure integration client ID and tenant ID, either from config or DynamoDB. + summary: Get Context Upload Credentials + /admin/events: + post: + description: Cross-service unified event feed with filtering and cursor pagination parameters: - description: The Azure organization ID in: query @@ -1421,6 +1712,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1466,28 +1768,48 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetAzureConfigOutput' + $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Azure Configuration - post: - description: Install Azure DevOps integration for the organization + summary: List Unified Events + /admin/external-writes: + get: + description: >- + The tenant's switches over every write Nullify makes outside itself: git platform writes, pull request reviews, + and the Manager agent's pull requests, tickets and messages. parameters: - description: The Azure organization ID in: query @@ -1508,6 +1830,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1558,24 +1891,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminPostAzureInstallOutput' + $ref: '#/components/schemas/EndpointsExternalWritesOutput' description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Install Azure DevOps Integration - /admin/integrations/azure/credentials: - post: - description: Stores the Azure credentials (client ID, tenant ID, client secret) in DynamoDB & Parameter Store. + summary: Read External Writes + put: + description: >- + Turn the named external-write switches on or off, audited as the caller. A switch Nullify staff locked is + refused (403). Switches are applied in order and a failure names those already applied (409); retrying the same + change is safe. parameters: - description: The Azure organization ID in: query @@ -1596,6 +1925,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1645,13 +1985,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminPostAzureCredentialsInput' + $ref: '#/components/schemas/EndpointsPutExternalWritesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminPostAzureCredentialsOutput' + $ref: '#/components/schemas/EndpointsExternalWritesOutput' description: OK '400': content: @@ -1659,22 +1999,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '401': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Set Azure Credentials - /admin/integrations/buildkite: - delete: - description: Removes the Buildkite API token and org slug from Parameter Store. + summary: Change External Writes + /admin/finding/{findingId}: + get: + description: Get a single finding by ID from the metrics store parameters: - description: The Azure organization ID in: query @@ -1695,6 +2041,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1740,28 +2097,48 @@ paths: items: type: string type: array + - description: The finding ID + in: path + name: findingId + required: true + schema: + description: The finding ID + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteBuildkiteIntegrationOutput' + $ref: '#/components/schemas/EndpointsAdminGetFindingOutput' description: OK - '401': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Buildkite Integration - get: - description: Returns whether a Buildkite integration is configured. + summary: Get Finding + /admin/findings: + post: + description: Query paginated findings with filtering and sorting parameters: - description: The Azure organization ID in: query @@ -1782,6 +2159,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1827,29 +2215,40 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminQueryFindingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBuildkiteIntegrationOutput' + $ref: '#/components/schemas/EndpointsAdminQueryFindingsOutput' description: OK - '401': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Buildkite Integration Status - /admin/integrations/buildkite/token: + summary: Query Findings + /admin/findings/download: post: - description: Stores the Buildkite API token and org slug securely in Parameter Store. + description: Download filtered findings as a CSV file parameters: - description: The Azure organization ID in: query @@ -1870,6 +2269,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -1919,13 +2329,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBuildkiteTokenInput' + $ref: '#/components/schemas/EndpointsAdminFindingsDownloadInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBuildkiteTokenOutput' + $ref: '#/components/schemas/EndpointsAdminFindingsDownloadOutput' description: OK '400': content: @@ -1933,22 +2343,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '401': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Set Buildkite API Token - /admin/integrations/circleci: - delete: - description: Removes the CircleCI API token from Parameter Store. + summary: Download Findings + /admin/findings/groups: + post: + description: >- + Count the findings matching a query per value of one dimension (repository, branch, type, priority or language), + largest group first parameters: - description: The Azure organization ID in: query @@ -1969,6 +2381,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2014,28 +2437,40 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminFindingsGroupsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteCircleCIIntegrationOutput' + $ref: '#/components/schemas/EndpointsAdminFindingsGroupsOutput' description: OK - '401': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete CircleCI Integration - get: - description: Returns whether a CircleCI integration is configured. + summary: Group Findings + /admin/findings/progress: + post: + description: Get per-finding timestamps and duration metrics parameters: - description: The Azure organization ID in: query @@ -2056,6 +2491,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2101,29 +2547,46 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminQueryFindingsProgressInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCircleCIIntegrationOutput' + $ref: '#/components/schemas/EndpointsAdminQueryFindingsProgressOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CircleCI Integration Status - /admin/integrations/circleci/token: - post: - description: Stores the CircleCI API token securely in Parameter Store. + summary: Post Findings Progress + /admin/fix-effort: + get: + description: Get Fix Effort Mapping that have been created for the organization parameters: - description: The Azure organization ID in: query @@ -2144,6 +2607,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2189,24 +2663,13 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCircleCITokenInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCircleCITokenOutput' + $ref: '#/components/schemas/EndpointsAdminGetFixEffortOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -2219,10 +2682,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Set CircleCI API Token - /admin/integrations/cloud/aws/settings: - delete: - description: Deletes AWS cloud integration settings for the tenant + summary: Get Fix Effort Mapping + put: + description: Upsert Fix Effort Mapping for the organization parameters: - description: The Azure organization ID in: query @@ -2243,6 +2705,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2288,12 +2761,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPutFixEffortInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminDeleteAWSSettingsOutput' + $ref: '#/components/schemas/EndpointsAdminPutFixEffortOutput' description: OK '401': content: @@ -2313,9 +2791,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Cloud AWS Settings + summary: Put Fix Effort Mapping + /admin/getFileContents: get: - description: Retrieves AWS cloud integration settings for the tenant + description: >- + Gets contents of a file from source control. For a tenant that narrows any scan, a repository outside the + scanFamily's scan scope (code by default; secrets for a secrets finding) or a path that family's directory scope + leaves out is refused (412), and an unreadable scan scope is 503. parameters: - description: The Azure organization ID in: query @@ -2336,6 +2818,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2381,110 +2874,49 @@ paths: items: type: string type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminGetAWSSettingsOutput' - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Cloud AWS Settings - post: - description: Creates or updates AWS cloud integration settings for the tenant - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId + - in: query + name: repositoryId + required: true schema: - description: The Azure organization ID type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId + - in: query + name: reference + required: true schema: - description: The Bitbucket workspace ID type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId + - in: query + name: filePath + required: true schema: - description: The Nullify installation ID type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId + - in: query + name: projectId schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId + type: string + - in: query + name: startLine schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId + type: integer + - in: query + name: endLine schema: - description: Filter by GitHub team ID - format: int64 type: integer - - description: Filter by Bitbucket repository IDs + - description: 'Scan family whose scope must admit the file: code (default) or secrets' in: query - name: bitbucketRepositoryId + name: scanFamily schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminUpsertAWSSettingsInput' + default: code + description: 'Scan family whose scope must admit the file: code (default) or secrets' + enum: + - code + - secrets + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminUpsertAWSSettingsOutput' + $ref: '#/components/schemas/EndpointsAdminFileContentsOutput' description: OK '400': content: @@ -2498,16 +2930,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Upsert Cloud AWS Settings - /admin/integrations/cloud/aws/validate-role: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get File Contents + /admin/getFileOwners: post: - description: Validates that Nullify can assume the specified IAM role in the customer's AWS account(s) + description: Gets the owners of a file path from previously cached codeowners files for a repo + branch parameters: - description: The Azure organization ID in: query @@ -2528,6 +2978,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2577,13 +3038,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminValidateAWSRoleInput' + $ref: '#/components/schemas/EndpointsAdminFileOwnersInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminValidateAWSRoleOutput' + $ref: '#/components/schemas/EndpointsAdminFileOwnersOutput' description: OK '400': content: @@ -2603,11 +3064,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Validate AWS Role - /admin/integrations/cloud/azure/settings: - delete: - description: Deletes Azure cloud integration settings for the tenant + summary: Get File Owners + /admin/getPullRequest: + get: + description: Gets the current state of a pull request parameters: + - in: query + name: repositoryId + required: true + schema: + type: string + - in: query + name: prId + required: true + schema: + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -2627,6 +3098,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2677,8 +3159,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminDeleteAzureSettingsOutput' + $ref: '#/components/schemas/EndpointsGetPullRequestStateOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: @@ -2697,9 +3185,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Cloud Azure Settings - get: - description: Retrieves Azure cloud integration settings for the tenant + summary: Get PR State + /admin/identity/entra: + delete: + description: >- + Removes the caller's tenant's Entra directory binding and its auth projection. A no-op if the tenant has no + binding. parameters: - description: The Azure organization ID in: query @@ -2720,6 +3211,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2766,33 +3268,29 @@ paths: type: string type: array responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminGetAzureSettingsOutput' - description: OK + '204': + description: No Content '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Cloud Azure Settings - post: - description: Creates or updates Azure cloud integration settings for the tenant + summary: Disconnect Microsoft Entra directory binding + get: + description: Reports the caller's tenant's current Entra directory binding, if any. parameters: - description: The Azure organization ID in: query @@ -2813,6 +3311,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2858,24 +3367,13 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminUpsertAzureSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminUpsertAzureSettingsOutput' + $ref: '#/components/schemas/EndpointsIdentityEntraGetOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -2888,10 +3386,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Upsert Cloud Azure Settings - /admin/integrations/cloud/gcp/settings: - delete: - description: Deletes GCP cloud integration settings for the tenant + summary: Get Microsoft Entra directory binding status + /admin/identity/entra/connect: + post: + description: >- + Generates a Microsoft v2 admin-consent URL (leg 1 of the two-leg connect flow) for Nullify's shared multitenant + Entra app registration and persists a short-lived, single-use state token keyed to the caller's tenant, bound to + the response's state cookie. parameters: - description: The Azure organization ID in: query @@ -2912,6 +3413,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -2962,7 +3474,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminDeleteGCPSettingsOutput' + $ref: '#/components/schemas/EndpointsIdentityEntraConnectPostOutput' description: OK '401': content: @@ -2970,21 +3482,36 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Cloud GCP Settings + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start Microsoft Entra connect + /admin/identity/entra/handoff: get: - description: Retrieves GCP cloud integration settings for the tenant + description: >- + Lists the workspace's unexpired consent links and the flows they started. The links themselves are never + returned. parameters: - description: The Azure organization ID in: query @@ -3005,6 +3532,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3055,29 +3593,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetGCPSettingsOutput' + $ref: '#/components/schemas/EndpointsIdentityEntraHandoffListOutput' description: OK + headers: + Cache-Control: + schema: + type: string + style: simple '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Cloud GCP Settings + summary: List Microsoft Entra consent links post: - description: Creates or updates GCP cloud integration settings for the tenant + description: >- + Creates a 24-hour single-use consent link for one directory, replacing the workspace's previous link. The + recipient sees the workspace name and must confirm it after proving they administer the directory. parameters: - description: The Azure organization ID in: query @@ -3098,6 +3643,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3147,14 +3703,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminUpsertGCPSettingsInput' + $ref: '#/components/schemas/EndpointsIdentityEntraHandoffPostInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminUpsertGCPSettingsOutput' + $ref: '#/components/schemas/EndpointsIdentityEntraHandoffPostOutput' description: OK + headers: + Cache-Control: + schema: + type: string + style: simple + Referrer-Policy: + schema: + type: string + style: simple '400': content: application/json: @@ -3167,18 +3732,39 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Upsert Cloud GCP Settings - /admin/integrations/cloud/gcp/validate: - post: - description: >- - Validates that Nullify can authenticate against the customer's GCP environment and access the configured - projects. Reads the persisted WIF configuration from postgres — the customer must Save before they can Verify. + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Delegate Microsoft Entra directory consent + /admin/identity/entra/handoff/{id}: + delete: parameters: - description: The Azure organization ID in: query @@ -3199,6 +3785,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3244,36 +3841,28 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminValidateGCPInput' + - description: Consent link identifier + in: path + name: id + required: true + schema: + description: Consent link identifier + type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminValidateGCPOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request + '204': + description: No Content '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '412': content: application/json: @@ -3286,12 +3875,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Validate GCP Credentials - /admin/integrations/cloud/k8s/whitelist: + summary: Revoke a Microsoft Entra consent link + /admin/identity/entra/link: post: description: >- - Reconcile the S3 bucket and KMS key policies so the given AWS accounts (or all accounts from stored settings) - are allowed to write under k8s-collector/. + Generates a Microsoft authorization-code sign-in URL (prompt=select_account) that binds the caller's own + existing Nullify account to their Entra identity, and persists a short-lived, single-use state token keyed to + the caller, bound to the response's state cookie. parameters: - description: The Azure organization ID in: query @@ -3312,6 +3902,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3357,46 +3958,34 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminK8SConnectorWhitelistInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminK8SConnectorWhitelistOutput' + $ref: '#/components/schemas/EndpointsIdentityEntraLinkPostOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Whitelist K8s Connector Accounts - /admin/integrations/github/app-settings: + summary: Start Microsoft Entra self-service account link + /admin/identity/entra/policy: get: - description: Get the GitHub app installation settings (webhook events and permissions) parameters: - description: The Azure organization ID in: query @@ -3417,6 +4006,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3467,24 +4067,22 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetGitHubAppSettingsOutput' + $ref: '#/components/schemas/EndpointsWorkspaceEntraSSOPolicyOutput' description: OK - '401': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '500': + description: Forbidden + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get GitHub App Settings - /admin/integrations/jenkins: - delete: - description: Removes the Jenkins URL, username, and API token from Parameter Store. + description: Service Unavailable + summary: Create Interactor [] + put: parameters: - description: The Azure organization ID in: query @@ -3505,6 +4103,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3550,28 +4159,56 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceEntraSSOPolicyInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteJenkinsIntegrationOutput' + $ref: '#/components/schemas/EndpointsWorkspaceEntraSSOPolicyOutput' description: OK - '401': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '500': + description: Bad Request + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Delete Jenkins Integration - get: - description: Returns whether a Jenkins integration is configured. + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Create Interactor [] + /admin/identity/entra/sign-in: + post: + description: >- + Records that the caller signed in with their own Microsoft account, upgrading the caller's SCIM-provisioned, + migrated or staff-bootstrapped Entra identity binding to a proven sign-in so it counts toward the administrators + who can sign in once Microsoft sign-in is required. Takes no body and touches only the caller's own (directory, + subject) from the verified token; idempotent. Refused for a caller who did not sign in with Microsoft. parameters: - description: The Azure organization ID in: query @@ -3592,6 +4229,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3642,7 +4290,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetJenkinsIntegrationOutput' + $ref: '#/components/schemas/EndpointsIdentityEntraSignInPostOutput' description: OK '401': content: @@ -3650,16 +4298,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '500': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Jenkins Integration Status - /admin/integrations/jenkins/token: - post: - description: Stores the Jenkins URL, username, and API token securely in Parameter Store. + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + summary: Record a Microsoft sign-in + /admin/identity/scim: + get: + description: Returns the tenant's SCIM base URL and its non-secret credential list parameters: - description: The Azure organization ID in: query @@ -3680,6 +4334,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3725,24 +4390,13 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostJenkinsTokenInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostJenkinsTokenOutput' + $ref: '#/components/schemas/EndpointsGetIdentityScimOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -3755,10 +4409,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Set Jenkins API Token - /admin/integrations/jira: - get: - description: Get global defaults for Jira integration + summary: Get SCIM Identity Settings + /admin/identity/scim/credentials: + post: + description: Mints a new bearer credential for the tenant SCIM API. The plaintext token is returned once and never again. parameters: - description: The Azure organization ID in: query @@ -3779,6 +4433,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3829,7 +4494,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetJiraConfigOutput' + $ref: '#/components/schemas/EndpointsPostIdentityScimCredentialOutput' description: OK '401': content: @@ -3837,15 +4502,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Jira Configuration - post: - description: Update global defaults for Jira integration + summary: Create SCIM Credential + /admin/identity/scim/credentials/{id}: + delete: + description: Revokes a tenant SCIM API credential effective on its next use parameters: - description: The Azure organization ID in: query @@ -3866,6 +4538,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -3911,24 +4594,20 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsUpdateJiraConfigInput' + - description: The SCIM credential ID + in: path + name: id + required: true + schema: + description: The SCIM credential ID + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsUpdateJiraConfigOutput' + $ref: '#/components/schemas/EndpointsDeleteIdentityScimCredentialOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -3947,12 +4626,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Jira Configuration - /admin/integrations/linear/install: + summary: Revoke SCIM Credential + /admin/installations: get: - description: >- - Generates an OAuth authorize URL for the Nullify-owned Linear app and persists a short-lived state token keyed - to the caller's tenant. + description: Get a list of app installations the current user has access to parameters: - description: The Azure organization ID in: query @@ -3973,6 +4650,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4023,7 +4711,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetLinearInstallOutput' + $ref: '#/components/schemas/EndpointsAdminGetUserInstallationsOutput' description: OK '401': content: @@ -4031,22 +4719,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '412': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Start Linear OAuth install - /admin/integrations/linear/oauth: - get: - description: Returns whether the authenticated tenant has completed the Linear OAuth install. + summary: Get App Installations + /admin/integrations/{providerId}/{capability}/configure: + put: + description: Update non-secret settings (and optionally rotate secrets) for a connected integration. parameters: - description: The Azure organization ID in: query @@ -4067,6 +4749,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4112,31 +4805,70 @@ paths: items: type: string type: array + - in: path + name: providerId + required: true + schema: + type: string + - in: path + name: capability + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminConfigureIntegrationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetLinearOAuthStatusOutput' + $ref: '#/components/schemas/EndpointsAdminConfigureIntegrationOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Linear OAuth install status - /admin/integrations/notifications: - get: + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Configure Integration + /admin/integrations/{providerId}/{capability}/connect: + post: description: >- - Get per-tenant notification delivery configuration (Slack channels, email addresses, webhook URLs and their - event filters) + Connect a credential/token integration. Fields are validated against the connector's config schema; secret + fields are stored in the secret store. parameters: - description: The Azure organization ID in: query @@ -4157,6 +4889,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4202,30 +4945,69 @@ paths: items: type: string type: array + - description: The provider id, e.g. Slack + in: path + name: providerId + required: true + schema: + description: The provider id, e.g. Slack + type: string + - description: The capability, e.g. message + in: path + name: capability + required: true + schema: + description: The capability, e.g. message + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminConnectIntegrationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAdminNotificationConfigOutput' + $ref: '#/components/schemas/EndpointsAdminConnectIntegrationOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Notification Config - put: + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Connect Integration + /admin/integrations/{providerId}/{capability}/connections: + post: description: >- - Replace the per-tenant notification delivery configuration. Each entry pairs an event filter (severity, CWEs, - CVEs) with target channels (Slack, email, webhook). + Create an additional connection instance for a multi-instance connector. Fields are validated against the + connector's config schema; the credential is stored pending and reported unverified until the connector supports + live validation. parameters: - description: The Azure organization ID in: query @@ -4246,6 +5028,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4291,34 +5084,72 @@ paths: items: type: string type: array + - description: The provider id, e.g. PrivateNpm + in: path + name: providerId + required: true + schema: + description: The provider id, e.g. PrivateNpm + type: string + - description: The capability, e.g. package_registry + in: path + name: capability + required: true + schema: + description: The capability, e.g. package_registry + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutAdminNotificationConfigInput' + $ref: '#/components/schemas/EndpointsAdminCreateIntegrationConnectionInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutAdminNotificationConfigOutput' + $ref: '#/components/schemas/EndpointsAdminCreateIntegrationConnectionOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Put Notification Config - /admin/integrations/slack: - get: - description: Get global defaults for Slack integration + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Create Integration Connection + /admin/integrations/{providerId}/{capability}/disconnect: + delete: + description: Delete connection state and revoke stored secrets for an integration. parameters: - description: The Azure organization ID in: query @@ -4339,6 +5170,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4384,12 +5226,22 @@ paths: items: type: string type: array + - in: path + name: providerId + required: true + schema: + type: string + - in: path + name: capability + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSlackConfigOutput' + $ref: '#/components/schemas/EndpointsAdminDisconnectIntegrationOutput' description: OK '401': content: @@ -4397,18 +5249,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Slack Configuration - /admin/integrations/slack/install: + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Disconnect Integration + /admin/integrations/{providerId}/{capability}/install: get: description: >- - Generates an OAuth v2 authorize URL for the Nullify-owned Slack app and persists a short-lived state token keyed - to the caller's tenant. + Generates an OAuth authorize URL for a connector's Nullify-owned app and persists a short-lived state token + bound to the caller's tenant and the (provider, capability) connection. parameters: - description: The Azure organization ID in: query @@ -4429,6 +5293,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4474,19 +5349,45 @@ paths: items: type: string type: array + - description: The provider id, e.g. notion + in: path + name: providerId + required: true + schema: + description: The provider id, e.g. notion + type: string + - description: The capability, e.g. knowledgebase + in: path + name: capability + required: true + schema: + description: The capability, e.g. knowledgebase + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSlackDistributedInstallOutput' + $ref: '#/components/schemas/EndpointsGetIntegrationOAuthInstallOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '412': content: application/json: @@ -4499,10 +5400,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Start Slack distributed install - /admin/integrations/slack/key: + summary: Start Integration OAuth install + /admin/integrations/{providerId}/{capability}/test: post: - description: Stores the Slack API key securely in Parameter Store and associates the Slack workspace with this installation. + description: Run a connectivity/permission check for a connected integration. parameters: - description: The Azure organization ID in: query @@ -4523,6 +5424,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4568,47 +5480,58 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostSlackAPIKeyInput' + - in: path + name: providerId + required: true + schema: + type: string + - in: path + name: capability + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSlackAPIKeyOutput' + $ref: '#/components/schemas/EndpointsAdminTestIntegrationOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '401': + description: Unauthorized + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Set Slack API Key - /admin/integrations/teams: + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Test Integration + /admin/integrations/asana/oauth: get: - description: Get teams from an integrated platform (github, gitlab, azure, bitbucket, okta) + description: Returns whether the authenticated tenant has configured an Asana PAT. parameters: - - description: The integration provider to query teams from - in: query - name: provider - schema: - description: The integration provider to query teams from - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -4628,6 +5551,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4678,14 +5612,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetIntegrationTeamsOutput' + $ref: '#/components/schemas/EndpointsGetAsanaStatusOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -4698,17 +5626,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Integration Teams - /admin/integrations/users: - get: - description: Get users from an integrated platform (github, jira, slack) + summary: Get Asana install status + /admin/integrations/asana/ticket-config: + post: + description: Set the Asana PAT, workspace, and default project that manual ticket creation files tasks against. parameters: - - description: The integration provider to query users from - in: query - name: provider - schema: - description: The integration provider to query users from - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -4728,6 +5650,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4773,12 +5706,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPostAsanaTicketConfigInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetIntegrationUsersOutput' + $ref: '#/components/schemas/EndpointsAdminPostAsanaTicketConfigOutput' description: OK '400': content: @@ -4798,10 +5736,94 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Integration Users - /admin/metrics/findings: + summary: Set Asana Ticket Configuration + /admin/integrations/atlassian: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAtlassianInstallationOutput' + description: OK + summary: Get Atlassian integration post: - description: Get aggregate findings metrics directly from the database parameters: - description: The Azure organization ID in: query @@ -4822,6 +5844,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4871,13 +5904,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminQueryFindingsMetricsInput' + $ref: '#/components/schemas/EndpointsPostAtlassianSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminQueryFindingsMetricsOutput' + $ref: '#/components/schemas/EndpointsPostAtlassianSettingsOutput' description: OK '400': content: @@ -4885,28 +5918,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '401': + '409': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '403': + description: Conflict + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Post Findings Metrics - /admin/metrics/interactions: + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Update Atlassian integration choices + /admin/integrations/azure: get: - description: Get interactions (autofix PRs, tickets, etc) from findings + description: Get Azure integration client ID and tenant ID. parameters: - description: The Azure organization ID in: query @@ -4927,6 +5966,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -4977,43 +6027,51 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminBotInteractionsOutput' + $ref: '#/components/schemas/EndpointsAdminGetAzureConfigOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Interactions - /admin/metrics/over-time: + summary: Get Azure Configuration post: - description: Get introduced and fixed finding counts over time + description: >- + Reconciles a connected organization's Azure DevOps service hooks and merge gate, router-managed organizations + included: missing hooks are created on every project (including ones created after the connect and ones with no + repository yet), disabled or probation hooks are re-enabled after their failed deliveries are read for a root + cause, hooks a customer admin disabled are left off and reported, duplicates and the work-item hook Azure Boards + no longer needs are removed, and each project's health is recorded. dryRun returns the plan and changes nothing. + An organization with no stored connection is refused with FailedPrecondition (reason not_connected) until it is + connected. What a person has to fix is reported as failures rather than failing the whole call. parameters: - - description: Time granularity for metrics aggregation (hour, day, week) + - description: >- + Rewrite existing service-hook subscriptions in place with the current webhook URL and per-install secret + instead of skipping them. Use to repair hooks provisioned before per-install secrets. in: query - name: resolution + name: reconcile schema: - description: Time granularity for metrics aggregation (hour, day, week) - type: string + description: >- + Rewrite existing service-hook subscriptions in place with the current webhook URL and per-install secret + instead of skipping them. Use to repair hooks provisioned before per-install secrets. + type: boolean + - description: >- + Plan the repair against Azure DevOps and return it without creating, replacing or deleting anything, and + without recording health. + in: query + name: dryRun + schema: + description: >- + Plan the repair against Azure DevOps and return it without creating, replacing or deleting anything, and + without recording health. + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -5033,6 +6091,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5078,17 +6147,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsQueryMetricsOverTimeInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsQueryMetricsOverTimeOutput' + $ref: '#/components/schemas/EndpointsAdminPostAzureInstallOutput' description: OK '400': content: @@ -5096,22 +6160,49 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '500': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Metrics Over Time - /admin/metrics/overview: + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Repair Azure DevOps Service Hooks + /admin/integrations/azure/codeowners/preview: post: - description: Query aggregated overview metrics including funnel data and type breakdowns + description: >- + Reads a connected Azure DevOps repository's CODEOWNERS file and reports the Azure DevOps required-reviewer + policies it would translate to, together with every owner or rule that could not be carried over. Read-only: no + policy is created, updated or deleted. parameters: - description: The Azure organization ID in: query @@ -5132,6 +6223,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5181,13 +6283,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsQueryOverviewInput' + $ref: '#/components/schemas/EndpointsAdminPostAzureCodeownersPreviewInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsQueryOverviewOutput' + $ref: '#/components/schemas/EndpointsAdminPostAzureCodeownersPreviewOutput' description: OK '400': content: @@ -5195,23 +6297,51 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Query Overview - /admin/metrics/raw: - post: - description: Query raw finding metrics with flexible filtering + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Preview CODEOWNERS as Azure DevOps required-reviewer policies + /admin/integrations/azure/connect: + delete: + description: >- + Disconnects an Azure DevOps organization from the caller's tenant. The owning stack first removes Nullify's + service hooks and branch policy from Azure DevOps and deletes its install and connection rows; then the router + removes the organization's route, so no more tokens are minted or webhooks accepted for it and it can be + connected again, and its auth tenant-provider binding. Cleanup failures retain the installation, credentials and + route for a safe retry. Idempotent. 404s when Azure DevOps connect is disabled for this deployment. parameters: + - in: query + name: organizationId + required: true + schema: + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -5231,6 +6361,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5276,17 +6417,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsQueryMetricsRawInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsQueryMetricsRawOutput' + $ref: '#/components/schemas/EndpointsAdminDeleteAzureConnectOutput' description: OK '400': content: @@ -5294,52 +6430,58 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Query Raw Metrics - /admin/metrics/usage/aggregate: - get: - description: Cost and token totals grouped by agent/class for a tenant + summary: Disconnect an Azure DevOps organization + post: + description: >- + Starts the Azure DevOps one-click connect flow against the shared Entra app registration and persists a + short-lived, single-use state row. Azure DevOps-only connects start with Microsoft sign-in (leg 2): an + organization name selects its resolved Entra directory, an existing verified workspace directory is used when + available, and otherwise the organizations authority lets the user choose a work account before the validated + identity determines the directory. Every Microsoft sign-in it builds asks for the account picker + (prompt=select_account), so a browser already signed in to another Microsoft account cannot complete setup with + it silently; the account chosen must be a Project Collection Administrator of each organization to install, + which Confirm checks again and reports on the entitlement step with code not_collection_admin. A missing API + grant returns a consent_required hand-off for an Entra administrator; installing still requires current Project + Collection Administrator permissions in Azure DevOps. With alsoEnableSignIn, setup starts at Microsoft admin + consent (leg 1), except when the workspace already has exactly one verified Microsoft sign-in directory matching + the resolved organization directory (or no organization is named); enabling workspace sign-in also requires + current Nullify identity-management authority and an eligible directory-member Entra administrator. With + reauthorizeHandle, instead builds a fresh Microsoft sign-in (leg 2) in that handle's directory, carrying over + its options and waiting organizations but never its token; 404s for a handle that is unknown, expired or another + tenant's, and 412s for one that cannot be reauthorized. With requestAdminConsent and no reauthorizeHandle, never + sends the browser to Microsoft: it creates a consent_required hand-off handle holding the admin-consent link and + returns the app's own page for it. 404s when Azure DevOps connect is disabled for this deployment. parameters: - - in: query - name: window - schema: - type: string - - in: query - name: class - schema: - nullable: true - type: string - - in: query - name: agent - schema: - nullable: true - type: string - - in: query - name: branchType - schema: - nullable: true - type: string - - in: query - name: from - schema: - nullable: true - type: string - - in: query - name: to - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -5359,6 +6501,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5404,12 +6557,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPostAzureConnectInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminUsageMetricsAggregateOutput' + $ref: '#/components/schemas/EndpointsAdminPostAzureConnectOutput' description: OK '400': content: @@ -5429,63 +6587,44 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Usage Aggregate - /admin/metrics/usage/ledger: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start Azure DevOps connect + /admin/integrations/azure/connect/{handle}: get: - description: Paginated per-run billing ledger entries for a tenant + description: >- + Returns the merged router + tenant-stack progress for a connect handle: discovered organizations, checklist, and + (when consent is blocked) the admin-consent URL to hand to a directory admin. Polled by the UI every few seconds + until status is done or failed. parameters: - - in: query - name: class - schema: - nullable: true - type: string - - in: query - name: agent - schema: - nullable: true - type: string - - in: query - name: branchType - schema: - nullable: true - type: string - - in: query - name: runId - schema: - nullable: true - type: string - - in: query - name: findingId - schema: - items: - type: string - type: array - - in: query - name: from - schema: - nullable: true - type: string - - in: query - name: to - schema: - nullable: true - type: string - - in: query - name: cursor - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -5505,6 +6644,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5550,64 +6700,46 @@ paths: items: type: string type: array + - in: path + name: handle + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminUsageLedgerResponse' + $ref: '#/components/schemas/EndpointsAdminGetAzureConnectStatusOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Usage Ledger - /admin/metrics/usage/timeseries: - get: - description: Daily or hourly cost and token aggregation for a tenant + summary: Get Azure DevOps connect status + /admin/integrations/azure/connect/{handle}/confirm: + post: + description: >- + Accepts the selected, previously-discovered organizations and provisions them in the background: ownership + proof, service principal entitlement, the ServiceHooks access grant, router route registration, the auth + tenant-provider bind, then a relay to the owning tenant stack. Refuses (412) an organization the handle's + permission preflight did not read as allowed, and asks Azure DevOps again before granting anything. Returns as + soon as the selection is validated, with status "connecting"; poll GET .../{handle} for the checklist. parameters: - - in: query - name: granularity - schema: - type: string - - in: query - name: from - schema: - type: string - - in: query - name: to - schema: - type: string - - in: query - name: class - schema: - nullable: true - type: string - - in: query - name: agent - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -5627,6 +6759,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5672,12 +6815,22 @@ paths: items: type: string type: array + - in: path + name: handle + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPostAzureConnectConfirmInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminUsageMetricsTimeseriesOutput' + $ref: '#/components/schemas/EndpointsAdminPostAzureConnectConfirmOutput' description: OK '400': content: @@ -5691,22 +6844,43 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Usage Timeseries - /admin/organization: - get: - description: Gets metadata and properties from an installed organization + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Confirm Azure DevOps connect + /admin/integrations/azure/connect/{handle}/recheck: + post: + description: >- + Refreshes organization eligibility using the initiating actor's unexpired delegated Microsoft authorization. + Makes read-only provider checks and never installs or grants access. A fresh Microsoft sign-in is required when + authorization has expired. Concurrent installation or changes to the handle return 409. parameters: - description: The Azure organization ID in: query @@ -5727,6 +6901,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5772,43 +6957,68 @@ paths: items: type: string type: array + - in: path + name: handle + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetOrganizationOutput' + $ref: '#/components/schemas/EndpointsAdminGetAzureConnectStatusOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '401': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Organization - /admin/privacy/acknowledgment: - get: - description: Check if the user has acknowledged a specific version of the privacy policy + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Recheck Azure DevOps permissions + /admin/integrations/azure/connect/{handle}/retry: + post: + description: >- + Re-runs Confirm for one organization whose checklist carries a failed step. Every router-side step and the + tenant-stack relay are idempotent, so this is Confirm with a single-organization selection -- accepted + immediately with status "connecting", then polled through GET .../{handle}. parameters: - - description: The version of the privacy policy to check - in: query - name: policyVersion - required: true - schema: - description: The version of the privacy policy to check - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -5828,6 +7038,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5873,12 +7094,22 @@ paths: items: type: string type: array + - in: path + name: handle + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPostAzureConnectRetryInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPrivacyAcknowledgmentOutput' + $ref: '#/components/schemas/EndpointsAdminPostAzureConnectRetryOutput' description: OK '400': content: @@ -5892,15 +7123,40 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Privacy Acknowledgment + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Retry Azure DevOps connect + /admin/integrations/azure/credentials: post: - description: Record that the user has acknowledged a specific version of the privacy policy + description: Stores the Azure credentials (client ID, tenant ID, client secret) securely. parameters: - description: The Azure organization ID in: query @@ -5921,6 +7177,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -5970,13 +7237,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostPrivacyAcknowledgmentInput' + $ref: '#/components/schemas/EndpointsAdminPostAzureCredentialsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostPrivacyAcknowledgmentOutput' + $ref: '#/components/schemas/EndpointsAdminPostAzureCredentialsOutput' description: OK '400': content: @@ -5996,40 +7263,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post Privacy Acknowledgment - /admin/repositories: - get: - description: Get a list of repositories in the org + summary: Set Azure Credentials + /admin/integrations/azure/installations: + delete: + description: Removes the Azure DevOps webhook installation row for the given (organizationId, projectId). parameters: - - description: Pagination token for the next page of results - in: query - name: nextToken + - in: query + name: organizationId + required: true schema: - description: Pagination token for the next page of results - nullable: true type: string - - description: Maximum number of repositories to return per page - in: query - name: limit - schema: - description: Maximum number of repositories to return per page - nullable: true - type: integer - - description: Case-insensitive search filter for repository names - in: query - name: search + - in: query + name: projectId + required: true schema: - description: Case-insensitive search filter for repository names - nullable: true type: string - - description: Filter repositories by team ULID - in: query - name: teamIDs - schema: - description: Filter repositories by team ULID - items: - type: string - type: array - description: The Azure organization ID in: query name: azureOrganizationId @@ -6049,6 +7297,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6099,24 +7358,55 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetRepositoriesOutput' + $ref: '#/components/schemas/EndpointsAdminDeleteAzureInstallationOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repositories - /admin/repositories/initialize: - post: - description: Initialize any webhooks or other settings for the repositories + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Delete Azure DevOps webhook installation + get: + description: >- + Lists Azure DevOps webhook installations for the caller's tenant. Used by the configure page to render the + install table. parameters: - description: The Azure organization ID in: query @@ -6137,6 +7427,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6182,17 +7483,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostInitializeRepositoriesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostInitializeRepositoriesOutput' + $ref: '#/components/schemas/EndpointsAdminListAzureInstallationsOutput' description: OK '401': content: @@ -6206,10 +7502,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Initialize Repositories - /admin/repositories/uninitialize: + summary: List Azure DevOps webhook installations post: - description: Uninitialize any webhooks or other settings for the repositories + description: >- + Registers (or rotates) the Azure DevOps webhook installation for a given (organizationId, projectId). Returns a + newly generated shared secret once; the GET endpoint never re-exposes it. An explicit claim can finish restoring + a previously removed router-owned installation without rotating its secret; that recovery returns an empty + webhookSecret. parameters: - description: The Azure organization ID in: query @@ -6230,6 +7529,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6279,39 +7589,65 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUninitializeRepositoriesInput' + $ref: '#/components/schemas/EndpointsAdminUpsertAzureInstallationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUninitializeRepositoriesOutput' + $ref: '#/components/schemas/EndpointsAdminUpsertAzureInstallationOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Uninitialize Repositories - /admin/repository-property-team-keys: - delete: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Register Azure DevOps webhook installation + /admin/integrations/azure/installations/suspend: + post: description: >- - Remove a repository property key from the tenant's team-derivation configuration. Property-derived teams without - any remaining ownership rows are cleaned up by the next sync run. + Disables (or re-enables) every ADO service-hook subscription under the organization, makes Nullify's branch + policy non-blocking (or blocking again), and stamps the install rows' admin_disabled_at to match. + installationsAffected counts install rows only; read failures to know whether Azure DevOps itself changed. + Resuming an organization Nullify disabled is refused with FailedPrecondition. parameters: - - description: The repository property team key ID - in: query - name: keyId - schema: - description: The repository property team key ID - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -6331,6 +7667,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6376,12 +7723,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminSuspendAzureInstallationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteRepositoryPropertyTeamKeyOutput' + $ref: '#/components/schemas/EndpointsAdminSuspendAzureInstallationOutput' description: OK '400': content: @@ -6401,15 +7753,36 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Repository Property Team Key - get: - description: List the repository property keys this tenant uses to derive teams from repository metadata. + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Suspend or resume an Azure DevOps organization's installations + /admin/integrations/azure/installations/test: + post: + description: >- + Re-runs the provisioning checklist read-only: verifies connectivity, lists repositories, and reports any + missing, drifted or disabled service-hook subscriptions. Creates or changes nothing. parameters: - description: The Azure organization ID in: query @@ -6430,6 +7803,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6475,30 +7859,64 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminTestAzureInstallationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetRepositoryPropertyTeamKeysOutput' + $ref: '#/components/schemas/EndpointsAdminTestAzureInstallationOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Repository Property Team Keys - post: - description: >- - Configure a repository property key that should drive team derivation for this tenant. The next sync run will - create teams from the distinct values seen for this property. + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Test an Azure DevOps organization's provisioning state + /admin/integrations/buildkite: + delete: + description: Removes the Buildkite API token and org slug. parameters: - description: The Azure organization ID in: query @@ -6519,6 +7937,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6564,53 +7993,29 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostRepositoryPropertyTeamKeyInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostRepositoryPropertyTeamKeyOutput' + $ref: '#/components/schemas/EndpointsDeleteBuildkiteIntegrationOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Repository Property Team Key - /admin/service_accounts: - delete: - description: Delete a given service account and revoke its access token + summary: Delete Buildkite Integration + get: + description: Returns whether a Buildkite integration is configured. parameters: - - description: The service account ID - in: query - name: serviceAccountId - schema: - description: The service account ID - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -6630,6 +8035,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6680,14 +8096,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteServiceAccountOutput' + $ref: '#/components/schemas/EndpointsGetBuildkiteIntegrationOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -6700,9 +8110,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Service Account - get: - description: Get a list of service accounts that have been created for the organization + summary: Get Buildkite Integration Status + /admin/integrations/buildkite/organizations: + post: + description: >- + Verifies a Buildkite API token's scopes and returns the organizations it can access, so the UI can offer a + picker instead of free-text slug entry. parameters: - description: The Azure organization ID in: query @@ -6723,6 +8136,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6768,13 +8192,24 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBuildkiteOrganizationsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetServiceAccountsOutput' + $ref: '#/components/schemas/EndpointsPostBuildkiteOrganizationsOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: @@ -6787,9 +8222,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Service Accounts + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: List Buildkite Organizations For Token + /admin/integrations/buildkite/token: post: - description: Created a service account with an access token for the Nullify API + description: Stores the Buildkite API token and org slug securely. parameters: - description: The Azure organization ID in: query @@ -6810,6 +8258,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6859,13 +8318,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostServiceAccountInput' + $ref: '#/components/schemas/EndpointsPostBuildkiteTokenInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostServiceAccountOutput' + $ref: '#/components/schemas/EndpointsPostBuildkiteTokenOutput' description: OK '400': content: @@ -6885,10 +8344,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Service Account - /admin/sla: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Set Buildkite API Token + /admin/integrations/catalog: get: - description: Get SLAs that have been created for the organization + description: List every connector definition annotated with the tenant's connection status. parameters: - description: The Azure organization ID in: query @@ -6909,6 +8380,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -6959,7 +8441,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSLAsOutput' + $ref: '#/components/schemas/EndpointsAdminGetIntegrationsCatalogOutput' description: OK '401': content: @@ -6973,9 +8455,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SLAs - post: - description: Create a new SLA for the organization + summary: Get Integrations Catalog + /admin/integrations/circleci: + delete: + description: Removes the CircleCI API token. parameters: - description: The Azure organization ID in: query @@ -6996,6 +8479,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7041,46 +8535,28 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostSLAInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSLAOutput' + $ref: '#/components/schemas/EndpointsDeleteCircleCIIntegrationOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post SLA - /admin/sla/{slaId}: - patch: - description: Update an existing SLA for the organization + summary: Delete CircleCI Integration + get: + description: Returns whether a CircleCI integration is configured. parameters: - description: The Azure organization ID in: query @@ -7101,6 +8577,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7146,24 +8633,12 @@ paths: items: type: string type: array - - description: The ID of the SLA to update - in: path - name: slaId - required: true - schema: - description: The ID of the SLA to update - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchSLAInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSLAOutput' + $ref: '#/components/schemas/EndpointsGetCircleCIIntegrationOutput' description: OK '401': content: @@ -7171,22 +8646,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Patch SLA - /admin/sla/bulk: - put: - description: Upsert multiple SLAs for the organization + summary: Get CircleCI Integration Status + /admin/integrations/circleci/token: + post: + description: Stores the CircleCI API token securely. parameters: - description: The Azure organization ID in: query @@ -7207,6 +8676,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7256,38 +8736,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutBulkSLAInput' + $ref: '#/components/schemas/EndpointsPostCircleCITokenInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutBulkSLAOutput' + $ref: '#/components/schemas/EndpointsPostCircleCITokenOutput' description: OK - '401': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '404': + description: Bad Request + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Put Bulk SLA - /admin/team-source-preferences: - get: - description: >- - Read the per-tenant on/off state of the auto-sync team sources (GitHub Teams, repository custom properties). - Manual teams are always available and have no toggle. + summary: Set CircleCI API Token + /admin/integrations/cloud/aws/settings: + delete: + description: Deletes AWS cloud integration settings for the tenant parameters: - description: The Azure organization ID in: query @@ -7308,6 +8786,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7358,7 +8847,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetTeamSourcePreferencesOutput' + $ref: '#/components/schemas/EndpointsAdminDeleteAWSSettingsOutput' description: OK '401': content: @@ -7366,18 +8855,29 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Team Source Preferences - put: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Delete Cloud AWS Settings + get: description: >- - Enable or disable each auto-sync team source for this tenant. Disabling a source soft-hides every existing team - for that source; re-enabling restores them and triggers a teams-only sync so any upstream changes are picked up - immediately. + Retrieves AWS cloud integration settings for the tenant. A tenant with no AWS integration gets overallStatus + "not_configured" and empty settings. parameters: - description: The Azure organization ID in: query @@ -7398,6 +8898,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7443,24 +8954,13 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPutTeamSourcePreferencesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutTeamSourcePreferencesOutput' + $ref: '#/components/schemas/EndpointsAdminGetAWSSettingsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -7473,22 +8973,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Team Source Preferences - /admin/team-sync-runs: - get: - description: >- - Most-recent team-sync workflow runs for this tenant, newest first. The UI polls this to show in-flight / - last-sync state on the Configure > Teams page. + summary: Get Cloud AWS Settings + post: + description: Creates or updates AWS cloud integration settings for the tenant parameters: - - in: query - name: source - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -7508,6 +8996,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7553,12 +9052,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminUpsertAWSSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetTeamSyncRunsOutput' + $ref: '#/components/schemas/EndpointsAdminUpsertAWSSettingsOutput' description: OK '400': content: @@ -7578,11 +9082,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Team Sync Runs + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Upsert Cloud AWS Settings + /admin/integrations/cloud/aws/validate-role: post: - description: >- - Manually request a team-sync workflow run. Subject to dedup: if a pending or running run already exists for the - tenant + source, this is a no-op and the existing run is returned. + description: Validates that Nullify can assume the specified IAM role in the customer's AWS account(s) parameters: - description: The Azure organization ID in: query @@ -7603,6 +9112,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7652,13 +9172,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamSyncRunInput' + $ref: '#/components/schemas/EndpointsAdminValidateAWSRoleInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamSyncRunOutput' + $ref: '#/components/schemas/EndpointsAdminValidateAWSRoleOutput' description: OK '400': content: @@ -7672,16 +9192,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Trigger Team Sync - /admin/team/{teamID}: - get: - description: Retrieve a single team by teamID, with user and repository details populated + summary: Validate AWS Role + /admin/integrations/cloud/azure/settings: + delete: + description: Deletes Azure cloud integration settings for the tenant parameters: - description: The Azure organization ID in: query @@ -7702,6 +9228,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7747,24 +9284,13 @@ paths: items: type: string type: array - - in: path - name: teamID - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetTeamOutput' + $ref: '#/components/schemas/EndpointsAdminDeleteAzureSettingsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -7783,10 +9309,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Team - /admin/teams: + summary: Delete Cloud Azure Settings get: - description: Get a paginated list of teams from all sources (database and git platform), with user details populated. + description: >- + Retrieves Azure cloud integration settings for the tenant. A tenant with no Azure integration gets overallStatus + "not_configured" and empty settings. parameters: - description: The Azure organization ID in: query @@ -7807,6 +9334,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7852,33 +9390,12 @@ paths: items: type: string type: array - - description: Pagination token for the next page of results - in: query - name: nextToken - schema: - description: Pagination token for the next page of results - nullable: true - type: string - - description: Maximum number of teams to return per page - in: query - name: limit - schema: - description: Maximum number of teams to return per page - nullable: true - type: integer - - description: Case-insensitive search filter for team names - in: query - name: search - schema: - description: Case-insensitive search filter for team names - nullable: true - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetTeamsOutput' + $ref: '#/components/schemas/EndpointsAdminGetAzureSettingsOutput' description: OK '401': content: @@ -7892,9 +9409,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get All Teams + summary: Get Cloud Azure Settings post: - description: Create or update a team in DynamoDB under the given providerID (upsert repositories) + description: Creates or updates Azure cloud integration settings for the tenant parameters: - description: The Azure organization ID in: query @@ -7915,6 +9432,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -7964,13 +9492,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamInput' + $ref: '#/components/schemas/EndpointsAdminUpsertAzureSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamOutput' + $ref: '#/components/schemas/EndpointsAdminUpsertAzureSettingsOutput' description: OK '400': content: @@ -7990,12 +9518,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post Team - /admin/teams/{teamID}: - delete: + summary: Upsert Cloud Azure Settings + /admin/integrations/cloud/azure/validate: + post: description: >- - Soft-delete a manually created team. Returns 400 if the team's source is not 'manual' — synced teams are managed - by their sync workflow and cannot be removed individually. + Validates that Nullify can authenticate against the customer's Azure environment and access the configured + subscriptions. Reads the previously saved workload identity federation configuration — the customer must Save + before they can Verify. parameters: - description: The Azure organization ID in: query @@ -8016,6 +9545,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8061,19 +9601,17 @@ paths: items: type: string type: array - - description: The ID of the manual team to delete - in: path - name: teamID - required: true - schema: - description: The ID of the manual team to delete - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminValidateAzureInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteTeamOutput' + $ref: '#/components/schemas/EndpointsAdminValidateAzureOutput' description: OK '400': content: @@ -8087,21 +9625,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Manual Team - patch: - description: Update an existing team with partial data. Only provided fields will be updated. + summary: Validate Azure Credentials + /admin/integrations/cloud/gcp/access-token: + post: + description: Returns a short-lived GCP access token using the authenticated tenant's saved integration settings. parameters: - description: The Azure organization ID in: query @@ -8122,6 +9667,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8167,53 +9723,41 @@ paths: items: type: string type: array - - description: The ID of the team to update - in: path - name: teamID - required: true - schema: - description: The ID of the team to update - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchTeamOutput' + $ref: '#/components/schemas/EndpointsAdminMintGCPAccessTokenOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '401': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '404': + description: Forbidden + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Patch Team - /admin/teams/{teamID}/events: - post: - description: Cross-service unified event feed filtered by team + summary: Mint GCP Access Token + /admin/integrations/cloud/gcp/settings: + delete: + description: Deletes GCP cloud integration settings for the tenant parameters: - description: The Azure organization ID in: query @@ -8234,6 +9778,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8279,51 +9834,36 @@ paths: items: type: string type: array - - in: path - name: teamID - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsByTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsOutput' + $ref: '#/components/schemas/EndpointsAdminDeleteGCPSettingsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Team Unified Events - /admin/teams/{teamID}/findings: + summary: Delete Cloud GCP Settings get: - description: Get a list of findings mapped to a specific team. + description: >- + Retrieves GCP cloud integration settings for the tenant. A tenant with no GCP integration gets overallStatus + "not_configured" and empty settings. parameters: - description: The Azure organization ID in: query @@ -8344,6 +9884,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8389,46 +9940,28 @@ paths: items: type: string type: array - - in: path - name: teamID - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetTeamFindingsOutput' + $ref: '#/components/schemas/EndpointsAdminGetGCPSettingsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Team Findings mapping - /admin/teams/appzip: - get: - description: Generate and download a Microsoft Teams app package with manifest and icons + summary: Get Cloud GCP Settings + post: + description: Creates or updates GCP cloud integration settings for the tenant parameters: - description: The Azure organization ID in: query @@ -8449,6 +9982,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8494,12 +10038,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminUpsertGCPSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetTeamsAppZipOutput' + $ref: '#/components/schemas/EndpointsAdminUpsertGCPSettingsOutput' description: OK '400': content: @@ -8519,10 +10068,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Teams App Zip - /admin/teams/compass: - post: - description: Adapt a Compass/Atlassian‐style payload into our in‐house Team model and upsert users and repositories + summary: Upsert Cloud GCP Settings + /admin/integrations/cloud/gcp/setup: + get: + description: >- + Returns the values needed to create the Nullify GCP integration with Terraform, the installer script or any + other tool parameters: - description: The Azure organization ID in: query @@ -8543,6 +10094,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8588,24 +10150,13 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCompassTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCompassTeamOutput' + $ref: '#/components/schemas/EndpointsAdminGetGCPSetupOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -8618,10 +10169,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post Compass/Atlassian Team - /admin/teams/findings: - get: - description: Get a list of teams with their mapped findings aggregated from DynamoDB. + summary: Get Cloud GCP Setup + /admin/integrations/cloud/gcp/validate: + post: + description: >- + Validates that Nullify can authenticate against the customer's GCP environment and access the configured + projects. Reads the previously saved WIF configuration — the customer must Save before they can Verify. parameters: - description: The Azure organization ID in: query @@ -8642,6 +10195,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8687,12 +10251,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminValidateGCPInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsListTeamFindingsOutput' + $ref: '#/components/schemas/EndpointsAdminValidateGCPOutput' description: OK '400': content: @@ -8712,15 +10281,26 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get All Team Findings mapping + summary: Validate GCP Credentials + /admin/integrations/cloud/k8s/clusters: post: - description: Manually assign findings to teams. + description: >- + Adds one K8s cluster, or updates the cluster with the same identity (type, account, region and name; resourceId + for AKS), without changing the tenant's other clusters or role ARN. Omitted collectSecrets/collectConfigMaps + keep stored values and default to true for a new cluster. An EKS cluster must name a 12-digit AWS account + connected in the tenant's AWS settings. parameters: - description: The Azure organization ID in: query @@ -8741,6 +10321,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8790,13 +10381,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamFindingsInput' + $ref: '#/components/schemas/EndpointsAdminUpsertK8SClusterInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamFindingsOutput' + $ref: '#/components/schemas/EndpointsAdminUpsertK8SClusterOutput' description: OK '400': content: @@ -8810,24 +10401,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Manual Team Findings Assignment - /admin/teams/findings/sync: - post: + summary: Add or Update a K8s Cluster + /admin/integrations/cloud/k8s/clusters/{clusterId}: + delete: description: >- - Run the finding-to-team matcher. Optionally scope by repository IDs, names, or finding IDs. Set async=true to - dispatch to a background Lambda for large tenants. + Removes one of the tenant's K8s clusters, addressed by row id or scan identity. Other clusters and the + integration settings stay. parameters: - description: The Azure organization ID in: query @@ -8848,6 +10433,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8893,17 +10489,19 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostTeamFindingsSyncInput' + - description: Cluster row id or scan identity + in: path + name: clusterId + required: true + schema: + description: Cluster row id or scan identity + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamFindingsSyncOutput' + $ref: '#/components/schemas/EndpointsAdminDeleteK8SClusterOutput' description: OK '400': content: @@ -8917,22 +10515,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Sync Team Findings - /admin/teams/merge: - post: - description: Merge multiple provider-specific teams into one unified team + summary: Remove a K8s Cluster + /admin/integrations/cloud/k8s/settings: + delete: + description: Removes the tenant's K8s integration and all configured clusters. parameters: - description: The Azure organization ID in: query @@ -8953,6 +10551,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -8998,46 +10607,36 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostTeamMergeInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostTeamMergeOutput' + $ref: '#/components/schemas/EndpointsAdminDeleteK8SSettingsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Merge Teams - /admin/ui/savedViews: + description: Service Unavailable + summary: Delete Cloud K8s Settings get: - description: Get UI Saved Views for a user + description: >- + Retrieves K8s cloud integration settings (managed clusters + on-prem) for the tenant. A tenant with no K8s + integration gets an empty cluster list. parameters: - description: The Azure organization ID in: query @@ -9058,6 +10657,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9108,7 +10718,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetUISavedViewsOutput' + $ref: '#/components/schemas/EndpointsAdminGetK8SSettingsOutput' description: OK '401': content: @@ -9122,9 +10732,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get UI Saved Views + summary: Get Cloud K8s Settings post: - description: Create a new UI Saved View + description: >- + Creates or updates K8s integration settings (managed clusters + on-prem) for the tenant. Replaces the prior + cluster set; use POST /admin/integrations/cloud/k8s/clusters to change one cluster. An omitted nullifyRoleArn + keeps the stored value, and omitted collectSecrets/collectConfigMaps keep each matched cluster's values. parameters: - description: The Azure organization ID in: query @@ -9145,6 +10758,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9194,13 +10818,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUISavedViewInput' + $ref: '#/components/schemas/EndpointsAdminUpsertK8SSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUISavedViewOutput' + $ref: '#/components/schemas/EndpointsAdminUpsertK8SSettingsOutput' description: OK '400': content: @@ -9220,10 +10844,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post UI Saved View - /admin/ui/savedViews/{savedViewId}: - delete: - description: Delete an existing UI Saved View + summary: Upsert Cloud K8s Settings + /admin/integrations/cloud/k8s/whitelist: + get: parameters: - description: The Azure organization ID in: query @@ -9244,96 +10867,15 @@ paths: description: The Github owner ID format: int64 type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - - in: path - name: savedViewId - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsDeleteUISavedViewOutput' - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Delete UI Saved View - patch: - description: Update an existing UI Saved View - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. in: query - name: githubOwnerId + name: githubInstallationId schema: - description: The Github owner ID + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. format: int64 type: integer - description: The GitLab group ID @@ -9381,22 +10923,12 @@ paths: items: type: string type: array - - in: path - name: savedViewId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchUISavedViewInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchUISavedViewOutput' + $ref: '#/components/schemas/EndpointsAdminGetK8SCollectorAccountsOutput' description: OK '401': content: @@ -9404,22 +10936,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Patch UI Saved View - /admin/user/{userID}: - get: - description: Retrieve a single user by userID + description: Service Unavailable + summary: Read collector account access + post: + description: Allow the given AWS accounts (or all accounts from stored settings) to upload Kubernetes collector data. parameters: - description: The Azure organization ID in: query @@ -9440,6 +10971,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9485,19 +11027,17 @@ paths: items: type: string type: array - - description: The ID of the user to fetch - in: path - name: userID - required: true - schema: - description: The ID of the user to fetch - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminK8SConnectorWhitelistInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetUserOutput' + $ref: '#/components/schemas/EndpointsAdminK8SConnectorWhitelistOutput' description: OK '400': content: @@ -9517,17 +11057,35 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get User - /admin/user/current: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Whitelist K8s Connector Accounts + /admin/integrations/connections: get: - description: Get the current user + description: List connection instances, optionally filtered by capability. Never returns secret values. parameters: + - description: Restrict to one capability, e.g. package_registry + in: query + name: capability + schema: + description: Restrict to one capability, e.g. package_registry + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -9547,6 +11105,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9597,7 +11166,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCurrentUserOutput' + $ref: '#/components/schemas/EndpointsAdminListIntegrationConnectionsOutput' description: OK '401': content: @@ -9605,22 +11174,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Current User - /admin/user/mapping: - get: - description: Get a User Mapping + summary: List Integration Connections + /admin/integrations/connections/{connectionId}: + delete: + description: >- + Disconnect one connection instance: block new credential use and destroy Nullify's stored secret while + preserving non-secret metadata. Idempotent. parameters: - description: The Azure organization ID in: query @@ -9641,6 +11206,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9686,13 +11262,8 @@ paths: items: type: string type: array - - in: query - name: providerId - required: true - schema: - type: string - - in: query - name: userId + - in: path + name: connectionId required: true schema: type: string @@ -9701,7 +11272,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetUserMappingOutput' + $ref: '#/components/schemas/EndpointsAdminDisconnectIntegrationConnectionOutput' description: OK '401': content: @@ -9715,15 +11286,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get User Mapping - post: - description: Create new User Mappings; if useSuggestions=true, compute and persist suggestions + summary: Disconnect Integration Connection + /admin/integrations/connections/{connectionId}/rotate: + put: + description: >- + Atomically replace credential and/or config fields on one connection instance. The replacement is validated + first; a failed validation leaves the stored credential untouched. parameters: - description: The Azure organization ID in: query @@ -9744,6 +11324,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9789,18 +11380,29 @@ paths: items: type: string type: array + - in: path + name: connectionId + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUserMappingInput' + $ref: '#/components/schemas/EndpointsAdminRotateIntegrationConnectionInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUserMappingOutput' + $ref: '#/components/schemas/EndpointsAdminRotateIntegrationConnectionOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: @@ -9813,16 +11415,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post Add User Mappings - /admin/user/mapping/{userId}: - delete: - description: Delete a User Mapping + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Rotate Integration Connection + /admin/integrations/connections/{connectionId}/test: + post: + description: Run a connectivity/permission check for one connection instance. parameters: - description: The Azure organization ID in: query @@ -9843,6 +11463,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9889,28 +11520,59 @@ paths: type: string type: array - in: path - name: userId + name: connectionId required: true schema: type: string responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminTestIntegrationConnectionOutput' + description: OK '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete User Mapping - put: - description: Edit a User Mapping + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Test Integration Connection + /admin/integrations/github-packages/discover: + post: + description: >- + Resolves a raw GitHub Packages classic PAT's identity and readable npm packages before any connection is + created, so the connect form can prefill fields instead of asking for them blind. parameters: - description: The Azure organization ID in: query @@ -9931,6 +11593,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -9976,19 +11649,24 @@ paths: items: type: string type: array - - in: path - name: userId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutEditUserMappingInput' + $ref: '#/components/schemas/EndpointsAdminDiscoverGitHubPackagesCredentialInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminDiscoverGitHubPackagesCredentialOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: @@ -10001,10 +11679,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Edit User Mapping - /admin/user/mapping/suggestions: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Discover GitHub Packages Identity + /admin/integrations/github/app-settings: get: - description: Get user mapping suggestions + description: Get the GitHub app installation settings (webhook events and permissions) parameters: - description: The Azure organization ID in: query @@ -10025,6 +11715,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10075,7 +11776,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSuggestedUserMappingsOutput' + $ref: '#/components/schemas/EndpointsAdminGetGitHubAppSettingsOutput' description: OK '401': content: @@ -10083,16 +11784,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get User Mapping Suggestions - /admin/user/mappings: - get: - description: Get all User Mappings + summary: Get GitHub App Settings + /admin/integrations/gitlab/connect: + post: parameters: - description: The Azure organization ID in: query @@ -10113,6 +11819,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10163,24 +11880,35 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetUserMappingsOutput' + $ref: '#/components/schemas/EndpointsAdminGitLabConnectOutput' description: OK - '401': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get User Mappings - /admin/users: - get: - description: Get a list of users, global across all platforms. + summary: Connect GitLab + /admin/integrations/gitlab/connect/confirm: + post: parameters: - description: The Azure organization ID in: query @@ -10201,6 +11929,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10246,29 +11985,56 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminGitLabConnectConfirmInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAdminGetUsersOutput' + $ref: '#/components/schemas/EndpointsAdminGitLabConnectStatusOutput' description: OK - '401': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get All Users - post: - description: Create or update a user in DynamoDB under the given providerID + summary: Finish GitLab connection + /admin/integrations/gitlab/connect/status: + get: parameters: + - in: query + name: handle + schema: + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -10288,6 +12054,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10333,17 +12110,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostUserInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUserOutput' + $ref: '#/components/schemas/EndpointsAdminGitLabConnectStatusOutput' description: OK '400': content: @@ -10351,22 +12123,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '401': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post User - /admin/users/{providerID}: - get: - description: Retrieve all users for a specific provider/platform + summary: GitLab connection status + /admin/integrations/jenkins: + delete: + description: Removes the Jenkins URL, username, and API token. parameters: - description: The Azure organization ID in: query @@ -10387,6 +12165,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10432,26 +12221,13 @@ paths: items: type: string type: array - - description: The provider ID - in: path - name: providerID - required: true - schema: - description: The provider ID - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetProviderUsersOutput' + $ref: '#/components/schemas/EndpointsDeleteJenkinsIntegrationOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: @@ -10464,10 +12240,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Provider Users - /admin/users/{providerID}/{userID}: + summary: Delete Jenkins Integration get: - description: Retrieve a single user by providerID and userID + description: Returns whether a Jenkins integration is configured. parameters: - description: The Azure organization ID in: query @@ -10488,6 +12263,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10533,55 +12319,29 @@ paths: items: type: string type: array - - description: The provider ID - in: path - name: providerID - required: true - schema: - description: The provider ID - type: string - - description: The ID of the user to fetch - in: path - name: userID - required: true - schema: - description: The ID of the user to fetch - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetUserOutput' + $ref: '#/components/schemas/EndpointsGetJenkinsIntegrationOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get User By Provider - /admin/users/{userId}/erasure: - delete: - description: Permanently erase all personal data for a user in compliance with GDPR right to erasure + summary: Get Jenkins Integration Status + /admin/integrations/jenkins/token: + post: + description: Stores the Jenkins URL, username, and API token securely. parameters: - description: The Azure organization ID in: query @@ -10602,6 +12362,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10647,19 +12418,17 @@ paths: items: type: string type: array - - description: The ID of the user to erase - in: path - name: userId - required: true - schema: - description: The ID of the user to erase - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostJenkinsTokenInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteUserErasureOutput' + $ref: '#/components/schemas/EndpointsPostJenkinsTokenOutput' description: OK '400': content: @@ -10673,30 +12442,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete User Erasure (GDPR Art. 17) - /admin/users/{userId}/export: + summary: Set Jenkins API Token + /admin/integrations/jira: get: - description: Export all personal data held for a user in compliance with GDPR right of access and data portability + description: Get global defaults for Jira integration parameters: - - description: Export format (json) - in: query - name: format - schema: - default: json - description: Export format (json) - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -10716,6 +12472,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10761,48 +12528,28 @@ paths: items: type: string type: array - - description: The ID of the user to export data for - in: path - name: userId - required: true - schema: - description: The ID of the user to export data for - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetUserDataExportOutput' + $ref: '#/components/schemas/EndpointsAdminGetJiraConfigOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get User Data Export (GDPR Art. 15, 20) - /admin/users/bulkSearchMappings: + summary: Get Jira Configuration post: - description: Get user mappings for a list of canonical user IDs + description: Update global defaults for Jira integration parameters: - description: The Azure organization ID in: query @@ -10823,6 +12570,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -10872,305 +12630,55 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBulkGetUserMappingsInput' + $ref: '#/components/schemas/EndpointsUpdateJiraConfigInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBulkGetUserMappingsOutput' + $ref: '#/components/schemas/EndpointsUpdateJiraConfigOutput' description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Post Bulk Get User Mappings - /auth/access_token: - GET: - description: Exchange a one time code from cognito for a pair of access and refresh tokens - parameters: - - description: OAuth2 authorization code from identity provider - in: query - name: code - required: true - schema: - type: string - - description: Redirect URI used in the OAuth flow - in: query - name: redirect_uri - required: true - schema: - type: string - - description: >- - RFC 7636 PKCE verifier paired with the code_challenge sent on the authorize request. Required when the - original authorize request set a code_challenge; otherwise omit. - in: query - name: code_verifier - required: false - schema: - type: string - responses: - '200': - content: - application/json: - schema: - properties: - expiresAt: - description: Token expiration timestamp in milliseconds - format: int64 - type: integer - expiresIn: - description: Token expiration time in seconds - type: integer - installationIds: - description: List of GitHub installation IDs - items: - type: string - type: array - required: - - expiresIn - - installationIds - - expiresAt - type: object - description: Successful token exchange - '400': - content: - application/json: - schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Bad Request - '401': - content: - application/json: - schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Unauthorized - '403': - content: - application/json: - schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Forbidden - '500': - content: - application/json: - schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Internal Server Error - summary: Get Tokens - /auth/github_token: - GET: - description: Generate a JWT token for GitHub Actions or CLI access - parameters: - - description: GitHub organization or user name - in: query - name: owner - required: true - schema: - type: string - - description: GitHub token for authentication - in: query - name: token - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - properties: - accessToken: - description: JWT access token for Nullify API - type: string - required: - - accessToken - type: object - description: Successful token generation '400': content: application/json: schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object + $ref: '#/components/schemas/RestErrResponse' description: Bad Request '401': content: application/json: schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object + $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '403': + '404': content: application/json: schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Forbidden + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object + $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get GitHub Token - /auth/logout: - GET: - description: Clear authentication cookies and log out the user - responses: - '200': - description: OK - summary: Logout - /auth/refresh_token: - GET: - description: Exchange a refresh token for a new access token - parameters: - - description: Refresh token cookie - in: cookie - name: refresh_token - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - properties: - expiresAt: - description: Token expiration timestamp in milliseconds - format: int64 - type: integer - expiresIn: - description: Token expiration time in seconds - type: integer - installationIds: - description: List of GitHub installation IDs - items: - type: string - type: array - required: - - expiresIn - - installationIds - - expiresAt - type: object - description: Successful token refresh - '400': - content: - application/json: - schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Bad Request - '401': - content: - application/json: - schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Unauthorized - '403': + '503': content: application/json: schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Forbidden - '500': + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': content: application/json: schema: - properties: - error: - description: Error message - type: string - required: - - error - type: object - description: Internal Server Error - summary: Refresh Access Token - /asset-graph/reachability: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Update Jira Configuration + /admin/integrations/jira/forge: get: - description: Computes network reachability and topology paths for a node in the asset graph + description: Returns whether the authenticated tenant has a linked Jira Forge installation, and the linked site when present. parameters: - - in: query - name: nodeId - required: true - schema: - type: string - - in: query - name: accountId - schema: - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -11190,6 +12698,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11240,48 +12759,33 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAssetGraphReachabilityOutput' + $ref: '#/components/schemas/EndpointsGetJiraForgeStatusOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Asset Graph Reachability - /asset-graph/search: + summary: Get Jira Forge connection status + /admin/integrations/jira/install: get: - description: Searches the asset graph for nodes matching a query string + description: >- + Generates an Atlassian 3LO authorize URL for the Nullify-owned OAuth app and persists a short-lived state token + keyed to the caller's tenant. parameters: - - in: query - name: q - required: true + - description: Atlassian site URL selected for this connection + in: query + name: siteUrl schema: - minLength: 2 + description: Atlassian site URL selected for this connection type: string - - in: query - name: objectTypes - schema: - items: - type: string - type: array - - in: query - name: maxResults - schema: - default: 20 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -11301,6 +12805,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11351,7 +12866,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAssetGraphSearchOutput' + $ref: '#/components/schemas/EndpointsGetJiraInstallOutput' description: OK '400': content: @@ -11359,42 +12874,29 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Search Asset Graph - /asset-graph/subgraph: + summary: Start Jira Forge OAuth connect + /admin/integrations/linear: get: - description: Extracts a bounded subgraph from the merged asset graph starting from a root node + description: Returns the saved Linear team and routing-policy configuration. parameters: - - in: query - name: rootNodeId - required: true - schema: - type: string - - in: query - name: depth - schema: - default: 1 - type: integer - - in: query - name: maxNodes - schema: - default: 150 - type: integer - - in: query - name: accountId - schema: - type: string - - in: query - name: objectTypes - schema: - items: - type: string - type: array - description: The Azure organization ID in: query name: azureOrganizationId @@ -11414,6 +12916,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11464,30 +12977,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAssetGraphSubgraphOutput' + $ref: '#/components/schemas/EndpointsAdminGetLinearConfigOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Asset Graph Subgraph - /asset-graph/summary: + summary: Get Linear Configuration + /admin/integrations/linear/install: get: - description: Retrieves a unified summary of all infrastructure and repo context graphs with presigned download URLs + description: >- + Generates an OAuth authorize URL for the Nullify-owned Linear app and persists a short-lived state token keyed + to the caller's tenant. parameters: - description: The Azure organization ID in: query @@ -11508,6 +13017,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11558,31 +13078,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAssetGraphSummaryOutput' + $ref: '#/components/schemas/EndpointsGetLinearInstallOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '404': + description: Unauthorized + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Asset Graph Summary - /context/applications: + summary: Start Linear OAuth install + /admin/integrations/linear/members: get: - description: Retrieves all applications for the tenant + description: >- + Lists the active members of a Linear team (the configured team when teamId is omitted), for ticket assignee + selection. Without q it returns the first page and hasMore; with q it searches name, display name and email. parameters: + - in: query + name: teamId + schema: + type: string + - in: query + name: q + schema: + maxLength: 100 + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -11602,6 +13133,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11652,23 +13194,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetContextApplicationsOutput' + $ref: '#/components/schemas/EndpointsAdminGetLinearMembersOutput' description: OK - '403': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': + description: Bad Request + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Applications - post: - description: Create a new application + description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Linear Team Members + /admin/integrations/linear/oauth: + get: + description: >- + Returns whether the authenticated tenant has completed the Linear OAuth install, and whether this deployment can + start one and keep it renewed. parameters: - description: The Azure organization ID in: query @@ -11689,6 +13246,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11734,40 +13302,29 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostContextApplicationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostContextApplicationOutput' + $ref: '#/components/schemas/EndpointsGetLinearOAuthStatusOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Application - /context/applications/{applicationId}: - delete: - description: Delete an application + summary: Get Linear OAuth install status + /admin/integrations/linear/teams: + get: + description: Lists the Linear teams available to the tenant's Linear install, for team selection. parameters: - description: The Azure organization ID in: query @@ -11788,6 +13345,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11833,45 +13401,35 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteContextApplicationOutput' + $ref: '#/components/schemas/EndpointsAdminGetLinearTeamsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Unauthorized + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Application - get: - description: Retrieves a specific application by ID + summary: List Linear Teams + /admin/integrations/linear/ticket-config: + post: + description: Set the Linear team that manual ticket creation files work items against. parameters: - description: The Azure organization ID in: query @@ -11892,6 +13450,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -11937,17 +13506,17 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPostLinearTicketConfigInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetContextApplicationOutput' + $ref: '#/components/schemas/EndpointsAdminPostLinearTicketConfigOutput' description: OK '400': content: @@ -11955,27 +13524,42 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Unauthorized + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Application - patch: - description: Update an existing application + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Set Linear Ticket Configuration + /admin/integrations/notifications: + get: + description: >- + Get per-tenant notification delivery configuration (Slack channels, email addresses, webhook URLs and their + event filters) parameters: - description: The Azure organization ID in: query @@ -11996,6 +13580,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12041,51 +13636,30 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchContextApplicationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchContextApplicationOutput' + $ref: '#/components/schemas/EndpointsGetAdminNotificationConfigOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Application - /context/applications/{applicationId}/schema: - get: - description: Returns the computed API schema for an application by merging all linked project schemas + summary: Get Notification Config + put: + description: >- + Replace the per-tenant notification delivery configuration. Each entry pairs an event filter (severity, CWEs, + CVEs) with target channels (Slack, email, webhook). parameters: - description: The Azure organization ID in: query @@ -12106,6 +13680,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12151,17 +13736,17 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutAdminNotificationConfigInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetApplicationSchemaOutput' + $ref: '#/components/schemas/EndpointsPutAdminNotificationConfigOutput' description: OK '400': content: @@ -12169,22 +13754,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Application Schema - /context/applications/rebuild: - post: - description: Trigger application context rebuilding + summary: Put Notification Config + /admin/integrations/slack: + get: + description: Get global defaults for Slack integration parameters: - description: The Azure organization ID in: query @@ -12205,6 +13790,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12250,63 +13846,32 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsRebuildApplicationsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsRebuildApplicationsOutput' + $ref: '#/components/schemas/EndpointsGetSlackConfigOutput' description: OK - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Rebuild Applications - /context/artifact-deployments: + summary: Get Slack Configuration + /admin/integrations/slack/install: get: - description: Lists all artifact deployments with optional filtering + description: >- + Generates an OAuth v2 authorize URL for the Nullify-owned Slack app and persists a short-lived state token keyed + to the caller's tenant. parameters: - - in: query - name: artifactId - schema: - type: string - - in: query - name: repositoryId - schema: - type: string - - in: query - name: cloudResourceId - schema: - type: string - - in: query - name: computeType - schema: - type: string - - in: query - name: limit - schema: - type: integer - - in: query - name: nextToken - schema: - type: string - - in: query - name: includeDeleted - schema: - type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -12326,6 +13891,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12376,24 +13952,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsListArtifactDeploymentsOutput' + $ref: '#/components/schemas/EndpointsGetSlackDistributedInstallOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request + description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Artifact Deployments - /context/artifact-deployments/{deploymentId}: - get: - description: Retrieves a single artifact deployment by ID + summary: Start Slack distributed install + /admin/integrations/slack/key: + post: + description: Stores the Slack API key securely and associates the Slack workspace with this installation. parameters: - description: The Azure organization ID in: query @@ -12414,6 +13996,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12459,17 +14052,17 @@ paths: items: type: string type: array - - in: path - name: deploymentId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSlackAPIKeyInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetArtifactDeploymentOutput' + $ref: '#/components/schemas/EndpointsPostSlackAPIKeyOutput' description: OK '400': content: @@ -12477,47 +14070,47 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Artifact Deployment - /context/artifacts: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Set Slack API Key + /admin/integrations/teams: get: - description: Lists all build artifacts with optional filtering + description: Get teams from an integrated platform (github, gitlab, azure, bitbucket, okta) parameters: - - in: query - name: repositoryId - schema: - type: string - - in: query - name: projectId - schema: - type: string - - in: query - name: type - schema: - type: string - - in: query - name: limit - schema: - type: integer - - in: query - name: nextToken + - description: The integration provider to query teams from + in: query + name: provider schema: + description: The integration provider to query teams from type: string - - in: query - name: includeDeleted - schema: - type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -12537,6 +14130,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12587,7 +14191,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsListArtifactsOutput' + $ref: '#/components/schemas/EndpointsAdminGetIntegrationTeamsOutput' description: OK '400': content: @@ -12595,16 +14199,25 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Artifacts - /context/artifacts/{artifactId}: - delete: - description: Soft-delete an artifact + summary: Get Integration Teams + /admin/integrations/threat-intel/destinations: + get: + description: >- + Where customer-facing threat-investigation results are posted: the Slack channel Nullify shares with you (on by + default), a channel in your own Slack workspace, and a Microsoft Teams channel. A Teams webhook URL is never + returned. parameters: - description: The Azure organization ID in: query @@ -12625,6 +14238,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12670,45 +14294,30 @@ paths: items: type: string type: array - - in: path - name: artifactId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteArtifactOutput' + $ref: '#/components/schemas/EndpointsAdminGetThreatNotificationDestinationsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Artifact - get: - description: Retrieves a single build artifact by ID + summary: Get Threat Investigation Destinations + put: + description: >- + Change where customer-facing threat-investigation results are posted. Omitted fields are unchanged; an empty + string removes that destination. Several destinations can be on at once. parameters: - description: The Azure organization ID in: query @@ -12729,6 +14338,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12774,17 +14394,17 @@ paths: items: type: string type: array - - in: path - name: artifactId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPutThreatNotificationDestinationsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetArtifactOutput' + $ref: '#/components/schemas/EndpointsAdminPutThreatNotificationDestinationsOutput' description: OK '400': content: @@ -12792,25 +14412,41 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Artifact - /context/asset-inventory/cloud-accounts: + summary: Update Threat Investigation Destinations + /admin/integrations/users: get: - description: >- - Retrieves cloud accounts discovered during cloud integration scans. These are NOT integration configuration - settings, but accounts observed in scan results. + description: Get users from an integrated platform (github, jira, slack) parameters: + - description: The integration provider to query users from + in: query + name: provider + schema: + description: The integration provider to query users from + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -12830,6 +14466,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12875,30 +14522,12 @@ paths: items: type: string type: array - - in: query - name: provider - schema: - nullable: true - type: string - - in: query - name: active - schema: - nullable: true - type: boolean - - in: query - name: nextToken - schema: - type: string - - in: query - name: limit - schema: - type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCloudAccountRecordsOutput' + $ref: '#/components/schemas/EndpointsAdminGetIntegrationUsersOutput' description: OK '400': content: @@ -12906,24 +14535,27 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Asset Inventory Cloud Accounts - /context/asset-inventory/cloud-resources: + summary: Get Integration Users + /admin/manager/settings: get: description: >- - Retrieves cloud resources from asset inventory with optional filtering by category, type, provider, account, and - status. Covers all resource types: compute, network, storage, database, messaging, identity, etc. + Per-tenant settings governing what the autonomous manager agent may do: the set of blocked manager action types + / group aliases (PULL_REQUESTS / TICKETS / MESSAGING) plus freeform ground rules and opt-in automatic threat + investigations (default off). Separate from ticket auto-create settings. Returns the stored set (empty = + everything enabled for an unconfigured tenant action types) plus a read-only install status per class; the agent + acts on an action only when it is not blocked AND its integration is installed. parameters: - description: The Azure organization ID in: query @@ -12944,6 +14576,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -12989,45 +14632,12 @@ paths: items: type: string type: array - - in: query - name: category - schema: - nullable: true - type: string - - in: query - name: type - schema: - nullable: true - type: string - - in: query - name: provider - schema: - nullable: true - type: string - - in: query - name: accountId - schema: - nullable: true - type: string - - in: query - name: active - schema: - nullable: true - type: boolean - - in: query - name: nextToken - schema: - type: string - - in: query - name: limit - schema: - type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAssetInventoryCloudResourcesOutput' + $ref: '#/components/schemas/EndpointsGetManagerSettingsOutput' description: OK '400': content: @@ -13035,25 +14645,25 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Asset Inventory Cloud Resources - /context/asset-inventory/public-facing: - get: + summary: Get Manager Settings + put: description: >- - Returns the unified list of public-facing assets across cloud providers. The bug hunter daily workflow calls - this once per scan to seed its scope. Backed by a single is_public_facing index column maintained by the cloud - scan converter. + Persist the per-tenant manager-agent settings: the blocked-action-types set (specific action types and/or the + group aliases PULL_REQUESTS / TICKETS / MESSAGING) and the freeform ground rules. Blocks are enforced as hard + tool gates at agent runtime (independent of admin scan-pipeline auto-create) and the ground rules are injected + into the agent prompt. parameters: - description: The Azure organization ID in: query @@ -13074,6 +14684,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13119,30 +14740,17 @@ paths: items: type: string type: array - - in: query - name: cloudProvider - schema: - nullable: true - type: string - - in: query - name: accountId - schema: - nullable: true - type: string - - in: query - name: nextToken - schema: - type: string - - in: query - name: limit - schema: - type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutManagerSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPublicFacingAssetsOutput' + $ref: '#/components/schemas/EndpointsPutManagerSettingsOutput' description: OK '400': content: @@ -13150,24 +14758,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Public Facing Assets - /context/asset-inventory/resources: - get: - description: >- - Retrieves cloud resources from asset inventory with optional filtering by category, type, and status. Supports - CSPM-style resource categorization across multi-cloud environments (AWS, K8s, GCP, Azure). + summary: Update Manager Settings + /admin/metrics/findings: + post: + description: Get aggregate findings metrics parameters: - description: The Azure organization ID in: query @@ -13188,6 +14800,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13233,35 +14856,17 @@ paths: items: type: string type: array - - in: query - name: category - schema: - nullable: true - type: string - - in: query - name: type - schema: - nullable: true - type: string - - in: query - name: active - schema: - nullable: true - type: boolean - - in: query - name: nextToken - schema: - type: string - - in: query - name: limit - schema: - type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminQueryFindingsMetricsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAssetInventoryResourcesOutput' + $ref: '#/components/schemas/EndpointsAdminQueryFindingsMetricsOutput' description: OK '400': content: @@ -13269,6 +14874,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -13281,35 +14892,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Asset Inventory Resources - /context/cicd-pipelines: - get: - description: Lists all CI/CD pipelines with optional filtering + summary: Post Findings Metrics + /admin/metrics/findings/by-repository: + post: + description: Get per-repository closure and time-to-resolve metrics parameters: - - in: query - name: repositoryId - schema: - type: string - - in: query - name: projectId - schema: - type: string - - in: query - name: platform - schema: - type: string - - in: query - name: limit - schema: - type: integer - - in: query - name: nextToken - schema: - type: string - - in: query - name: includeDeleted - schema: - type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -13329,6 +14916,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13374,12 +14972,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminQueryFindingsMetricsByRepositoryInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsListPipelinesOutput' + $ref: '#/components/schemas/EndpointsAdminQueryFindingsMetricsByRepositoryOutput' description: OK '400': content: @@ -13387,16 +14990,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List CI/CD Pipelines - /context/cicd-pipelines/{pipelineId}: - delete: - description: Soft-delete a CI/CD pipeline + summary: Post Findings Metrics By Repository + /admin/metrics/findings/frameworks: + post: + description: Get per-compliance-framework finding counts (critical/high emphasis) parameters: - description: The Azure organization ID in: query @@ -13417,6 +15032,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13462,17 +15088,12 @@ paths: items: type: string type: array - - in: path - name: pipelineId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeletePipelineOutput' + $ref: '#/components/schemas/EndpointsAdminQueryFindingsFrameworksOutput' description: OK '400': content: @@ -13480,27 +15101,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete CI/CD Pipeline + summary: Post Findings Compliance Frameworks + /admin/metrics/interactions: get: - description: Retrieves a single CI/CD pipeline by ID + description: Get interactions (autofix PRs, tickets, etc) from findings parameters: - description: The Azure organization ID in: query @@ -13521,6 +15143,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13566,17 +15199,22 @@ paths: items: type: string type: array - - in: path - name: pipelineId - required: true + - in: query + name: fromDate + schema: + nullable: true + type: string + - in: query + name: toDate schema: + nullable: true type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPipelineOutput' + $ref: '#/components/schemas/EndpointsAdminBotInteractionsOutput' description: OK '400': content: @@ -13584,25 +15222,35 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CI/CD Pipeline - /context/cloud-recon/accounts/{accountId}/discovered-nodes: - get: - description: >- - Returns graph nodes from the latest cloud_recon scan, filterable by object type and source (use - source='cloudrecon' to get prescan additions only) + summary: Get Interactions + /admin/metrics/over-time: + post: + description: Get introduced, resolved, and verified fixed finding counts over time parameters: + - description: Time granularity for metrics aggregation (hour, day, week) + in: query + name: resolution + schema: + description: Time granularity for metrics aggregation (hour, day, week) + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -13622,6 +15270,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13667,33 +15326,17 @@ paths: items: type: string type: array - - in: query - name: objectType - schema: - type: string - - in: query - name: source - schema: - type: string - - in: query - name: limit - schema: - type: integer - - in: query - name: offset - schema: - type: integer - - in: path - name: accountId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsQueryMetricsOverTimeInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCloudReconDiscoveredNodesOutput' + $ref: '#/components/schemas/EndpointsQueryMetricsOverTimeOutput' description: OK '400': content: @@ -13713,10 +15356,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Cloud Recon Discovered Nodes - /context/cloud-recon/accounts/{accountId}/hotspots: - get: - description: Returns hotspots from the latest completed cloud_recon scan + summary: Get Metrics Over Time + /admin/metrics/overview: + post: + description: >- + Query aggregated overview metrics including funnel data and type breakdowns. The estimatedTriageWorkHours field + estimates manual triage workload at six minutes per visible finding; it does not measure realized savings. parameters: - description: The Azure organization ID in: query @@ -13737,6 +15382,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13782,29 +15438,17 @@ paths: items: type: string type: array - - in: query - name: severity - schema: - type: string - - in: query - name: limit - schema: - type: integer - - in: query - name: offset - schema: - type: integer - - in: path - name: accountId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsQueryOverviewInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCloudReconHotspotsOutput' + $ref: '#/components/schemas/EndpointsQueryOverviewOutput' description: OK '400': content: @@ -13824,10 +15468,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Cloud Recon Hotspots - /context/cloud-recon/accounts/{accountId}/scans/latest: - get: - description: Returns the latest completed cloud_recon scan metadata for an account + summary: Query Overview + /admin/metrics/pullrequests: + post: + description: Get aggregate pull request metrics parameters: - description: The Azure organization ID in: query @@ -13848,6 +15492,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -13893,17 +15548,17 @@ paths: items: type: string type: array - - in: path - name: accountId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminQueryPullRequestMetricsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetLatestCloudReconScanOutput' + $ref: '#/components/schemas/EndpointsAdminQueryPullRequestMetricsOutput' description: OK '400': content: @@ -13911,28 +15566,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Latest Cloud Recon Scan - /context/cloud-recon/scans: + summary: Post Pull Request Metrics + /admin/metrics/raw: post: - description: Persist a completed cloud_recon scan (S3 blob + indexed Postgres rows) + description: Query raw finding metrics with flexible filtering parameters: - description: The Azure organization ID in: query @@ -13953,6 +15608,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14002,13 +15668,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCloudReconScanInput' + $ref: '#/components/schemas/EndpointsQueryMetricsRawInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCloudReconScanOutput' + $ref: '#/components/schemas/EndpointsQueryMetricsRawOutput' description: OK '400': content: @@ -14028,10 +15694,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Persist Cloud Recon Scan - /context/cloud-recon/tenants/cross-account-trusts: - get: - description: Returns every external principal trusted by 2+ accounts in the tenant (latest scans only) + summary: Query Raw Metrics + /admin/metrics/tickets: + post: + description: Get aggregate ticket metrics parameters: - description: The Azure organization ID in: query @@ -14052,6 +15718,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14097,13 +15774,30 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminQueryTicketMetricsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCloudReconTenantTrustsOutput' + $ref: '#/components/schemas/EndpointsAdminQueryTicketMetricsOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -14116,11 +15810,40 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Tenant Cloud Recon Cross-Account Trusts - /context/cloud-scan/{scanId}/status: + summary: Post Ticket Metrics + /admin/metrics/usage/aggregate: get: - description: Returns the aggregated status of a cloud-scan across every provider the tenant scanned (AWS, Azure, GCP). + description: Cost and token totals grouped by agent/class for a tenant parameters: + - in: query + name: window + schema: + type: string + - in: query + name: class + schema: + nullable: true + type: string + - in: query + name: agent + schema: + nullable: true + type: string + - in: query + name: branchType + schema: + nullable: true + type: string + - in: query + name: from + schema: + nullable: true + type: string + - in: query + name: to + schema: + nullable: true + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -14140,6 +15863,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14185,41 +15919,93 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsContextGetCloudScanStatusOutput' + $ref: '#/components/schemas/EndpointsAdminUsageMetricsAggregateOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized - '404': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Cloud Scan Status - /context/cloud-scan/start: - post: - description: Starts an async cloud-scan Step Function that scans every cloud integration the calling tenant has installed. + summary: Usage Aggregate + /admin/metrics/usage/ledger: + get: + description: Paginated per-run billing ledger entries for a tenant parameters: + - in: query + name: query + schema: + maxLength: 256 + type: string + - in: query + name: class + schema: + nullable: true + type: string + - in: query + name: agent + schema: + nullable: true + type: string + - in: query + name: branchType + schema: + nullable: true + type: string + - in: query + name: runId + schema: + nullable: true + type: string + - in: query + name: findingId + schema: + items: + type: string + type: array + - in: query + name: from + schema: + nullable: true + type: string + - in: query + name: to + schema: + nullable: true + type: string + - in: query + name: cursor + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -14239,6 +16025,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14289,28 +16086,59 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsContextStartCloudScanOutput' + $ref: '#/components/schemas/EndpointsAdminUsageLedgerResponse' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Start Cloud Scan - /context/deps: - delete: - description: >- - Deletes dependency occurrence records. Scope is inferred from query parameters: single entry - (repo+project+ecosystem+name+version+introducedAt), project-wide (repo+project), or tenant-wide (no selectors, - confirmGlobal=true). + summary: Usage Ledger + /admin/metrics/usage/timeseries: + get: + description: Daily or hourly cost and token aggregation for a tenant parameters: + - in: query + name: granularity + schema: + type: string + - in: query + name: from + schema: + type: string + - in: query + name: to + schema: + type: string + - in: query + name: class + schema: + nullable: true + type: string + - in: query + name: agent + schema: + nullable: true + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -14330,6 +16158,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14375,47 +16214,12 @@ paths: items: type: string type: array - - in: query - name: repositoryId - schema: - nullable: true - type: string - - in: query - name: projectId - schema: - nullable: true - type: string - - in: query - name: ecosystem - schema: - nullable: true - type: string - - in: query - name: name - schema: - nullable: true - type: string - - in: query - name: version - schema: - nullable: true - type: string - - in: query - name: introducedAt - schema: - nullable: true - type: string - - in: query - name: global - schema: - nullable: true - type: boolean responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteDepsOutput' + $ref: '#/components/schemas/EndpointsAdminUsageMetricsTimeseriesOutput' description: OK '400': content: @@ -14423,6 +16227,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -14435,9 +16245,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete dependency data + summary: Usage Timeseries + /admin/network/ip-allowlist: get: - description: Returns dependency history across all repositories/projects. + description: Returns the ranges people may reach this tenant's API from, and the caller's own address. parameters: - description: The Azure organization ID in: query @@ -14458,6 +16269,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14503,44 +16325,32 @@ paths: items: type: string type: array - - in: query - name: pageSize - schema: - format: int32 - type: integer - - in: query - name: cursor - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDepsOutput' + $ref: '#/components/schemas/EndpointsNetworkIPAllowlistOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Tenant Wide Dependencies (Historical) - /context/deps/active: - get: - description: Returns dependencies that are active across all repositories/projects. + summary: Get IP Allowlist + put: + description: >- + Replaces the tenant's IP allowlist. An empty list removes the restriction; ranges matching every address are + rejected. Service accounts and GitHub Actions are never restricted. A list that excludes the caller's own + address is rejected. expectedCidrs refuses a list changed since it was read; preview a list with POST + /admin/network/ip-allowlist/preview. parameters: - description: The Azure organization ID in: query @@ -14561,6 +16371,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14606,50 +16427,17 @@ paths: items: type: string type: array - - in: query - name: pageSize - schema: - format: int32 - type: integer - - in: query - name: cursor - schema: - type: string - - in: query - name: search - schema: - type: string - - in: query - name: ecosystem - schema: - type: string - - in: query - name: name - schema: - type: string - - in: query - name: direct - schema: - nullable: true - type: boolean - - in: query - name: repositoryId - schema: - type: string - - in: query - name: projectId - schema: - type: string - - in: query - name: range - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutNetworkIPAllowlistInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetActiveDepsOutput' + $ref: '#/components/schemas/EndpointsNetworkIPAllowlistOutput' description: OK '400': content: @@ -14657,22 +16445,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Tenant Wide Active Dependencies - /context/deps/active/summary: - get: - description: Returns aggregate counts and the oldest active dependency across all repositories/projects, search-aware. + summary: Replace IP Allowlist + /admin/network/ip-allowlist/preview: + post: + description: 'Validates and assesses a list without storing it: warnings, and whether it admits the caller''s own address.' parameters: - description: The Azure organization ID in: query @@ -14693,6 +16493,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14738,41 +16549,17 @@ paths: items: type: string type: array - - in: query - name: search - schema: - type: string - - in: query - name: ecosystem - schema: - type: string - - in: query - name: name - schema: - type: string - - in: query - name: direct - schema: - nullable: true - type: boolean - - in: query - name: repositoryId - schema: - type: string - - in: query - name: projectId - schema: - type: string - - in: query - name: range - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPreviewNetworkIPAllowlistInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetActiveDepsSummaryOutput' + $ref: '#/components/schemas/EndpointsNetworkIPAllowlistOutput' description: OK '400': content: @@ -14780,24 +16567,31 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Tenant Wide Active Dependency Summary - /context/deps/by-ref/{bomRef}: - get: + summary: Preview IP Allowlist + /admin/operator/external-writes/initialize: + post: description: >- - Returns active dependency occurrences whose cdxgen bom-ref matches. A bom-ref is unique within a project but can - repeat across projects, so the result is a list. + For new-stack provisioning: install read-only defaults only in stores without a tenant row. Existing choices and + staff forces are preserved, including on retries. Nullify staff and the operator CLI only; dryRun writes + nothing. parameters: - description: The Azure organization ID in: query @@ -14818,6 +16612,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14863,26 +16668,17 @@ paths: items: type: string type: array - - in: query - name: pageSize - schema: - format: int32 - type: integer - - in: query - name: cursor - schema: - type: string - - in: path - name: bomRef - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsInitializeExternalWritesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDepsByBomRefOutput' + $ref: '#/components/schemas/EndpointsInitializeExternalWritesOutput' description: OK '400': content: @@ -14902,13 +16698,107 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Dependencies by Bom Ref - /context/deps/dependents/{bomRef}: + summary: Initialize External Write Defaults + /admin/operator/github-tenant/route: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGitHubTenantRouteOperatorInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceGitHubTenantRouteResult' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Preview, write or inspect a GitHub tenant route born paused + /admin/operator/native-tenant/route: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsNativeTenantRouteOperatorInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNativeTenantBootstrapResult' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Preview or write a native Azure workspace route + /admin/operator/package-feeds: get: - description: >- - Returns active dependency occurrences whose parent chain includes the given bom-ref. Walk recursively to - traverse the downstream dependency subtree. + description: Read redacted connections for an explicitly selected tenant; requires a verified human staff identity. parameters: + - description: Optional connection id to read + in: query + name: connectionId + schema: + description: Optional connection id to read + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -14928,6 +16818,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -14973,26 +16874,12 @@ paths: items: type: string type: array - - in: query - name: pageSize - schema: - format: int32 - type: integer - - in: query - name: cursor - schema: - type: string - - in: path - name: bomRef - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDepsDependentsOutput' + $ref: '#/components/schemas/EndpointsAdminCLIPackageFeedsOutput' description: OK '400': content: @@ -15006,16 +16893,23 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Dependents of a Bom Ref - /context/deps/exposure: - get: - description: Returns exposure windows across all repositories/projects intersecting a version filter (server-side filtering). + summary: Read Staff Package Feeds + post: + description: >- + Validate credentials and apply one revision-guarded connection change with its actor and reason in the same + audit transaction. parameters: - description: The Azure organization ID in: query @@ -15036,6 +16930,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15081,24 +16986,17 @@ paths: items: type: string type: array - - in: query - name: ecosystem - schema: - type: string - - in: query - name: name - schema: - type: string - - in: query - name: range - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminCLIPackageFeedControlInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetExposureOutput' + $ref: '#/components/schemas/EndpointsAdminCLIPackageFeedControlOutput' description: OK '400': content: @@ -15112,16 +17010,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Global package exposure by version filter (semver or hash) - /context/deps/repository/{repositoryId}/project/{projectId}/active: + summary: Control Staff Package Feed + /admin/operator/scan-entitlement: get: - description: Returns dependencies that are active for the latest commit using the DependencyOccurrence database. + description: >- + Read an explicitly selected tenant's code and secrets repository caps and their usage; Nullify staff and the + operator CLI only. parameters: - description: The Azure organization ID in: query @@ -15142,6 +17054,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15187,35 +17110,12 @@ paths: items: type: string type: array - - in: query - name: search - schema: - type: string - - in: query - name: ecosystem - schema: - type: string - - in: query - name: direct - schema: - nullable: true - type: boolean - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetProjectActiveDepsOutput' + $ref: '#/components/schemas/EndpointsOperatorScanEntitlementOutput' description: OK '400': content: @@ -15235,12 +17135,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Active Dependencies - /context/deps/repository/{repositoryId}/project/{projectId}/at/{commit}: - get: + summary: Read Staff Scan Entitlement + put: description: >- - Returns dependencies exposed at the specified commit (resolved to commit timestamp) using the - DependencyOccurrence database. + Replace the tenant's code and secrets repository caps (null is unlimited) only if the entitlement still carries + expectedUpdatedAt, recording the actor and reason in the same transaction. Every write leaves enrollment scoping + on, so clearing both caps still scans only enrolled repositories; scopingEnabled false, accepted only with both + caps null, turns scoping off. secretsMode switches the secrets mode under the new caps: independent with no + secrets cap enrolls every repository for secrets, otherwise secrets enrollment is seeded from code enrollment. A + cap below its family's usage is refused. Turning staffRepositoryAllowlist off is refused (412) when the + repositories it makes available put a family over its cap; send a cap that fits in the same request. + Repositories brought into a family's scope get a default-branch scan. parameters: - description: The Azure organization ID in: query @@ -15261,6 +17166,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15306,27 +17222,17 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string - - in: path - name: commit - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsOperatorScanEntitlementPutInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDepsAtCommitOutput' + $ref: '#/components/schemas/EndpointsOperatorScanEntitlementOutput' description: OK '400': content: @@ -15340,16 +17246,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Dependencies at commit - /context/deps/repository/{repositoryId}/project/{projectId}/diff: + summary: Replace Staff Scan Entitlement + /admin/operator/scan-scope/repositories: get: - description: Computes added, removed, and upgraded packages by comparing database snapshots at the two commit timestamps. + description: >- + List every live repository's code and secrets enrollment and directory rules, its Nullify-set limits and the + scope scans resolve, for an explicitly selected tenant; Nullify staff and the operator CLI only. parameters: - description: The Azure organization ID in: query @@ -15370,6 +17290,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15415,32 +17346,12 @@ paths: items: type: string type: array - - in: query - name: fromCommit - schema: - nullable: true - type: string - - in: query - name: toCommit - schema: - nullable: true - type: string - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDepsDiffOutput' + $ref: '#/components/schemas/EndpointsOperatorRepositoryScanScopesOutput' description: OK '400': content: @@ -15460,10 +17371,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Dependency diff between two commits - /context/deps/repository/{repositoryId}/project/{projectId}/exposure: - get: - description: Returns exposure windows for a repo/project intersecting a version filter (server-side filtering). + summary: Read Staff Repository Scan Scopes + put: + description: >- + Set, for up to 100 repositories, whether each is on the staff repository allowlist and the code directories + Nullify limits code scanning to and skips (secrets scanning is never limited by them), recording the actor and + reason in the same transaction. The customer's choices are kept and cut to these limits when a scope is + resolved, so lifting a limit restores them. An item carrying expectedStaffUpdatedAt is refused (409) when the + repository's staff limits changed since, and then nothing is written. Allowing a repository whose dormant + customer enrollment would put a family over its cap resets that enrollment in the same transaction, audited and + reported in enrollmentReset. Reports the repositories whose scanned scope narrowed; widened ones get a + default-branch scan. Nullify staff and the operator CLI only. parameters: - description: The Azure organization ID in: query @@ -15484,6 +17402,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15529,34 +17458,17 @@ paths: items: type: string type: array - - in: query - name: ecosystem - schema: - type: string - - in: query - name: name - schema: - type: string - - in: query - name: range - schema: - type: string - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsOperatorRepositoryStaffScopesPutInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetProjectExposureOutput' + $ref: '#/components/schemas/EndpointsOperatorRepositoryStaffScopesOutput' description: OK '400': content: @@ -15570,18 +17482,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Project package exposure by version filter (semver or hash) - /context/deps/repository/{repositoryId}/project/{projectId}/history: + summary: Set Staff Repository Scan Limits + /admin/operator/tenant-capabilities: get: description: >- - Returns exposure windows for a given package (ecosystem+name), grouped by version, from the DependencyOccurrence - database. + List every capability's tenant-wide value and every stored per-repository value of an explicitly selected + tenant: the staff force, the tenant's choice and the value in force; Nullify staff and the operator CLI only. parameters: - description: The Azure organization ID in: query @@ -15602,6 +17520,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15647,30 +17576,12 @@ paths: items: type: string type: array - - in: query - name: ecosystem - schema: - type: string - - in: query - name: name - schema: - type: string - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDepsHistoryOut' + $ref: '#/components/schemas/EndpointsOperatorTenantCapabilitiesOutput' description: OK '400': content: @@ -15690,12 +17601,14 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Package exposure history (windows) - /context/deps/without-lockfile: - get: + summary: Read Staff Tenant Capabilities + put: description: >- - Returns projects or repositories whose dependencies were resolved without a committed lockfile. These are at - higher risk during supply chain incidents. + Force a capability on or off for the tenant, or for one repository of a repository-scoped capability, or lift + the force (unset), only if the force still carries expectedStaffUpdatedAt, recording the actor and reason in the + same transaction. A force needs a customer-facing lockReason. The tenant cannot change a forced capability. With + seedCustomerEnabled, writes the tenant's own choice as the system seed actor instead, once, without touching a + force or an existing choice. Nullify staff and the operator CLI only. parameters: - description: The Azure organization ID in: query @@ -15716,6 +17629,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15761,16 +17685,17 @@ paths: items: type: string type: array - - in: query - name: level - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsOperatorTenantCapabilityPutInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDepsWithoutLockfileOutput' + $ref: '#/components/schemas/EndpointsOperatorTenantCapabilityPutOutput' description: OK '400': content: @@ -15784,41 +17709,299 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List projects/repos without lockfiles - /context/entrypoints: + summary: Force Tenant Capability + /admin/operator/workspace-bootstrap/approve: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceProvisioningApproveInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceProvisioningApproveOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Approve an exact provisioning request + /admin/operator/workspace-bootstrap/invitation: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceBootstrapOperatorInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceBootstrapOperatorOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Preview or issue a workspace bootstrap invitation + /admin/operator/workspace-bootstrap/operation: get: - description: Lists all application entrypoints with optional filtering parameters: - in: query - name: repositoryId - schema: - type: string - - in: query - name: projectId - schema: - type: string - - in: query - name: kind + name: operationId schema: type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspacebootstrapOperatorInspection' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Inspect a durable workspace claim + /admin/operator/workspace-bootstrap/renew: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceBootstrapRenewInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspacebootstrapOperatorInspection' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Preview or renew an organization-pinned workspace invitation + /admin/operator/workspace-bootstrap/requests: + get: + parameters: - in: query - name: limit - schema: - type: integer - - in: query - name: nextToken + name: beforeRequestId schema: type: string - - in: query - name: includeDeleted - schema: - type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceProvisioningQueueOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: List provisioning requests + /admin/operator/workspace-bootstrap/revoke: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceBootstrapRevokeInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspacebootstrapOperatorInspection' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Preview or revoke a workspace claim without stage receipts + /admin/organization: + get: + description: Gets metadata and properties from an installed organization + parameters: - description: The Azure organization ID in: query name: azureOrganizationId @@ -15838,6 +18021,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15883,12 +18077,23 @@ paths: items: type: string type: array + - description: >- + Include teams and members from the git platform (default true). When false, returns identity metadata with + unpopulated teams and members arrays. + in: query + name: includeDirectory + schema: + description: >- + Include teams and members from the git platform (default true). When false, returns identity metadata with + unpopulated teams and members arrays. + nullable: true + type: boolean responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsListEntrypointsOutput' + $ref: '#/components/schemas/EndpointsAdminGetOrganizationOutput' description: OK '400': content: @@ -15896,16 +18101,27 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Entrypoints - /context/entrypoints/{entrypointId}: - delete: - description: Soft-delete an entrypoint + summary: Get Organization + /admin/pr-gate-settings: + get: + description: >- + Get the per-tenant PR gate: which net-new findings fail the Nullify check, whether a new CVE at or above the + CVSS cutoff always fails it, whether a scan that cannot complete fails it (failOnIncompleteCoverage, independent + of the findings controls), whether PR reviews run, whether Nullify scans pull requests at all (prScansEnabled), + whether automatic push scans run (pushScansEnabled), and the thresholds it applies. With no control on, the + check is information only and always passes. parameters: - description: The Azure organization ID in: query @@ -15926,6 +18142,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -15971,45 +18198,35 @@ paths: items: type: string type: array - - in: path - name: entrypointId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteEntrypointOutput' + $ref: '#/components/schemas/EndpointsAdminGetPRGateSettingsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Entrypoint - get: - description: Retrieves a single application entrypoint by ID + summary: Get PR Gate Settings + put: + description: >- + Upsert the per-tenant PR gate. prScansEnabled turns every pull request scan, and every check, review and comment + Nullify would post on a pull request, on or off; omitting it keeps the stored value. pushScansEnabled controls + automatic push scans, including secrets; omitting it keeps the stored value. findingsPolicy and cvssEnforcement + are authoritative when findingsPolicy is sent, and enabled must agree with them; a caller without findingsPolicy + sends enabled and keeps the stored controls it cannot express. failOnIncompleteCoverage independently controls + operational scan failures; omitting it keeps the stored value. cvssEnforcement fails a pull request on a new + dependency or container CVE at or above scaBlockCvssThreshold without AI confirmation. Every change is audited. parameters: - description: The Azure organization ID in: query @@ -16030,6 +18247,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16075,17 +18303,17 @@ paths: items: type: string type: array - - in: path - name: entrypointId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminPutPRGateSettingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetEntrypointOutput' + $ref: '#/components/schemas/EndpointsAdminPutPRGateSettingsOutput' description: OK '400': content: @@ -16093,25 +18321,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Entrypoint - /context/memories: + summary: Put PR Gate Settings + /admin/privacy/acknowledgment: get: - description: >- - Query memories with flexible filtering. Memories are first-class resources that can be associated with various - resource types. + description: Check if the user has acknowledged a specific version of the privacy policy parameters: + - description: The version of the privacy policy to check + in: query + name: policyVersion + required: true + schema: + description: The version of the privacy policy to check + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -16131,6 +18364,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16176,61 +18420,12 @@ paths: items: type: string type: array - - description: Filter by resource ID (e.g., document ID, finding ID) - in: query - name: resourceId - schema: - description: Filter by resource ID (e.g., document ID, finding ID) - nullable: true - type: string - - description: Filter by resource type (e.g., 'document', 'finding', 'chat') - in: query - name: resourceType - schema: - description: Filter by resource type (e.g., 'document', 'finding', 'chat') - nullable: true - type: string - - description: Filter by memory type - in: query - name: memoryType - schema: - description: Filter by memory type - nullable: true - type: string - - description: Filter by priority level - in: query - name: priority - schema: - description: Filter by priority level - nullable: true - type: string - - description: Filter for latest memories only - in: query - name: isLatest - schema: - description: Filter for latest memories only - nullable: true - type: boolean - - description: 'Maximum number of results (default: 50, max: 1000)' - in: query - name: limit - schema: - description: 'Maximum number of results (default: 50, max: 1000)' - nullable: true - type: integer - - description: Pagination token for next page - in: query - name: nextToken - schema: - description: Pagination token for next page - nullable: true - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetMemoriesOutput' + $ref: '#/components/schemas/EndpointsGetPrivacyAcknowledgmentOutput' description: OK '400': content: @@ -16238,21 +18433,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Memories + summary: Get Privacy Acknowledgment post: - description: Create a new memory as a first-class resource + description: Record that the user has acknowledged a specific version of the privacy policy parameters: - description: The Azure organization ID in: query @@ -16273,6 +18468,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16322,13 +18528,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostMemoryInput' + $ref: '#/components/schemas/EndpointsPostPrivacyAcknowledgmentInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostMemoryOutput' + $ref: '#/components/schemas/EndpointsPostPrivacyAcknowledgmentOutput' description: OK '400': content: @@ -16336,23 +18542,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Memory - /context/memories/{memoryId}: - delete: - description: Deletes a memory permanently + summary: Post Privacy Acknowledgment + /admin/pullrequests: + get: + description: Get one finding_pull_requests record by its internal ID parameters: + - in: query + name: id + required: true + schema: + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -16372,6 +18583,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16417,19 +18639,12 @@ paths: items: type: string type: array - - description: ID of the memory to delete - in: path - name: memoryId - required: true - schema: - description: ID of the memory to delete - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteMemoryOutput' + $ref: '#/components/schemas/EndpointsAdminGetPullRequestRecordOutput' description: OK '400': content: @@ -16437,6 +18652,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '404': content: application/json: @@ -16449,9 +18676,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Memory - get: - description: Retrieves a specific memory by ID + summary: Get Pull Request Record + post: + description: Query the canonical finding_pull_requests records for a tenant parameters: - description: The Azure organization ID in: query @@ -16472,6 +18699,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16517,24 +18755,17 @@ paths: items: type: string type: array - - in: query - name: version - schema: - nullable: true - type: string - - description: ID of the memory to retrieve - in: path - name: memoryId - required: true - schema: - description: ID of the memory to retrieve - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminQueryPullRequestsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetMemoryOutput' + $ref: '#/components/schemas/EndpointsAdminQueryPullRequestsOutput' description: OK '400': content: @@ -16542,27 +18773,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Memory - patch: - description: Updates the content of an existing memory + summary: Query Pull Requests + /admin/pullrequests/refresh-ci: + post: + description: Refresh CI state for visible active autofix pull requests parameters: - description: The Azure organization ID in: query @@ -16583,6 +18815,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16628,22 +18871,17 @@ paths: items: type: string type: array - - in: path - name: memoryId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchMemoryInput' + $ref: '#/components/schemas/EndpointsAdminRefreshPullRequestsCIInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchMemoryOutput' + $ref: '#/components/schemas/EndpointsAdminRefreshPullRequestsCIOutput' description: OK '400': content: @@ -16651,131 +18889,97 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Memory - /context/memories/{memoryId}/versions: + summary: Refresh Pull Request CI + /admin/repositories: get: - description: Retrieve all versions of a specific memory + description: Get a list of repositories in the org parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID + - description: Pagination token for the next page of results in: query - name: bitbucketWorkspaceId + name: nextToken schema: - description: The Bitbucket workspace ID + description: Pagination token for the next page of results + nullable: true type: string - - description: The Github owner ID + - description: Pagination offset; overrides nextToken when set in: query - name: githubOwnerId + name: offset schema: - description: The Github owner ID - format: int64 + description: Pagination offset; overrides nextToken when set + nullable: true type: integer - - description: The GitLab group ID + - description: Maximum number of repositories to return per page in: query - name: gitlabGroupId + name: limit schema: - description: The GitLab group ID - format: int64 + description: Maximum number of repositories to return per page + nullable: true type: integer - - description: The Nullify installation ID + - description: Case-insensitive search filter for repository names in: query - name: installationId + name: search schema: - description: The Nullify installation ID + description: Case-insensitive search filter for repository names + nullable: true type: string - - description: Filter by Azure repository IDs + - description: Filter repositories by team ULID in: query - name: azureRepositoryId + name: teamIDs schema: - description: Filter by Azure repository IDs + description: Filter repositories by team ULID items: type: string type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID + - description: Include repositories archived on their source platform (default false) in: query - name: githubTeamId + name: includeArchived schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs + description: Include repositories archived on their source platform (default false) + nullable: true + type: boolean + - description: >- + While archived repositories are hidden, still return those enrolled for one of these scan families: code, + secrets in: query - name: bitbucketRepositoryId + name: includeArchivedEnrolled schema: - description: Filter by Bitbucket repository IDs + description: >- + While archived repositories are hidden, still return those enrolled for one of these scan families: code, + secrets items: type: string type: array - - description: 'Maximum number of versions to return (default: 50)' + - description: >- + Return exactly these repositories (at most 100), archived ones included; search, the archived filters and + paging are ignored in: query - name: limit + name: ids schema: - description: 'Maximum number of versions to return (default: 50)' - format: int32 - type: integer - - description: Memory ID - in: path - name: memoryId - required: true - schema: - description: Memory ID - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsGetMemoryVersionsOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Memory Versions - /context/memories/type: - get: - description: Query memories filtered by memory type. Use the memoryType query parameter to filter results. - parameters: + description: >- + Return exactly these repositories (at most 100), archived ones included; search, the archived filters and + paging are ignored + items: + type: string + maxItems: 100 + type: array - description: The Azure organization ID in: query name: azureOrganizationId @@ -16795,6 +18999,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16840,31 +19055,12 @@ paths: items: type: string type: array - - in: query - name: memoryType - schema: - type: string - - in: query - name: isLatest - schema: - nullable: true - type: boolean - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: paginationToken - schema: - nullable: true - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetMemoriesByTypeOutput' + $ref: '#/components/schemas/EndpointsAdminGetRepositoriesOutput' description: OK '400': content: @@ -16872,23 +19068,31 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Memories By Type - /context/organization: + summary: Get Repositories + /admin/repositories/{repositoryId}/directories: get: - description: Returns a classification of your entire organization and what software it builds + description: >- + List the subdirectories one level below path on the repository's default branch, for choosing directory rules. A + repository Nullify did not make available is refused (403). parameters: + - description: Repo-relative directory to list; empty is the root + in: query + name: path + schema: + description: Repo-relative directory to list; empty is the root + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -16908,6 +19112,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -16953,12 +19168,17 @@ paths: items: type: string type: array + - in: path + name: repositoryId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetOrganizationOutput' + $ref: '#/components/schemas/EndpointsGetRepositoryDirectoriesOutput' description: OK '400': content: @@ -16966,21 +19186,43 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Organization Context - patch: - description: Updates a classification of your entire organization and what software it builds + summary: List Repository Directories + /admin/repositories/recommendations: + get: + description: >- + The capability-coverage covering set from the latest repo-scope scan — repos recommended to prove each PoV + (SAST, SCA, secrets, DAST, code-to-cloud, campaigns). Repositories Nullify has not made available to scan are + left out. Produce-only; confirm via enrollment. parameters: - description: The Azure organization ID in: query @@ -17001,6 +19243,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17046,35 +19299,36 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsUpdateOrganizationInput' responses: - '204': - description: No Content - '400': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + $ref: '#/components/schemas/EndpointsAdminGetRepoRecommendationsOutput' + description: OK + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Classification of the Organization + summary: Get Repository PoV Recommendations + /admin/repositories/scan-scope: put: - description: Creates a classification of your entire organization and what software it builds + description: >- + Apply a delta of up to 100 repositories: code enrollment, secrets enrollment (independent mode only), code + directory includes and excludes, and secrets directory excludes. Only repositories newly entering a family are + charged against its cap; a breach is refused and nothing is written. Enrolling a repository Nullify did not make + available, or a code include outside the directories Nullify set, is refused (403) and nothing is written. An + item carrying expectedScopeUpdatedAt is refused (409) when the repository changed since, and then nothing is + written. Repositories a family newly covers, or whose directory rules widen, get a default-branch scan of that + family. Audited. parameters: - description: The Azure organization ID in: query @@ -17095,6 +19349,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17144,13 +19409,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsCreateOrganizationInput' + $ref: '#/components/schemas/EndpointsPutRepositoryScanScopesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsCreateOrganizationOutput' + $ref: '#/components/schemas/EndpointsPutRepositoryScanScopesOutput' description: OK '400': content: @@ -17158,104 +19423,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': + description: Unauthorized + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Upsert Classification of the Organization - /context/rag/resync: - post: - description: >- - Enqueues a full reconciliation of the tenant's RAG vector store with the canonical S3 vault state. Returns - immediately after the message is queued. The onboardingagent Lambda lists every vault file and re-indexes; - anything in the vector store that no longer has a matching S3 file is removed. Use for backfill on first RAG - activation and for drift recovery. - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostRAGResyncOutput' - description: OK - '403': + description: Forbidden + '409': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Conflict '412': content: application/json: @@ -17268,33 +19453,19 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Resync RAG Vector Store - /context/repo-scans: - get: + summary: Update Repository Scan Scopes + /admin/repository-property-team-keys: + delete: description: >- - Lists repo-context scans for the calling tenant. Filter by repositoryId, commitSha, status. Returns newest - first. + Remove a repository property key from the tenant's team-derivation configuration. Property-derived teams without + any remaining ownership rows are cleaned up by the next sync run. parameters: - - in: query - name: repositoryId - schema: - type: string - - in: query - name: commitSha - schema: - type: string - - in: query - name: status + - description: The repository property team key ID + in: query + name: keyId schema: + description: The repository property team key ID type: string - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -17314,6 +19485,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17364,7 +19546,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsListRepoScansOutput' + $ref: '#/components/schemas/EndpointsDeleteRepositoryPropertyTeamKeyOutput' description: OK '400': content: @@ -17372,21 +19554,27 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Repo Context Scans - post: - description: Records the start of a context-service run against a repository. Returns the persisted scan with a generated id. + summary: Delete Repository Property Team Key + get: + description: List the repository property keys this tenant uses to derive teams from repository metadata. parameters: - description: The Azure organization ID in: query @@ -17407,6 +19595,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17452,40 +19651,30 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsCreateRepoScanInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsCreateRepoScanOutput' + $ref: '#/components/schemas/EndpointsGetRepositoryPropertyTeamKeysOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Repo Context Scan - /context/repo-scans/{scanId}: - get: - description: Returns a single repo-context scan by id. + summary: List Repository Property Team Keys + post: + description: >- + Configure a repository property key that should drive team derivation for this tenant. The next sync run will + create teams from the distinct values seen for this property. parameters: - description: The Azure organization ID in: query @@ -17506,6 +19695,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17551,17 +19751,17 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostRepositoryPropertyTeamKeyInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetRepoScanOutput' + $ref: '#/components/schemas/EndpointsPostRepositoryPropertyTeamKeyOutput' description: OK '400': content: @@ -17569,29 +19769,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Unauthorized + '409': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repo Context Scan - patch: + summary: Create Repository Property Team Key + /admin/runs/{kind}/{id}: + get: description: >- - Patches status, subagent execution metadata, projects touched, SBOMs generated, or error message on an existing - repo-context scan. + One run of the run graph and the cursor to resume its live broadcast topic from, authorized as a subscribe to + that topic is parameters: - description: The Azure organization ID in: query @@ -17612,6 +19813,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17657,35 +19869,33 @@ paths: items: type: string type: array - - in: path - name: scanId + - description: The run kind (a runevents.Kinds entry other than tenant) + in: path + name: kind required: true schema: + description: The run kind (a runevents.Kinds entry other than tenant) + type: string + - description: The run id + in: path + name: id + required: true + schema: + description: The run id type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchRepoScanInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchRepoScanOutput' + $ref: '#/components/schemas/RunsnapshotSnapshot' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -17698,10 +19908,14 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Repo Context Scan - /context/reports: - post: - description: Creates a new report generation job and returns a job ID. The report will be generated asynchronously. + summary: Get Run Snapshot + /admin/scan-scope: + get: + description: >- + The tenant's Nullify-set repository caps (read-only), the usage of each scan family and the secrets scope mode, + and the GitHub repositories GitHub no longer shares with Nullify (removed from the GitHub App installation or + missing from the last sync): the first 200 by name and their total count, cut to the caller's teams for a + team-scoped caller. parameters: - description: The Azure organization ID in: query @@ -17722,6 +19936,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17767,40 +19992,33 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostReportInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostReportOutput' + $ref: '#/components/schemas/EndpointsScanScopeOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Report Generation Job - /context/reports/{jobId}: - get: - description: Retrieves the status of a report generation job. Returns status, error (if failed), and URL (if success). + summary: Get Scan Scope + put: + description: >- + Turn enrollment scoping on (scopingEnabled true; it cannot be turned off here), and/or choose whether secrets + scanning follows code enrollment (follow_code) or is enrolled per repository (independent). Switching to + independent enrolls every repository for secrets when there is no secrets cap, and otherwise seeds secrets + enrollment from code enrollment; a switch that exceeds the secrets cap is refused. Repositories brought into + secrets scope get a default-branch scan. Audited. parameters: - description: The Azure organization ID in: query @@ -17821,6 +20039,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17866,17 +20095,17 @@ paths: items: type: string type: array - - in: path - name: jobId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutScanScopeInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetReportStatusOutput' + $ref: '#/components/schemas/EndpointsPutScanScopeOutput' description: OK '400': content: @@ -17884,43 +20113,79 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Report Status - /context/repositories: + summary: Update Scan Scope Settings + /admin/scans/orchestrator: get: - description: Returns a classification of attributes of each repository + description: >- + Lists scans grouped by orchestrator run: the per-scanner scan_runs of one push/PR (repository, branch, commit, + trigger) collapsed into a single row parameters: - - in: query - name: nextToken + - description: Scan types to include (sast, sca_dependencies, sca_containers, secrets); default all + in: query + name: scanType + schema: + description: Scan types to include (sast, sca_dependencies, sca_containers, secrets); default all + items: + type: string + type: array + - description: >- + Scan run statuses to include (running_scan, running_results, completed, skipped, scan_failed, + results_failed, stuck_failed); default all + in: query + name: status + schema: + description: >- + Scan run statuses to include (running_scan, running_results, completed, skipped, scan_failed, + results_failed, stuck_failed); default all + items: + type: string + type: array + - description: Only include scans started at or after this RFC3339 timestamp + in: query + name: from schema: + description: Only include scans started at or after this RFC3339 timestamp nullable: true type: string - - in: query - name: limit + - description: Only include scans started at or before this RFC3339 timestamp + in: query + name: to schema: + description: Only include scans started at or before this RFC3339 timestamp nullable: true - type: integer - - in: query - name: sortBy + type: string + - description: Max scans per page (default 100, max 100) + in: query + name: limit schema: + description: Max scans per page (default 100, max 100) nullable: true - type: string - - in: query - name: sort + type: integer + - description: Pagination offset (default 0) + in: query + name: offset schema: + description: Pagination offset (default 0) nullable: true - type: string + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -17940,6 +20205,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -17990,7 +20266,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetRepositoriesOutput' + $ref: '#/components/schemas/EndpointsListMergedScansOutput' description: OK '400': content: @@ -17998,23 +20274,29 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Contexts of Repositories - /context/repositories/{repositoryId}: + summary: List Orchestrator Scans + /admin/service_accounts: delete: - description: Deletes a repository permanently + description: Delete a given service account and revoke its access token parameters: + - description: The service account ID + in: query + name: serviceAccountId + schema: + description: The service account ID + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -18034,6 +20316,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18079,19 +20372,12 @@ paths: items: type: string type: array - - description: ID of the repository to delete - in: path - name: repositoryId - required: true - schema: - description: ID of the repository to delete - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteRepositoryOutput' + $ref: '#/components/schemas/EndpointsDeleteServiceAccountOutput' description: OK '400': content: @@ -18099,27 +20385,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Repository + summary: Delete Service Account get: - description: Returns context about a repository + description: Get a list of service accounts that have been created for the organization parameters: - description: The Azure organization ID in: query @@ -18140,6 +20420,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18185,45 +20476,28 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetRepositoryOutput' + $ref: '#/components/schemas/EndpointsGetServiceAccountsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repository - patch: - description: Updates the classification of a repository + summary: Get Service Accounts + post: + description: Created a service account with an access token for the Nullify API parameters: - description: The Azure organization ID in: query @@ -18244,6 +20518,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18289,60 +20574,41 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsUpdateRepositoryInput' + $ref: '#/components/schemas/EndpointsPostServiceAccountInput' responses: - '204': - description: No Content - '400': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + $ref: '#/components/schemas/EndpointsPostServiceAccountOutput' + description: OK + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Bad Request + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Repository - /context/repositories/{repositoryId}/projects: + summary: Create Service Account + /admin/settings/cspm-scan-cadence: get: - description: Lists all projects in a repository with optional pagination and filtering + description: The tenant's cloud-posture scan cadence. An empty value means no cadence is configured, which is scanned daily. parameters: - - in: query - name: limit - schema: - type: integer - - in: query - name: nextToken - schema: - type: string - - in: query - name: includeDeleted - schema: - type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -18362,6 +20628,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18407,34 +20684,42 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsListRepositoryProjectsOutput' + $ref: '#/components/schemas/EndpointsCSPMScanCadenceOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Projects - /context/repositories/{repositoryId}/projects/{projectId}: - delete: - description: Soft-delete a project + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get CSPM Scan Cadence + put: + description: >- + Set the tenant's cloud-posture scan cadence (daily, weekly, fortnightly, monthly, on_change, manual). An empty + value clears it back to daily. parameters: - description: The Azure organization ID in: query @@ -18455,6 +20740,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18500,22 +20796,17 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutCSPMScanCadenceInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteProjectOutput' + $ref: '#/components/schemas/EndpointsCSPMScanCadenceOutput' description: OK '400': content: @@ -18523,27 +20814,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Unauthorized + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Delete Project + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Set CSPM Scan Cadence + /admin/settings/inference-region: get: - description: Retrieves a single project by ID + description: Where the tenant's LLM inference may be served. A tenant that never set one reads as global. parameters: - description: The Azure organization ID in: query @@ -18564,6 +20862,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18609,38 +20918,42 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetProjectOutput' + $ref: '#/components/schemas/EndpointsInferenceRegionOutput' description: OK - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Project - patch: - description: Updates a project's metadata and properties + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Inference Region + put: + description: >- + Set where the tenant's LLM inference may be served (global, us). us restricts inference to US-only endpoints and + models, at a higher per-token price. parameters: - description: The Azure organization ID in: query @@ -18661,6 +20974,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18706,27 +21030,17 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsUpdateProjectInput' + $ref: '#/components/schemas/EndpointsPutInferenceRegionInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsUpdateProjectOutput' + $ref: '#/components/schemas/EndpointsInferenceRegionOutput' description: OK '400': content: @@ -18734,22 +21048,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Project - /context/repositories/{repositoryId}/projects/{projectId}/schema: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Set Inference Region + /admin/sla: get: - description: Returns the API schema for a given project + description: Get SLAs that have been created for the organization parameters: - description: The Azure organization ID in: query @@ -18770,6 +21096,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18815,38 +21152,28 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetProjectSchemaOutput' + $ref: '#/components/schemas/EndpointsGetSLAsOutput' description: OK - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Project Schema + summary: Get SLAs post: - description: Uploads an API schema for a project + description: Create a new SLA for the organization parameters: - description: The Azure organization ID in: query @@ -18867,6 +21194,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -18912,38 +21250,46 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostProjectSchemaInput' + $ref: '#/components/schemas/EndpointsPostSLAInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostProjectSchemaOutput' + $ref: '#/components/schemas/EndpointsPostSLAOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Upload Project Schema - /context/repositories/{repositoryId}/projects/{projectId}/schema/metadata: - get: - description: Returns the metadata for a given project schema + summary: Post SLA + /admin/sla/{slaId}: + patch: + description: Update an existing SLA for the organization parameters: - description: The Azure organization ID in: query @@ -18964,6 +21310,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19009,23 +21366,31 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId + - description: The ID of the SLA to update + in: path + name: slaId required: true schema: + description: The ID of the SLA to update type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSLAInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetProjectSchemaMetadataOutput' + $ref: '#/components/schemas/EndpointsPatchSLAOutput' description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '404': content: application/json: @@ -19038,12 +21403,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Project Schema Metadata - /context/repositories/{repositoryId}/projects/{projectId}/schema/raw: - get: - description: >- - Returns a presigned download URL for the raw API spec file (OpenAPI JSON/YAML, Proto, or GraphQL SDL) that can - be rendered or imported directly + summary: Patch SLA + /admin/sla/bulk: + put: + description: Upsert multiple SLAs for the organization parameters: - description: The Azure organization ID in: query @@ -19064,6 +21427,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19109,23 +21483,24 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutBulkSLAInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetProjectSchemaRawOutput' + $ref: '#/components/schemas/EndpointsPutBulkSLAOutput' description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '404': content: application/json: @@ -19138,10 +21513,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Project Schema Raw File - /context/sbomingestor/replay: - post: - description: Enqueue a full SBOM ingest replay; either global or for a specific repository and project + summary: Put Bulk SLA + /admin/support-access: + delete: + description: Revoke the calling staff member's active support access grant (staff only) parameters: - description: The Azure organization ID in: query @@ -19162,6 +21537,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19207,17 +21593,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsSBOMIngestReplayInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsSBOMIngestReplayOutput' + $ref: '#/components/schemas/EndpointsAdminRevokeSupportAccessOutput' description: OK '400': content: @@ -19225,25 +21606,41 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Compute Dependencies Repository/Project SBOM Ingest Replay - /context/sboms: - delete: - description: >- - Deletes SBOM (software bill of materials) items for a tenant. Scope can be limited by repository/project, and - you can optionally restrict deletions to invalid SBOM objects only. + summary: Revoke Support Access + get: + description: Return the calling staff member's active support access grant and the tenant's recent grants (staff only) parameters: + - description: Max grants to list (default 50, max 200) + in: query + name: limit + schema: + description: Max grants to list (default 50, max 200) + format: int32 + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -19263,6 +21660,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19308,28 +21716,12 @@ paths: items: type: string type: array - - in: query - name: repositoryId - schema: - type: string - - in: query - name: projectId - schema: - type: string - - in: query - name: invalidOnly - schema: - type: boolean - - in: query - name: dryRun - schema: - type: boolean responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteSBOMOutput' + $ref: '#/components/schemas/EndpointsAdminGetSupportAccessOutput' description: OK '400': content: @@ -19337,24 +21729,35 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete SBOMs for tenant - /context/sboms/generate: + summary: Get Support Access post: description: >- - Triggers a full SBOM generation pipeline: clone repo, classify projects, run cdxgen with dep tree, store SBOMs, - and ingest dependencies. Returns immediately with status='generating' — poll GET /context/sboms/... for results. + Elevate the calling verified Nullify staff member to a time-boxed admin in this tenant, or extend their active + grant (staff only) parameters: - description: The Azure organization ID in: query @@ -19375,6 +21778,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19424,13 +21838,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSBOMGenerateInput' + $ref: '#/components/schemas/EndpointsAdminElevateSupportAccessInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSBOMGenerateOutput' + $ref: '#/components/schemas/EndpointsAdminElevateSupportAccessOutput' description: OK '400': content: @@ -19438,22 +21852,36 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Generate SBOM - /context/sboms/repository/{repositoryId}/latest: + summary: Elevate Support Access + /admin/team-source-preferences: get: - description: Returns the most recent SBOM for each project within a repository. + description: >- + Read the per-tenant on/off state of the auto-sync team sources (GitHub Teams, repository custom properties). + Manual teams are always available and have no toggle. parameters: - description: The Azure organization ID in: query @@ -19474,6 +21902,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19519,81 +21958,32 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetLatestSBOMsOutput' + $ref: '#/components/schemas/EndpointsGetTeamSourcePreferencesOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Latest SBOMs for Repository - /context/sboms/repository/{repositoryId}/project/{projectId}: - get: + summary: Get Team Source Preferences + put: description: >- - Returns a list of SBOM (software bill of materials) items for a repository/project based on the query - parameters. Responses are paginated in reverse-time order. + Enable or disable each auto-sync team source for this tenant. Disabling a source soft-hides every existing team + for that source; re-enabling restores them and triggers a teams-only sync so any upstream changes are picked up + immediately. parameters: - - in: query - name: page - schema: - nullable: true - type: integer - - in: query - name: pageSize - schema: - nullable: true - type: integer - - in: query - name: fromCommit - schema: - nullable: true - type: string - - in: query - name: untilCommit - schema: - nullable: true - type: string - - in: query - name: fromTime - schema: - format: date-time - nullable: true - type: string - - in: query - name: untilTime - schema: - format: date-time - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -19613,6 +22003,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19658,22 +22059,17 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true - schema: - type: string - - in: path - name: projectId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutTeamSourcePreferencesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSBOMSOutput' + $ref: '#/components/schemas/EndpointsPutTeamSourcePreferencesOutput' description: OK '400': content: @@ -19681,31 +22077,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repository/Project SBOMs - /context/sboms/resolve: - post: + summary: Update Team Source Preferences + /admin/team-sync-runs: + get: description: >- - Returns the S3 key of the SBOM for the given (tenant, repo, commit). Walks a 3-tier cache (per-branch pointer → - hash-keyed cache → cdxgen via the sbomgenerator Lambda). Single source of truth for SBOM lifecycle. + Most-recent team-sync workflow runs for this tenant, newest first. The UI polls this to show in-flight / + last-sync state on the Configure > Teams page. parameters: + - in: query + name: source + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -19725,6 +22124,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19770,17 +22180,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostSBOMResolveInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSBOMResolveOutput' + $ref: '#/components/schemas/EndpointsGetTeamSyncRunsOutput' description: OK '400': content: @@ -19788,24 +22193,23 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get or generate SBOM - /context/sboms/scan: + summary: List Team Sync Runs post: description: >- - Returns an existing SBOM if available, or enqueues generation and returns status='generating'. Callers can poll - the GET endpoint to retrieve the result once ready. + Manually request a team-sync workflow run. Subject to dedup: if a pending or running run already exists for the + tenant + source, this is a no-op and the existing run is returned. parameters: - description: The Azure organization ID in: query @@ -19826,6 +22230,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19875,13 +22290,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSBOMScanInput' + $ref: '#/components/schemas/EndpointsPostTeamSyncRunInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSBOMScanOutput' + $ref: '#/components/schemas/EndpointsPostTeamSyncRunOutput' description: OK '400': content: @@ -19889,24 +22304,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Scan SBOM (get-or-generate) - /context/sboms/tree: + summary: Trigger Team Sync + /admin/team/{teamID}: get: - description: >- - Returns a tree structure of SBOM (software bill of materials) items for a tenant. Commits are paginated in time - order. Add optional verbose=true query parameter to include repository and project names. + description: Retrieve a single team by teamID, with user and repository details populated parameters: - description: The Azure organization ID in: query @@ -19927,6 +22340,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -19972,16 +22396,17 @@ paths: items: type: string type: array - - in: query - name: verbose + - in: path + name: teamID + required: true schema: - type: boolean + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSBOMTreeOutput' + $ref: '#/components/schemas/EndpointsGetTeamOutput' description: OK '400': content: @@ -19989,22 +22414,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SBOM key tree for tenant - /context/schemas: + summary: Get Team + /admin/teams: get: - description: Lists all project schemas across all repositories + description: Get a paginated list of teams from all sources (Nullify and git platform), with user details populated. parameters: - description: The Azure organization ID in: query @@ -20025,6 +22456,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20070,23 +22512,83 @@ paths: items: type: string type: array + - description: Pagination token for the next page of results + in: query + name: nextToken + schema: + description: Pagination token for the next page of results + nullable: true + type: string + - description: Pagination offset; overrides nextToken when set + in: query + name: offset + schema: + description: Pagination offset; overrides nextToken when set + nullable: true + type: integer + - description: Maximum number of teams to return per page + in: query + name: limit + schema: + description: Maximum number of teams to return per page + nullable: true + type: integer + - description: Case-insensitive search filter for team names + in: query + name: search + schema: + description: Case-insensitive search filter for team names + nullable: true + type: string + - description: Return only teams that own this repository (canonical repository ID). Skips the full-tenant scan. + in: query + name: repositoryId + schema: + description: Return only teams that own this repository (canonical repository ID). Skips the full-tenant scan. + nullable: true + type: string + - description: >- + Internal callers only: skip user (Lead/Members) enrichment and the synchronous GitHub teams refresh. Returns + a pure DB-paginated page. + in: query + name: skipUserEnrichment + schema: + description: >- + Internal callers only: skip user (Lead/Members) enrichment and the synchronous GitHub teams refresh. + Returns a pure DB-paginated page. + nullable: true + type: boolean responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsListSchemasOutput' + $ref: '#/components/schemas/EndpointsGetTeamsOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Schemas - /context/vault/file: + summary: Get All Teams post: - description: Returns a presigned upload URL for a file to S3 with metadata including document ID and optional description + description: >- + Create or update a team under the given providerID (upsert repositories). codeOwnerships make the team the owner + of repositories and need a person: internal automation (agents) cannot send them and is refused; its other + fields are accepted parameters: - description: The Azure organization ID in: query @@ -20107,6 +22609,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20156,13 +22669,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostVaultFileInput' + $ref: '#/components/schemas/EndpointsPostTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostVaultFileOutput' + $ref: '#/components/schemas/EndpointsPostTeamOutput' description: OK '400': content: @@ -20170,6 +22683,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -20182,10 +22701,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post Vault File - /context/vault/file/{fileId}: + summary: Post Team + /admin/teams/{teamID}: delete: - description: Deletes a vault file + description: >- + Soft-delete a manually created team. Returns 400 if the team's source is not 'manual' — synced teams are managed + by their sync workflow and cannot be removed individually. parameters: - description: The Azure organization ID in: query @@ -20206,6 +22727,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20251,35 +22783,56 @@ paths: items: type: string type: array - - in: path - name: fileId + - description: The ID of the manual team to delete + in: path + name: teamID required: true schema: + description: The ID of the manual team to delete type: string responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTeamOutput' + description: OK '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Vault File - get: - description: Returns a presigned url for a vault file + summary: Delete Manual Team + patch: + description: >- + Update an existing team with partial data. Only provided fields will be updated. memberIds is the team's + complete member list: a user listed who is not a member becomes a manual member the provider sync keeps, and a + member left out, whether the provider sync or an earlier edit added them, is removed and recorded as a removal + the sync never undoes. Users already in the list are left alone, an empty list removes every member, and + repeating the same list changes nothing. Omit memberIds to keep the membership as it is. + addMemberIds/removeMemberIds apply atomic membership-only changes; they cannot be combined with metadata or + memberIds. Removing the current lead returns 409. Internal automation (agents) cannot send memberIds, + addMemberIds, removeMemberIds, clearLead or codeOwnerships and is refused: they change access and need a person; + its other fields are accepted parameters: - description: The Azure organization ID in: query @@ -20300,6 +22853,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20345,17 +22909,24 @@ paths: items: type: string type: array - - in: path - name: fileId + - description: The ID of the team to update + in: path + name: teamID required: true schema: + description: The ID of the team to update type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetVaultFileOutput' + $ref: '#/components/schemas/EndpointsPatchTeamOutput' description: OK '400': content: @@ -20363,6 +22934,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -20375,16 +22952,26 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Vault File - /context/vault/file/{fileName}: - patch: - description: Update metadata for a vault file in S3 + summary: Patch Team + /admin/teams/{teamID}/code-ownership: + post: + description: >- + Make the team the only manual code owner of the whole repository. Any other team's manual ownership of the + repository is replaced in the same transaction; ownerships the provider sync or a code owners file produced are + untouched, and the manual ownership survives every sync. The caller is recorded as the ownership's author. + Dashboard users and the operator CLI may; internal automation (agents) is refused parameters: - description: The Azure organization ID in: query @@ -20405,6 +22992,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20450,22 +23048,24 @@ paths: items: type: string type: array - - in: path - name: fileName + - description: The team that becomes the repository's manual owner + in: path + name: teamID required: true schema: + description: The team that becomes the repository's manual owner type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchVaultFileInput' + $ref: '#/components/schemas/EndpointsPostTeamCodeOwnershipInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchVaultFileOutput' + $ref: '#/components/schemas/EndpointsPostTeamCodeOwnershipOutput' description: OK '400': content: @@ -20473,22 +23073,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Patch Vault File - /context/vault/files: - get: - description: Returns a list of vault files + summary: Make Team The Owner Of A Repository + /admin/teams/{teamID}/events: + post: + description: Cross-service unified event feed filtered by team parameters: - description: The Azure organization ID in: query @@ -20509,6 +23121,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20554,12 +23177,22 @@ paths: items: type: string type: array + - in: path + name: teamID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsByTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetVaultFilesOutput' + $ref: '#/components/schemas/EndpointsAdminListUnifiedEventsOutput' description: OK '400': content: @@ -20567,6 +23200,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -20579,10 +23218,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Vault Files - /context/vault/files/list: + summary: List Team Unified Events + /admin/teams/{teamID}/findings: get: - description: Returns a simplified list of vault files with fileName and description + description: Get a list of findings mapped to a specific team. parameters: - description: The Azure organization ID in: query @@ -20603,6 +23242,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20648,12 +23298,17 @@ paths: items: type: string type: array + - in: path + name: teamID + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetVaultFilesListOutput' + $ref: '#/components/schemas/EndpointsGetTeamFindingsOutput' description: OK '400': content: @@ -20661,6 +23316,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -20673,13 +23334,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Vault Files List - /context/vault/onboard: - post: - description: >- - Triggers the onboarding process asynchronously for specified vault files. Returns immediately after the message - is queued. The onboarding agent will extract organizational context from the provided documents in the - background. + summary: Get Team Findings mapping + /admin/teams/appzip: + get: + description: Generate and download a Microsoft Teams app package with manifest and icons parameters: - description: The Azure organization ID in: query @@ -20700,6 +23358,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -20745,17 +23414,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostVaultOnboardInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostVaultOnboardOutput' + $ref: '#/components/schemas/EndpointsGetTeamsAppZipOutput' description: OK '400': content: @@ -20763,22 +23427,25 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Trigger Vault Onboarding - /infrastructure/graphs: - get: - description: Lists all infrastructure graphs for the tenant + summary: Get Teams App Zip + /admin/teams/compass: + post: + description: >- + Adapt a Compass/Atlassian‐style payload into our in‐house Team model and upsert users and repositories. A lead, + members or repositories add team members and make the team the owner of repositories, which need a person: + internal automation (agents) cannot send them and is refused parameters: - description: The Azure organization ID in: query @@ -20799,92 +23466,15 @@ paths: description: The Github owner ID format: int64 type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsListInfrastructureGraphsOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: List Infrastructure Graphs - /infrastructure/graphs/{accountId}: - get: - description: Retrieves the latest infrastructure graph for a specific AWS account - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. in: query - name: githubOwnerId + name: githubInstallationId schema: - description: The Github owner ID + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. format: int64 type: integer - description: The GitLab group ID @@ -20932,17 +23522,17 @@ paths: items: type: string type: array - - in: path - name: accountId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCompassTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetInfrastructureGraphOutput' + $ref: '#/components/schemas/EndpointsPostCompassTeamOutput' description: OK '400': content: @@ -20950,22 +23540,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Infrastructure Graph - /infrastructure/graphs/{accountId}/download: + summary: Post Compass/Atlassian Team + /admin/teams/findings: get: - description: Generates a presigned URL to download the infrastructure graph + description: Get a list of teams with their mapped findings. parameters: - description: The Azure organization ID in: query @@ -20986,6 +23582,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21031,17 +23638,12 @@ paths: items: type: string type: array - - in: path - name: accountId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetInfrastructureGraphDownloadOutput' + $ref: '#/components/schemas/EndpointsListTeamFindingsOutput' description: OK '400': content: @@ -21049,22 +23651,27 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Infrastructure Graph Download URL - /infrastructure/graphs/{accountId}/versions: - get: - description: Lists all versions of an infrastructure graph for a specific AWS account + summary: Get All Team Findings mapping + post: + description: Manually assign findings to teams. parameters: - description: The Azure organization ID in: query @@ -21085,6 +23692,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21130,17 +23748,17 @@ paths: items: type: string type: array - - in: path - name: accountId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTeamFindingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsListInfrastructureGraphVersionsOutput' + $ref: '#/components/schemas/EndpointsPostTeamFindingsOutput' description: OK '400': content: @@ -21148,16 +23766,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Infrastructure Graph Versions - /infrastructure/graphs/{accountId}/versions/{version}: - get: - description: Retrieves a specific version of an infrastructure graph + summary: Manual Team Findings Assignment + /admin/teams/findings/sync: + post: + description: >- + Run the finding-to-team matcher. Optionally scope by repository IDs, names, or finding IDs. Set async=true to + process large tenants in the background. parameters: - description: The Azure organization ID in: query @@ -21178,6 +23810,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21223,22 +23866,17 @@ paths: items: type: string type: array - - in: path - name: accountId - required: true - schema: - type: string - - in: path - name: version - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTeamFindingsSyncInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetInfrastructureGraphVersionOutput' + $ref: '#/components/schemas/EndpointsPostTeamFindingsSyncOutput' description: OK '400': content: @@ -21246,22 +23884,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Infrastructure Graph Version - /infrastructure/graphs/info: - get: - description: Retrieves comprehensive statistics and metadata about all infrastructure graphs + summary: Sync Team Findings + /admin/teams/merge: + post: + description: Merge multiple provider-specific teams into one unified team parameters: - description: The Azure organization ID in: query @@ -21282,6 +23926,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21327,12 +23982,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTeamMergeInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsInfrastructureGraphInfo' + $ref: '#/components/schemas/EndpointsPostTeamMergeOutput' description: OK '400': content: @@ -21340,6 +24000,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '404': content: application/json: @@ -21352,10 +24018,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Infrastructure Graph Info - /infrastructure/graphs/summary: - get: - description: Retrieves infrastructure graph summary with presigned download URLs for each account's graph + summary: Merge Teams + /admin/teams/sla-breakdown: + post: + description: Aggregate per-team in-SLA / out-of-SLA finding counts across the supplied finding IDs. parameters: - description: The Azure organization ID in: query @@ -21376,6 +24042,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21421,12 +24098,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTeamSLABreakdownInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetInfrastructureGraphSummaryOutput' + $ref: '#/components/schemas/EndpointsPostTeamSLABreakdownOutput' description: OK '400': content: @@ -21434,16 +24116,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Infrastructure Graph Summary - /cspm/findings: + summary: Get Team SLA Breakdown + /admin/tenant-capabilities: get: - description: Returns a filtered set of CSPM findings based on query parameters + description: >- + The tenant's customer-visible capabilities: the value in force, what decides it (Nullify staff, the tenant's + choice, or the Nullify default), and, when Nullify locked it, why. parameters: - description: The Azure organization ID in: query @@ -21464,6 +24160,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21509,100 +24216,200 @@ paths: items: type: string type: array - - description: Maximum number of findings to return + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTenantCapabilitiesOutput' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Tenant Capabilities + /admin/tenant-capabilities/{capability}: + put: + description: >- + Set (true or false) or clear (null) the tenant's choice for a customer-visible capability, only if the choice + still carries expectedUpdatedAt. A capability Nullify locked is refused (403) until Nullify lifts the lock. + Audited. + parameters: + - description: The Azure organization ID in: query - name: limit + name: azureOrganizationId schema: - description: Maximum number of findings to return - nullable: true - type: integer - - description: Token for pagination + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID in: query - name: nextToken + name: bitbucketWorkspaceId schema: - description: Token for pagination - nullable: true + description: The Bitbucket workspace ID type: string - - description: Sort order (asc or desc) + - description: The Github owner ID in: query - name: sort + name: githubOwnerId schema: - description: Sort order (asc or desc) - nullable: true - type: string - - description: Field to sort by (priority, time, severity) + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. in: query - name: sortBy + name: githubInstallationId schema: - description: Field to sort by (priority, time, severity) - nullable: true - type: string - - description: Filter by severity + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID in: query - name: severity + name: gitlabGroupId schema: - description: Filter by severity - nullable: true - type: string - - description: Filter by status + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID in: query - name: status + name: installationId schema: - description: Filter by status - nullable: true + description: The Nullify installation ID type: string - - description: Filter by account ID + - description: Filter by Azure repository IDs in: query - name: accountId + name: azureRepositoryId schema: - description: Filter by account ID - nullable: true - type: string - - description: Filter by region + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs in: query - name: region + name: githubRepositoryId schema: - description: Filter by region - nullable: true - type: string - - description: Filter by resource type + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID in: query - name: resourceType + name: githubTeamId schema: - description: Filter by resource type - nullable: true - type: string - - description: Filter by scan ID + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs in: query - name: scanId + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: capability + required: true schema: - description: Filter by scan ID - nullable: true type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutTenantCapabilityInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCSPMFindingsOutput' + $ref: '#/components/schemas/EndpointsPutTenantCapabilityOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Findings - /cspm/findings/{findingId}: + summary: Set Tenant Capability + /admin/ticketing/activity: get: - description: Returns a specific CSPM finding by ID + description: >- + Paginated tenant-wide audit-event feed for the Configure → Ticketing Activity tab. Filter by eventType / actor / + date range. Each row links back to its finding_ticket. parameters: + - description: Optional ticket_audit_event_type to filter by + in: query + name: eventType + schema: + description: Optional ticket_audit_event_type to filter by + type: string + - description: Optional ticket_audit_actor to filter by + in: query + name: actor + schema: + description: Optional ticket_audit_actor to filter by + type: string + - description: RFC3339 lower bound on created_at + in: query + name: fromTime + schema: + description: RFC3339 lower bound on created_at + type: string + - description: RFC3339 upper bound on created_at + in: query + name: toTime + schema: + description: RFC3339 upper bound on created_at + type: string + - description: Page size (default 50, max 200) + in: query + name: limit + schema: + description: Page size (default 50, max 200) + format: int32 + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + format: int32 + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -21622,6 +24429,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21667,19 +24485,12 @@ paths: items: type: string type: array - - description: ID of the CSPM finding - in: path - name: findingId - required: true - schema: - description: ID of the CSPM finding - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCSPMFindingOutput' + $ref: '#/components/schemas/EndpointsGetTicketActivityOutput' description: OK '400': content: @@ -21687,35 +24498,23 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Finding - /cspm/findings/{findingId}/autofix/activity: + summary: List Ticketing Activity + /admin/ticketing/bulk-operations/{operationId}: get: - description: >- - Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` - defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen - (use the `nextCursor` value from a prior response). + description: Returns the full progress state of a bulk operation. Client polls this between dispatch and completion. parameters: - - in: query - name: since_id - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -21735,6 +24534,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21781,7 +24591,7 @@ paths: type: string type: array - in: path - name: findingId + name: operationId required: true schema: type: string @@ -21790,7 +24600,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + $ref: '#/components/schemas/EndpointsGetBulkOperationOutput' description: OK '400': content: @@ -21798,12 +24608,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -21816,10 +24626,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Finding Autofix Activity - /cspm/findings/{findingId}/autofix/cache/diff: - get: - description: Get the cached autofix diff for a CSPM finding + summary: Get Bulk Operation Status + /admin/ticketing/bulk-operations/{operationId}/cancel: + post: + description: >- + Sets cancellation_requested_at on the operation. The applier exits cleanly between pages; already-mutated + tickets stay mutated. parameters: - description: The Azure organization ID in: query @@ -21840,6 +24652,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21886,7 +24709,7 @@ paths: type: string type: array - in: path - name: findingId + name: operationId required: true schema: type: string @@ -21895,7 +24718,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCSPMFindingAutofixDiffOutput' + $ref: '#/components/schemas/EndpointsPostBulkOperationCancelOutput' description: OK '400': content: @@ -21903,12 +24726,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -21921,10 +24744,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Finding Autofix Diff - /cspm/findings/{findingId}/autofix/fix: - post: - description: Generates a fix and creates an IaC pull request for a CSPM finding. + summary: Request Bulk Operation Cancellation + /admin/ticketing/saved-filters: + get: + description: List the requesting user's saved filter presets for the Configure → Ticketing workbench. parameters: - description: The Azure organization ID in: query @@ -21945,6 +24768,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -21990,22 +24824,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCSPMFindingAutofixInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCSPMFindingAutofixOutput' + $ref: '#/components/schemas/EndpointsGetTicketSavedFiltersOutput' description: OK '400': content: @@ -22013,36 +24837,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '409': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Conflict + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post CSPM Finding Autofix - /cspm/findings/{findingId}/autofix/state: - get: - description: >- - Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; - the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + summary: List Saved Ticket Filters + post: + description: Persist a per-user filter preset for the Configure → Ticketing workbench. parameters: - description: The Azure organization ID in: query @@ -22063,6 +24872,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22108,17 +24928,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTicketSavedFilterInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCSPMFindingAutofixStateOutput' + $ref: '#/components/schemas/EndpointsPostTicketSavedFilterOutput' description: OK '400': content: @@ -22126,28 +24946,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Finding Autofix State - /cspm/findings/{findingId}/autofix/status: - get: - description: Lightweight per-finding autofix lifecycle status for UI polling. + summary: Create Saved Ticket Filter + /admin/ticketing/saved-filters/{id}: + delete: + description: Remove a saved filter preset by id. parameters: - description: The Azure organization ID in: query @@ -22168,6 +24982,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22214,7 +25039,7 @@ paths: type: string type: array - in: path - name: findingId + name: id required: true schema: type: string @@ -22223,7 +25048,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCSPMFindingAutofixStatusOutput' + $ref: '#/components/schemas/EndpointsDeleteTicketSavedFilterOutput' description: OK '400': content: @@ -22231,12 +25056,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -22249,10 +25074,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Finding Autofix Status - /cspm/findings/{findingId}/ticket: - post: - description: Creates a ticket (Jira, GitHub, etc.) for a given CSPM finding + summary: Delete Saved Ticket Filter + patch: + description: Rename or replace the filter snapshot on an existing saved preset. Either name, filter, or both may be supplied. parameters: - description: The Azure organization ID in: query @@ -22273,6 +25097,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22318,24 +25153,22 @@ paths: items: type: string type: array - - description: The ID of the CSPM finding to create a ticket for - in: path - name: findingId + - in: path + name: id required: true schema: - description: The ID of the CSPM finding to create a ticket for type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketCSPMFindingInput' + $ref: '#/components/schemas/EndpointsPatchTicketSavedFilterInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketCSPMFindingOutput' + $ref: '#/components/schemas/EndpointsPatchTicketSavedFilterOutput' description: OK '400': content: @@ -22343,12 +25176,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -22361,16 +25194,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '501': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Implemented - summary: Create Ticket for CSPM Finding - /cspm/scans: - get: - description: Returns a list of CSPM scans + summary: Update Saved Ticket Filter + /admin/ticketing/settings/{findingType}: + post: + description: >- + Persist ticket_settings for the (tenant, findingType). Writes a ticket_settings_history row capturing the old + + new snapshot, applied_by, and the chosen migration_action. The migration_action is recorded only — the frontend + orchestrates the actual cleanup by calling the relevant bulk-action endpoint next. parameters: - description: The Azure organization ID in: query @@ -22391,6 +25221,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22436,54 +25277,152 @@ paths: items: type: string type: array - - description: Maximum number of scans to return + - description: The finding type the settings apply to + in: path + name: findingType + required: true + schema: + description: The finding type the settings apply to + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTicketSettingsInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTicketSettingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Save Ticket Settings + /admin/ticketing/settings/{findingType}/history: + get: + description: >- + Paginated audit history of ticket_settings saves for the (tenant, findingType), most-recent first. Each row + records the old + new snapshot, who applied it, and the chosen migrationAction. + parameters: + - description: Page size (default 50, max 200) in: query name: limit schema: - description: Maximum number of scans to return - nullable: true + description: Page size (default 50, max 200) + format: int32 type: integer - - description: Token for pagination + - description: Pagination offset (default 0) in: query - name: nextToken + name: offset schema: - description: Token for pagination - nullable: true - type: string - - description: Filter by scan status + description: Pagination offset (default 0) + format: int32 + type: integer + - description: The Azure organization ID in: query - name: status + name: azureOrganizationId schema: - description: Filter by scan status - nullable: true + description: The Azure organization ID type: string - - description: Filter by account ID + - description: The Bitbucket workspace ID in: query - name: accountId + name: bitbucketWorkspaceId schema: - description: Filter by account ID - nullable: true + description: The Bitbucket workspace ID type: string - - description: Filter by region + - description: The Github owner ID in: query - name: region + name: githubOwnerId schema: - description: Filter by region - nullable: true + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID type: string - - description: Filter by scan type + - description: Filter by Azure repository IDs in: query - name: scanType + name: azureRepositoryId schema: - description: Filter by scan type - nullable: true + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The finding type to fetch history for + in: path + name: findingType + required: true + schema: + description: The finding type to fetch history for type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCSPMScansOutput' + $ref: '#/components/schemas/EndpointsGetTicketSettingsHistoryOutput' description: OK '400': content: @@ -22491,16 +25430,25 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Scans - /cspm/scans/{scanId}: - get: - description: Returns a specific CSPM scan by ID + summary: List Ticket Settings History + /admin/ticketing/settings/{findingType}/preview: + post: + description: >- + Compute the impact of proposed ticket_settings against the tenant's current findings + tickets without + persisting. Returns counts of tickets that would become out-of-scope and findings that would become + ticket-eligible, plus a sample of affected tickets for UI display. parameters: - description: The Azure organization ID in: query @@ -22521,6 +25469,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22566,19 +25525,24 @@ paths: items: type: string type: array - - description: ID of the CSPM scan + - description: The finding type the proposal applies to in: path - name: scanId + name: findingType required: true schema: - description: ID of the CSPM scan + description: The finding type the proposal applies to type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostTicketSettingsPreviewInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCSPMScanOutput' + $ref: '#/components/schemas/EndpointsPostTicketSettingsPreviewOutput' description: OK '400': content: @@ -22586,23 +25550,103 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get CSPM Scan - /dast/bughunt/config: + summary: Preview Ticket Settings Impact + /admin/ticketing/tickets: get: - description: Retrieve the BugHunt config for the tenant, creating a default if none exists + description: >- + Paginated finding_tickets list for the Configure → Ticketing workbench. Every filter dimension is optional. Pass + ?savedFilterId=... to load a previously-saved filter snapshot. parameters: + - in: query + name: source + schema: + items: + type: string + type: array + - in: query + name: status + schema: + items: + type: string + type: array + - in: query + name: findingType + schema: + items: + type: string + type: array + - in: query + name: platform + schema: + items: + type: string + type: array + - in: query + name: boardId + schema: + type: string + - in: query + name: createdAfter + schema: + type: string + - in: query + name: createdBefore + schema: + type: string + - in: query + name: closedAfter + schema: + type: string + - in: query + name: closedBefore + schema: + type: string + - in: query + name: lastSyncedBefore + schema: + type: string + - in: query + name: outOfEligibilitySinceAfter + schema: + type: string + - in: query + name: hasSyncError + schema: + type: string + - in: query + name: q + schema: + type: string + - in: query + name: savedFilterId + schema: + type: string + - description: Page size (default 50, max 200) + in: query + name: limit + schema: + description: Page size (default 50, max 200) + format: int32 + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + format: int32 + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -22622,6 +25666,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22672,11 +25727,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntConfigOutput' + $ref: '#/components/schemas/EndpointsGetTicketWorkbenchListOutput' description: OK - summary: Get BugHunt Config - put: - description: Create or update BugHunt config for the tenant + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Tickets (Power-User Workbench) + /admin/ticketing/tickets/{ticketId}: + get: + description: Ticket row + paginated audit history for the workbench drill-down panel. parameters: - description: The Azure organization ID in: query @@ -22697,6 +25771,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22742,24 +25827,48 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPutBugHuntConfigInput' + - description: Internal finding_tickets.id + in: path + name: ticketId + required: true + schema: + description: Internal finding_tickets.id + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutBugHuntConfigOutput' + $ref: '#/components/schemas/EndpointsGetTicketWorkbenchDrilldownOutput' description: OK - summary: Put BugHunt Config - /dast/bughunt/config/validate: + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Ticket Drill-Down + /admin/ticketing/tickets/bulk-add-comment: post: - description: >- - Validate a BugHunt config payload without persisting it. Returns a typed slice of ConfigValidationError so the - configure UI can render inline errors. + description: Record a comment in each matched ticket audit record in Nullify. Does not post provider-side comments. parameters: - description: The Azure organization ID in: query @@ -22780,6 +25889,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22829,18 +25949,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsValidateBugHuntConfigInput' + $ref: '#/components/schemas/EndpointsPostBulkAddCommentInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsValidateBugHuntConfigOutput' + $ref: '#/components/schemas/EndpointsPostBulkAddCommentOutput' description: OK - summary: Validate BugHunt Config - /dast/bughunt/findings: - get: - description: List all BugHunt findings + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Add Comment To Tickets + /admin/ticketing/tickets/bulk-close: + post: + description: Close every finding_ticket matching the filter. Dry-run+confirm flow. parameters: - description: The Azure organization ID in: query @@ -22861,6 +25999,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22906,17 +26055,40 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkCloseInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntFindingsOutput' + $ref: '#/components/schemas/EndpointsPostBulkCloseOutput' description: OK - summary: Get BugHunt Findings - /dast/bughunt/findings/{findingId}: - get: - description: Get a single BugHunt finding by ID + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Close Tickets + /admin/ticketing/tickets/bulk-move: + post: + description: Record a new board ID in Nullify. Does not move provider-side tickets. Dry-run+confirm flow. parameters: - description: The Azure organization ID in: query @@ -22937,6 +26109,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -22982,22 +26165,40 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkMoveInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntFindingOutput' + $ref: '#/components/schemas/EndpointsPostBulkMoveOutput' description: OK - summary: Get BugHunt Finding - /dast/bughunt/findings/{findingId}/allowlist: - patch: - description: Mark/unmark an BugHunt finding as allowlisted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Move Tickets + /admin/ticketing/tickets/bulk-reassign-assignee: + post: + description: Update the provider assignee and canonical metadata for each matched ticket using validated tenant identities. parameters: - description: The Azure organization ID in: query @@ -23018,6 +26219,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23063,27 +26275,43 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchBugHuntFindingAllowlistInput' + $ref: '#/components/schemas/EndpointsPostBulkReassignAssigneeInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchBugHuntFindingAllowlistOutput' + $ref: '#/components/schemas/EndpointsPostBulkReassignAssigneeOutput' description: OK - summary: Allowlist BugHunt Finding - /dast/bughunt/findings/{findingId}/events: - get: - description: Get events for an BugHunt finding + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Reassign Ticket Assignee + /admin/ticketing/tickets/bulk-reassign-team: + post: + description: >- + Reassign the underlying findings of matched tickets to the target team as a manual assignment that survives the + team-findings inference. Future auto-creates route to the new team's board. Needs finding:write. Dashboard users + and the operator CLI may; internal automation (agents) is refused, including the dry run parameters: - description: The Azure organization ID in: query @@ -23104,6 +26332,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23149,21 +26388,48 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkReassignTeamInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntFindingEventsOutput' + $ref: '#/components/schemas/EndpointsPostBulkReassignTeamOutput' description: OK - summary: Get BugHunt Finding Events - /dast/bughunt/findings/{findingId}/triage: - get: + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Reassign Tickets to Team + /admin/ticketing/tickets/bulk-relabel: + post: + description: >- + Record requested label changes in each matched ticket audit record in Nullify. Does not change provider-side + labels. parameters: - description: The Azure organization ID in: query @@ -23184,6 +26450,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23229,22 +26506,40 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkRelabelInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntFindingTriageOutput' + $ref: '#/components/schemas/EndpointsPostBulkRelabelOutput' description: OK - summary: Create Interactor [] - /dast/bughunt/scans: - get: - description: List BugHunt scans for tenant + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Relabel Tickets + /admin/ticketing/tickets/bulk-reopen: + post: + description: Reopen closed finding_tickets whose underlying findings are unresolved. Dry-run+confirm flow. parameters: - description: The Azure organization ID in: query @@ -23265,6 +26560,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23310,16 +26616,40 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkReopenInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntScansOutput' + $ref: '#/components/schemas/EndpointsPostBulkReopenOutput' description: OK - summary: Get BugHunt Scans + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Reopen Tickets + /admin/ticketing/tickets/bulk-resync: post: - description: Start a new BugHunt scan + description: Force a Goal C drift sync on each matched ticket synchronously. Dry-run+confirm flow. parameters: - description: The Azure organization ID in: query @@ -23340,6 +26670,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23389,18 +26730,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBugHuntScanInput' + $ref: '#/components/schemas/EndpointsPostBulkResyncInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBugHuntScanOutput' + $ref: '#/components/schemas/EndpointsPostBulkResyncOutput' description: OK - summary: Start BugHunt Scan - /dast/bughunt/scans/{scanId}: - get: - description: Get BugHunt scan by ID + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Re-Sync Tickets + /admin/ticketing/tickets/bulk-set-priority: + post: + description: Store the priority label on each matched ticket in Nullify. Does not update provider-side priority. parameters: - description: The Azure organization ID in: query @@ -23421,6 +26780,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23466,31 +26836,65 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkSetPriorityInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntScanOutput' + $ref: '#/components/schemas/EndpointsPostBulkSetPriorityOutput' description: OK - summary: Get BugHunt Scan - /dast/bughunt/scans/{scanId}/diff: + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bulk Set Ticket Priority + /admin/ticketing/tickets/counts: get: - description: >- - Diff two BugHunt scans into the four buckets New / Reopened / Unchanged / Resolved. The 'against' query - parameter is the older scan id; both scans must belong to the caller's tenant and must be in a successful - terminal state. + description: Sidebar facet counts (by source, platform, status, findingType) for the Configure → Ticketing workbench. parameters: - in: query - name: against - required: true + name: source schema: - type: string + items: + type: string + type: array + - in: query + name: status + schema: + items: + type: string + type: array + - in: query + name: findingType + schema: + items: + type: string + type: array + - in: query + name: platform + schema: + items: + type: string + type: array - description: The Azure organization ID in: query name: azureOrganizationId @@ -23510,6 +26914,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23555,22 +26970,35 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntScanDiffOutput' + $ref: '#/components/schemas/EndpointsGetTicketWorkbenchCountsOutput' description: OK - summary: Get BugHunt Scan Diff - /dast/bughunt/scans/{scanId}/findings: - get: - description: Get findings for an BugHunt scan + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Ticket Facet Counts + /admin/triage/context-census: + post: + description: Report which of the supplied findings were triaged without org or repo context, with the tenant-wide shortfall parameters: - description: The Azure organization ID in: query @@ -23591,6 +27019,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23636,22 +27075,60 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminTriageContextCensusInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntScanFindingsOutput' + $ref: '#/components/schemas/EndpointsAdminTriageContextCensusOutput' description: OK - summary: Get BugHunt Scan Findings - /dast/bughunt/scans/{scanId}/logs: - get: - description: Returns the network logs for a specific bughunt sub-agent + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Post Triage Context Census + /admin/ui/preferences: + delete: + description: >- + Wipe the calling user's stored UI preferences. Idempotent: succeeds with deleted=true even when no preferences + were stored, so a 200 does not confirm a row existed. parameters: - description: The Azure organization ID in: query @@ -23672,6 +27149,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23717,40 +27205,28 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSubAgentNetworkLogOutput' + $ref: '#/components/schemas/EndpointsDeleteUIPreferencesOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get BugHunt Sub-Agent Network Log - /dast/bughunt/scans/{scanId}/stop: - post: - description: Stop a running BugHunt scan + summary: Delete UI Preferences + get: + description: Get the calling user's UI preferences parameters: - description: The Azure organization ID in: query @@ -23771,6 +27247,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23816,22 +27303,28 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsStopBugHuntScanOutput' + $ref: '#/components/schemas/EndpointsGetUIPreferencesOutput' description: OK - summary: Stop BugHunt Scan - /dast/bughunt/suite-runs: - get: - description: Returns the per-suite cadence state (last run at, last run id) for the tenant. + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get UI Preferences + put: + description: Upsert the calling user's UI preferences (top-level merge) parameters: - description: The Azure organization ID in: query @@ -23852,6 +27345,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23897,19 +27401,40 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutUIPreferencesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBugHuntSuiteRunsOutput' + $ref: '#/components/schemas/EndpointsPutUIPreferencesOutput' description: OK - summary: Get BugHunt Suite Runs - /dast/bughunt/suites/{suite}/run-now: - post: - description: >- - Manually trigger a single bug hunt test suite for the tenant. Honours the tenant's stored intensity unless the - request supplies an override. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Put UI Preferences + /admin/ui/savedViews: + get: + description: Get UI Saved Views for a user parameters: - description: The Azure organization ID in: query @@ -23930,6 +27455,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -23975,27 +27511,28 @@ paths: items: type: string type: array - - in: path - name: suite - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostBugHuntSuiteRunNowInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBugHuntSuiteRunNowOutput' + $ref: '#/components/schemas/EndpointsGetUISavedViewsOutput' description: OK - summary: Run BugHunt Suite Now - /dast/credentials: - get: - description: Get all credentials with optional context filtering + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get UI Saved Views + post: + description: Create a new UI Saved View parameters: - description: The Azure organization ID in: query @@ -24016,6 +27553,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24061,19 +27609,40 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUISavedViewInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCredentialsOutput' + $ref: '#/components/schemas/EndpointsPostUISavedViewOutput' description: OK - summary: Get All Credentials - tags: - - Credentials - - Vault - post: - description: Create a new unified credential for BugHunt or Pentest + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Post UI Saved View + /admin/ui/savedViews/{savedViewId}: + delete: + description: Delete an existing UI Saved View parameters: - description: The Azure organization ID in: query @@ -24094,6 +27663,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24139,25 +27719,39 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCredentialInput' + - in: path + name: savedViewId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCredentialOutput' + $ref: '#/components/schemas/EndpointsDeleteUISavedViewOutput' description: OK - summary: Create Credential - tags: - - Credentials - - Vault - /dast/credentials/{credentialId}: - delete: - description: Delete a credential + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Delete UI Saved View + patch: + description: Update an existing UI Saved View parameters: - description: The Azure organization ID in: query @@ -24178,6 +27772,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24224,23 +27829,50 @@ paths: type: string type: array - in: path - name: credentialId + name: savedViewId required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchUISavedViewInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteCredentialOutput' + $ref: '#/components/schemas/EndpointsPatchUISavedViewOutput' description: OK - summary: Delete Credential - tags: - - Credentials - - Vault + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Patch UI Saved View + /admin/user/{userID}: get: - description: Get a specific credential by ID + description: Retrieve a single user by userID parameters: - description: The Azure organization ID in: query @@ -24261,6 +27893,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24306,24 +27949,48 @@ paths: items: type: string type: array - - in: path - name: credentialId + - description: The ID of the user to fetch + in: path + name: userID required: true schema: + description: The ID of the user to fetch type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCredentialOutput' + $ref: '#/components/schemas/EndpointsGetUserOutput' description: OK - summary: Get Credential - tags: - - Credentials - - Vault - put: - description: Update an existing credential + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get User + /admin/user/current: + get: + description: Get the current user parameters: - description: The Azure organization ID in: query @@ -24344,6 +28011,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24389,30 +28067,35 @@ paths: items: type: string type: array - - in: path - name: credentialId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPutCredentialInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutCredentialOutput' + $ref: '#/components/schemas/EndpointsGetCurrentUserOutput' description: OK - summary: Update Credential - tags: - - Credentials - - Vault - /dast/credentials/{credentialId}/validate: - post: - description: Validate a credential by testing it against a service + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Current User + /admin/user/mapping: + get: + description: Get a User Mapping parameters: - description: The Azure organization ID in: query @@ -24433,6 +28116,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24478,8 +28172,13 @@ paths: items: type: string type: array - - in: path - name: credentialId + - in: query + name: providerId + required: true + schema: + type: string + - in: query + name: userId required: true schema: type: string @@ -24488,25 +28187,46 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsValidateCredentialOutput' + $ref: '#/components/schemas/EndpointsGetUserMappingOutput' description: OK - summary: Validate Credential - tags: - - Credentials - - Validation - - Vault - /dast/pentest/applications: - get: - description: Get all pentest application configs for a tenant + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get User Mapping + post: + description: >- + Create new User Mappings, upserting on the git identity; if useSuggestions=true, compute and persist + suggestions. A person (dashboard) or the operator CLI upserts and overwrites identities already stored. Internal + automation (agents, workflows, the daily suggestion fill) only fills identities the mapping lacks and never + overwrites or clears one, and a chat account previously rejected for that git user is not restored. parameters: - - in: query - name: nextToken - schema: - type: string - - in: query - name: limit - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -24526,6 +28246,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24571,19 +28302,45 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUserMappingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestAppConfigsOutput' + $ref: '#/components/schemas/EndpointsPostUserMappingOutput' description: OK - summary: Get Pentest App Configs - tags: - - Applications - - Vault - post: - description: Create a new application + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Post Add User Mappings + /admin/user/mapping/{userId}: + delete: + description: >- + Remove a wrong User Mapping. userId is the mapping id (the id field of a user mapping), not an admin user id. By + default the mapping row stays with its git identity, its Slack and Teams identities are emptied and the cleared + ids are remembered as rejected, so the daily automatic mapping cannot bring the same wrong person back. + hard=true deletes the row outright (offboarding or erasure). Internal automation (agents) cannot tell a wrong + match from a leaver: its delete is a plain clear that rejects nothing, and hard=true is refused parameters: - description: The Azure organization ID in: query @@ -24604,6 +28361,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24649,25 +28417,66 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostPentestAppConfigInput' + - description: >- + Delete the mapping row outright (offboarding or erasure). By default the row is kept with its Slack and + Teams identities cleared and remembered as rejected. An internal automation caller (an agent) is refused; it + always gets a plain clear that rejects nothing + in: query + name: hard + required: false + schema: + description: >- + Delete the mapping row outright (offboarding or erasure). By default the row is kept with its Slack and + Teams identities cleared and remembered as rejected. An internal automation caller (an agent) is refused; + it always gets a plain clear that rejects nothing + type: boolean + - description: The mapping id (the id field of a user mapping), not an admin user id + in: path + name: userId + required: true + schema: + description: The mapping id (the id field of a user mapping), not an admin user id + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostPentestAppConfigOutput' + $ref: '#/components/schemas/EndpointsDeleteUserMappingOutput' description: OK - summary: Create Application - tags: - - Applications - - Vault - /dast/pentest/applications/{applicationId}: - delete: - description: Delete a pentest application config + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Delete User Mapping + put: + description: >- + Edit a User Mapping. userId is the mapping id (the id field of a user mapping), not an admin user id. Identities + in the body are merged into the mapping: an identity that is absent or sent with an empty id is left unchanged. + clearSlack and clearTeams are the only way to clear an identity; a clear also remembers the cleared id as + rejected so the daily automatic mapping never restores it, and clearing an already-empty identity changes + nothing. The mapping's git account cannot be changed. Dashboard users and the operator CLI overwrite and clear; + internal automation (agents) may only fill identities the mapping lacks and is refused when it clears parameters: - description: The Azure organization ID in: query @@ -24688,6 +28497,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24733,24 +28553,65 @@ paths: items: type: string type: array - - in: path - name: applicationId + - description: The mapping id (the id field of a user mapping), not an admin user id + in: path + name: userId required: true schema: + description: The mapping id (the id field of a user mapping), not an admin user id type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutEditUserMappingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeletePentestAppConfigOutput' + $ref: '#/components/schemas/EndpointsPutEditUserMappingOutput' description: OK - summary: Delete Pentest App Config - tags: - - Applications - - Vault + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Edit User Mapping + /admin/user/mapping/suggestions: get: - description: Get a specific pentest application config by ID + description: Get user mapping suggestions parameters: - description: The Azure organization ID in: query @@ -24771,6 +28632,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24816,24 +28688,29 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestAppConfigOutput' + $ref: '#/components/schemas/EndpointsGetSuggestedUserMappingsOutput' description: OK - summary: Get Pentest App Config - tags: - - Applications - - Vault - put: - description: Update an existing application + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get User Mapping Suggestions + /admin/user/mappings: + get: + description: Get all User Mappings parameters: - description: The Azure organization ID in: query @@ -24854,6 +28731,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24899,33 +28787,29 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPutPentestAppConfigInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPutPentestAppConfigOutput' + $ref: '#/components/schemas/EndpointsGetUserMappingsOutput' description: OK - summary: Update Application - tags: - - Applications - - Vault - /dast/pentest/applications/{applicationId}/preflight: - post: - description: >- - Runs a readiness check for an application before a pentest scan. Validates credentials, retrieves application - context, enumerates network-reachable findings, and produces a typed three-level summary plus a duration / cost - estimate for the upcoming pentest. + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get User Mappings + /admin/users: + get: + description: Get a list of users, global across all platforms. parameters: - description: The Azure organization ID in: query @@ -24946,6 +28830,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -24991,61 +28886,28 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsStartPentestPreflightInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsStartPentestPreflightOutput' + $ref: '#/components/schemas/EndpointsAdminGetUsersOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Conflict - '429': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Too Many Requests + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Start Pentest Preflight - tags: - - Applications - - Pentest - - Preflight - /dast/pentest/applications/{applicationId}/preflight/latest: - get: - description: Returns the most recent pentest preflight for an application, or null if the customer has never run one. + summary: Get All Users + post: + description: Create or update a user under the given providerID parameters: - description: The Azure organization ID in: query @@ -25066,6 +28928,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25111,34 +28984,40 @@ paths: items: type: string type: array - - in: path - name: applicationId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUserInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetLatestPentestPreflightOutput' + $ref: '#/components/schemas/EndpointsPostUserOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Latest Pentest Preflight for Application - tags: - - Applications - - Pentest - - Preflight - /dast/pentest/applications/{applicationId}/preflight/quota: + summary: Post User + /admin/users/{providerID}: get: - description: >- - Returns the daily preflight usage and limit for an application. Used by the UI to render an indicator and - disable buttons when the limit is reached. + description: Retrieve all users for a specific provider/platform parameters: - description: The Azure organization ID in: query @@ -25159,6 +29038,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25204,79 +29094,43 @@ paths: items: type: string type: array - - in: path - name: applicationId + - description: The provider ID + in: path + name: providerID required: true schema: + description: The provider ID type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestPreflightQuotaOutput' + $ref: '#/components/schemas/EndpointsGetProviderUsersOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Preflight Quota - tags: - - Applications - - Pentest - - Preflight - /dast/pentest/findings: + summary: Get Provider Users + /admin/users/{providerID}/{userID}: get: - description: Returns the list of all pentest findings + description: Retrieve a single user by providerID and userID parameters: - - in: query - name: nextToken - schema: - type: string - - in: query - name: limit - schema: - type: integer - - in: query - name: scanId - schema: - nullable: true - type: string - - in: query - name: priorityLabel - schema: - nullable: true - type: string - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isLatest - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isResolved - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - type: string - - in: query - name: sort - schema: - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -25296,6 +29150,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25341,12 +29206,26 @@ paths: items: type: string type: array + - description: The provider ID + in: path + name: providerID + required: true + schema: + description: The provider ID + type: string + - description: The ID of the user to fetch + in: path + name: userID + required: true + schema: + description: The ID of the user to fetch + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestFindingsOutput' + $ref: '#/components/schemas/EndpointsGetUserOutput' description: OK '400': content: @@ -25354,16 +29233,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Findings - /dast/pentest/findings/{findingId}: - get: - description: Get all the details of a pentest finding + summary: Get User By Provider + /admin/users/{userId}/erasure: + delete: + description: Permanently erase all personal data for a user in compliance with GDPR right to erasure parameters: - description: The Azure organization ID in: query @@ -25384,6 +29275,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25429,17 +29331,19 @@ paths: items: type: string type: array - - in: path - name: findingId + - description: The ID of the user to erase + in: path + name: userId required: true schema: + description: The ID of the user to erase type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestFindingOutput' + $ref: '#/components/schemas/EndpointsDeleteUserErasureOutput' description: OK '400': content: @@ -25447,12 +29351,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -25465,11 +29369,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Finding - /dast/pentest/findings/{findingId}/allowlist: - post: - description: Allowlist a pentest finding + summary: Delete User Erasure (GDPR Art. 17) + /admin/users/{userId}/export: + get: + description: Export all personal data held for a user in compliance with GDPR right of access and data portability parameters: + - description: Export format (json) + in: query + name: format + schema: + default: json + description: Export format (json) + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -25489,6 +29400,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25534,48 +29456,49 @@ paths: items: type: string type: array - - in: path - name: findingId + - description: The ID of the user to export data for + in: path + name: userId required: true schema: + description: The ID of the user to export data for type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowlistPentestFindingInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetUserDataExportOutput' + description: OK '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found - summary: Allowlist Pentest Finding - /dast/pentest/findings/{findingId}/autofix/activity: - get: - description: >- - Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` - defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen - (use the `nextCursor` value from a prior response). + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get User Data Export (GDPR Art. 15, 20) + /admin/users/activate: + post: + description: Grant platform access to already-synced users at a chosen role and teams (admin only) parameters: - - in: query - name: since_id - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -25595,6 +29518,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25640,17 +29574,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminActivateUsersInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + $ref: '#/components/schemas/EndpointsAdminActivateUsersOutput' description: OK '400': content: @@ -25658,6 +29592,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -25676,10 +29616,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get DAST Pentest Finding Autofix Activity - /dast/pentest/findings/{findingId}/autofix/cache/diff: - get: - description: Get the cached autofix diff for a pentest finding + summary: Activate Users + /admin/users/bulkSearchMappings: + post: + description: Get user mappings for a list of canonical user IDs parameters: - description: The Azure organization ID in: query @@ -25700,6 +29640,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25745,17 +29696,123 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkGetUserMappingsInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBulkGetUserMappingsOutput' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Post Bulk Get User Mappings + /admin/users/deactivate: + post: + description: >- + Deactivate a git-provider user who has left the company but is still in the organization (admin or operator + only; a SCIM-managed user's lifecycle stays with its directory) + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId schema: + description: The Azure organization ID type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminDeactivateUserInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestFindingAutofixDiffOutput' + $ref: '#/components/schemas/EndpointsAdminDeactivateUserOutput' description: OK '400': content: @@ -25763,6 +29820,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -25775,16 +29838,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Finding Autofix Diff - /dast/pentest/findings/{findingId}/autofix/fix: - post: - description: Creates a pull request to fix a given DAST pentest finding + summary: Deactivate User + /admin/users/identity/{providerID}/{providerUserID}: + get: + description: >- + Resolve exactly one live tenant account by its native git provider user id. Refuses ambiguous legacy accounts + and excludes operator-granted staff. parameters: - description: The Azure organization ID in: query @@ -25805,6 +29876,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25851,21 +29933,21 @@ paths: type: string type: array - in: path - name: findingId + name: providerID + required: true + schema: + type: string + - in: path + name: providerUserID required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAutofixDASTPentestFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAutofixDASTPentestFindingOutput' + $ref: '#/components/schemas/EndpointsGetUserOutput' description: OK '400': content: @@ -25873,12 +29955,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -25897,12 +29973,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post DAST Pentest Finding AutoFix - /dast/pentest/findings/{findingId}/autofix/state: - get: - description: >- - Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; - the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + summary: Get User By Git Identity + /admin/users/reactivate: + post: + description: Reactivate a git-provider user who was deactivated (admin or operator only) parameters: - description: The Azure organization ID in: query @@ -25923,6 +29997,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -25968,17 +30053,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAdminReactivateUserInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDASTFindingAutofixStateOutput' + $ref: '#/components/schemas/EndpointsAdminReactivateUserOutput' description: OK '400': content: @@ -25986,6 +30071,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized '403': content: application/json: @@ -25998,16 +30089,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get DAST Pentest Finding Autofix State - /dast/pentest/findings/{findingId}/autofix/status: + summary: Reactivate User + /findings/{findingId}/feedback: get: - description: Lightweight per-finding autofix lifecycle status for UI polling. + description: Returns the recorded thumbs on a finding, newest first. parameters: - description: The Azure organization ID in: query @@ -26028,6 +30125,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -26083,20 +30191,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDASTFindingAutofixStatusOutput' + $ref: '#/components/schemas/EndpointsGetFindingFeedbackOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -26109,10 +30211,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get DAST Pentest Finding Autofix Status - /dast/pentest/findings/{findingId}/events: - get: - description: Returns the list of all the events for a given Pentest finding + summary: List feedback on a finding + post: + description: Records a thumbs-up or thumbs-down against a finding. Never changes the finding. parameters: - description: The Azure organization ID in: query @@ -26133,6 +30234,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -26183,12 +30295,17 @@ paths: required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostFindingFeedbackInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestFindingEventsOutput' + $ref: '#/components/schemas/EndpointsPostFindingFeedbackOutput' description: OK '400': content: @@ -26196,86 +30313,47 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - summary: Get Pentest Finding Events - /dast/pentest/findings/{findingId}/full: - get: - description: Get the full pentest finding, including the triage + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Record feedback on a finding + /public/findings/feedback/{token}: + post: + description: >- + Records a thumbs-up or thumbs-down from a signed link in a pull request comment. Returns an acknowledgement only + — never any finding content. parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - in: path - name: findingId + name: token required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostPublicFindingFeedbackInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestFindingFullOutput' + $ref: '#/components/schemas/EndpointsPostPublicFindingFeedbackOutput' description: OK '400': content: @@ -26283,12 +30361,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -26301,77 +30373,15 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Finding Full - /dast/pentest/findings/{findingId}/ticket: + summary: Record anonymous feedback on a finding + /public/findings/feedback/{token}/confirm: post: - description: Creates a Jira ticket for a given pentest finding + description: >- + Attaches an optional note to a vote already recorded from a signed link in a pull request comment, and marks + that vote as one a human was present for. Returns an acknowledgement only — never any finding content. parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - in: path - name: findingId + name: token required: true schema: type: string @@ -26379,13 +30389,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketPentestFindingInput' + $ref: '#/components/schemas/EndpointsPostPublicFindingFeedbackConfirmInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketPentestFindingOutput' + $ref: '#/components/schemas/EndpointsPostPublicFindingFeedbackConfirmOutput' description: OK '400': content: @@ -26393,12 +30403,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -26411,87 +30415,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Jira Ticket for Pentest Finding - /dast/pentest/findings/{findingId}/triage: + summary: Attach a note to anonymous feedback on a finding + /public/workspace/bootstrap/request: get: - description: Get the full pentest finding, including the triage - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - - in: path - name: findingId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestFindingFullOutput' + $ref: '#/components/schemas/EndpointsWorkspaceProvisioningRequestOutput' description: OK + headers: + Cache-Control: + schema: + type: string + style: simple '400': content: application/json: @@ -26504,228 +30442,490 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '409': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Conflict + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Finding Full - /dast/pentest/findings/{findingId}/unallowlist: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get my workspace provisioning request post: - description: Unallowlist a pentest finding - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - - in: path - name: findingId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUnallowlistPentestFindingInput' + $ref: '#/components/schemas/EndpointsWorkspaceProvisioningRequestInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWorkspaceProvisioningRequestOutput' + description: OK + headers: + Cache-Control: + schema: + type: string + style: simple '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - summary: Unallowlist Pentest Finding - /dast/pentest/preflights/{preflightId}: - get: - description: Returns a single pentest preflight by ID, including the readiness summary when complete. - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - - in: path - name: preflightId - required: true - schema: - type: string + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Request workspace provisioning + /public/workspace/bootstrap/session: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPublicWorkspaceBootstrapInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestPreflightOutput' + $ref: '#/components/schemas/EndpointsPublicWorkspaceBootstrapOutput' description: OK - '404': + headers: + Cache-Control: + schema: + type: string + style: simple + Referrer-Policy: + schema: + type: string + style: simple + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Bad Request + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Pentest Preflight - tags: - - Applications - - Pentest - - Preflight - /dast/pentest/preflights/{preflightId}/events: - get: - description: >- - Returns the live event stream for a preflight execution. Use the `afterSeq` query parameter (echoing the - previous response's `highestSeq`) for incremental polling. - parameters: - - in: query - name: afterSeq - schema: - format: int64 - type: integer - - in: query - name: limit - schema: - type: integer - - description: The Azure organization ID - in: query - name: azureOrganizationId + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Set up an invited Microsoft workspace + /public/workspace/bootstrap/start: + post: + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPublicWorkspaceBootstrapOutput' + description: OK + headers: + Cache-Control: + schema: + type: string + style: simple + Referrer-Policy: + schema: + type: string + style: simple + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start my approved workspace setup + /auth/github_token: + get: + description: Generate a JWT token for GitHub Actions or CLI access + parameters: + - description: GitHub organization or user name + in: query + name: owner + required: true + schema: + type: string + - description: GitHub token for authentication + in: query + name: token + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + properties: + accessToken: + description: JWT access token for Nullify API + type: string + required: + - accessToken + type: object + description: Successful token generation + '400': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Bad Request + '401': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Unauthorized + '403': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Forbidden + '500': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Internal Server Error + summary: Get GitHub Token + post: + description: Generate a JWT token for CLI access using a GitHub PAT supplied in the request body + requestBody: + content: + application/json: + schema: + properties: + owner: + description: GitHub organization or user name + type: string + token: + description: GitHub token for authentication + type: string + required: + - owner + - token + type: object + description: GitHub owner and PAT + required: true + responses: + '200': + content: + application/json: + schema: + properties: + accessToken: + description: JWT access token for Nullify API + type: string + required: + - accessToken + type: object + description: Successful token generation + '400': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Bad Request + '401': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Unauthorized + '403': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Forbidden + '500': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Internal Server Error + summary: Get GitHub Token + /auth/logout: + get: + description: Clear authentication cookies and log out the user + responses: + '200': + description: OK + summary: Logout + /auth/network/ip_allowed: + get: + description: Report whether the caller's address passes this tenant's IP allowlist + responses: + '200': + content: + application/json: + schema: + properties: + allowed: + type: boolean + ip: + type: string + required: + - ip + - allowed + type: object + description: Caller network admission + '503': + description: IP allowlist unavailable + summary: Check IP Allowlist + /auth/refresh_token: + get: + description: Exchange a refresh token for a new access token + parameters: + - description: Refresh token cookie + in: cookie + name: refresh_token + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + properties: + expiresAt: + description: Token expiration timestamp in milliseconds + format: int64 + type: integer + expiresIn: + description: Token expiration time in seconds + type: integer + installationIds: + description: List of GitHub installation IDs + items: + type: string + type: array + required: + - expiresIn + - installationIds + - expiresAt + type: object + description: Successful token refresh + '400': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Bad Request + '401': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Unauthorized + '403': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Forbidden + '500': + content: + application/json: + schema: + properties: + error: + description: Error message + type: string + required: + - error + type: object + description: Internal Server Error + summary: Refresh Access Token + /context/applications: + get: + description: Retrieves a page of applications for the tenant, with the total across all pages + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId schema: description: The Azure organization ID type: string @@ -26742,6 +30942,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -26787,47 +30998,50 @@ paths: items: type: string type: array - - in: path - name: preflightId - required: true + - description: Maximum number of applications to return per page (default 1000, max 1000) + in: query + name: limit + schema: + description: Maximum number of applications to return per page (default 1000, max 1000) + nullable: true + type: integer + - description: Number of applications to skip before the page + in: query + name: offset + schema: + description: Number of applications to skip before the page + nullable: true + type: integer + - description: Case-insensitive substring match on application name and description + in: query + name: search schema: + description: Case-insensitive substring match on application name and description + nullable: true type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestPreflightEventsOutput' + $ref: '#/components/schemas/EndpointsGetContextApplicationsOutput' description: OK - '400': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Preflight Events - tags: - - Applications - - Pentest - - Preflight - /dast/pentest/scans: - get: - description: Returns all pentest scans for a tenant + summary: Get Applications + post: + description: Create a new application parameters: - - in: query - name: nextToken - schema: - type: string - - in: query - name: limit - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -26847,6 +31061,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -26892,12 +31117,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostContextApplicationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestScansOutput' + $ref: '#/components/schemas/EndpointsPostContextApplicationOutput' description: OK '400': content: @@ -26905,16 +31135,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Scans - /dast/pentest/scans/{scanId}: - get: - description: Returns the details of a pentest scan + summary: Create Application + /context/applications/{applicationId}: + delete: + description: Delete an application parameters: - description: The Azure organization ID in: query @@ -26935,6 +31171,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -26981,7 +31228,7 @@ paths: type: string type: array - in: path - name: scanId + name: applicationId required: true schema: type: string @@ -26990,7 +31237,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestScanOutput' + $ref: '#/components/schemas/EndpointsDeleteContextApplicationOutput' description: OK '400': content: @@ -26998,6 +31245,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '404': content: application/json: @@ -27010,10 +31263,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Scan - /dast/pentest/scans/{scanId}/findings: + summary: Delete Application get: - description: Returns the list of all the pentest findings from a scan + description: Retrieves a specific application by ID parameters: - description: The Azure organization ID in: query @@ -27034,6 +31286,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27080,7 +31343,7 @@ paths: type: string type: array - in: path - name: scanId + name: applicationId required: true schema: type: string @@ -27089,7 +31352,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestScanFindingsOutput' + $ref: '#/components/schemas/EndpointsGetContextApplicationOutput' description: OK '400': content: @@ -27097,6 +31360,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '404': content: application/json: @@ -27109,10 +31378,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Scan Findings - /dast/pentest/scans/{scanId}/hypotheses: - get: - description: Returns the auth matrix hypotheses with full evidence for a pentest scan + summary: Get Application + patch: + description: Update an existing application parameters: - description: The Azure organization ID in: query @@ -27133,6 +31401,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27179,16 +31458,21 @@ paths: type: string type: array - in: path - name: scanId + name: applicationId required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchContextApplicationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAuthMatrixHypothesesOutput' + $ref: '#/components/schemas/EndpointsPatchContextApplicationOutput' description: OK '400': content: @@ -27196,6 +31480,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '404': content: application/json: @@ -27208,11 +31498,56 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Auth Matrix Hypotheses - /dast/pentest/scans/{scanId}/logs: + summary: Update Application + /context/applications/{applicationId}/execution-recipe: get: - description: Returns the network logs for a specific pentest sub-agent + description: >- + Returns the proven commands that stand a whole application up at a commit, or why none can be served. An + application whose components span more than one repository has no single recipe target and is rejected. parameters: + - description: The commit the caller wants to stand the target up at + in: query + name: commitSha + schema: + description: The commit the caller wants to stand the target up at + type: string + - description: >- + The build input hash the caller computed from its own checkout, used when Context has never observed the + commit + in: query + name: inputHash + schema: + description: >- + The build input hash the caller computed from its own checkout, used when Context has never observed the + commit + type: string + - description: Whether the caller's sandbox provides a Docker daemon + in: query + name: docker + schema: + description: Whether the caller's sandbox provides a Docker daemon + type: boolean + - description: >- + Comma separated sandbox capabilities beyond docker, from docker_compose, network, nested_virtualization, + gpu, service_postgres, service_mysql, service_redis, service_mongo, service_elasticsearch, service_kafka + in: query + name: capabilities + schema: + description: >- + Comma separated sandbox capabilities beyond docker, from docker_compose, network, nested_virtualization, + gpu, service_postgres, service_mysql, service_redis, service_mongo, service_elasticsearch, service_kafka + type: string + - description: >- + Whether the caller will apply the file edits a recipe carries. Defaults to true; false returns incompatible + rather than a recipe the caller would refuse + in: query + name: allowEdits + schema: + description: >- + Whether the caller will apply the file edits a recipe carries. Defaults to true; false returns + incompatible rather than a recipe the caller would refuse + nullable: true + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -27232,6 +31567,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27278,7 +31624,7 @@ paths: type: string type: array - in: path - name: scanId + name: applicationId required: true schema: type: string @@ -27287,7 +31633,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSubAgentNetworkLogOutput' + $ref: '#/components/schemas/EndpointsGetApplicationExecutionRecipeOutput' description: OK '400': content: @@ -27295,23 +31641,41 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Sub-Agent Network Log - /dast/pentest/scans/{scanId}/report: - get: - description: Returns the report of a pentest scan - parameters: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Application Execution Recipe + /context/applications/{applicationId}/schema: + get: + description: Returns the computed API schema for an application by merging all linked project schemas + parameters: - description: The Azure organization ID in: query name: azureOrganizationId @@ -27331,6 +31695,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27377,7 +31752,7 @@ paths: type: string type: array - in: path - name: scanId + name: applicationId required: true schema: type: string @@ -27386,14 +31761,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestScanReportOutput' + $ref: '#/components/schemas/EndpointsGetApplicationSchemaOutput' description: OK - '403': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Bad Request '404': content: application/json: @@ -27406,10 +31781,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Scan Report - /dast/pentest/scans/{scanId}/report/download: - get: - description: Returns the download url of a pentest scan report + summary: Get Application Schema + /context/applications/rebuild: + post: + description: >- + Trigger application context rebuilding. The returned runId is the generation the rebuilt applications are stored + under; read it back with GET /context/applications/rebuilds/{runId}. parameters: - description: The Azure organization ID in: query @@ -27430,6 +31807,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27475,17 +31863,17 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsRebuildApplicationsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestScanReportDownloadURLOutput' + $ref: '#/components/schemas/EndpointsRebuildApplicationsOutput' description: OK '403': content: @@ -27493,22 +31881,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Pentest Scan Report Download URL - /dast/pentest/scans/{scanId}/report/external/pdf: + description: Service Unavailable + summary: Rebuild Applications + /context/applications/rebuilds/{runId}: get: - description: Returns a presigned URL to download the external customer-facing PDF report of a pentest scan + description: >- + Reports an application rebuild started by POST /context/applications/rebuild and lists the applications it + stored. parameters: - description: The Azure organization ID in: query @@ -27529,6 +31919,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27575,7 +31976,7 @@ paths: type: string type: array - in: path - name: scanId + name: runId required: true schema: type: string @@ -27584,8 +31985,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestScanReportPDFOutput' + $ref: '#/components/schemas/EndpointsGetApplicationRebuildOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request '403': content: application/json: @@ -27604,11 +32011,45 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Scan External Report PDF - /dast/pentest/scans/{scanId}/report/pdf: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Application Rebuild + /context/artifact-deployments: get: - description: Returns a presigned URL to download the PDF report of a pentest scan + description: Lists all artifact deployments with optional filtering parameters: + - in: query + name: artifactId + schema: + type: string + - in: query + name: repositoryId + schema: + type: string + - in: query + name: cloudResourceId + schema: + type: string + - in: query + name: computeType + schema: + type: string + - in: query + name: limit + schema: + type: integer + - in: query + name: nextToken + schema: + type: string + - in: query + name: includeDeleted + schema: + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -27628,6 +32069,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27673,40 +32125,29 @@ paths: items: type: string type: array - - in: path - name: scanId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPentestScanReportPDFOutput' + $ref: '#/components/schemas/EndpointsListArtifactDeploymentsOutput' description: OK - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Bad Request '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Scan Report PDF - /dast/pentest/scans/{scanId}/stop: - post: - description: Request to stop a pentest scan + summary: List Artifact Deployments + /context/artifact-deployments/{deploymentId}: + get: + description: Retrieves a single artifact deployment by ID parameters: - description: The Azure organization ID in: query @@ -27727,6 +32168,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27773,7 +32225,7 @@ paths: type: string type: array - in: path - name: scanId + name: deploymentId required: true schema: type: string @@ -27782,7 +32234,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsStopPentestScanOutput' + $ref: '#/components/schemas/EndpointsGetArtifactDeploymentOutput' description: OK '400': content: @@ -27790,25 +32242,55 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Stop Pentest Scan - /dast/pentest/start: - post: - description: >- - Start a new pentest scan using the supplied Application configuration. The pentest workflow runs its own - preflight check internally and aborts the scan to human_fallback if the application is not pentestable. + summary: Get Artifact Deployment + /context/artifacts: + get: + description: Lists all build artifacts with optional filtering parameters: + - in: query + name: repositoryId + schema: + type: string + - in: query + name: projectId + schema: + type: string + - in: query + name: type + schema: + type: string + - in: query + name: limit + schema: + type: integer + - in: query + name: nextToken + schema: + type: string + - in: query + name: offset + schema: + type: integer + - in: query + name: search + schema: + type: string + - in: query + name: includeDeleted + schema: + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -27828,6 +32310,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27873,17 +32366,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsStartPentestScanFromApplicationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsStartPentestScanFromApplicationOutput' + $ref: '#/components/schemas/EndpointsListArtifactsOutput' description: OK '400': content: @@ -27891,31 +32379,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Start Pentest Scan from Application - tags: - - Applications - - Pentest - /dast/scans/status/last: - get: - description: Returns the status of the most recent BugHunt scan for the tenant. + summary: List Artifacts + /context/artifacts/{artifactId}: + delete: + description: Soft-delete an artifact parameters: - description: The Azure organization ID in: query @@ -27936,6 +32409,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -27981,23 +32465,45 @@ paths: items: type: string type: array + - in: path + name: artifactId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDASTLastScanStatusesOutput' + $ref: '#/components/schemas/EndpointsDeleteArtifactOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Pentest Last Scan Status - /dast/sourceips: + summary: Delete Artifact get: - description: Returns the public IP addresses from which DAST scans originate + description: Retrieves a single build artifact by ID parameters: - description: The Azure organization ID in: query @@ -28018,6 +32524,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28063,31 +32580,61 @@ paths: items: type: string type: array + - in: path + name: artifactId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSourceIPsOutput' + $ref: '#/components/schemas/EndpointsGetArtifactOutput' description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Source IPs - /manager/campaigns: + summary: Get Artifact + /context/asset-graph/attack-paths: get: - description: Returns a list of campaigns containing full campaign details. + description: >- + Returns the tenant's stored internet-to-target attack paths from the last rebuild, optionally filtered by + terminal node kind and whether a critical finding sits on the path. parameters: - in: query - name: page + name: terminalNodeKind + schema: + $ref: '#/components/schemas/EndpointsAttackPathTerminalNodeKind' + - in: query + name: hasCriticalFinding schema: + nullable: true + type: boolean + - in: query + name: limit + schema: + default: 50 type: integer - in: query - name: pageSize + name: offset schema: + default: 0 type: integer - description: The Azure organization ID in: query @@ -28108,6 +32655,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28158,7 +32716,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignsOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphAttackPathsOutput' description: OK '400': content: @@ -28166,34 +32724,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: List Campaigns - post: - description: Register a new campaign + summary: List Asset Graph Attack Paths + /context/asset-graph/landing: + get: + description: >- + Returns the PG-backed explorer landing dashboard: per-kind counts and entry-point cards for cloud accounts, k8s + clusters, applications and repositories parameters: + - in: query + name: perCategory + schema: + default: 12 + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -28213,6 +32761,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28258,53 +32817,29 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCampaignInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCampaignOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphLandingOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Post Campaign - /manager/campaigns/{campaignId}: - delete: - description: Delete a campaign (remove permanently) + summary: Get Asset Graph Landing + /context/asset-graph/node: + get: + description: Returns a single asset graph node with its direct child-by-kind counts and full payload parameters: + - in: query + name: nodeId + required: true + schema: + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -28324,6 +32859,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28369,26 +32915,19 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true - schema: - type: string responses: - '204': - description: No Content - '400': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + $ref: '#/components/schemas/EndpointsGetAssetGraphNodeOutput' + description: OK + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Bad Request '404': content: application/json: @@ -28401,16 +32940,33 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Delete Campaign + summary: Get Asset Graph Node + /context/asset-graph/nodes: get: - description: Returns a campaign + description: Returns a paginated, name-ordered page of asset graph nodes for one or more node kinds parameters: + - in: query + name: kinds + required: true + schema: + items: + type: string + type: array + - in: query + name: limit + schema: + default: 50 + type: integer + - in: query + name: offset + schema: + default: 0 + type: integer + - in: query + name: childCounts + schema: + default: false + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -28430,6 +32986,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28475,17 +33042,12 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphNodesOutput' description: OK '400': content: @@ -28493,34 +33055,36 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Campaign by ID - patch: - description: Update an existing campaign + summary: List Asset Graph Nodes + /context/asset-graph/reachability: + get: + description: >- + Network reachability from the Internet to the target, computed by the network-path engine over the node's graph + neighbourhood. Directly-internet-attached hosts honour security groups, the subnet NACL (stateless, with + ephemeral-return evaluation) and the subnet route table's default route to the internet gateway; within-VPC + load-balancer paths honour the load balancer's internet-facing listener admission and NACL/route-table + evaluation on the load-balancer-to-target hop. Cross-VPC load-balancer paths are resolved at the routing layer + and managed edge services (CloudFront, API Gateway) at their distribution layer. parameters: + - in: query + name: nodeId + required: true + schema: + type: string + - in: query + name: port + schema: + type: integer + - in: query + name: protocol + schema: + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -28540,6 +33104,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28585,22 +33160,12 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchCampaignInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchCampaignOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphReachabilityOutput' description: OK '400': content: @@ -28608,63 +33173,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Patch Campaign - /manager/campaigns/{campaignId}/events: + summary: Get Asset Graph Reachability + /context/asset-graph/retrieve: get: - description: Returns a list of events for a campaign + description: >- + Hybrid semantic + lexical search over asset graph nodes, returning ranked nodes with a compact text + serialization parameters: - - description: 'Page number, 1-indexed (default: 1)' - in: query - name: page + - in: query + name: q + required: true schema: - description: 'Page number, 1-indexed (default: 1)' - type: integer - - description: 'Number of events per page (default: 1000)' - in: query - name: pageSize + minLength: 3 + type: string + - in: query + name: maxResults schema: - description: 'Number of events per page (default: 1000)' + default: 10 type: integer - - description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) - in: query - name: actionTypes - schema: - description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) - items: - type: string - type: array - - description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) - in: query - name: statuses - schema: - description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) - items: - type: string - type: array - description: The Azure organization ID in: query name: azureOrganizationId @@ -28684,6 +33216,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28729,17 +33272,12 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignEventsOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphRetrieveOutput' description: OK '400': content: @@ -28747,35 +33285,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Campaign Events - /manager/campaigns/{campaignId}/findings: + summary: Retrieve Asset Graph Nodes + /context/asset-graph/search: get: - description: Returns a list of findingIDs for current and historical findings within the campaign scope. + description: Searches the asset graph for nodes matching a query string parameters: + - in: query + name: q + required: true + schema: + minLength: 3 + type: string + - in: query + name: objectTypes + schema: + items: + type: string + type: array + - in: query + name: maxResults + schema: + default: 20 + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -28795,6 +33332,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28840,17 +33388,12 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignFindingsOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphSearchOutput' description: OK '400': content: @@ -28858,37 +33401,44 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get (Triaged) Findings Associated with a campaign - /manager/campaigns/{campaignId}/preview: + summary: Search Asset Graph + /context/asset-graph/subgraph: get: - description: >- - Returns a campaign preview model, with title, description, and mapped finding IDs. For full campaign details use - the GetCampaign endpoint. + description: Extracts a bounded subgraph from the merged asset graph starting from a root node parameters: + - in: query + name: rootNodeId + required: true + schema: + type: string + - in: query + name: depth + schema: + default: 1 + type: integer + - in: query + name: maxNodes + schema: + default: 150 + type: integer + - in: query + name: objectTypes + schema: + items: + type: string + type: array + - in: query + name: edgeTypes + schema: + items: + type: string + type: array - description: The Azure organization ID in: query name: azureOrganizationId @@ -28908,6 +33458,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -28953,17 +33514,12 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignPreviewOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphSubgraphOutput' description: OK '400': content: @@ -28971,44 +33527,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Campaign Preview Details - /manager/campaigns/{campaignId}/runs: + summary: Get Asset Graph Subgraph + /context/asset-graph/summary: get: - description: Returns the run history (one row per Fargate execution) for a campaign, ordered newest first. + description: Retrieves a unified summary of all infrastructure and repo context graphs with presigned download URLs parameters: - - in: query - name: cursor - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -29028,6 +33557,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29073,17 +33613,12 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignRunsOutput' + $ref: '#/components/schemas/EndpointsGetAssetGraphSummaryOutput' description: OK '400': content: @@ -29091,12 +33626,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -29109,16 +33638,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: List Campaign Runs - /manager/campaigns/{campaignId}/runs/{runId}: + summary: Get Asset Graph Summary + /context/asset-inventory: get: - description: Returns a single campaign run with the resolved plan blob. + description: >- + Unified asset inventory across every category — repos, build artifacts, cloud hosts, databases, etc. Universal + columns only; drill into a per-category endpoint for promoted columns and details. parameters: - description: The Azure organization ID in: query @@ -29139,6 +33664,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29184,22 +33720,70 @@ paths: items: type: string type: array - - in: path - name: campaignId - required: true + - in: query + name: category + schema: + nullable: true + type: string + - in: query + name: subType schema: + nullable: true type: string - - in: path - name: runId - required: true + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: q + schema: + nullable: true + type: string + - in: query + name: updatedAfter + schema: + nullable: true + type: string + - in: query + name: nextToken schema: type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignRunOutput' + $ref: '#/components/schemas/EndpointsListAssetInventoryOutput' description: OK '400': content: @@ -29213,28 +33797,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Campaign Run - /manager/campaigns/default: - get: - description: Returns a list of generated default campaigns + summary: List Asset Inventory + /context/asset-inventory/{category}/{id}: + delete: + description: >- + Soft-delete a single asset (is_active=false). The row is retained for audit; deleted_at_scan_id is set to a + 'manual:' sentinel so the deletion is distinguishable from a scan-driven stale-mark. parameters: - description: The Azure organization ID in: query @@ -29255,6 +33829,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29300,12 +33885,22 @@ paths: items: type: string type: array + - in: path + name: category + required: true + schema: + type: string + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetDefaultCampaignsOutput' + $ref: '#/components/schemas/EndpointsDeleteAssetOutput' description: OK '400': content: @@ -29331,25 +33926,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Default Campaigns - /manager/campaigns/default/generate: - post: - description: Trigger the campaign generator to create default campaigns + summary: Delete Asset + /context/asset-inventory/{category}/{id}/flags: + patch: + description: >- + Override the is_public_facing / is_internet_reachable flags on a single asset. The next scan will rewrite them — + full override-respecting semantics is a follow-up. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -29369,6 +33952,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29414,12 +34008,27 @@ paths: items: type: string type: array + - in: path + name: category + required: true + schema: + type: string + - in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchAssetFlagsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGenerateDefaultCampaignsOutput' + $ref: '#/components/schemas/EndpointsPatchAssetFlagsOutput' description: OK '400': content: @@ -29439,28 +34048,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Generate Default Campaigns - /manager/campaigns/findings: - get: - description: Returns a list of all findings across all campaigns + summary: Patch Asset Flags + /context/asset-inventory/{category}/{id}/tags: + patch: + description: >- + Replace the tags map on a single asset. Manual override entry-point — note that the projector clobbers tags on + every scan, so this is durable only between scans. parameters: - description: The Azure organization ID in: query @@ -29481,6 +34080,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29526,12 +34136,27 @@ paths: items: type: string type: array + - in: path + name: category + required: true + schema: + type: string + - in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchAssetTagsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAllCampaignsFindingsOutput' + $ref: '#/components/schemas/EndpointsPatchAssetTagsOutput' description: OK '400': content: @@ -29557,23 +34182,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get All Campaigns Findings - /manager/campaigns/metrics/refresh: + summary: Patch Asset Tags + /context/asset-inventory/ai-ml: get: - description: Refresh and recalculate campaign metrics + description: >- + Lists ai_ml assets (SageMaker endpoints, Bedrock models, Vertex AI endpoints, Azure OpenAI deployments, Azure ML + workspaces) with optional filters. parameters: - - description: 'Whether to include expired campaigns in the metrics refresh (default: false)' - in: query - name: includeExpired - schema: - description: 'Whether to include expired campaigns in the metrics refresh (default: false)' - type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -29593,6 +34208,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29638,12 +34264,55 @@ paths: items: type: string type: array + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignMetricsRefreshOutput' + $ref: '#/components/schemas/EndpointsListAiMlAssetsOutput' description: OK '400': content: @@ -29657,43 +34326,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Refresh Campaign Metrics - /manager/campaigns/previews: + summary: List AI/ML Assets + /context/asset-inventory/ai-ml/{id}: get: - description: Returns a list of campaign previews with title, description, and mapped finding IDs + description: Returns the full detail view of a single ai_ml asset, including the per-sub_type details. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -29713,6 +34356,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29758,12 +34412,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignPreviewsOutput' + $ref: '#/components/schemas/EndpointsGetAiMlAssetOutput' description: OK '400': content: @@ -29789,25 +34448,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Campaign Previews - /manager/campaigns/summaries: + summary: Get AI/ML Asset + /context/asset-inventory/artifact-repositories: get: - description: Returns a list of campaign summaries from plans + description: >- + Lists artifact repository assets (container/package registries) with optional filters. This category is the + cross-source dedupe target — cloud-scan ECR records and repo-context registry records both land here. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -29827,6 +34474,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29872,12 +34530,55 @@ paths: items: type: string type: array + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCampaignSummariesOutput' + $ref: '#/components/schemas/EndpointsListArtifactRepositoriesAssetsOutput' description: OK '400': content: @@ -29891,37 +34592,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Campaign Summaries - /manager/chat/sessions: + summary: List Artifact Repositories Assets + /context/asset-inventory/artifact-repositories/{id}: get: - description: Returns a paginated list of chat sessions for the authenticated user. + description: Returns the full detail view of a single artifact_repositories asset, including the per-sub_type details. parameters: - - in: query - name: limit - schema: - type: integer - - in: query - name: nextToken - schema: - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -29941,6 +34622,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -29986,12 +34678,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsListChatSessionsOutput' + $ref: '#/components/schemas/EndpointsGetArtifactRepositoriesAssetOutput' description: OK '400': content: @@ -30005,16 +34702,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Chat Sessions - /manager/chat/sessions/{chatID}: - delete: - description: Delete a chat session and its associated chat history. + summary: Get Artifact Repositories Asset + /context/asset-inventory/artifacts: + get: + description: Lists build-artifact assets (Docker images, JARs, wheels, npm packages, executables) with optional filters. parameters: - description: The Azure organization ID in: query @@ -30035,6 +34738,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30080,121 +34794,60 @@ paths: items: type: string type: array - - in: path - name: chatID - required: true + - in: query + name: subType schema: + nullable: true type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsDeleteChatSessionOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Delete Chat Session - get: - description: Returns a single chat session by ID. - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId + - in: query + name: provider schema: - description: The Azure organization ID + nullable: true type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId + - in: query + name: accountId schema: - description: The Bitbucket workspace ID + nullable: true type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId + - in: query + name: region schema: - description: The Nullify installation ID + nullable: true type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId + - in: query + name: active schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId + nullable: true + type: boolean + - in: query + name: publicFacing schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId + nullable: true + type: boolean + - in: query + name: internetReachable schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId + nullable: true + type: boolean + - in: query + name: projectId schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - - in: path - name: chatID - required: true + nullable: true + type: string + - in: query + name: nextToken schema: type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetChatSessionOutput' + $ref: '#/components/schemas/EndpointsListArtifactsAssetsOutput' description: OK '400': content: @@ -30208,21 +34861,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Chat Session - patch: - description: Update the title of a chat session. + summary: List Artifacts Assets + /context/asset-inventory/artifacts/{id}: + get: + description: Returns the full detail view of a single artifacts asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -30243,6 +34891,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30289,21 +34948,16 @@ paths: type: string type: array - in: path - name: chatID + name: id required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchChatSessionInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchChatSessionOutput' + $ref: '#/components/schemas/EndpointsGetArtifactsAssetOutput' description: OK '400': content: @@ -30329,10 +34983,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Patch Chat Session - /manager/chat/sessions/{chatID}/actions: + summary: Get Artifacts Asset + /context/asset-inventory/cdn-and-dns: get: - description: Returns the pending actions for a chat session. + description: >- + Lists CDN/DNS assets (CloudFront, Route53, API Gateway, GCP/Azure CDN/DNS, Front Door) with optional filters. + Returns the table-view shape without per-sub_type details — fetch a single asset by ID for the detail view. parameters: - description: The Azure organization ID in: query @@ -30353,6 +35009,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30398,17 +35065,55 @@ paths: items: type: string type: array - - in: path - name: chatID - required: true + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region schema: + nullable: true type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetChatSessionActionsOutput' + $ref: '#/components/schemas/EndpointsListCDNAndDNSAssetsOutput' description: OK '400': content: @@ -30422,31 +35127,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Chat Session Actions - /manager/chat/sessions/{chatID}/audit: + summary: List CDN and DNS Assets + /context/asset-inventory/cdn-and-dns/{id}: get: - description: Returns the audit trail of actions taken in a chat session. + description: Returns the full detail view of a single cdn_and_dns asset, including the per-sub_type details. parameters: - - in: query - name: limit - schema: - type: integer - - in: query - name: nextToken - schema: - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -30466,6 +35157,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30512,7 +35214,7 @@ paths: type: string type: array - in: path - name: chatID + name: id required: true schema: type: string @@ -30521,7 +35223,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetChatSessionAuditOutput' + $ref: '#/components/schemas/EndpointsGetCDNAndDNSAssetOutput' description: OK '400': content: @@ -30547,19 +35249,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get chat session audit trail - /manager/chat/sessions/{chatID}/history: + summary: Get CDN and DNS Asset + /context/asset-inventory/ci-cd: get: - description: Returns the paginated message history for a chat session. + description: >- + Lists ci_cd assets (CodeBuild, CodePipeline, CodeCommit, CodeDeploy, GCP Cloud Build, Azure DevOps Pipelines) + with optional filters. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -30579,6 +35275,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30624,17 +35331,55 @@ paths: items: type: string type: array - - in: path - name: chatID - required: true + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken schema: type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetChatSessionHistoryOutput' + $ref: '#/components/schemas/EndpointsListCiCdAssetsOutput' description: OK '400': content: @@ -30648,22 +35393,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Chat Session History - /manager/config: + summary: List CI/CD Assets + /context/asset-inventory/ci-cd/{id}: get: - description: Fetches the Manager configuration for this tenant. + description: Returns the full detail view of a single ci_cd asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -30684,6 +35423,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30729,12 +35479,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetManagerConfigOutput' + $ref: '#/components/schemas/EndpointsGetCiCdAssetOutput' description: OK '400': content: @@ -30760,15 +35515,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Manager config - post: - description: Stores the Manager configuration for this tenant. + summary: Get CI/CD Asset + /context/asset-inventory/cluster: + get: + description: Lists cluster assets (EKS, ECS clusters, GKE, AKS) with optional filters. parameters: - description: The Azure organization ID in: query @@ -30789,6 +35539,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30834,17 +35595,55 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostManagerConfigInput' + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostManagerConfigOutput' + $ref: '#/components/schemas/EndpointsListClusterAssetsOutput' description: OK '400': content: @@ -30858,28 +35657,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Update Manager config - /manager/credits: + summary: List Cluster Assets + /context/asset-inventory/cluster/{id}: get: - description: Returns the available credit balance. Credits cap how many actions Nullify can take on this tenant's behalf. + description: Returns the full detail view of a single cluster asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -30900,6 +35687,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -30945,12 +35743,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCreditsOutput' + $ref: '#/components/schemas/EndpointsGetClusterAssetOutput' description: OK '400': content: @@ -30976,17 +35779,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Manager credit balance - post: + summary: Get Cluster Asset + /context/asset-inventory/compute: + get: description: >- - Increment or decrement the available credit balance. Credits cap how many actions Nullify can take on this - tenant's behalf. + Lists compute assets (EC2, GCE, Azure VM, K8s node, etc.) with optional filters. Returns the table-view shape + without per-sub_type details — fetch a single asset by ID for the detail view. parameters: - description: The Azure organization ID in: query @@ -31007,6 +35805,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31052,17 +35861,55 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCreditsInput' + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreditsOutput' + $ref: '#/components/schemas/EndpointsListComputeAssetsOutput' description: OK '400': content: @@ -31076,28 +35923,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Update Manager credit balance - /manager/customer-questions: - delete: - description: Delete all customer question sets for a tenant + summary: List Compute Assets + /context/asset-inventory/compute/{id}: + get: + description: >- + Returns the full detail view of a single compute asset, including the per-sub_type details. Use this for the + single-asset detail page in the UI. parameters: - description: The Azure organization ID in: query @@ -31118,6 +35955,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31163,12 +36011,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteAllCustomerQuestionSetsOutput' + $ref: '#/components/schemas/EndpointsGetComputeAssetOutput' description: OK '400': content: @@ -31182,24 +36035,25 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete All Customer Question Sets + summary: Get Compute Asset + /context/asset-inventory/connectivity: get: - description: List all generated customer question sets for the tenant + description: >- + Lists connectivity assets (VPN connections, Direct Connect, ExpressRoute, PrivateLink, TGW attachments) with + optional filters. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -31219,6 +36073,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31264,12 +36129,55 @@ paths: items: type: string type: array + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCustomerQuestionSetsOutput' + $ref: '#/components/schemas/EndpointsListConnectivityAssetsOutput' description: OK '400': content: @@ -31283,22 +36191,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Customer Question Sets - /manager/customer-questions/{questionSetId}: - delete: - description: Delete a customer question set and all its questions + summary: List Connectivity Assets + /context/asset-inventory/connectivity/{id}: + get: + description: Returns the full detail view of a single connectivity asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -31319,6 +36221,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31365,7 +36278,7 @@ paths: type: string type: array - in: path - name: questionSetId + name: id required: true schema: type: string @@ -31374,7 +36287,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteCustomerQuestionSetOutput' + $ref: '#/components/schemas/EndpointsGetConnectivityAssetOutput' description: OK '400': content: @@ -31400,9 +36313,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Customer Question Set + summary: Get Connectivity Asset + /context/asset-inventory/container: get: - description: Get a customer question set by ID + description: >- + Lists container assets (ECS Service/Task, K8s Deployment/Pod/StatefulSet/DaemonSet, Cloud Run, Azure ACI/App + Service) with optional filters. parameters: - description: The Azure organization ID in: query @@ -31423,6 +36339,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31468,17 +36395,55 @@ paths: items: type: string type: array - - in: path - name: questionSetId - required: true + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken schema: type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCustomerQuestionSetOutput' + $ref: '#/components/schemas/EndpointsListContainerAssetsOutput' description: OK '400': content: @@ -31492,22 +36457,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Customer Question Set - /manager/customer-questions/{questionSetId}/answers/{questionId}: - patch: - description: Submit an answer for a customer question + summary: List Container Assets + /context/asset-inventory/container/{id}: + get: + description: Returns the full detail view of a single container asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -31528,6 +36487,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31574,26 +36544,16 @@ paths: type: string type: array - in: path - name: questionSetId - required: true - schema: - type: string - - in: path - name: questionId + name: id required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchCustomerQuestionAnswerInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchCustomerQuestionAnswerOutput' + $ref: '#/components/schemas/EndpointsGetContainerAssetOutput' description: OK '400': content: @@ -31619,10 +36579,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Submit Question Answer - /manager/customer-questions/{questionSetId}/questions/{questionId}: - delete: - description: Delete an individual question from a question set + summary: Get Container Asset + /context/asset-inventory/data-pipeline: + get: + description: >- + Lists data_pipeline assets (Glue, EMR, Athena, Dataflow, Dataproc, Data Factory, Databricks) with optional + filters. parameters: - description: The Azure organization ID in: query @@ -31643,6 +36605,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31688,22 +36661,55 @@ paths: items: type: string type: array - - in: path - name: questionSetId - required: true + - in: query + name: subType schema: + nullable: true type: string - - in: path - name: questionId - required: true + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId schema: + nullable: true type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteCustomerQuestionOutput' + $ref: '#/components/schemas/EndpointsListDataPipelineAssetsOutput' description: OK '400': content: @@ -31717,31 +36723,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Delete Customer Question - /manager/escalations: + summary: List Data Pipeline Assets + /context/asset-inventory/data-pipeline/{id}: get: - description: Returns a list of escalations (open and resolved) + description: Returns the full detail view of a single data_pipeline asset, including the per-sub_type details. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -31761,6 +36753,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31806,12 +36809,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetEscalationsOutput' + $ref: '#/components/schemas/EndpointsGetDataPipelineAssetOutput' description: OK '400': content: @@ -31837,16 +36845,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Escalations - /manager/escalations/{escalationId}: - patch: - description: Update an existing escalation + summary: Get Data Pipeline Asset + /context/asset-inventory/database: + get: + description: >- + Lists database assets (RDS, DynamoDB, Redshift, Neptune, ElastiCache, OpenSearch, GCP + Spanner/BigQuery/Firestore, Azure SQL/Cosmos) with optional filters. parameters: - description: The Azure organization ID in: query @@ -31867,6 +36871,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -31912,19 +36927,56 @@ paths: items: type: string type: array - - in: path - name: escalationId - required: true + - in: query + name: subType schema: + nullable: true type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchEscalationsInput' + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListDatabaseAssetsOutput' + description: OK '400': content: application/json: @@ -31937,37 +36989,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Patch Escalation - /manager/events: + summary: List Database Assets + /context/asset-inventory/database/{id}: get: - description: Returns a list of events across all campaigns + description: Returns the full detail view of a single database asset, including the per-sub_type details. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -31987,6 +37019,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32032,12 +37075,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetEventsOutput' + $ref: '#/components/schemas/EndpointsGetDatabaseAssetOutput' description: OK '400': content: @@ -32063,16 +37111,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Events - /manager/events/{eventId}: - delete: - description: Delete a single event by ID + summary: Get Database Asset + /context/asset-inventory/endpoints: + get: + description: >- + Lists HTTP/RPC endpoints discovered on hosts (the asset-inventory endpoints sub-resource). Filterable by + host_category, host_id, aws_service, source_type, active, path-substring. parameters: - description: The Azure organization ID in: query @@ -32093,6 +37137,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32138,17 +37193,50 @@ paths: items: type: string type: array - - in: path - name: eventId - required: true + - in: query + name: hostCategory schema: + nullable: true + type: string + - in: query + name: hostId + schema: + nullable: true + type: string + - in: query + name: awsService + schema: + nullable: true + type: string + - in: query + name: sourceType + schema: + nullable: true type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: q + schema: + nullable: true + type: string + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsDeleteEventOutput' + $ref: '#/components/schemas/EndpointsListEndpointsAssetsOutput' description: OK '400': content: @@ -32162,28 +37250,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Delete Event - /manager/events/deduplicate: - post: - description: Remove duplicate events from the database + summary: List Asset Inventory Endpoints + /context/asset-inventory/endpoints/{id}: + get: + description: Returns a single asset-inventory endpoint by id. parameters: - description: The Azure organization ID in: query @@ -32204,6 +37280,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32249,17 +37336,17 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostDeduplicateEventsInput' + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostDeduplicateEventsOutput' + $ref: '#/components/schemas/EndpointsGetEndpointsAssetOutput' description: OK '400': content: @@ -32285,45 +37372,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Deduplicate Events - /manager/findings/{findingId}/events: + summary: Get Asset Inventory Endpoint + /context/asset-inventory/identity: get: - description: Returns a list of events associated with a finding + description: >- + Lists identity assets (IAM users, roles, groups, policies, Cognito user pools, K8s service accounts and roles) + with optional filters. parameters: - - description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) - in: query - name: actionTypes - schema: - description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) - items: - type: string - type: array - - description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) - in: query - name: statuses - schema: - description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) - items: - type: string - type: array - - description: Maximum number of events to return (default 100, max 1000) - in: query - name: limit - schema: - description: Maximum number of events to return (default 100, max 1000) - type: integer - - description: Pagination cursor from previous request - in: query - name: cursor - schema: - description: Pagination cursor from previous request - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -32343,6 +37398,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32388,17 +37454,55 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: subType schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetFindingEventsOutput' + $ref: '#/components/schemas/EndpointsListIdentityAssetsOutput' description: OK '400': content: @@ -32412,28 +37516,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Finding Events - /manager/groundrules: + summary: List Identity Assets + /context/asset-inventory/identity/{id}: get: - description: Fetches the ground rules Nullify follows for this tenant. + description: Returns the full detail view of a single identity asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -32454,6 +37546,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32499,12 +37602,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetManagerGroundRulesOutput' + $ref: '#/components/schemas/EndpointsGetIdentityAssetOutput' description: OK '400': content: @@ -32530,15 +37638,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Manager ground rules - patch: - description: Update an existing ground rules + summary: Get Identity Asset + /context/asset-inventory/load-balancer: + get: + description: >- + Lists load balancer assets (ALB/NLB/CLB, target groups, K8s Service/Ingress, Azure App Gateway, GCP LB) with + optional filters. parameters: - description: The Azure organization ID in: query @@ -32559,6 +37664,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32604,17 +37720,55 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchGroundRulesInput' + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchGroundRulesOutput' + $ref: '#/components/schemas/EndpointsListLoadBalancerAssetsOutput' description: OK '400': content: @@ -32628,27 +37782,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Patch a GroundRules object to S3 - post: - description: Provide a list of enabled/disabled action types + summary: List Load Balancer Assets + /context/asset-inventory/load-balancer/{id}: + get: + description: Returns the full detail view of a single load_balancer asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -32669,6 +37812,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32714,17 +37868,17 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostManagerGroundRulesInput' + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostManagerGroundRulesOutput' + $ref: '#/components/schemas/EndpointsGetLoadBalancerAssetOutput' description: OK '400': content: @@ -32750,16 +37904,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Post a GroundRules object to S3 - /manager/metrics: + summary: Get Load Balancer Asset + /context/asset-inventory/messaging: get: - description: Returns metrics for the manager + description: >- + Lists messaging assets (SQS, SNS, Kinesis, EventBridge, SES, GCP Pub/Sub, Azure Service Bus/Event Hub) with + optional filters. parameters: - description: The Azure organization ID in: query @@ -32780,6 +37930,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32825,12 +37986,55 @@ paths: items: type: string type: array + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetManagerMetricsOutput' + $ref: '#/components/schemas/EndpointsListMessagingAssetsOutput' description: OK '400': content: @@ -32844,41 +38048,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Metrics - /manager/plans: + summary: List Messaging Assets + /context/asset-inventory/messaging/{id}: get: - description: Returns a list of plans + description: Returns the full detail view of a single messaging asset, including the per-sub_type details. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - - in: query - name: campaignId - schema: - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -32898,6 +38078,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -32943,12 +38134,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetPlansOutput' + $ref: '#/components/schemas/EndpointsGetMessagingAssetOutput' description: OK '400': content: @@ -32974,16 +38170,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Plans - /manager/state: + summary: Get Messaging Asset + /context/asset-inventory/network: get: - description: Returns the current state of the manager + description: Lists network assets (VPCs, subnets, gateways, route tables, EIPs, VPC endpoints) with optional filters. parameters: - description: The Azure organization ID in: query @@ -33004,6 +38194,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33049,12 +38250,55 @@ paths: items: type: string type: array + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetManagerStateOutput' + $ref: '#/components/schemas/EndpointsListNetworkAssetsOutput' description: OK '400': content: @@ -33068,28 +38312,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Manager State - /manager/state/latest: + summary: List Network Assets + /context/asset-inventory/network/{id}: get: - description: Returns the current state of the manager (legacy endpoint) + description: Returns the full detail view of a single network asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -33110,6 +38342,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33155,12 +38398,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetManagerStateOutput' + $ref: '#/components/schemas/EndpointsGetNetworkAssetOutput' description: OK '400': content: @@ -33186,25 +38434,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Manager State (Legacy) - /manager/states: + summary: Get Network Asset + /context/asset-inventory/observability: get: - description: Returns a history of manager states + description: >- + Lists observability assets (CloudWatch Log Groups/Alarms/Dashboards, X-Ray, Stackdriver, Azure Monitor) with + optional filters. parameters: - - in: query - name: page - schema: - type: integer - - in: query - name: pageSize - schema: - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -33224,6 +38460,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33269,12 +38516,55 @@ paths: items: type: string type: array + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetManagerStatesOutput' + $ref: '#/components/schemas/EndpointsListObservabilityAssetsOutput' description: OK '400': content: @@ -33288,28 +38578,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Manager States - /manager/strategy: + summary: List Observability Assets + /context/asset-inventory/observability/{id}: get: - description: Get the currently active security program strategy + description: Returns the full detail view of a single observability asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -33330,6 +38608,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33375,12 +38664,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetStrategyOutput' + $ref: '#/components/schemas/EndpointsGetObservabilityAssetOutput' description: OK '400': content: @@ -33406,9 +38700,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Active Strategy - patch: - description: Edit the active security program strategy. Each edit creates a new version. + summary: Get Observability Asset + /context/asset-inventory/pipelines: + get: + description: >- + Lists CI/CD pipeline assets (GitHub Actions, GitLab CI, Jenkins, CircleCI, Buildkite, Azure Pipelines) with + optional filters. parameters: - description: The Azure organization ID in: query @@ -33429,6 +38726,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33474,17 +38782,65 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchStrategyInput' + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: repoId + schema: + nullable: true + type: string + - in: query + name: projectId + schema: + nullable: true + type: string + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchStrategyOutput' + $ref: '#/components/schemas/EndpointsListPipelinesAssetsOutput' description: OK '400': content: @@ -33498,28 +38854,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Patch Active Strategy - /manager/strategy/trigger: - post: - description: Trigger the strategy agent to generate a new security program strategy + summary: List Pipelines Assets + /context/asset-inventory/pipelines/{id}: + get: + description: Returns the full detail view of a single pipelines asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -33540,6 +38884,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33585,12 +38940,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsTriggerStrategyOutput' + $ref: '#/components/schemas/EndpointsGetPipelinesAssetOutput' description: OK '400': content: @@ -33610,28 +38970,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Trigger Strategy Generation - /manager/strategy/versions: + summary: Get Pipelines Asset + /context/asset-inventory/projects: get: - description: Get historical security program strategy versions in descending order. + description: >- + Lists repo-context project assets (per-path application units inside a repo) with optional filters. Returns the + table-view shape without per-sub_type details — fetch a single asset by ID for the detail view. parameters: - description: The Azure organization ID in: query @@ -33652,6 +39002,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33698,113 +39059,59 @@ paths: type: string type: array - in: query - name: page + name: subType schema: - type: integer + nullable: true + type: string - in: query - name: pageSize + name: provider schema: - type: integer - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsListStrategyVersionsOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: List Strategy Versions - /manager/tacit-knowledge/trigger: - post: - description: Trigger the tacit knowledge to process findings and generate customer questions - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId + nullable: true + type: string + - in: query + name: accountId schema: - description: The Azure organization ID + nullable: true type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId + - in: query + name: region schema: - description: The Bitbucket workspace ID + nullable: true type: string - - description: The Github owner ID - in: query - name: githubOwnerId + - in: query + name: active schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId + nullable: true + type: boolean + - in: query + name: publicFacing schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId + nullable: true + type: boolean + - in: query + name: internetReachable schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId + nullable: true + type: boolean + - in: query + name: repoId schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId + nullable: true + type: string + - in: query + name: nextToken schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId + type: string + - in: query + name: limit schema: - description: Filter by GitHub team ID - format: int64 type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsTriggerTacitKnowledgeOutput' + $ref: '#/components/schemas/EndpointsListProjectsAssetsOutput' description: OK '400': content: @@ -33818,34 +39125,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Trigger TacitKnowledge - /manager/threat-investigations: + summary: List Projects Assets + /context/asset-inventory/projects/{id}: get: - description: Returns a list of threat investigations detected by threat intelligence + description: Returns the full detail view of a single projects asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -33866,6 +39155,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -33911,22 +39211,17 @@ paths: items: type: string type: array - - in: query - name: page - schema: - default: 1 - type: integer - - in: query - name: pageSize + - in: path + name: id + required: true schema: - default: 20 - type: integer + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetThreatInvestigationsOutput' + $ref: '#/components/schemas/EndpointsGetProjectsAssetOutput' description: OK '400': content: @@ -33952,15 +39247,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Threat Investigations - post: - description: Create a new threat investigation in PENDING status + summary: Get Projects Asset + /context/asset-inventory/public: + get: + description: >- + Returns active assets across every category that are either intentionally public-facing OR reachable from the + public internet. Powers the AI bug-hunter / attack-surface query. parameters: - description: The Azure organization ID in: query @@ -33981,6 +39273,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34026,17 +39329,40 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostThreatInvestigationInput' + - in: query + name: category + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: policy + schema: + nullable: true + type: string + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostThreatInvestigationOutput' + $ref: '#/components/schemas/EndpointsListAssetInventoryOutput' description: OK '400': content: @@ -34056,16 +39382,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Post Threat Investigation - /manager/threat-investigations/{threatInvestigationId}: + summary: List Public Asset Inventory + /context/asset-inventory/repos: get: - description: Returns a single threat investigation with its events + description: >- + Lists source-code repository assets (GitHub, GitLab, Bitbucket, Azure Repos) with optional filters. Returns the + table-view shape without per-sub_type details — fetch a single asset by ID for the detail view. parameters: - description: The Azure organization ID in: query @@ -34086,6 +39408,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34131,17 +39464,55 @@ paths: items: type: string type: array - - in: path - name: threatInvestigationId - required: true + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider schema: + nullable: true type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetThreatInvestigationOutput' + $ref: '#/components/schemas/EndpointsListReposAssetsOutput' description: OK '400': content: @@ -34155,27 +39526,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Get Threat Investigation - patch: - description: Perform an action on a threat investigation (e.g. activate) + summary: List Repos Assets + /context/asset-inventory/repos/{id}: + get: + description: Returns the full detail view of a single repos asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -34196,6 +39556,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34242,21 +39613,16 @@ paths: type: string type: array - in: path - name: threatInvestigationId + name: id required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchThreatInvestigationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchThreatInvestigationOutput' + $ref: '#/components/schemas/EndpointsGetReposAssetOutput' description: OK '400': content: @@ -34282,16 +39648,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Patch Threat Investigation - /manager/trigger: - post: - description: Starts a Manager run for this tenant. + summary: Get Repos Asset + /context/asset-inventory/security: + get: + description: >- + Lists security assets (security groups, NACLs, WAF, KMS, Secrets Manager, ACM, GuardDuty, Config, CloudTrail) + with optional filters. parameters: - description: The Azure organization ID in: query @@ -34312,6 +39674,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34357,17 +39730,55 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsTriggerCampaignsOrchestratorInput' + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsTriggerCampaignsOrchestratorOutput' + $ref: '#/components/schemas/EndpointsListSecurityAssetsOutput' description: OK '400': content: @@ -34381,34 +39792,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Too Many Requests '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - '504': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Gateway Timeout - summary: Start a Manager run - /orchestrator/autofix/batch: - post: - description: Start a batch autofix step function to fix multiple findings + summary: List Security Assets + /context/asset-inventory/security/{id}: + get: + description: Returns the full detail view of a single security asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -34429,6 +39822,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34474,17 +39878,17 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostBatchAutofixInput' + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBatchAutofixOutput' + $ref: '#/components/schemas/EndpointsGetSecurityAssetOutput' description: OK '400': content: @@ -34492,16 +39896,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Start Batch Autofix - /orchestrator/autofix/batch/{executionId}: + summary: Get Security Asset + /context/asset-inventory/serverless: get: - description: Get the status of a batch autofix execution + description: >- + Lists serverless assets (Lambda, Step Functions, App Runner, Cloud Functions, Azure Functions) with optional + filters. parameters: - description: The Azure organization ID in: query @@ -34522,6 +39940,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34567,17 +39996,55 @@ paths: items: type: string type: array - - in: path - name: executionId - required: true + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region schema: + nullable: true type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetBatchAutofixStatusOutput' + $ref: '#/components/schemas/EndpointsListServerlessAssetsOutput' description: OK '400': content: @@ -34585,22 +40052,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '404': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Batch Autofix Status - /orchestrator/codereviews: + summary: List Serverless Assets + /context/asset-inventory/serverless/{id}: get: - description: Get the list of code reviews for the tenant + description: Returns the full detail view of a single serverless asset, including the per-sub_type details. parameters: - description: The Azure organization ID in: query @@ -34621,6 +40088,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34666,12 +40144,17 @@ paths: items: type: string type: array + - in: path + name: id + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCodeReviewsOutput' + $ref: '#/components/schemas/EndpointsGetServerlessAssetOutput' description: OK '400': content: @@ -34679,16 +40162,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Code Reviews - /orchestrator/codereviews/{id}: + summary: Get Serverless Asset + /context/asset-inventory/storage-and-backup: get: - description: Get a specific code review by ID + description: >- + Lists storage_and_backup assets (S3, EBS, EFS, Backup vaults, Storage Gateway, GCP/Azure storage equivalents) + with optional filters. parameters: - description: The Azure organization ID in: query @@ -34709,6 +40206,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34754,17 +40262,55 @@ paths: items: type: string type: array - - in: path - name: id - required: true + - in: query + name: subType + schema: + nullable: true + type: string + - in: query + name: provider + schema: + nullable: true + type: string + - in: query + name: accountId + schema: + nullable: true + type: string + - in: query + name: region + schema: + nullable: true + type: string + - in: query + name: active + schema: + nullable: true + type: boolean + - in: query + name: publicFacing + schema: + nullable: true + type: boolean + - in: query + name: internetReachable + schema: + nullable: true + type: boolean + - in: query + name: nextToken schema: type: string + - in: query + name: limit + schema: + type: integer responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetCodeReviewOutput' + $ref: '#/components/schemas/EndpointsListStorageAndBackupAssetsOutput' description: OK '400': content: @@ -34772,22 +40318,23 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Code Review - /orchestrator/findings/{findingID}/autofix-iterations: + summary: List Storage and Backup Assets + /context/asset-inventory/storage-and-backup/{id}: get: - description: Returns the autofix iteration timeline for a finding, oldest first. + description: Returns the full detail view of a single storage_and_backup asset, including the per-sub_type details. parameters: - - in: query - name: findingType - required: true - schema: - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -34807,6 +40354,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34853,7 +40411,7 @@ paths: type: string type: array - in: path - name: findingID + name: id required: true schema: type: string @@ -34862,7 +40420,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetFindingAutofixIterationsOutput' + $ref: '#/components/schemas/EndpointsGetStorageAndBackupAssetOutput' description: OK '400': content: @@ -34870,29 +40428,53 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '401': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Unauthorized - '403': + description: Forbidden + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding Autofix Iterations - /orchestrator/findings/retriage: - post: - description: Queue findings for retriage processing via Step Functions + summary: Get Storage and Backup Asset + /context/cicd-pipelines: + get: + description: Lists all CI/CD pipelines with optional filtering parameters: + - in: query + name: repositoryId + schema: + type: string + - in: query + name: projectId + schema: + type: string + - in: query + name: platform + schema: + type: string + - in: query + name: limit + schema: + type: integer + - in: query + name: nextToken + schema: + type: string + - in: query + name: includeDeleted + schema: + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -34912,6 +40494,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -34957,17 +40550,12 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsOutput' + $ref: '#/components/schemas/EndpointsListPipelinesOutput' description: OK '400': content: @@ -34981,10 +40569,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Retriage Findings - /orchestrator/onboarding/complete: - post: - description: Internal endpoint to mark onboarding as complete for testing purposes + summary: List CI/CD Pipelines + /context/cicd-pipelines/{pipelineId}: + delete: + description: Soft-delete a CI/CD pipeline parameters: - description: The Azure organization ID in: query @@ -35005,6 +40593,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35050,17 +40649,17 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsCompleteOnboardingInput' + - in: path + name: pipelineId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsCompleteOnboardingOutput' + $ref: '#/components/schemas/EndpointsDeletePipelineOutput' description: OK '400': content: @@ -35068,16 +40667,27 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Complete Onboarding (Test Only) - /orchestrator/onboarding/start: - post: - description: Start the onboarding pipeline for the tenant + summary: Delete CI/CD Pipeline + get: + description: Retrieves a single CI/CD pipeline by ID parameters: - description: The Azure organization ID in: query @@ -35098,6 +40708,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35143,17 +40764,17 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsStartOnboardingInput' + - in: path + name: pipelineId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsStartOnboardingOutput' + $ref: '#/components/schemas/EndpointsGetPipelineOutput' description: OK '400': content: @@ -35161,22 +40782,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '409': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Conflict + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Start Onboarding - /orchestrator/onboarding/status: - get: - description: Get the current onboarding status for the tenant + summary: Get CI/CD Pipeline + /context/cloud-connector-pr/runs: + post: + description: >- + Records an idempotent preparation request. An expired proposal requires expectedRunId and its exact digest. + GitHub is never changed by this endpoint. parameters: - description: The Azure organization ID in: query @@ -35197,6 +40820,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35242,67 +40876,49 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextStartCloudConnectorPRRunInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetOnboardingStatusOutput' + $ref: '#/components/schemas/EndpointsContextStartCloudConnectorPRRunOutput' description: OK - '400': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Onboarding Status - /sast/events: + summary: Start Cloud Connector PR Run + /context/cloud-connector-pr/runs/{runId}: get: - description: "Returns SAST events after a specified timestamp or event ID.\n\t\tAll events are returned if no timestamp or event ID is provided.\n\t\tA maximum of 100 events can be returned per request." + description: >- + Reports one cloud-connector-PR run started by POST /context/cloud-connector-pr/runs and the pull request it + opened. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: fromTime - schema: - nullable: true - type: string - - in: query - name: eventType - schema: - items: - type: string - type: array - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: findingId - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -35322,6 +40938,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35367,12 +40994,17 @@ paths: items: type: string type: array + - in: path + name: runId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTEventsOutput' + $ref: '#/components/schemas/EndpointsContextGetCloudConnectorPRRunOutput' description: OK '400': content: @@ -35386,122 +41018,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SAST Events - /sast/findings: - get: - description: Returns a filtered set of SAST findings based on query parameters + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Cloud Connector PR Run + /context/cloud-connector-pr/runs/{runId}/approve: + post: parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: priorityLabel - schema: - nullable: true - type: string - - in: query - name: severity - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: hasPullRequest - schema: - nullable: true - type: boolean - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - description: if not provided, all repositories will be included - in: query - name: repositoryIds - schema: - description: if not provided, all repositories will be included - items: - type: string - type: array - - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isArchived - schema: - nullable: true - type: boolean - - description: true = AI code-review only, false = rule-only, omitted = both - in: query - name: aiGenerated - schema: - description: true = AI code-review only, false = rule-only, omitted = both - nullable: true - type: boolean - - in: query - name: isLatest - schema: - nullable: true - type: boolean - - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - in: query - name: autoFixState - schema: - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - nullable: true - type: string - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -35521,6 +41059,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35566,35 +41115,50 @@ paths: items: type: string type: array + - in: path + name: runId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextApproveCloudConnectorProposalInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingsOutput' + $ref: '#/components/schemas/EndpointsContextApproveCloudConnectorProposalOutput' description: OK - '400': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + description: Forbidden + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SAST Findings - /sast/findings/{findingId}: + summary: Create approved AWS connector draft PR + /context/cloud-connector-pr/runs/{runId}/proposal: get: - description: Returns a given finding with explanation and impact parameters: - description: The Azure organization ID in: query @@ -35615,6 +41179,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35661,7 +41236,7 @@ paths: type: string type: array - in: path - name: findingId + name: runId required: true schema: type: string @@ -35670,35 +41245,29 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingOutput' + $ref: '#/components/schemas/EndpointsContextGetCloudConnectorProposalOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Not Found + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding - patch: - description: Update a given finding with the fields provided + summary: Review AWS connector proposal + /context/cloud-connector-pr/runs/{runId}/recover: + post: parameters: - description: The Azure organization ID in: query @@ -35719,6 +41288,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35765,7 +41345,7 @@ paths: type: string type: array - in: path - name: findingId + name: runId required: true schema: type: string @@ -35773,20 +41353,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSASTFindingInput' + $ref: '#/components/schemas/EndpointsContextRecoverCloudConnectorProposalInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSASTFindingOutput' + $ref: '#/components/schemas/EndpointsContextRecoverCloudConnectorProposalOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '403': content: application/json: @@ -35799,16 +41373,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Finding - /sast/findings/{findingId}/allowlist: - post: - description: Allowlists a finding + summary: Recover unresolved connector publication + /context/cloud-connector-pr/status: + get: + description: >- + Returns read-only readiness, the current preparation and the independent saved PR. Does not survey code or start + work. parameters: - description: The Azure organization ID in: query @@ -35829,6 +41411,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35874,64 +41467,30 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSASTFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSASTFindingOutput' + $ref: '#/components/schemas/EndpointsContextGetCloudConnectorPRStatusOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Finding - /sast/findings/{findingId}/autofix/activity: + summary: Get Cloud Connector PR Status + /context/cloud-recon/accounts/{accountId}/cross-account-relationships: get: - description: >- - Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` - defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen - (use the `nextCursor` value from a prior response). + description: Returns the cross-account trust relationships identified in the latest cloud_recon scan for an account parameters: - - in: query - name: since_id - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -35951,6 +41510,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -35997,7 +41567,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -36006,7 +41576,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconCrossAccountRelationshipsOutput' description: OK '400': content: @@ -36032,10 +41602,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SAST Finding Autofix Activity - /sast/findings/{findingId}/autofix/cache/diff: + summary: Get Cloud Recon Cross-Account Relationships + /context/cloud-recon/accounts/{accountId}/discovered-nodes: get: - description: Gets the git diffs for a finding's proposed autofix + description: >- + Returns graph nodes from the latest cloud_recon scan, filterable by object type and source (use + source='cloudrecon' to get prescan additions only) parameters: - description: The Azure organization ID in: query @@ -36056,6 +41628,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36101,127 +41684,33 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingFixOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Finding Autofix Diff - /sast/findings/{findingId}/autofix/fix: - post: - description: Creates a pull request to fix a given finding - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId + - in: query + name: objectType schema: - description: The Azure organization ID type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId + - in: query + name: source schema: - description: The Bitbucket workspace ID type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId + - in: query + name: limit schema: - description: The GitLab group ID - format: int64 type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId + - in: query + name: offset schema: - description: Filter by GitHub team ID - format: int64 type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - in: path - name: findingId + name: accountId required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAutofixSASTFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAutofixSASTFindingOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconDiscoveredNodesOutput' description: OK '400': content: @@ -36235,30 +41724,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Post Finding AutoFix - /sast/findings/{findingId}/autofix/state: + summary: Get Cloud Recon Discovered Nodes + /context/cloud-recon/accounts/{accountId}/graph-gaps: get: description: >- - Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; - the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + Returns the discovery gaps (unresolved or unobserved areas) recorded in the latest cloud_recon scan for an + account parameters: - description: The Azure organization ID in: query @@ -36279,6 +41756,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36325,7 +41813,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -36334,7 +41822,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingAutofixStateOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconGraphGapsOutput' description: OK '400': content: @@ -36360,10 +41848,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SAST Finding Autofix State - /sast/findings/{findingId}/autofix/status: + summary: Get Cloud Recon Graph Gaps + /context/cloud-recon/accounts/{accountId}/hotspots: get: - description: Lightweight per-finding autofix lifecycle status for UI polling. + description: Returns hotspots from the latest completed cloud_recon scan parameters: - description: The Azure organization ID in: query @@ -36384,6 +41872,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36429,8 +41928,20 @@ paths: items: type: string type: array + - in: query + name: severity + schema: + type: string + - in: query + name: limit + schema: + type: integer + - in: query + name: offset + schema: + type: integer - in: path - name: findingId + name: accountId required: true schema: type: string @@ -36439,7 +41950,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingAutofixStatusOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconHotspotsOutput' description: OK '400': content: @@ -36453,22 +41964,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SAST Finding Autofix Status - /sast/findings/{findingId}/events: + summary: Get Cloud Recon Hotspots + /context/cloud-recon/accounts/{accountId}/iam-posture: get: - description: Returns a list of events for a given finding. + description: Returns the IAM posture rollup from the latest cloud_recon scan for an account parameters: - description: The Azure organization ID in: query @@ -36489,6 +41994,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36535,7 +42051,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -36544,7 +42060,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingEventsOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconIamPostureOutput' description: OK '400': content: @@ -36570,10 +42086,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding Events - /sast/findings/{findingId}/ticket: - post: - description: Creates a ticket (Jira or Linear) for a given finding + summary: Get Cloud Recon IAM Posture + /context/cloud-recon/accounts/{accountId}/network-exposures: + get: + description: >- + Returns the network exposures (open ports, permissive CIDRs) identified in the latest cloud_recon scan for an + account parameters: - description: The Azure organization ID in: query @@ -36594,6 +42112,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36639,24 +42168,17 @@ paths: items: type: string type: array - - description: The ID of the finding to create a Jira ticket for - in: path - name: findingId + - in: path + name: accountId required: true schema: - description: The ID of the finding to create a Jira ticket for type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSASTFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSASTFindingOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconNetworkExposuresOutput' description: OK '400': content: @@ -36682,10 +42204,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Ticket - /sast/findings/{findingId}/triage: + summary: Get Cloud Recon Network Exposures + /context/cloud-recon/accounts/{accountId}/overview: get: - description: Returns the triage data for a specific finding + description: Returns the per-account summary, coverage status, and infrastructure rollup from the latest cloud_recon scan parameters: - description: The Azure organization ID in: query @@ -36706,6 +42228,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36752,7 +42285,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -36761,7 +42294,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingTriageOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconAccountOverviewOutput' description: OK '400': content: @@ -36787,10 +42320,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Triaged Finding - /sast/findings/{findingId}/unallowlist: - post: - description: Unallowlists a finding + summary: Get Cloud Recon Account Overview + /context/cloud-recon/accounts/{accountId}/scans/latest: + get: + description: Returns the latest completed cloud_recon scan metadata for an account parameters: - description: The Azure organization ID in: query @@ -36811,6 +42344,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36856,19 +42400,22 @@ paths: items: type: string type: array + - in: query + name: scanId + schema: + type: string - in: path - name: findingId + name: accountId required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostUnallowlistSASTFindingInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetLatestCloudReconScanOutput' + description: OK '400': content: application/json: @@ -36893,10 +42440,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Unallowlist Finding - /sast/findings/{findingId}/users: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Latest Cloud Recon Scan + /context/cloud-recon/accounts/{accountId}/security-boundaries: get: - description: Returns the users associated with a specific finding + description: Returns the security boundaries identified in the latest cloud_recon scan for an account parameters: - description: The Azure organization ID in: query @@ -36917,6 +42470,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -36963,7 +42527,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -36972,7 +42536,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingUsersOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconSecurityBoundariesOutput' description: OK '400': content: @@ -36998,10 +42562,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding Users - /sast/findings/allowlist: - post: - description: Allowlist a list of SAST findings, by findingsID + summary: Get Cloud Recon Security Boundaries + /context/cloud-recon/accounts/{accountId}/synthesis/latest: + get: + description: >- + Returns the full CloudRecon artifact (summary, infrastructure summary, security boundaries, trusted services, + traffic flows, mermaid diagram, hotspots, graph gaps) from the latest scan for an account parameters: - description: The Azure organization ID in: query @@ -37022,6 +42588,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -37067,14 +42644,22 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowListSASTFindingBatchInput' + - in: query + name: scanId + schema: + type: string + - in: path + name: accountId + required: true + schema: + type: string responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCloudReconAccountSynthesisOutput' + description: OK '400': content: application/json: @@ -37099,101 +42684,19 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Batch of SAST Findings - /sast/findings/detailed: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Latest Cloud Recon Account Synthesis + /context/cloud-recon/accounts/{accountId}/topology: get: - description: Returns current SAST findings in default branches + description: >- + Returns the per-account mermaid topology diagram plus the full discovered node/edge counts from the latest + cloud_recon scan parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: priorityLabel - schema: - nullable: true - type: string - - in: query - name: severity - schema: - nullable: true - type: string - - in: query - name: language - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: hasPullRequest - schema: - nullable: true - type: boolean - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isArchived - schema: - nullable: true - type: boolean - - description: true = AI code-review only, false = rule-only, omitted = both - in: query - name: aiGenerated - schema: - description: true = AI code-review only, false = rule-only, omitted = both - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -37213,6 +42716,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -37258,12 +42772,17 @@ paths: items: type: string type: array + - in: path + name: accountId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingsDetailedOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconTopologyOutput' description: OK '400': content: @@ -37277,122 +42796,23 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Findings Detailed - /sast/findings/preview: + summary: Get Cloud Recon Topology + /context/cloud-recon/accounts/{accountId}/traffic-flows: get: - description: Returns a filtered set of SAST findings based on query parameters + description: Returns the major traffic flows identified in the latest cloud_recon scan for an account parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: priorityLabel - schema: - nullable: true - type: string - - in: query - name: severity - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: hasPullRequest - schema: - nullable: true - type: boolean - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - description: if not provided, all repositories will be included - in: query - name: repositoryIds - schema: - description: if not provided, all repositories will be included - items: - type: string - type: array - - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isArchived - schema: - nullable: true - type: boolean - - description: true = AI code-review only, false = rule-only, omitted = both - in: query - name: aiGenerated - schema: - description: true = AI code-review only, false = rule-only, omitted = both - nullable: true - type: boolean - - in: query - name: isLatest - schema: - nullable: true - type: boolean - - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - in: query - name: autoFixState - schema: - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - nullable: true - type: string - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -37412,6 +42832,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -37457,12 +42888,17 @@ paths: items: type: string type: array + - in: path + name: accountId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTFindingsOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconTrafficFlowsOutput' description: OK '400': content: @@ -37476,29 +42912,25 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SAST Findings - /sast/repositories: + summary: Get Cloud Recon Traffic Flows + /context/cloud-recon/accounts/{accountId}/trusted-services: get: description: >- - Returns a map of repository stats. The map is sorted by repositoryID and contains a list of repository stats for - each repositoryID. + Returns the trusted services (data stores, managed services) identified in the latest cloud_recon scan for an + account parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -37518,6 +42950,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -37563,12 +43006,17 @@ paths: items: type: string type: array + - in: path + name: accountId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTRepositoriesOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconTrustedServicesOutput' description: OK '400': content: @@ -37582,18 +43030,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repositories - /sast/repositories/{repositoryId}: + summary: Get Cloud Recon Trusted Services + /context/cloud-recon/organization/synthesis/latest: get: description: >- - Returns a sorted map of repository stats. The map is sorted by repositoryID and contains a list of repository - stats for each repositoryID. + Returns the latest completed org-level cloud_recon synthesis (combined summary, mermaid diagram, cross-account + correlations) for the tenant parameters: - description: The Azure organization ID in: query @@ -37614,6 +43068,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -37659,9 +43124,8 @@ paths: items: type: string type: array - - in: path - name: repositoryId - required: true + - in: query + name: scanRunId schema: type: string responses: @@ -37669,7 +43133,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSASTRepositoryOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconOrgSynthesisOutput' description: OK '400': content: @@ -37695,41 +43159,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repository Stats - /sast/scan-runs: - get: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Latest Cloud Recon Org Synthesis + /context/cloud-recon/scans: + post: + description: Persist a completed cloud_recon scan parameters: - - description: Repository ID to list scan runs for - in: query - name: repositoryId - required: true - schema: - description: Repository ID to list scan runs for - type: string - - description: Max scan runs per page (default 10, max 50) - in: query - name: limit - schema: - description: Max scan runs per page (default 10, max 50) - nullable: true - type: integer - - description: Pagination offset (default 0) - in: query - name: offset - schema: - description: Pagination offset (default 0) - nullable: true - type: integer - - description: Sort order by start time (default newest) - in: query - name: sort - schema: - description: Sort order by start time (default newest) - enum: - - newest - - oldest - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -37749,6 +43189,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -37794,12 +43245,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCloudReconScanInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetScanRunsOutput' + $ref: '#/components/schemas/EndpointsPostCloudReconScanOutput' description: OK '400': content: @@ -37819,81 +43275,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Scan Runs - /sca/containers/findings: + summary: Persist Cloud Recon Scan + /context/cloud-recon/tenants/cross-account-trusts: get: - description: Returns a filtered set of SCA container findings based on query parameters + description: Returns every external principal trusted by 2+ accounts in the tenant (latest scans only) parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: package - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - description: combination of isFixed, isFalsePositive and isAllowlisted - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive and isAllowlisted - nullable: true - type: boolean - - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - in: query - name: autoFixState - schema: - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - nullable: true - type: string - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -37913,6 +43299,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -37963,14 +43360,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingsOutput' + $ref: '#/components/schemas/EndpointsGetCloudReconTenantTrustsOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request '403': content: application/json: @@ -37983,10 +43374,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Container Findings - /sca/containers/findings/{findingId}: + summary: Get Tenant Cloud Recon Cross-Account Trusts + /context/cloud-scan/{scanId}/status: get: - description: Returns a given finding + description: >- + Returns the aggregated status of a cloud-scan across every provider the tenant scanned (AWS, Azure, GCP, + Kubernetes). parameters: - description: The Azure organization ID in: query @@ -38007,6 +43400,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38053,7 +43457,7 @@ paths: type: string type: array - in: path - name: findingId + name: scanId required: true schema: type: string @@ -38062,7 +43466,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingOutput' + $ref: '#/components/schemas/EndpointsContextGetCloudScanStatusOutput' description: OK '400': content: @@ -38070,12 +43474,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Unauthorized '404': content: application/json: @@ -38088,9 +43492,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Container Finding - patch: - description: Update a given finding with the fields provided + summary: Get Cloud Scan Status + /context/cloud-scan/start: + post: + description: Starts an asynchronous scan of every cloud integration the calling tenant has installed. parameters: - description: The Azure organization ID in: query @@ -38111,6 +43516,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38156,51 +43572,79 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - description: Scan only this integration (AWS, AZURE, GCP or K8S). Every installed integration is scanned when omitted. + in: query + name: provider schema: + description: Scan only this integration (AWS, AZURE, GCP or K8S). Every installed integration is scanned when omitted. + enum: + - AWS + - AZURE + - GCP + - K8S type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchSCAContainerFindingInput' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchSCAContainerFindingOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + - description: >- + Managed Kubernetes cluster scan identities or admin cluster IDs to scan. Repeat the parameter for each + cluster. Requires provider K8S. + in: query + name: clusterIds + schema: + description: >- + Managed Kubernetes cluster scan identities or admin cluster IDs to scan. Repeat the parameter for each + cluster. Requires provider K8S. + items: + type: string + type: array + - description: >- + Scan only these accounts (AWS), subscriptions (Azure), projects (GCP) or cluster ids (K8S) instead of every + one the provider resolves. Repeat the parameter for each account. Requires provider. + in: query + name: accountIds + schema: + description: >- + Scan only these accounts (AWS), subscriptions (Azure), projects (GCP) or cluster ids (K8S) instead of + every one the provider resolves. Repeat the parameter for each account. Requires provider. + items: + type: string + type: array + - description: Rebuild the infrastructure graph once the scan completes. Defaults to false. + in: query + name: rebuildInfraGraph + schema: + description: Rebuild the infrastructure graph once the scan completes. Defaults to false. + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextStartCloudScanOutput' + description: OK + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Bad Request + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Container Finding - /sca/containers/findings/{findingId}/allowlist: - post: - description: Allowlist a container finding and record reason + summary: Start Cloud Scan + /context/deps: + delete: + description: >- + Deletes dependency occurrence records. Scope is inferred from query parameters: single entry + (repo+project+ecosystem+name+version+introducedAt), project-wide (repo+project), or tenant-wide (no selectors, + global=true). parameters: - description: The Azure organization ID in: query @@ -38221,6 +43665,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38266,19 +43721,48 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: repositoryId schema: + nullable: true type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSCAContainerFindingInput' + - in: query + name: projectId + schema: + nullable: true + type: string + - in: query + name: ecosystem + schema: + nullable: true + type: string + - in: query + name: name + schema: + nullable: true + type: string + - in: query + name: version + schema: + nullable: true + type: string + - in: query + name: introducedAt + schema: + nullable: true + type: string + - in: query + name: global + schema: + nullable: true + type: boolean responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteDepsOutput' + description: OK '400': content: application/json: @@ -38291,35 +43775,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Container Finding - /sca/containers/findings/{findingId}/autofix/activity: + summary: Delete dependency data get: - description: >- - Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` - defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen - (use the `nextCursor` value from a prior response). + description: Returns dependency history across all repositories/projects. parameters: - - in: query - name: since_id - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -38339,6 +43804,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38384,9 +43860,13 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: pageSize + schema: + format: int32 + type: integer + - in: query + name: cursor schema: type: string responses: @@ -38394,7 +43874,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + $ref: '#/components/schemas/EndpointsGetDepsOutput' description: OK '400': content: @@ -38408,22 +43888,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Container Finding Autofix Activity - /sca/containers/findings/{findingId}/autofix/fix: - post: - description: Raises fix PRs for existing container findings given their IDs + summary: List Tenant Wide Dependencies (Historical) + /context/deps/active: + get: + description: Returns dependencies that are active across all repositories/projects. parameters: - description: The Azure organization ID in: query @@ -38444,6 +43918,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38489,22 +43974,50 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: pageSize + schema: + format: int32 + type: integer + - in: query + name: cursor + schema: + type: string + - in: query + name: search + schema: + type: string + - in: query + name: ecosystem + schema: + type: string + - in: query + name: name + schema: + type: string + - in: query + name: direct + schema: + nullable: true + type: boolean + - in: query + name: repositoryId + schema: + type: string + - in: query + name: projectId + schema: + type: string + - in: query + name: range schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostSCAContainerFindingFixInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostSCAContainerFindingFixOutput' + $ref: '#/components/schemas/EndpointsGetActiveDepsOutput' description: OK '400': content: @@ -38518,24 +44031,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Fix Container Findings - /sca/containers/findings/{findingId}/autofix/state: + summary: List Tenant Wide Active Dependencies + /context/deps/active/summary: get: - description: >- - Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; - the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + description: Returns aggregate counts and the oldest active dependency across all repositories/projects, search-aware. parameters: - description: The Azure organization ID in: query @@ -38556,6 +44061,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38601,9 +44117,33 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: search + schema: + type: string + - in: query + name: ecosystem + schema: + type: string + - in: query + name: name + schema: + type: string + - in: query + name: direct + schema: + nullable: true + type: boolean + - in: query + name: repositoryId + schema: + type: string + - in: query + name: projectId + schema: + type: string + - in: query + name: range schema: type: string responses: @@ -38611,7 +44151,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingAutofixStateOutput' + $ref: '#/components/schemas/EndpointsGetActiveDepsSummaryOutput' description: OK '400': content: @@ -38625,22 +44165,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Container Finding Autofix State - /sca/containers/findings/{findingId}/autofix/status: + summary: Tenant Wide Active Dependency Summary + /context/deps/by-ref/{bomRef}: get: - description: Lightweight per-finding autofix lifecycle status for UI polling. + description: >- + Returns active dependency occurrences whose SBOM bom-ref matches. A bom-ref is unique within a project but can + repeat across projects, so the result is a list. parameters: - description: The Azure organization ID in: query @@ -38661,6 +44197,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38706,8 +44253,17 @@ paths: items: type: string type: array + - in: query + name: pageSize + schema: + format: int32 + type: integer + - in: query + name: cursor + schema: + type: string - in: path - name: findingId + name: bomRef required: true schema: type: string @@ -38716,7 +44272,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingAutofixStatusOutput' + $ref: '#/components/schemas/EndpointsGetDepsByBomRefOutput' description: OK '400': content: @@ -38730,22 +44286,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Container Finding Autofix Status - /sca/containers/findings/{findingId}/events: + summary: Get Dependencies by Bom Ref + /context/deps/dependents/{bomRef}: get: - description: Returns a list of events for a given finding. + description: >- + Returns active dependency occurrences whose parent chain includes the given bom-ref. Walk recursively to + traverse the downstream dependency subtree. parameters: - description: The Azure organization ID in: query @@ -38766,6 +44318,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38811,8 +44374,17 @@ paths: items: type: string type: array + - in: query + name: pageSize + schema: + format: int32 + type: integer + - in: query + name: cursor + schema: + type: string - in: path - name: findingId + name: bomRef required: true schema: type: string @@ -38821,7 +44393,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingEventsOutput' + $ref: '#/components/schemas/EndpointsGetDepsDependentsOutput' description: OK '400': content: @@ -38835,22 +44407,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Container Finding Events - /sca/containers/findings/{findingId}/ticket: - post: - description: Creates a Jira ticket for a given container finding + summary: List Dependents of a Bom Ref + /context/deps/exposure: + get: + description: Returns exposure windows across all repositories/projects intersecting a version filter (server-side filtering). parameters: - description: The Azure organization ID in: query @@ -38871,6 +44437,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -38916,22 +44493,24 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: ecosystem + schema: + type: string + - in: query + name: name + schema: + type: string + - in: query + name: range schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketDependencyFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketDependencyFindingOutput' + $ref: '#/components/schemas/EndpointsGetExposureOutput' description: OK '400': content: @@ -38945,22 +44524,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Jira Ticket - /sca/containers/findings/{findingId}/triage: + summary: Global package exposure by version filter (semver or hash) + /context/deps/repository/{repositoryId}/project/{projectId}/active: get: - description: Returns the triage data for a specific finding + description: Returns dependencies that are active for the latest commit. parameters: - description: The Azure organization ID in: query @@ -38981,6 +44554,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39026,8 +44610,26 @@ paths: items: type: string type: array + - in: query + name: search + schema: + type: string + - in: query + name: ecosystem + schema: + type: string + - in: query + name: direct + schema: + nullable: true + type: boolean - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string @@ -39036,7 +44638,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingTriageOutput' + $ref: '#/components/schemas/EndpointsGetProjectActiveDepsOutput' description: OK '400': content: @@ -39050,22 +44652,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Triaged Finding - /sca/containers/findings/{findingId}/unallowlist: - post: - description: Unallowlist a container finding and record reason + summary: List Active Dependencies + /context/deps/repository/{repositoryId}/project/{projectId}/at/{commit}: + get: + description: Returns dependencies exposed at the specified commit (resolved to commit timestamp). parameters: - description: The Azure organization ID in: query @@ -39086,6 +44682,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39132,18 +44739,27 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string + - in: path + name: commit required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostUnallowlistSCAContainerFindingInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDepsAtCommitOutput' + description: OK '400': content: application/json: @@ -39156,22 +44772,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Unallowlist Container Finding - /sca/containers/findings/{findingId}/users: + summary: Dependencies at commit + /context/deps/repository/{repositoryId}/project/{projectId}/diff: get: - description: Returns the users related to a given finding based on git history + description: >- + Computes added, removed, upgraded, and downgraded packages by comparing dependency snapshots at the two commit + timestamps. parameters: - description: The Azure organization ID in: query @@ -39192,6 +44804,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39237,8 +44860,23 @@ paths: items: type: string type: array + - in: query + name: fromCommit + schema: + nullable: true + type: string + - in: query + name: toCommit + schema: + nullable: true + type: string - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string @@ -39247,7 +44885,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingUsersOutput' + $ref: '#/components/schemas/EndpointsGetDepsDiffOutput' description: OK '400': content: @@ -39273,74 +44911,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding Related Users - /sca/containers/findings/detailed: + summary: Dependency diff between two commits + /context/deps/repository/{repositoryId}/project/{projectId}/exposure: get: - description: Returns current SCA container findings in default branches based on query parameters + description: Returns exposure windows for a repo/project intersecting a version filter (server-side filtering). parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: package - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - description: combination of isFixed, isFalsePositive and isAllowlisted - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive and isAllowlisted - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -39360,6 +44935,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39405,12 +44991,34 @@ paths: items: type: string type: array + - in: query + name: ecosystem + schema: + type: string + - in: query + name: name + schema: + type: string + - in: query + name: range + schema: + type: string + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingsDetailedOutput' + $ref: '#/components/schemas/EndpointsGetProjectExposureOutput' description: OK '400': content: @@ -39430,81 +45038,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Container Findings [DEPRECATED - TO BE REMOVED BY 2025] - /sca/containers/findings/preview: + summary: Project package exposure by version filter (semver or hash) + /context/deps/repository/{repositoryId}/project/{projectId}/history: get: - description: Returns a filtered set of SCA container findings based on query parameters + description: Returns exposure windows for a given package (ecosystem+name), grouped by version. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: package - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - description: combination of isFixed, isFalsePositive and isAllowlisted - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive and isAllowlisted - nullable: true - type: boolean - - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - in: query - name: autoFixState - schema: - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - nullable: true - type: string - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -39524,6 +45062,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39569,12 +45118,30 @@ paths: items: type: string type: array + - in: query + name: ecosystem + schema: + type: string + - in: query + name: name + schema: + type: string + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAContainerFindingsOutput' + $ref: '#/components/schemas/EndpointsGetDepsHistoryOut' description: OK '400': content: @@ -39594,81 +45161,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Container Findings Preview - /sca/dependencies/findings: + summary: Package exposure history (windows) + /context/deps/without-lockfile: get: - description: Returns a filtered set of SCA dependency findings based on query parameters + description: >- + Returns projects or repositories whose dependencies were resolved without a committed lockfile. These are at + higher risk during supply chain incidents. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: package - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - description: combination of isFixed, isFalsePositive and isAllowlisted - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive and isAllowlisted - nullable: true - type: boolean - - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - in: query - name: autoFixState - schema: - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - nullable: true - type: string - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -39688,6 +45187,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39733,12 +45243,16 @@ paths: items: type: string type: array + - in: query + name: level + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingsOutput' + $ref: '#/components/schemas/EndpointsGetDepsWithoutLockfileOutput' description: OK '400': content: @@ -39758,11 +45272,35 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Dependency Findings - /sca/dependencies/findings/{findingId}: + summary: List projects/repos without lockfiles + /context/entrypoints: get: - description: Returns a given finding + description: Lists all application entrypoints with optional filtering parameters: + - in: query + name: repositoryId + schema: + type: string + - in: query + name: projectId + schema: + type: string + - in: query + name: kind + schema: + type: string + - in: query + name: limit + schema: + type: integer + - in: query + name: nextToken + schema: + type: string + - in: query + name: includeDeleted + schema: + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -39782,6 +45320,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39827,17 +45376,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingOutput' + $ref: '#/components/schemas/EndpointsListEntrypointsOutput' description: OK '400': content: @@ -39845,27 +45389,16 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding - patch: - description: Update a given finding with the fields provided + summary: List Entrypoints + /context/entrypoints/{entrypointId}: + delete: + description: Soft-delete an entrypoint parameters: - description: The Azure organization ID in: query @@ -39886,6 +45419,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -39932,21 +45476,16 @@ paths: type: string type: array - in: path - name: findingId + name: entrypointId required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchSCADependencyFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSCADependencyFindingOutput' + $ref: '#/components/schemas/EndpointsDeleteEntrypointOutput' description: OK '400': content: @@ -39972,10 +45511,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Dependencies Finding - /sca/dependencies/findings/{findingId}/allowlist: - post: - description: Allowlist a dependency finding and record reason + summary: Delete Entrypoint + get: + description: Retrieves a single application entrypoint by ID parameters: - description: The Azure organization ID in: query @@ -39996,6 +45534,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40042,30 +45591,23 @@ paths: type: string type: array - in: path - name: findingId + name: entrypointId required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSCADependencyFindingInput' responses: - '204': - description: No Content - '400': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + $ref: '#/components/schemas/EndpointsGetEntrypointOutput' + description: OK + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Bad Request '404': content: application/json: @@ -40078,23 +45620,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Dependency Finding - /sca/dependencies/findings/{findingId}/autofix/activity: + summary: Get Entrypoint + /context/infrastructure/graphs: get: - description: >- - Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` - defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen - (use the `nextCursor` value from a prior response). + description: Lists all infrastructure graphs for the tenant parameters: - - in: query - name: since_id - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -40114,6 +45644,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40159,17 +45700,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + $ref: '#/components/schemas/EndpointsListInfrastructureGraphsOutput' description: OK '400': content: @@ -40177,28 +45713,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Service Unavailable + '504': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get SCA Dependency Finding Autofix Activity - /sca/dependencies/findings/{findingId}/autofix/cache/diff: + description: Gateway Timeout + summary: List Infrastructure Graphs + /context/infrastructure/graphs/{accountId}: get: - description: Gets the git diffs for a finding's proposed fix + description: >- + Retrieves the latest infrastructure graph. Oversized graphs return 412 graph_requires_download; use the account + download endpoint for the complete graph. parameters: - description: The Azure organization ID in: query @@ -40219,6 +45757,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40265,7 +45814,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -40274,7 +45823,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingFixOutput' + $ref: '#/components/schemas/EndpointsGetInfrastructureGraphOutput' description: OK '400': content: @@ -40282,135 +45831,49 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get SCA Dependency Finding Fix - /sca/dependencies/findings/{findingId}/autofix/fix: - post: - description: Raises fix PRs for existing dependency finding given its ID - parameters: - - description: The Azure organization ID - in: query - name: azureOrganizationId - schema: - description: The Azure organization ID - type: string - - description: The Bitbucket workspace ID - in: query - name: bitbucketWorkspaceId - schema: - description: The Bitbucket workspace ID - type: string - - description: The Github owner ID - in: query - name: githubOwnerId - schema: - description: The Github owner ID - format: int64 - type: integer - - description: The GitLab group ID - in: query - name: gitlabGroupId - schema: - description: The GitLab group ID - format: int64 - type: integer - - description: The Nullify installation ID - in: query - name: installationId - schema: - description: The Nullify installation ID - type: string - - description: Filter by Azure repository IDs - in: query - name: azureRepositoryId - schema: - description: Filter by Azure repository IDs - items: - type: string - type: array - - description: Filter by GitHub repository IDs - in: query - name: githubRepositoryId - schema: - description: Filter by GitHub repository IDs - items: - format: int64 - type: integer - type: array - - description: Filter by GitHub team ID - in: query - name: githubTeamId - schema: - description: Filter by GitHub team ID - format: int64 - type: integer - - description: Filter by Bitbucket repository IDs - in: query - name: bitbucketRepositoryId - schema: - description: Filter by Bitbucket repository IDs - items: - type: string - type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostSCADependencyFindingFixInput' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostSCADependencyFindingFixOutput' - description: OK - '400': + description: Not Found + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + description: Precondition Failed + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '409': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Conflict - '500': + description: Service Unavailable + '504': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Fix Dependency Finding - /sca/dependencies/findings/{findingId}/autofix/state: + description: Gateway Timeout + summary: Get Infrastructure Graph + /context/infrastructure/graphs/{accountId}/download: get: description: >- - Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; - the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + Generates a presigned URL to download the complete infrastructure graph, optionally selecting an exact snapshot + version. The object is raw graph JSON without the inline response wrapper. parameters: + - description: Graph snapshot version; defaults to latest + in: query + name: version + schema: + description: Graph snapshot version; defaults to latest + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -40430,6 +45893,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40476,7 +45950,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -40485,7 +45959,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingAutofixStateOutput' + $ref: '#/components/schemas/EndpointsGetInfrastructureGraphDownloadOutput' description: OK '400': content: @@ -40493,12 +45967,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -40511,10 +45979,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Dependency Finding Autofix State - /sca/dependencies/findings/{findingId}/autofix/status: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Infrastructure Graph Download URL + /context/infrastructure/graphs/{accountId}/versions: get: - description: Lightweight per-finding autofix lifecycle status for UI polling. + description: Lists all versions of an infrastructure graph for a specific AWS account parameters: - description: The Azure organization ID in: query @@ -40535,6 +46015,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40581,7 +46072,7 @@ paths: type: string type: array - in: path - name: findingId + name: accountId required: true schema: type: string @@ -40590,7 +46081,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingAutofixStatusOutput' + $ref: '#/components/schemas/EndpointsListInfrastructureGraphVersionsOutput' description: OK '400': content: @@ -40598,12 +46089,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -40616,10 +46101,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Dependency Finding Autofix Status - /sca/dependencies/findings/{findingId}/events: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: List Infrastructure Graph Versions + /context/infrastructure/graphs/{accountId}/versions/{version}: get: - description: Returns a list of events for a given finding. + description: >- + Retrieves a specific graph version. Oversized graphs return 412 graph_requires_download; use the account + download endpoint with the same version query parameter. parameters: - description: The Azure organization ID in: query @@ -40640,6 +46139,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40686,7 +46196,12 @@ paths: type: string type: array - in: path - name: findingId + name: accountId + required: true + schema: + type: string + - in: path + name: version required: true schema: type: string @@ -40695,7 +46210,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingEventsOutput' + $ref: '#/components/schemas/EndpointsGetInfrastructureGraphVersionOutput' description: OK '400': content: @@ -40703,28 +46218,40 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Not Found + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Dependency Finding Events - /sca/dependencies/findings/{findingId}/ticket: - post: - description: Creates a Jira ticket for a given finding + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Infrastructure Graph Version + /context/infrastructure/graphs/info: + get: + description: Retrieves comprehensive statistics and metadata about all infrastructure graphs parameters: - description: The Azure organization ID in: query @@ -40745,6 +46272,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40790,22 +46328,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketDependencyFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketDependencyFindingOutput' + $ref: '#/components/schemas/EndpointsInfrastructureGraphInfo' description: OK '400': content: @@ -40813,12 +46341,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -40831,10 +46353,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Jira Ticket - /sca/dependencies/findings/{findingId}/triage: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Infrastructure Graph Info + /context/infrastructure/graphs/summary: get: - description: Returns the triage data for a specific finding + description: Retrieves infrastructure graph summary with presigned download URLs for each account's graph parameters: - description: The Azure organization ID in: query @@ -40855,6 +46389,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -40900,17 +46445,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingTriageOutput' + $ref: '#/components/schemas/EndpointsGetInfrastructureGraphSummaryOutput' description: OK '400': content: @@ -40918,28 +46458,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Service Unavailable + '504': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Triaged Finding - /sca/dependencies/findings/{findingId}/unallowlist: - post: - description: Unallowlist a dependency finding and record reason + description: Gateway Timeout + summary: Get Infrastructure Graph Summary + /context/k8s/collector-clusters: + get: + description: >- + Lists the in-cluster Kubernetes collectors feeding the asset inventory that have no admin cluster registration, + each with its latest completed scan. parameters: - description: The Azure organization ID in: query @@ -40960,6 +46502,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -41005,47 +46558,37 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostUnallowlistSCADependencyFindingInput' responses: - '204': - description: No Content - '400': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request + $ref: '#/components/schemas/EndpointsListK8SCollectorClustersOutput' + description: OK '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Unallowlist Dependency Finding - /sca/dependencies/findings/{findingId}/users: + description: Service Unavailable + summary: List K8s Collector Clusters + /context/memories: get: - description: Returns the users related to a given finding based on git history + description: >- + Query memories with flexible filtering. Memories are first-class resources that can be associated with various + resource types. parameters: - description: The Azure organization ID in: query @@ -41066,6 +46609,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -41111,110 +46665,119 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - description: Filter by resource ID (e.g., document ID, finding ID) + in: query + name: resourceId schema: + description: Filter by resource ID (e.g., document ID, finding ID) + nullable: true type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingUsersOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get Finding Related Users - /sca/dependencies/findings/detailed: - get: - description: Returns current SCA findings in default branches based on query parameters - parameters: - - in: query - name: nextToken + - description: Filter by resource type (e.g., 'document', 'finding', 'chat') + in: query + name: resourceType schema: + description: Filter by resource type (e.g., 'document', 'finding', 'chat') nullable: true type: string - - in: query - name: limit + - description: Filter by memory type + in: query + name: memoryType schema: + description: Filter by memory type nullable: true - type: integer - - in: query - name: package + type: string + - description: Filter by priority level + in: query + name: priority schema: + description: Filter by priority level nullable: true type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: branch + - description: Filter for latest memories only + in: query + name: isLatest schema: + description: Filter for latest memories only nullable: true - type: string - - in: query - name: workflow + type: boolean + - description: Filter by cognitive class (episodic, semantic, procedural, prospective, retrieval) + in: query + name: memoryClass schema: + description: Filter by cognitive class (episodic, semantic, procedural, prospective, retrieval) nullable: true type: string - - in: query - name: isFalsePositive + - description: Filter by lifecycle status; a row with no stored status reads as active + in: query + name: status schema: + description: Filter by lifecycle status; a row with no stored status reads as active nullable: true - type: boolean - - in: query - name: isFixed + type: string + - description: Only memories at or above this trust tier (0 ingested .. 3 human decision); untiered memories never match + in: query + name: minTrustTier schema: + description: Only memories at or above this trust tier (0 ingested .. 3 human decision); untiered memories never match nullable: true - type: boolean - - in: query - name: isAllowlisted + type: integer + - description: 'Filter by author: an agent name (e.g. reposcope) or a user id' + in: query + name: createdBy schema: + description: 'Filter by author: an agent name (e.g. reposcope) or a user id' nullable: true - type: boolean - - description: combination of isFixed, isFalsePositive and isAllowlisted + type: string + - description: 'Maximum number of results (default: 50, max: 1000)' in: query - name: isResolved + name: limit schema: - description: combination of isFixed, isFalsePositive and isAllowlisted + description: 'Maximum number of results (default: 50, max: 1000)' nullable: true - type: boolean - - in: query - name: sortBy + type: integer + - description: Number of memories to skip before the page + in: query + name: offset schema: + description: Number of memories to skip before the page nullable: true - type: string - - in: query - name: sort + type: integer + - description: Pagination token for next page; absent when the page is the last one + in: query + name: nextToken schema: + description: Pagination token for next page; absent when the page is the last one nullable: true type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetMemoriesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Memories + post: + description: Create a new memory as a first-class resource + parameters: - description: The Azure organization ID in: query name: azureOrganizationId @@ -41234,6 +46797,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -41279,12 +46853,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostMemoryInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingsDetailedOutput' + $ref: '#/components/schemas/EndpointsPostMemoryOutput' description: OK '400': content: @@ -41298,87 +46877,43 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Dependency Findings Detailed [DEPRECATED - TO BE REMOVED BY 2025] - /sca/dependencies/findings/preview: - get: - description: Returns a filtered set of SCA dependency findings based on query parameters + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Memory + /context/memories/{memoryId}: + delete: + description: >- + Retracts a memory. The row is kept as a tombstone with retraction reason 'deleted' (or the supplied reason); it + leaves every search and list-latest read but GET by id still returns it with its status. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: package - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - description: combination of isFixed, isFalsePositive and isAllowlisted - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive and isAllowlisted - nullable: true - type: boolean - - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - in: query - name: autoFixState - schema: - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) - nullable: true - type: string - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -41398,6 +46933,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -41443,12 +46989,26 @@ paths: items: type: string type: array + - description: 'Why the memory is being retracted; recorded on the tombstone (default: deleted)' + in: query + name: reason + schema: + description: 'Why the memory is being retracted; recorded on the tombstone (default: deleted)' + nullable: true + type: string + - description: ID of the memory to delete + in: path + name: memoryId + required: true + schema: + description: ID of the memory to delete + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCADependencyFindingsOutput' + $ref: '#/components/schemas/EndpointsDeleteMemoryOutput' description: OK '400': content: @@ -41456,60 +47016,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Dependency Findings Preview - /sca/events: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Delete Memory get: - description: "Returns SCA events after a specified timestamp or event ID.\n\t\tAll events are returned if no timestamp or event ID is provided.\n\t\tA maximum of 100 events can be returned per request." + description: Retrieves a specific memory by ID parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: fromTime - schema: - nullable: true - type: string - - in: query - name: eventType - schema: - items: - type: string - type: array - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: findingId - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -41529,6 +47063,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -41574,12 +47119,24 @@ paths: items: type: string type: array + - in: query + name: version + schema: + nullable: true + type: string + - description: ID of the memory to retrieve + in: path + name: memoryId + required: true + schema: + description: ID of the memory to retrieve + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCAEventsOutput' + $ref: '#/components/schemas/EndpointsGetMemoryOutput' description: OK '400': content: @@ -41593,29 +47150,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCA Events - /sca/repositories: - get: + summary: Get Memory + patch: description: >- - Returns a sorted map of repository stats. The map is sorted by repositoryID and contains a list of repository - stats for each repositoryID. + Updates a live memory. Every update appends an immutable version; a memory that is superseded, retracted or + otherwise not active cannot be edited and must be replaced by a new memory that supersedes it. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -41635,6 +47187,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -41680,12 +47243,22 @@ paths: items: type: string type: array + - in: path + name: memoryId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchMemoryInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCARepositoriesOutput' + $ref: '#/components/schemas/EndpointsPatchMemoryOutput' description: OK '400': content: @@ -41699,18 +47272,42 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repository Stats - /sca/repositories/{repositoryId}: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Update Memory + /context/memories/{memoryId}/findings: get: description: >- - Returns a sorted map of repository stats. The map is sorted by repositoryID and contains a list of repository - stats for each repositoryID. + Lists the live findings associated with a memory: findings whose triage cited the vault document the memory was + distilled from, and findings the memory names in its anchors. Most severe first. parameters: - description: The Azure organization ID in: query @@ -41731,6 +47328,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -41776,17 +47384,26 @@ paths: items: type: string type: array - - in: path - name: repositoryId + - description: Maximum number of findings to return (1-100, default 20) + in: query + name: limit + schema: + description: Maximum number of findings to return (1-100, default 20) + nullable: true + type: integer + - description: Memory ID + in: path + name: memoryId required: true schema: + description: Memory ID type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCARepositoryOutput' + $ref: '#/components/schemas/EndpointsGetMemoryFindingsOutput' description: OK '400': content: @@ -41800,16 +47417,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repository Stats - /sca/repositories/{repositoryId}/sbom: - get: - description: Returns the SBOM for a repository + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Memory Findings + /context/memories/{memoryId}/retract: + post: + description: >- + Withdraws a memory with a reason. The memory is kept as a retracted tombstone: it leaves every search and + list-latest read but GET by id still returns it with its status. parameters: - description: The Azure organization ID in: query @@ -41830,7 +47461,18 @@ paths: description: The Github owner ID format: int64 type: integer - - description: The GitLab group ID + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID in: query name: gitlabGroupId schema: @@ -41875,17 +47517,24 @@ paths: items: type: string type: array - - in: path - name: repositoryId + - description: ID of the memory to retract + in: path + name: memoryId required: true schema: + description: ID of the memory to retract type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsRetractMemoryInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCARepositorySBOMOutput' + $ref: '#/components/schemas/EndpointsRetractMemoryOutput' description: OK '400': content: @@ -41899,57 +47548,37 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Repository SBOM - /sca/scan-runs: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Retract Memory + /context/memories/{memoryId}/versions: get: + description: >- + Retrieve the immutable version history of a memory, newest first. Every write and status transition (supersede, + retract) appends a version. parameters: - - description: Repository ID to list scan runs for - in: query - name: repositoryId - required: true - schema: - description: Repository ID to list scan runs for - type: string - - description: SCA scan type - in: query - name: scanType - required: true - schema: - description: SCA scan type - enum: - - sca_dependencies - - sca_containers - type: string - - description: Max scan runs per page (default 10, max 50) - in: query - name: limit - schema: - description: Max scan runs per page (default 10, max 50) - nullable: true - type: integer - - description: Pagination offset (default 0) - in: query - name: offset - schema: - description: Pagination offset (default 0) - nullable: true - type: integer - - description: Sort order by start time (default newest) - in: query - name: sort - schema: - description: Sort order by start time (default newest) - enum: - - newest - - oldest - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -41969,6 +47598,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -42014,144 +47654,26 @@ paths: items: type: string type: array - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsGetScanRunsOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: List Scan Runs - /scpm/containers/analyze: - post: - description: >- - Queues a container image for malware analysis via the vuln-database Step Function (KIND=oci). Idempotent within - 24h on (registry, repository, reference) OR caller-supplied idempotencyKey. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAnalyzeContainerInput' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAnalyzeContainerOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Request malware analysis for an OCI container image - /scpm/dependencies: - get: - description: >- - Returns CI/CD dependency inventory for reverse-lookup queries. Use ?name=tj-actions/changed-files to find all - repos using a specific action. - parameters: - - description: Filter by dependency name (e.g., actions/checkout, tj-actions/changed-files) - in: query - name: name - schema: - description: Filter by dependency name (e.g., actions/checkout, tj-actions/changed-files) - nullable: true - type: string - - description: Filter by version reference (requires name) + - description: 'Maximum number of versions to return (default: 50)' in: query - name: version + name: limit schema: - description: Filter by version reference (requires name) - nullable: true - type: string - - description: Filter by CI/CD platform (github-actions, gitlab-ci, azure-pipelines) - in: query - name: platform + description: 'Maximum number of versions to return (default: 50)' + format: int32 + type: integer + - description: Memory ID + in: path + name: memoryId + required: true schema: - description: Filter by CI/CD platform (github-actions, gitlab-ci, azure-pipelines) - nullable: true + description: Memory ID type: string - - description: Filter by pinned status - in: query - name: pinned - schema: - description: Filter by pinned status - nullable: true - type: boolean - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsGetDependenciesOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Get CI/CD Dependencies - /scpm/dependencies/analyze: - post: - description: >- - Queues a dependency version for malware analysis via the vuln-database Step Function. Idempotent within 24h on - (ecosystem, name, version) OR the caller-supplied idempotencyKey. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsAnalyzeDependencyInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsAnalyzeDependencyOutput' + $ref: '#/components/schemas/EndpointsGetMemoryVersionsOutput' description: OK '400': content: @@ -42171,47 +47693,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Request malware analysis for a dependency - /scpm/dependencies/query/batch: - post: - description: >- - Proxies vuln-database /v1/query/batch for authenticated callers. Caps at 1000 packages per request. Use this - over the public /v1/query endpoint when the caller has tenant identity — it adds per-tenant audit + - rate-limiting. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsBatchQueryDependenciesInput' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsBatchQueryDependenciesOutput' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '500': + description: Service Unavailable + '504': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Batch query vulnerabilities + malware verdict for dependencies - /scpm/events: + description: Gateway Timeout + summary: Get Memory Versions + /context/memories/document/{documentId}: get: - description: Returns SCPM events after a specified timestamp or event ID. + description: Return the latest memories scoped to a document (finding, repository, project, etc.). parameters: - description: The Azure organization ID in: query @@ -42232,6 +47729,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -42277,12 +47785,27 @@ paths: items: type: string type: array + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: paginationToken + schema: + nullable: true + type: string + - in: path + name: documentId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMEventsOutput' + $ref: '#/components/schemas/EndpointsGetMemoriesByDocumentOutput' description: OK '400': content: @@ -42302,97 +47825,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCPM Events - /scpm/findings: + summary: Get Memories By Document + /context/memories/document/{documentId}/type: get: - description: Returns a filtered set of SCPM findings based on query parameters + description: Return the latest memories scoped to a document and filtered by memory type. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: priorityLabel - schema: - nullable: true - type: string - - in: query - name: severity - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: hasPullRequest - schema: - nullable: true - type: boolean - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - description: if not provided, all repositories will be included - in: query - name: repositoryIds - schema: - description: if not provided, all repositories will be included - items: - type: string - type: array - - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isArchived - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -42412,6 +47849,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -42457,12 +47905,31 @@ paths: items: type: string type: array + - in: query + name: memoryType + schema: + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: paginationToken + schema: + nullable: true + type: string + - in: path + name: documentId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingsOutput' + $ref: '#/components/schemas/EndpointsGetMemoriesByDocumentAndTypeOutput' description: OK '400': content: @@ -42482,10 +47949,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCPM Findings - /scpm/findings/{findingId}: - get: - description: Returns a given finding with explanation and impact + summary: Get Memories By Document And Type + /context/memories/grep: + post: + description: Literal case-insensitive substring search over agent memories parameters: - description: The Azure organization ID in: query @@ -42506,6 +47973,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -42551,17 +48029,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGrepMemoriesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingOutput' + $ref: '#/components/schemas/EndpointsGrepMemoriesOutput' description: OK '400': content: @@ -42581,9 +48059,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding - patch: - description: Update a given finding with the fields provided + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Grep Memories + /context/memories/search: + post: + description: Hybrid semantic + lexical search over agent memories parameters: - description: The Azure organization ID in: query @@ -42604,6 +48095,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -42649,22 +48151,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSCPMFindingInput' + $ref: '#/components/schemas/EndpointsSearchMemoriesInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSCPMFindingOutput' + $ref: '#/components/schemas/EndpointsSearchMemoriesOutput' description: OK '400': content: @@ -42684,10 +48181,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Finding - /scpm/findings/{findingId}/allowlist: - post: - description: Allowlists a finding + summary: Search Memories + /context/memories/type: + get: + description: Query memories filtered by memory type. Use the memoryType query parameter to filter results. parameters: - description: The Azure organization ID in: query @@ -42708,6 +48205,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -42753,22 +48261,46 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: memoryType schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSCPMFindingInput' + - in: query + name: createdBy + schema: + nullable: true + type: string + - in: query + name: resourceId + schema: + nullable: true + type: string + - in: query + name: isLatest + schema: + nullable: true + type: boolean + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: offset + schema: + nullable: true + type: integer + - in: query + name: paginationToken + schema: + nullable: true + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSCPMFindingOutput' + $ref: '#/components/schemas/EndpointsGetMemoriesByTypeOutput' description: OK '400': content: @@ -42782,35 +48314,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Finding - /scpm/findings/{findingId}/autofix/activity: + summary: Get Memories By Type + /context/organization: get: - description: >- - Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` - defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen - (use the `nextCursor` value from a prior response). + description: Returns a classification of your entire organization and what software it builds parameters: - - in: query - name: since_id - schema: - type: string - - in: query - name: limit - schema: - format: int32 - type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -42830,6 +48344,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -42875,17 +48400,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + $ref: '#/components/schemas/EndpointsGetOrganizationOutput' description: OK '400': content: @@ -42899,22 +48419,17 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCPM Finding Autofix Activity - /scpm/findings/{findingId}/autofix/cache: - post: - description: Generates a fix for a finding and caches it in S3 without creating a PR + summary: Get Organization Context + patch: + description: >- + Renames an organization without replacing its collected context; notes are edited through the typed memory + endpoints parameters: - description: The Azure organization ID in: query @@ -42935,7 +48450,18 @@ paths: description: The Github owner ID format: int64 type: integer - - description: The GitLab group ID + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID in: query name: gitlabGroupId schema: @@ -42980,16 +48506,11 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCacheAutofixSCPMFindingInput' + $ref: '#/components/schemas/EndpointsUpdateOrganizationInput' responses: '204': description: No Content @@ -43011,16 +48532,21 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Cache Autofix - /scpm/findings/{findingId}/autofix/cache/create_pr: - post: - description: Creates a pull request using a previously cached autofix + summary: Update Classification of the Organization + put: + description: Creates a classification of your entire organization and what software it builds parameters: - description: The Azure organization ID in: query @@ -43041,6 +48567,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43086,22 +48623,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreatePullRequestSCPMFindingInput' + $ref: '#/components/schemas/EndpointsCreateOrganizationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreatePullRequestSCPMFindingOutput' + $ref: '#/components/schemas/EndpointsCreateOrganizationOutput' description: OK '400': content: @@ -43115,22 +48647,15 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Pull Request from Cached Fix - /scpm/findings/{findingId}/autofix/cache/diff: + summary: Upsert Classification of the Organization + /context/organization/runs/{runId}: get: - description: Get the cached autofix diff for an SCPM finding parameters: - description: The Azure organization ID in: query @@ -43151,6 +48676,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43196,8 +48732,12 @@ paths: items: type: string type: array + - in: query + name: includeResult + schema: + type: boolean - in: path - name: findingId + name: runId required: true schema: type: string @@ -43206,7 +48746,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingFixOutput' + $ref: '#/components/schemas/EndpointsGetOrgContextRunOutput' description: OK '400': content: @@ -43232,10 +48772,15 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCPM Finding Autofix Diff - /scpm/findings/{findingId}/autofix/fix: + summary: Get Organization Context Run + /context/rag/resync: post: - description: Generates a fix and creates a pull request for a finding + description: >- + Enqueues a full reconciliation of the tenant's knowledge base with the canonical vault state. Returns + immediately after the request is queued. With confluenceOnly, only selected Confluence pages are reconciled and + removed sources retracted. Otherwise every vault file is listed and re-indexed; anything in the knowledge base + that no longer has a matching vault file is removed. Use for backfill on first activation and for drift + recovery. parameters: - description: The Azure organization ID in: query @@ -43256,6 +48801,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43301,60 +48857,79 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAutofixSCPMFindingInput' + $ref: '#/components/schemas/EndpointsPostRAGResyncInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAutofixSCPMFindingOutput' + $ref: '#/components/schemas/EndpointsPostRAGResyncOutput' description: OK - '400': + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + description: Forbidden + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + description: Precondition Failed + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '409': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Conflict - '500': + description: Service Unavailable + '504': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Autofix Finding - /scpm/findings/{findingId}/autofix/state: + description: Gateway Timeout + summary: Resync RAG Vector Store + /context/repo-scans: get: description: >- - Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; - the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + Lists repo-context scans for the calling tenant. Filter by repositoryId, commitSha, status, or versionsOnly + (repositoryId required, newest-first version history). Returns newest first. parameters: + - in: query + name: repositoryId + schema: + type: string + - in: query + name: commitSha + schema: + type: string + - in: query + name: status + schema: + type: string + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - in: query + name: versionsOnly + schema: + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -43374,6 +48949,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43419,17 +49005,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingAutofixStateOutput' + $ref: '#/components/schemas/EndpointsListRepoScansOutput' description: OK '400': content: @@ -43443,22 +49024,15 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCPM Finding Autofix State - /scpm/findings/{findingId}/autofix/status: - get: - description: Lightweight per-finding autofix lifecycle status for UI polling. + summary: List Repo Context Scans + post: + description: Records the start of a context-service run against a repository. Returns the persisted scan with a generated id. parameters: - description: The Azure organization ID in: query @@ -43479,6 +49053,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43524,17 +49109,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsCreateRepoScanInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingAutofixStatusOutput' + $ref: '#/components/schemas/EndpointsCreateRepoScanOutput' description: OK '400': content: @@ -43548,22 +49133,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCPM Finding Autofix Status - /scpm/findings/{findingId}/events: + summary: Create Repo Context Scan + /context/repo-scans/{scanId}: get: - description: Returns a list of events for a given finding. + description: >- + Returns a single repo-context scan by id, with its lifecycle as a run. A triggered scan whose execution ended + without recording an outcome is marked failed. parameters: - description: The Azure organization ID in: query @@ -43584,6 +49165,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43630,7 +49222,7 @@ paths: type: string type: array - in: path - name: findingId + name: scanId required: true schema: type: string @@ -43639,7 +49231,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingEventsOutput' + $ref: '#/components/schemas/EndpointsGetRepoScanOutput' description: OK '400': content: @@ -43653,16 +49245,23 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding Events - /scpm/findings/{findingId}/triage: - get: - description: Returns the triage data for a specific finding + summary: Get Repo Context Scan + patch: + description: >- + Patches status, subagent execution metadata, projects touched, SBOMs generated, or error message on an existing + repo-context scan. parameters: - description: The Azure organization ID in: query @@ -43683,6 +49282,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43729,16 +49339,21 @@ paths: type: string type: array - in: path - name: findingId + name: scanId required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchRepoScanInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingTriageOutput' + $ref: '#/components/schemas/EndpointsPatchRepoScanOutput' description: OK '400': content: @@ -43752,16 +49367,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Triaged Finding - /scpm/findings/{findingId}/unallowlist: + summary: Update Repo Context Scan + /context/repo-scope/scans: post: - description: Unallowlists a finding + description: >- + Starts an async repo-scope Step Function that classifies the calling tenant's repositories for scan-scope + (produce-only). parameters: - description: The Azure organization ID in: query @@ -43782,6 +49405,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43827,48 +49461,45 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: includeArchived schema: - type: string + type: boolean requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostUnallowlistSCPMFindingInput' + $ref: '#/components/schemas/EndpointsContextStartRepoScopeScanInput' responses: - '204': - description: No Content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + $ref: '#/components/schemas/EndpointsContextStartRepoScopeScanOutput' + description: OK + '401': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Unallowlist Finding - /scpm/findings/allowlist: - post: - description: Allowlist a list of SCPM findings, by findingsID + summary: Start Repo-Scope Scan + /context/repo-scope/scans/{scanId}: + get: + description: >- + Reports a repo-scope scan started by POST /context/repo-scope/scans and, once its recommendations are current, + what it recommended. parameters: + - in: query + name: executionArn + schema: + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -43888,6 +49519,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -43933,14 +49575,18 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowListSCPMFindingBatchInput' + - in: path + name: scanId + required: true + schema: + type: string responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetRepoScopeScanOutput' + description: OK '400': content: application/json: @@ -43953,101 +49599,23 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Allowlist Batch of SCPM Findings - /scpm/findings/detailed: - get: - description: Returns current SCPM findings in default branches + description: Service Unavailable + summary: Get Repo-Scope Scan + /context/reports: + post: + description: Creates a new report generation job and returns a job ID. The report will be generated asynchronously. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: priorityLabel - schema: - nullable: true - type: string - - in: query - name: severity - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: hasPullRequest - schema: - nullable: true - type: boolean - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isArchived - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -44067,6 +49635,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44112,12 +49691,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostReportInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingsDetailedOutput' + $ref: '#/components/schemas/EndpointsPostReportOutput' description: OK '400': content: @@ -44137,97 +49721,11 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Findings Detailed - /scpm/findings/preview: + summary: Create Report Generation Job + /context/reports/{jobId}: get: - description: Returns a filtered set of SCPM findings based on query parameters + description: Retrieves the status of a report generation job. Returns status, error (if failed), and URL (if success). parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: priorityLabel - schema: - nullable: true - type: string - - in: query - name: severity - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: hasPullRequest - schema: - nullable: true - type: boolean - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: workflow - schema: - nullable: true - type: string - - description: if not provided, all repositories will be included - in: query - name: repositoryIds - schema: - description: if not provided, all repositories will be included - items: - type: string - type: array - - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - in: query - name: isResolved - schema: - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived - nullable: true - type: boolean - - in: query - name: isFixed - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isArchived - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -44247,6 +49745,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44292,12 +49801,17 @@ paths: items: type: string type: array + - in: path + name: jobId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSCPMFindingsOutput' + $ref: '#/components/schemas/EndpointsGetReportStatusOutput' description: OK '400': content: @@ -44311,17 +49825,43 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get SCPM Findings - /scpm/findings/retriage: - post: - description: Triggers retriage of findings based on the provided filters + summary: Get Report Status + /context/repositories: + get: + description: Returns a classification of attributes of each repository parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -44341,6 +49881,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44386,22 +49937,35 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostRetriageSCPMFindingsInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostRetriageSCPMFindingsOutput' + $ref: '#/components/schemas/EndpointsGetRepositoriesOutput' description: OK - summary: Retriage Findings - /scpm/findings/upload: - post: - description: Returns an S3 Presigned URL + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Contexts of Repositories + /context/repositories/{repositoryId}: + delete: + description: Deletes a repository permanently parameters: - description: The Azure organization ID in: query @@ -44422,6 +49986,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44467,17 +50042,19 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostGetUploadSCPMFindingsURLInput' + - description: ID of the repository to delete + in: path + name: repositoryId + required: true + schema: + description: ID of the repository to delete + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostGetUploadSCPMFindingsURLOutput' + $ref: '#/components/schemas/EndpointsDeleteRepositoryOutput' description: OK '400': content: @@ -44491,70 +50068,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Presigned URL to Upload SCPM Findings - /secrets/credentials/findings: + summary: Delete Repository get: - description: >- - Returns a filtered set of Secrets credential findings based on query parameters. One unique secret hash per - repository. + description: Returns context about a repository parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: secretType - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: isResolved - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive + - description: Return a presigned URL instead of the repository context inline + in: query + name: preferUrl schema: - nullable: true + description: Return a presigned URL instead of the repository context inline type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -44574,6 +50109,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44619,12 +50165,17 @@ paths: items: type: string type: array + - in: path + name: repositoryId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingsOutput' + $ref: '#/components/schemas/EndpointsGetRepositoryOutput' description: OK '400': content: @@ -44638,16 +50189,33 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Secrets Credential Findings - /secrets/credentials/findings/{findingId}: - get: - description: Returns a given credential finding + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Repository + patch: + description: Updates the classification of a repository parameters: - description: The Azure organization ID in: query @@ -44668,6 +50236,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44714,17 +50293,18 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsUpdateRepositoryInput' responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingOutput' - description: OK + '204': + description: No Content '400': content: application/json: @@ -44749,9 +50329,13 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Credential Finding - patch: - description: Update a given credential finding with the fields provided + summary: Update Repository + /context/repositories/{repositoryId}/execution-recipes/discover: + post: + description: >- + Queues a validation run for each of a repository's projects and starts the sandbox pipeline that works out how + to build, test and run them at the head of a branch. Asking twice for the same projects of the same commit + attaches to the run that is already going. parameters: - description: The Azure organization ID in: query @@ -44772,6 +50356,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44818,7 +50413,7 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId required: true schema: type: string @@ -44826,13 +50421,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSecretsFindingInput' + $ref: '#/components/schemas/EndpointsStartRepositoryExecutionRecipeDiscoveryInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSecretsFindingOutput' + $ref: '#/components/schemas/EndpointsStartRepositoryExecutionRecipeDiscoveryOutput' description: OK '400': content: @@ -44846,17 +50441,47 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Credential Finding - /secrets/credentials/findings/{findingId}/allowlist: - post: - description: Allowlist a credential secret + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start Repository Execution Recipe Discovery + /context/repositories/{repositoryId}/projects: + get: + description: Lists all projects in a repository with optional pagination and filtering parameters: + - in: query + name: limit + schema: + type: integer + - in: query + name: nextToken + schema: + type: string + - in: query + name: includeDeleted + schema: + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -44876,6 +50501,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -44922,46 +50558,33 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowListSecretsCredentialFindingInput' responses: - '204': - description: No Content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden - '404': + $ref: '#/components/schemas/EndpointsListRepositoryProjectsOutput' + description: OK + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Bad Request '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Credential Finding - /secrets/credentials/findings/{findingId}/events: - get: - description: Returns a list of events for a given finding. + summary: List Projects + /context/repositories/{repositoryId}/projects/{projectId}: + delete: + description: Soft-delete a project parameters: - description: The Azure organization ID in: query @@ -44982,6 +50605,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45028,7 +50662,12 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string @@ -45037,7 +50676,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingEventsOutput' + $ref: '#/components/schemas/EndpointsDeleteProjectOutput' description: OK '400': content: @@ -45063,10 +50702,9 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding Events - /secrets/credentials/findings/{findingId}/ticket: - post: - description: Creates a ticket for a given credential finding + summary: Delete Project + get: + description: Retrieves a single project by ID parameters: - description: The Azure organization ID in: query @@ -45087,6 +50725,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45132,24 +50781,135 @@ paths: items: type: string type: array - - description: The ID of the finding to create a Jira ticket for - in: path - name: findingId + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetProjectOutput' + description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Project + patch: + description: Updates a project's metadata and properties + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: - description: The ID of the finding to create a Jira ticket for type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingInput' + $ref: '#/components/schemas/EndpointsUpdateProjectInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingOutput' + $ref: '#/components/schemas/EndpointsUpdateProjectOutput' description: OK '400': content: @@ -45157,12 +50917,6 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '404': content: application/json: @@ -45175,11 +50929,56 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Ticket for Credential Finding - /secrets/credentials/findings/{findingId}/triage: + summary: Update Project + /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe: get: - description: Returns the triage data for a specific credential finding + description: >- + Returns the proven setup, build, test and run commands for a project at a commit, or why none can be served. + Every recipe is proved in a sandbox holding no credentials and is only ever safe to run in one. parameters: + - description: The commit the caller wants to stand the target up at + in: query + name: commitSha + schema: + description: The commit the caller wants to stand the target up at + type: string + - description: >- + The build input hash the caller computed from its own checkout, used when Context has never observed the + commit + in: query + name: inputHash + schema: + description: >- + The build input hash the caller computed from its own checkout, used when Context has never observed the + commit + type: string + - description: Whether the caller's sandbox provides a Docker daemon + in: query + name: docker + schema: + description: Whether the caller's sandbox provides a Docker daemon + type: boolean + - description: >- + Comma separated sandbox capabilities beyond docker, from docker_compose, network, nested_virtualization, + gpu, service_postgres, service_mysql, service_redis, service_mongo, service_elasticsearch, service_kafka + in: query + name: capabilities + schema: + description: >- + Comma separated sandbox capabilities beyond docker, from docker_compose, network, nested_virtualization, + gpu, service_postgres, service_mysql, service_redis, service_mongo, service_elasticsearch, service_kafka + type: string + - description: >- + Whether the caller will apply the file edits a recipe carries. Defaults to true; false returns incompatible + rather than a recipe the caller would refuse + in: query + name: allowEdits + schema: + description: >- + Whether the caller will apply the file edits a recipe carries. Defaults to true; false returns + incompatible rather than a recipe the caller would refuse + nullable: true + type: boolean - description: The Azure organization ID in: query name: azureOrganizationId @@ -45199,6 +50998,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45245,7 +51055,12 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string @@ -45254,7 +51069,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingTriageOutput' + $ref: '#/components/schemas/EndpointsGetProjectExecutionRecipeOutput' description: OK '400': content: @@ -45274,17 +51089,43 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Triaged Credential Finding - /secrets/credentials/findings/{findingId}/unallowlist: - post: - description: Unallowlist a credential secret + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Project Execution Recipe + /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/validations: + get: + description: >- + Returns the discovery and revalidation runs of a project's recipe, newest first, with what each run cost and why + it failed. parameters: + - description: Runs per page, default 50, max 200 + in: query + name: limit + schema: + description: Runs per page, default 50, max 200 + type: integer + - description: Runs to skip before the page + in: query + name: offset + schema: + description: Runs to skip before the page + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -45304,6 +51145,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45350,18 +51202,22 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostUnallowListSecretsFindingInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListProjectExecutionRecipeValidationsOutput' + description: OK '400': content: application/json: @@ -45380,17 +51236,43 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Unallowlist Credential Finding - /secrets/credentials/findings/{findingId}/users: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: List Project Execution Recipe Validations + /context/repositories/{repositoryId}/projects/{projectId}/execution-recipe/versions: get: - description: Get users related to a credential finding based on git blame and repository contributions. + description: >- + Returns a project's recipe versions newest first, without their commands. Read one version's commands through + the resolve endpoint. parameters: + - description: Versions per page, default 50, max 200 + in: query + name: limit + schema: + description: Versions per page, default 50, max 200 + type: integer + - description: Versions to skip before the page + in: query + name: offset + schema: + description: Versions to skip before the page + type: integer - description: The Azure organization ID in: query name: azureOrganizationId @@ -45410,6 +51292,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45456,7 +51349,12 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string @@ -45465,7 +51363,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingUsersOutput' + $ref: '#/components/schemas/EndpointsListProjectExecutionRecipeVersionsOutput' description: OK '400': content: @@ -45485,16 +51383,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Credential Finding Related Users - /secrets/credentials/findings/allowlist/batch: - post: - description: Allowlist a list of credential findings, by findingsID + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: List Project Execution Recipe Versions + /context/repositories/{repositoryId}/projects/{projectId}/schema: + get: + description: Returns the API schema for a given project parameters: - description: The Azure organization ID in: query @@ -45515,6 +51425,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45560,26 +51481,23 @@ paths: items: type: string type: array - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowListSecretsFindingBatchInput' + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string responses: - '204': - description: No Content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + $ref: '#/components/schemas/EndpointsGetProjectSchemaOutput' + description: OK '404': content: application/json: @@ -45592,62 +51510,10 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Batch of Credential Findings - /secrets/credentials/findings/detailed: - get: - description: Returns credential secrets summary. One unique secret hash per repository + summary: Get Project Schema + post: + description: Uploads an API schema for a project parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: secretType - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: isResolved - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -45667,6 +51533,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45712,85 +51589,39 @@ paths: items: type: string type: array + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostProjectSchemaInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingsDetailedOutput' + $ref: '#/components/schemas/EndpointsPostProjectSchemaOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Secrets Credential Findings Detailed - /secrets/events: + summary: Upload Project Schema + /context/repositories/{repositoryId}/projects/{projectId}/schema/metadata: get: - description: >- - Returns events after a specified timestamp or event ID. All events are returned if no timestamp or event ID is - provided + description: Returns the metadata for a given project schema parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: fromTime - schema: - nullable: true - type: string - - in: query - name: numItems - schema: - nullable: true - type: integer - - in: query - name: eventType - schema: - items: - type: string - type: array - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: findingId - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -45810,6 +51641,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -45855,89 +51697,42 @@ paths: items: type: string type: array + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsEventsOutput' + $ref: '#/components/schemas/EndpointsGetProjectSchemaMetadataOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Secret Events - /secrets/findings: + summary: Get Project Schema Metadata + /context/repositories/{repositoryId}/projects/{projectId}/schema/raw: get: description: >- - Returns a filtered set of Secrets credential findings based on query parameters. One unique secret hash per - repository. + Returns a presigned download URL for the raw API spec file (OpenAPI JSON/YAML, Proto, or GraphQL SDL) that can + be rendered or imported directly parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: secretType - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: isResolved - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -45957,6 +51752,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46002,35 +51808,41 @@ paths: items: type: string type: array + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingsOutput' + $ref: '#/components/schemas/EndpointsGetProjectSchemaRawOutput' description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Bad Request - '403': + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Forbidden + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Secrets Credential Findings - /secrets/findings/{findingId}: - get: - description: Returns a given credential finding + summary: Get Project Schema Raw File + /context/repositories/{repositoryId}/projects/{projectId}/schema/trigger: + post: + description: >- + Starts a schema-reversing run for one project against the repository's stored repo context and returns its run + id. Read its state from GET /context/repo-scans/{scanId}. parameters: - description: The Azure organization ID in: query @@ -46051,6 +51863,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46097,16 +51920,26 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriggerProjectSchemaInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingOutput' + $ref: '#/components/schemas/EndpointsTriggerProjectSchemaOutput' description: OK '400': content: @@ -46126,15 +51959,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Credential Finding - patch: - description: Update a given credential finding with the fields provided + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Trigger Project Schema Reversing + /context/repositories/{repositoryId}/repo-context/trigger: + post: + description: >- + Starts a repo-context run against the repository's current head and returns its run id. Read its state from GET + /context/repo-scans/{scanId}. parameters: - description: The Azure organization ID in: query @@ -46155,6 +52003,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46201,7 +52060,7 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId required: true schema: type: string @@ -46209,13 +52068,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSecretsFindingInput' + $ref: '#/components/schemas/EndpointsTriggerRepoContextInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSecretsFindingOutput' + $ref: '#/components/schemas/EndpointsTriggerRepoContextOutput' description: OK '400': content: @@ -46229,16 +52088,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Update Credential Finding - /secrets/findings/{findingId}/allowlist: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Trigger Repository Context + /context/sbomingestor/replay: post: - description: Allowlist a credential secret + description: Enqueue a full SBOM ingest replay; either global or for a specific repository and project parameters: - description: The Azure organization ID in: query @@ -46259,6 +52136,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46304,19 +52192,18 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAllowListSecretsCredentialFindingInput' + $ref: '#/components/schemas/EndpointsSBOMIngestReplayInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsSBOMIngestReplayOutput' + description: OK '400': content: application/json: @@ -46329,22 +52216,18 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Credential Finding - /secrets/findings/{findingId}/events: - get: - description: Returns a list of events for a given finding. + summary: Compute Dependencies Repository/Project SBOM Ingest Replay + /context/sboms: + delete: + description: >- + Deletes SBOM (software bill of materials) items for a tenant. Scope can be limited by repository/project, and + you can optionally restrict deletions to invalid SBOM objects only. parameters: - description: The Azure organization ID in: query @@ -46365,6 +52248,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46410,17 +52304,28 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true + - in: query + name: repositoryId + schema: + type: string + - in: query + name: projectId schema: type: string + - in: query + name: invalidOnly + schema: + type: boolean + - in: query + name: dryRun + schema: + type: boolean responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingEventsOutput' + $ref: '#/components/schemas/EndpointsDeleteSBOMOutput' description: OK '400': content: @@ -46434,22 +52339,19 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/RestErrResponse' - description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Finding Events - /secrets/findings/{findingId}/ticket: + summary: Delete SBOMs for tenant + /context/sboms/generate: post: - description: Creates a ticket for a given credential finding + description: >- + Starts the commit pipelines for a repository head: repo context and one whole-repo SBOM in parallel, then the + per-project split and dependency ingest. Returns status='generating' with the run's executionArn, or + status='complete' when the commit's run already finished — poll GET /context/sboms/... for results. parameters: - description: The Azure organization ID in: query @@ -46470,6 +52372,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46515,24 +52428,17 @@ paths: items: type: string type: array - - description: The ID of the finding to create a Jira ticket for - in: path - name: findingId - required: true - schema: - description: The ID of the finding to create a Jira ticket for - type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingInput' + $ref: '#/components/schemas/EndpointsPostSBOMGenerateInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingOutput' + $ref: '#/components/schemas/EndpointsPostSBOMGenerateOutput' description: OK '400': content: @@ -46546,22 +52452,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '412': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Ticket for Credential Finding - /secrets/findings/{findingId}/triage: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Generate SBOM + /context/sboms/repository/{repositoryId}/latest: get: - description: Returns the triage data for a specific credential finding + description: Returns the most recent SBOM for each project within a repository. parameters: - description: The Azure organization ID in: query @@ -46582,6 +52494,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46628,7 +52551,7 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId required: true schema: type: string @@ -46637,7 +52560,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingTriageOutput' + $ref: '#/components/schemas/EndpointsGetLatestSBOMsOutput' description: OK '400': content: @@ -46663,11 +52586,45 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Triaged Credential Finding - /secrets/findings/{findingId}/unallowlist: - post: - description: Unallowlist a credential secret + summary: Get Latest SBOMs for Repository + /context/sboms/repository/{repositoryId}/project/{projectId}: + get: + description: >- + Returns a list of SBOM (software bill of materials) items for a repository/project based on the query + parameters. Responses are paginated in reverse-time order. parameters: + - in: query + name: page + schema: + nullable: true + type: integer + - in: query + name: pageSize + schema: + nullable: true + type: integer + - in: query + name: fromCommit + schema: + nullable: true + type: string + - in: query + name: untilCommit + schema: + nullable: true + type: string + - in: query + name: fromTime + schema: + format: date-time + nullable: true + type: string + - in: query + name: untilTime + schema: + format: date-time + nullable: true + type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -46687,6 +52644,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46733,18 +52701,22 @@ paths: type: string type: array - in: path - name: findingId + name: repositoryId + required: true + schema: + type: string + - in: path + name: projectId required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostUnallowListSecretsFindingInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSBOMSOutput' + description: OK '400': content: application/json: @@ -46769,10 +52741,12 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Unallowlist Credential Finding - /secrets/findings/{findingId}/users: - get: - description: Get users related to a credential finding based on git blame and repository contributions. + summary: Get Repository/Project SBOMs + /context/sboms/resolve: + post: + description: >- + Returns the storage key of the SBOM for the given (tenant, repo, commit). Generates the SBOM on demand if it is + not already cached. Single source of truth for the SBOM lifecycle. parameters: - description: The Azure organization ID in: query @@ -46793,6 +52767,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46838,17 +52823,17 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSBOMResolveInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingUsersOutput' + $ref: '#/components/schemas/EndpointsPostSBOMResolveOutput' description: OK '400': content: @@ -46868,16 +52853,32 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Credential Finding Related Users - /secrets/findings/allowlist/batch: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get or generate SBOM + /context/sboms/runs: post: - description: Allowlist a list of credential findings, by findingsID + description: >- + Generates, splits per project and ingests one SBOM for the repository's default branch head, and starts nothing + else: no repo context, schema reversing or scan. commitSha, when given, must be the current head. Returns the + run id and its executionArn; the SBOM is readable from GET /context/sboms/repository/{repositoryId}/latest once + stored. parameters: - description: The Azure organization ID in: query @@ -46898,6 +52899,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -46947,10 +52959,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAllowListSecretsFindingBatchInput' + $ref: '#/components/schemas/EndpointsPostSBOMRunInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSBOMRunOutput' + description: OK '400': content: application/json: @@ -46969,68 +52985,31 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Batch of Credential Findings - /secrets/findings/detailed: - get: - description: Returns secrets summary. One unique secret hash per repository + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start SBOM Run + /context/sboms/scan: + post: + description: >- + Returns an existing SBOM if available, or enqueues generation and returns status='generating'. Callers can poll + the GET endpoint to retrieve the result once ready. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: secretType - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: isResolved - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -47050,6 +53029,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47095,12 +53085,17 @@ paths: items: type: string type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSBOMScanInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingsDetailedOutput' + $ref: '#/components/schemas/EndpointsPostSBOMScanOutput' description: OK '400': content: @@ -47114,70 +53109,31 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Secrets Credential Findings Detailed - [DEPRECATED - TO BE REMOVED BY 2025] - /secrets/findings/preview: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Scan SBOM (get-or-generate) + /context/sboms/tree: get: description: >- - Returns a filtered set of Secrets credential findings based on query parameters. One unique secret hash per - repository. + Returns a tree structure of SBOM (software bill of materials) items for a tenant. Commits are paginated in time + order. Add optional verbose=true query parameter to include repository and project names. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: secretType - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: isResolved - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -47197,6 +53153,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47242,12 +53209,16 @@ paths: items: type: string type: array + - in: query + name: verbose + schema: + type: boolean responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsFindingsOutput' + $ref: '#/components/schemas/EndpointsGetSBOMTreeOutput' description: OK '400': content: @@ -47267,41 +53238,106 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Secrets Credential Findings - /secrets/scan-runs: + summary: Get SBOM key tree for tenant + /context/schemas: get: + description: Lists all project schemas across all repositories parameters: - - description: Repository ID to list scan runs for + - description: The Azure organization ID in: query - name: repositoryId - required: true + name: azureOrganizationId schema: - description: Repository ID to list scan runs for + description: The Azure organization ID type: string - - description: Max scan runs per page (default 10, max 50) + - description: The Bitbucket workspace ID in: query - name: limit + name: bitbucketWorkspaceId schema: - description: Max scan runs per page (default 10, max 50) - nullable: true + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 type: integer - - description: Pagination offset (default 0) + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. in: query - name: offset + name: githubInstallationId schema: - description: Pagination offset (default 0) - nullable: true + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 type: integer - - description: Sort order by start time (default newest) + - description: The GitLab group ID in: query - name: sort + name: gitlabGroupId schema: - description: Sort order by start time (default newest) - enum: - - newest - - oldest - nullable: true + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListSchemasOutput' + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Schemas + /context/setup-recommendations/pentest-assessments: + get: + description: >- + One proposal per discovered application: the web services its repositories map to and the non-production hosts + its code declares, with what is still needed. Decided proposals included. + parameters: - description: The Azure organization ID in: query name: azureOrganizationId @@ -47321,6 +53357,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47371,7 +53418,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetScanRunsOutput' + $ref: '#/components/schemas/EndpointsSetupPentestAssessmentRecommendationsOutput' description: OK '400': content: @@ -47391,62 +53438,19 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: List Scan Runs - /secrets/sensitivedata/findings: - get: - description: Returns a filtered set of sensitive data findings based on query parameters. + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: List assessment setup proposals + /context/setup-recommendations/pentest-assessments/{recommendationId}/accept: + post: + description: >- + Record that the customer created the assessment setup. The application must be the tenant's live DAST + application stored under the proposed context application's id. parameters: - - in: query - name: nextToken - schema: - nullable: true - type: string - - in: query - name: limit - schema: - nullable: true - type: integer - - in: query - name: branch - schema: - nullable: true - type: string - - in: query - name: secretType - schema: - nullable: true - type: string - - in: query - name: fileOwnerName - schema: - items: - type: string - type: array - - in: query - name: isResolved - schema: - nullable: true - type: boolean - - in: query - name: isAllowlisted - schema: - nullable: true - type: boolean - - in: query - name: isFalsePositive - schema: - nullable: true - type: boolean - - in: query - name: sortBy - schema: - nullable: true - type: string - - in: query - name: sort - schema: - nullable: true - type: string - description: The Azure organization ID in: query name: azureOrganizationId @@ -47466,6 +53470,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47511,12 +53526,22 @@ paths: items: type: string type: array + - in: path + name: recommendationId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAcceptSetupPentestAssessmentRecommendationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingsOutput' + $ref: '#/components/schemas/EndpointsDecideSetupPentestAssessmentRecommendationOutput' description: OK '400': content: @@ -47530,16 +53555,34 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Sensitive Data Findings - /secrets/sensitivedata/findings/{findingId}: - get: - description: Returns a specific sensitive data finding by ID + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Accept assessment setup proposal + /context/setup-recommendations/pentest-assessments/{recommendationId}/dismiss: + post: + description: Record that the customer declined the proposal; a refresh does not propose it again. parameters: - description: The Azure organization ID in: query @@ -47560,6 +53603,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47606,7 +53660,7 @@ paths: type: string type: array - in: path - name: findingId + name: recommendationId required: true schema: type: string @@ -47615,7 +53669,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingOutput' + $ref: '#/components/schemas/EndpointsDecideSetupPentestAssessmentRecommendationOutput' description: OK '400': content: @@ -47635,15 +53689,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Sensitive Data Finding - patch: - description: Update a given sensitive data finding with the fields provided + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Dismiss assessment setup proposal + /context/setup-recommendations/pentest-assessments/refresh: + post: + description: >- + Re-derive pentest target recommendations, then one assessment setup proposal per discovered application. Decided + proposals are left unchanged. parameters: - description: The Azure organization ID in: query @@ -47664,6 +53733,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47709,22 +53789,12 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPatchSecretsSensitiveDataFindingInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPatchSecretsSensitiveDataFindingOutput' + $ref: '#/components/schemas/EndpointsSetupPentestAssessmentRecommendationsOutput' description: OK '400': content: @@ -47738,22 +53808,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Update Sensitive Data Finding - /secrets/sensitivedata/findings/{findingId}/allowlist: - post: - description: Allowlist a sensitive data (PII) finding + description: Service Unavailable + summary: Refresh assessment setup proposals + /context/setup-recommendations/pentest-targets: + get: + description: Non-production hosts from the tenant's cloud inventory proposed as pentest targets, decided ones included. parameters: - description: The Azure organization ID in: query @@ -47774,6 +53844,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47819,19 +53900,13 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSecretsSensitiveDataFindingInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsSetupPentestTargetRecommendationsOutput' + description: OK '400': content: application/json: @@ -47844,22 +53919,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Allowlist Sensitive Data Finding - /secrets/sensitivedata/findings/{findingId}/ticket: + description: Service Unavailable + summary: List pentest target recommendations + /context/setup-recommendations/pentest-targets/{recommendationId}/accept: post: - description: Creates a ticket for a given sensitive data finding + description: >- + Record that the customer added the recommended host as a DAST target. The target must be a live target of the + tenant with the recommended hostname. parameters: - description: The Azure organization ID in: query @@ -47880,6 +53957,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -47925,24 +54013,22 @@ paths: items: type: string type: array - - description: The ID of the finding to create a ticket for - in: path - name: findingId + - in: path + name: recommendationId required: true schema: - description: The ID of the finding to create a ticket for type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsSensitiveDataFindingInput' + $ref: '#/components/schemas/EndpointsAcceptSetupPentestTargetRecommendationInput' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsSensitiveDataFindingOutput' + $ref: '#/components/schemas/EndpointsDecideSetupPentestTargetRecommendationOutput' description: OK '400': content: @@ -47962,16 +54048,28 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Create Ticket for Sensitive Data Finding - /secrets/sensitivedata/findings/{findingId}/triage: - get: - description: Returns the triage data for a specific sensitive data finding + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Accept pentest target recommendation + /context/setup-recommendations/pentest-targets/{recommendationId}/dismiss: + post: + description: Record that the customer declined the recommended host. parameters: - description: The Azure organization ID in: query @@ -47992,6 +54090,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -48038,7 +54147,7 @@ paths: type: string type: array - in: path - name: findingId + name: recommendationId required: true schema: type: string @@ -48047,7 +54156,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingTriageOutput' + $ref: '#/components/schemas/EndpointsDecideSetupPentestTargetRecommendationOutput' description: OK '400': content: @@ -48067,16 +54176,30 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Triaged Sensitive Data Finding - /secrets/sensitivedata/findings/{findingId}/unallowlist: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Dismiss pentest target recommendation + /context/setup-recommendations/pentest-targets/refresh: post: - description: Unallowlist a sensitive data (PII) finding + description: >- + Re-derive pentest target recommendations from the tenant's cloud inventory. Decided recommendations are left + unchanged. parameters: - description: The Azure organization ID in: query @@ -48097,6 +54220,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -48142,19 +54276,13 @@ paths: items: type: string type: array - - in: path - name: findingId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostUnallowlistSecretsSensitiveDataFindingInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsSetupPentestTargetRecommendationsOutput' + description: OK '400': content: application/json: @@ -48167,22 +54295,24 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found - '500': + description: Internal Server Error + '503': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Unallowlist Sensitive Data Finding - /secrets/sensitivedata/findings/{findingId}/users: + description: Service Unavailable + summary: Refresh pentest target recommendations + /context/vault/document/{documentId}/text: get: - description: Get users related to a sensitive data (PII) finding based on git blame and repository contributions. + description: >- + Return the extracted text of an indexed vault document, optionally bounded to a page range and paginated by + nextToken. parameters: - description: The Azure organization ID in: query @@ -48203,6 +54333,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -48248,17 +54389,51 @@ paths: items: type: string type: array - - in: path - name: findingId + - description: First page to read (1-based, inclusive) + in: query + name: startPage + schema: + description: First page to read (1-based, inclusive) + nullable: true + type: integer + - description: Last page to read (1-based, inclusive) + in: query + name: endPage + schema: + description: Last page to read (1-based, inclusive) + nullable: true + type: integer + - description: >- + Maximum characters to return in this response (default and ceiling 60000). Setting it also opts into paging + a document too large to read whole + in: query + name: maxChars + schema: + description: >- + Maximum characters to return in this response (default and ceiling 60000). Setting it also opts into + paging a document too large to read whole + nullable: true + type: integer + - description: Pagination token returned by a truncated response + in: query + name: nextToken + schema: + description: Pagination token returned by a truncated response + nullable: true + type: string + - description: Vault document ID + in: path + name: documentId required: true schema: + description: Vault document ID type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingUsersOutput' + $ref: '#/components/schemas/EndpointsGetVaultDocumentTextOutput' description: OK '400': content: @@ -48284,10 +54459,22 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Get Sensitive Data Finding Related Users - /secrets/sensitivedata/findings/allowlist/batch: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Vault Document Text + /context/vault/file: post: - description: Allowlist a list of sensitive data findings, by findingsID + description: Returns a presigned upload URL for a file with metadata including document ID and optional description parameters: - description: The Azure organization ID in: query @@ -48308,6 +54495,17 @@ paths: description: The Github owner ID format: int64 type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer - description: The GitLab group ID in: query name: gitlabGroupId @@ -48357,10 +54555,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostAllowlistSecretsSensitiveDataFindingBatchInput' + $ref: '#/components/schemas/EndpointsPostVaultFileInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostVaultFileOutput' + description: OK '400': content: application/json: @@ -48373,13754 +54575,80036 @@ paths: schema: $ref: '#/components/schemas/RestErrResponse' description: Forbidden - '404': + '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Not Found + description: Internal Server Error + summary: Post Vault File + /context/vault/file/{fileId}: + delete: + description: Deletes a vault file and forgets its derived memories while retaining their audit history + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: fileId + required: true + schema: + type: string + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Allowlist Batch of Sensitive Data Findings - /core/bitbucket/descriptor: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Delete Vault File get: - description: Bitbucket connect descriptor json for installing Nullify into a Bitbucket workspace + description: Returns a presigned url for a vault file + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: fileId + required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBitbucketConnectDescriptorOutput' + $ref: '#/components/schemas/EndpointsGetVaultFileOutput' description: OK - '500': + '400': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Bitbucket Connect Descriptor - /core/bitbucket/disabled: - post: - description: Callback endpoint for when the Bitbucket app is disabled - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostBitbucketDisabledInput' - responses: - '204': - description: No Content - '500': + description: Bad Request + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Bitbucket App Disabled - /core/bitbucket/enabled: - post: - description: Callback endpoint for when the Bitbucket app is enabled - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostBitbucketEnabledInput' - responses: - '204': - description: No Content - '500': + description: Forbidden + '404': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Bitbucket App Enabled - /core/bitbucket/installed: - post: - description: Callback endpoint for when the Bitbucket app is installed - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostBitbucketInstalledInput' - responses: - '204': - description: No Content + description: Not Found '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Bitbucket App Installed - /core/bitbucket/uninstalled: - post: - description: Callback endpoint for when the Bitbucket app is installed + summary: Get Vault File + /context/vault/file/{fileName}: + patch: + description: Update metadata for a vault file + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: fileName + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostBitbucketUninstalledInput' + $ref: '#/components/schemas/EndpointsPatchVaultFileInput' responses: - '204': - description: No Content - '500': + '200': content: application/json: schema: - $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Bitbucket App Uninstalled - /core/jira/descriptor: - get: - description: Jira connect descriptor json for installing Nullify into a Jira workspace - responses: - '200': + $ref: '#/components/schemas/EndpointsPatchVaultFileOutput' + description: OK + '400': content: application/json: schema: - $ref: '#/components/schemas/EndpointsGetJiraConnectDescriptorOutput' - description: OK - '500': + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' - description: Internal Server Error - summary: Jira Connect Descriptor - /core/jira/installed: - post: - description: Callback endpoint for when the Jira app is installed - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndpointsPostJiraInstalledInput' - responses: - '204': - description: No Content + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Jira App Installed - /core/jira/uninstalled: - post: - description: Callback endpoint for when the Jira app is uninstalled + summary: Patch Vault File + /context/vault/files: + get: + description: Returns a page of vault files, with the total across all pages + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: 'Maximum number of files to return per page (default: all, max 1000)' + in: query + name: limit + schema: + description: 'Maximum number of files to return per page (default: all, max 1000)' + nullable: true + type: integer + - description: Number of files to skip before the page + in: query + name: offset + schema: + description: Number of files to skip before the page + nullable: true + type: integer + - description: Case-insensitive substring match on file name + in: query + name: search + schema: + description: Case-insensitive substring match on file name + nullable: true + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetVaultFilesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Vault Files + /context/vault/files/list: + get: + description: Returns a simplified list of vault files with fileName and description + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetVaultFilesListOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Vault Files List + /context/vault/index: + post: + description: >- + Enqueues chunk-and-embed indexing of the given vault files into the RAG knowledge base. Returns immediately + after the request is queued. Additive — never deletes. No org-context Claude call. Use per dashboard upload; use + /context/vault/onboard for the wizard batch and /context/rag/resync for tenant-wide reconciliation. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array requestBody: content: application/json: schema: - $ref: '#/components/schemas/EndpointsPostJiraUninstalledInput' + $ref: '#/components/schemas/EndpointsPostVaultIndexInput' responses: - '204': - description: No Content + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostVaultIndexOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden '500': content: application/json: schema: $ref: '#/components/schemas/RestErrResponse' description: Internal Server Error - summary: Jira App Uninstalled -components: - schemas: - EndpointsAccountValidationResult: - properties: - assumedRole: - type: string - errorMessage: - type: string - isValid: - type: boolean - status: - type: string - type: object - EndpointsAdminAzureConfigOutput: + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Index Vault Files + /context/vault/onboard: + post: + description: >- + Records an asynchronous onboarding request for specified vault files. Returns its run receipt even when queue + delivery is unconfirmed. The onboarding agent extracts organizational context from the provided documents in the + background. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostVaultOnboardInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostVaultOnboardOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Trigger Vault Onboarding + /context/vault/search: + post: + description: Hybrid semantic + lexical search over indexed vault documents + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsSearchVaultInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsSearchVaultOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Search Vault Documents + /context/waf-allowlist-pr/runs: + post: + description: >- + Records an idempotent WAF allowlist preparation request. An expired proposal requires expectedRunId and its + exact digest. GitHub is never changed by this endpoint. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextStartWAFAllowlistPRRunInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextStartCloudConnectorPRRunOutput' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Start WAF Allowlist PR Run + /context/waf-allowlist-pr/runs/{runId}: + get: + description: Reports one WAF allowlist run and the pull request it opened. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: runId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextGetCloudConnectorPRRunOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get WAF Allowlist PR Run + /context/waf-allowlist-pr/runs/{runId}/approve: + post: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: runId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextApproveWAFAllowlistProposalInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextApproveCloudConnectorProposalOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Create approved WAF allowlist draft PR + /context/waf-allowlist-pr/runs/{runId}/proposal: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: runId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextGetCloudConnectorProposalOutput' + description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Review WAF allowlist proposal + /context/waf-allowlist-pr/runs/{runId}/recover: + post: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: runId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextRecoverWAFAllowlistProposalInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextRecoverCloudConnectorProposalOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Recover unresolved WAF allowlist publication + /context/waf-allowlist-pr/status: + get: + description: >- + Returns read-only readiness of the proposal adding Nullify's DAST egress IPs to the tenant's WAF or IP + allowlist, the current preparation and the saved PR. Does not survey code or start work. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsContextGetCloudConnectorPRStatusOutput' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get WAF Allowlist PR Status + /cspm/findings: + get: + description: Returns a filtered set of CSPM findings based on query parameters + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: Maximum number of findings to return + in: query + name: limit + schema: + description: Maximum number of findings to return + nullable: true + type: integer + - description: Token for pagination + in: query + name: nextToken + schema: + description: Token for pagination + nullable: true + type: string + - description: Pagination offset; overrides nextToken when set + in: query + name: offset + schema: + description: Pagination offset; overrides nextToken when set + nullable: true + type: integer + - description: Sort order (asc or desc) + in: query + name: sort + schema: + description: Sort order (asc or desc) + nullable: true + type: string + - description: Field to sort by (priority, time, severity) + in: query + name: sortBy + schema: + description: Field to sort by (priority, time, severity) + nullable: true + type: string + - description: Filter by severity (upper case, e.g. CRITICAL) + in: query + name: severity + schema: + description: Filter by severity (upper case, e.g. CRITICAL) + nullable: true + type: string + - description: 'Filter by lifecycle status: open, allowlisted, archived or resolved' + in: query + name: status + schema: + description: 'Filter by lifecycle status: open, allowlisted, archived or resolved' + nullable: true + type: string + - description: Filter by account ID + in: query + name: accountId + schema: + description: Filter by account ID + nullable: true + type: string + - description: Filter by region + in: query + name: region + schema: + description: Filter by region + nullable: true + type: string + - description: Filter by resource type + in: query + name: resourceType + schema: + description: Filter by resource type + nullable: true + type: string + - description: Filter by scan ID + in: query + name: scanId + schema: + description: Filter by scan ID + nullable: true + type: string + - description: Server-side text search over title / resource / rule + in: query + name: search + schema: + description: Server-side text search over title / resource / rule + nullable: true + type: string + - description: Filter by cloud provider (aws, azure, gcp, kubernetes) + in: query + name: cloudProvider + schema: + description: Filter by cloud provider (aws, azure, gcp, kubernetes) + nullable: true + type: string + - description: Filter by rule ID + in: query + name: ruleId + schema: + description: Filter by rule ID + nullable: true + type: string + - description: Filter by rule category + in: query + name: category + schema: + description: Filter by rule category + nullable: true + type: string + - description: Filter by archived state; omitted means non-archived only + in: query + name: isArchived + schema: + description: Filter by archived state; omitted means non-archived only + nullable: true + type: boolean + - description: Filter by allowlisted state + in: query + name: isAllowlisted + schema: + description: Filter by allowlisted state + nullable: true + type: boolean + - description: Filter by false-positive state + in: query + name: isFalsePositive + schema: + description: Filter by false-positive state + nullable: true + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCSPMFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Findings + /cspm/findings/{findingId}: + get: + description: Returns a specific CSPM finding by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: ID of the CSPM finding + in: path + name: findingId + required: true + schema: + description: ID of the CSPM finding + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Finding + patch: + description: >- + Updates the user-authored overrides on a CSPM finding: severity override, priority override and notes. Omitted + fields are left unchanged. Set clearSeverityOverride or clearPriorityOverride to true to remove an override and + hand the finding back to the scanner and triage values; an empty string in the override field itself does the + same. A clear flag cannot be combined with a value for the same field. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to update + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to update + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Update CSPM Finding + /cspm/findings/{findingId}/allowlist: + post: + description: Allowlists a CSPM finding and best-effort closes any open tickets associated with it + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to allowlist + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to allowlist + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist CSPM Finding + /cspm/findings/{findingId}/archive: + post: + description: Archives a CSPM finding and best-effort closes any open tickets associated with it + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to archive + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to archive + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostArchiveCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostArchiveCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Archive CSPM Finding + /cspm/findings/{findingId}/autofix/activity: + get: + description: >- + Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Finding Autofix Activity + /cspm/findings/{findingId}/autofix/fix: + post: + description: Generates a fix and creates an IaC pull request for a CSPM finding. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCSPMFindingAutofixInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCSPMFindingAutofixOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Post CSPM Finding Autofix + /cspm/findings/{findingId}/autofix/state: + get: + description: >- + Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; + the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCSPMFindingAutofixStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Finding Autofix State + /cspm/findings/{findingId}/autofix/status: + get: + description: Lightweight per-finding autofix lifecycle status for UI polling. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCSPMFindingAutofixStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Finding Autofix Status + /cspm/findings/{findingId}/mark-false-positive: + post: + description: Marks a CSPM finding as a false positive and best-effort closes any open tickets associated with it + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to mark as false positive + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to mark as false positive + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostMarkFalsePositiveCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostMarkFalsePositiveCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Mark CSPM Finding as False Positive + /cspm/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a CSPM finding: closes it on the configured integration and clears Nullify's + tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for CSPM Finding + post: + description: Creates a ticket for a given CSPM finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to create a ticket for + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to create a ticket for + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket for CSPM Finding + /cspm/findings/{findingId}/triage: + get: + description: >- + Returns the enriched triage data for a CSPM finding, falling back to the base finding record when no enrichment + exists yet. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCSPMFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Finding Triage + /cspm/findings/{findingId}/unallowlist: + post: + description: Removes the allowlisted state from a CSPM finding and converges its ticket lifecycle. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to unallowlist + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to unallowlist + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist CSPM Finding + /cspm/findings/{findingId}/unarchive: + post: + description: Removes the archived state from a CSPM finding and converges its ticket lifecycle. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to unarchive + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to unarchive + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnarchiveCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnarchiveCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unarchive CSPM Finding + /cspm/findings/{findingId}/unmark-false-positive: + post: + description: Clears the false-positive state and its justification from a CSPM finding and converges its ticket lifecycle. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the CSPM finding to unmark as false positive + in: path + name: findingId + required: true + schema: + description: The ID of the CSPM finding to unmark as false positive + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnmarkFalsePositiveCSPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnmarkFalsePositiveCSPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unmark CSPM Finding as False Positive + /cspm/scans: + get: + description: Returns a list of CSPM scans + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: Maximum number of scans to return + in: query + name: limit + schema: + description: Maximum number of scans to return + nullable: true + type: integer + - description: Token for pagination + in: query + name: nextToken + schema: + description: Token for pagination + nullable: true + type: string + - description: Pagination offset; overrides nextToken when set + in: query + name: offset + schema: + description: Pagination offset; overrides nextToken when set + nullable: true + type: integer + - description: Filter by scan status + in: query + name: status + schema: + description: Filter by scan status + nullable: true + type: string + - description: Filter by account ID + in: query + name: accountId + schema: + description: Filter by account ID + nullable: true + type: string + - description: Filter by cloud provider (aws, azure, gcp, kubernetes) + in: query + name: cloudProvider + schema: + description: Filter by cloud provider (aws, azure, gcp, kubernetes) + nullable: true + type: string + - description: Filter by archived state + in: query + name: isArchived + schema: + description: Filter by archived state + nullable: true + type: boolean + - description: Server-side text search over account / region / provider + in: query + name: search + schema: + description: Server-side text search over account / region / provider + nullable: true + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCSPMScansOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Scans + /cspm/scans/{scanId}: + get: + description: Returns a specific CSPM scan by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: ID of the CSPM scan + in: path + name: scanId + required: true + schema: + description: ID of the CSPM scan + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCSPMScanOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CSPM Scan + /cspm/scans/start: + post: + description: Starts an asynchronous CSPM (cloud misconfiguration) scan for the calling tenant. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartCSPMScanOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Start CSPM Scan + /dast/applications: + get: + description: List DAST applications for the tenant + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTApplicationsOutput' + description: OK + summary: List Applications + tags: + - Applications + - Vault + post: + description: Create a DAST application — a set of web services, each deployed to one or more targets + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTApplicationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTApplicationOutput' + description: OK + summary: Create Application + tags: + - Applications + - Vault + /dast/applications/{applicationId}: + delete: + description: Soft-delete a DAST application + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteDASTApplicationOutput' + description: OK + summary: Delete Application + tags: + - Applications + - Vault + get: + description: Get a DAST application by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTApplicationOutput' + description: OK + summary: Get Application + tags: + - Applications + - Vault + put: + description: Update a DAST application + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTApplicationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTApplicationOutput' + description: OK + summary: Update Application + tags: + - Applications + - Vault + /dast/applications/from-context: + post: + description: >- + Register the confirmed targets and web services for a context application and create or link the DAST + application stored under its id. Idempotent; never creates credentials. Returns the application's readiness. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsCreateDASTApplicationFromContextInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsCreateDASTApplicationFromContextOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Create Assessment Setup From Context Application + tags: + - Applications + - Pentest + /dast/applications/readiness: + post: + description: >- + For each application id, whether a pentest can run and what setup is missing. Reads only: nothing is probed or + written. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTApplicationReadinessInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTApplicationReadinessOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Application Assessment Readiness + tags: + - Applications + - Pentest + /dast/bughunt/config: + get: + description: Retrieve the BugHunt config for the tenant, creating a default if none exists + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntConfigOutput' + description: OK + summary: Get BugHunt Config + put: + description: Create or update BugHunt config for the tenant + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutBugHuntConfigInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutBugHuntConfigOutput' + description: OK + summary: Put BugHunt Config + /dast/bughunt/config/validate: + post: + description: >- + Validate a BugHunt config payload without persisting it. Returns a typed slice of ConfigValidationError so the + configure UI can render inline errors. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateBugHuntConfigInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateBugHuntConfigOutput' + description: OK + summary: Validate BugHunt Config + /dast/bughunt/findings: + get: + description: List all BugHunt findings + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntFindingsOutput' + description: OK + summary: Get BugHunt Findings + /dast/bughunt/findings/{findingId}: + get: + description: Get a single BugHunt finding by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntFindingOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get BugHunt Finding + /dast/bughunt/findings/{findingId}/allowlist: + patch: + description: Mark/unmark an BugHunt finding as allowlisted + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchBugHuntFindingAllowlistInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchBugHuntFindingAllowlistOutput' + description: OK + summary: Allowlist BugHunt Finding + /dast/bughunt/findings/{findingId}/events: + get: + description: Get events for an BugHunt finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntFindingEventsOutput' + description: OK + summary: Get BugHunt Finding Events + /dast/bughunt/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a bughunt finding: closes it on the configured integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the bughunt finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the bughunt finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketBugHuntFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for BugHunt Finding + post: + description: Creates a ticket for a given BugHunt finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketBugHuntFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketBugHuntFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket for BugHunt Finding + /dast/bughunt/findings/{findingId}/triage: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntFindingTriageOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Create Interactor [] + /dast/bughunt/program/import: + post: + description: >- + Fetch and parse a public bug-bounty program (HackerOne/Bugcrowd) into a typed ScopePolicy, RulesOfEngagement, + and ScopeProvenance for human confirmation. PREVIEW ONLY — it never commits to the tenant's config; the operator + confirms then PUTs /dast/bughunt/config. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBugHuntProgramImportInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBugHuntProgramImportOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Preview BugHunt Program Import + /dast/bughunt/scans: + get: + description: List BugHunt scans for tenant + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: Pagination offset; overrides nextToken when > 0 + in: query + name: offset + schema: + description: Pagination offset; overrides nextToken when > 0 + type: integer + - description: Server-side text search over scan id / status / targets + in: query + name: search + schema: + description: Server-side text search over scan id / status / targets + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntScansOutput' + description: OK + summary: Get BugHunt Scans + post: + description: Start a new BugHunt scan + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBugHuntScanInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBugHuntScanOutput' + description: OK + summary: Start BugHunt Scan + /dast/bughunt/scans/{scanId}: + get: + description: Get BugHunt scan by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntScanOutput' + description: OK + summary: Get BugHunt Scan + /dast/bughunt/scans/{scanId}/activity: + get: + description: >- + Cursor-paginated activity log for a bug-hunt scan, for UI live-progress polling. Returns an empty list when no + entries exist yet. `limit` defaults to 50 and is clamped to [1, 200]; `since_id` is the ULID of the last entry + the client has already seen (use the `nextCursor` from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get BugHunt Scan Activity + /dast/bughunt/scans/{scanId}/diff: + get: + description: >- + Diff two BugHunt scans into the four buckets New / Reopened / Unchanged / Resolved. The 'against' query + parameter is the older scan id; both scans must belong to the caller's tenant and must be in a successful + terminal state. + parameters: + - in: query + name: against + required: true + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntScanDiffOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get BugHunt Scan Diff + /dast/bughunt/scans/{scanId}/findings: + get: + description: Get findings for an BugHunt scan + parameters: + - in: query + name: limit + schema: + type: integer + - in: query + name: offset + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntScanFindingsOutput' + description: OK + summary: Get BugHunt Scan Findings + /dast/bughunt/scans/{scanId}/logs: + get: + description: Returns a short-lived presigned URL for downloading the bughunt sub-agent network log + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSubAgentNetworkLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get BugHunt Sub-Agent Network Log + /dast/bughunt/scans/{scanId}/status: + get: + description: >- + Live-progress status poll for a bug-hunt scan: status, stage, progress, current activity, findings count, cost, + and lite per-phase view. Reads the cheap Postgres columns (NOT S3) so it is safe to poll on a short interval. + `terminal` flips true when the scan stops progressing — the UI stops polling then. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsBugHuntScanStatusOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get BugHunt Scan Status + /dast/bughunt/scans/{scanId}/stop: + post: + description: Stop a running BugHunt scan + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStopBugHuntScanOutput' + description: OK + summary: Stop BugHunt Scan + /dast/bughunt/suite-runs: + get: + description: Returns the per-suite cadence state (last run at, last run id) for the tenant. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBugHuntSuiteRunsOutput' + description: OK + summary: Get BugHunt Suite Runs + /dast/bughunt/suites/{suite}/run-now: + post: + description: >- + Manually trigger a single bug hunt test suite for the tenant. Honours the tenant's stored intensity unless the + request supplies an override. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: suite + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBugHuntSuiteRunNowInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBugHuntSuiteRunNowOutput' + description: OK + summary: Run BugHunt Suite Now + /dast/credentials: + get: + description: Get a page of credentials with optional search, plus the total matching count + parameters: + - description: Maximum number of credentials to return per page (default 50, max 1000) + in: query + name: limit + schema: + description: Maximum number of credentials to return per page (default 50, max 1000) + type: integer + - description: Number of credentials to skip before the page + in: query + name: offset + schema: + description: Number of credentials to skip before the page + type: integer + - description: Case-insensitive search over credential name, description and type + in: query + name: search + schema: + description: Case-insensitive search over credential name, description and type + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCredentialsOutput' + description: OK + summary: Get All Credentials + tags: + - Credentials + - Vault + post: + description: Create a new unified credential for BugHunt or Pentest + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCredentialInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCredentialOutput' + description: OK + summary: Create Credential + tags: + - Credentials + - Vault + /dast/credentials/{credentialId}: + delete: + description: Delete a credential + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteCredentialOutput' + description: OK + summary: Delete Credential + tags: + - Credentials + - Vault + get: + description: Get a specific credential by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCredentialOutput' + description: OK + summary: Get Credential + tags: + - Credentials + - Vault + put: + description: Update an existing credential + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutCredentialInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutCredentialOutput' + description: OK + summary: Update Credential + tags: + - Credentials + - Vault + /dast/credentials/{credentialId}/active: + put: + description: >- + Switch a credential on or off. A switched-off credential keeps its config and validation result but no scan, + exploit validation or preflight logs in with it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutCredentialActiveInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutCredentialActiveOutput' + description: OK + summary: Switch Credential On or Off + tags: + - Credentials + - Vault + /dast/credentials/{credentialId}/validate: + post: + description: >- + Validate a credential using the safest supported authentication check. Interactive checks may be queued: an + inconclusive response with an empty validatedAt means validation is in progress. Poll GET + /dast/credentials/{credentialId}/validations/status for completion. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateCredentialInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateCredentialOutput' + description: OK + summary: Validate Credential + tags: + - Credentials + - Validation + - Vault + /dast/credentials/{credentialId}/validations: + get: + description: List a credential's authentication validation history + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPaginatedValidations' + description: OK + summary: Credential Validation History + tags: + - Credentials + - Validation + - Vault + post: + description: Validate a credential, running an interactive login where an inline check cannot settle it + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTCredentialValidationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDASTCredentialValidationRun' + description: OK + summary: Start Credential Validation + tags: + - Credentials + - Validation + - Vault + /dast/credentials/{credentialId}/validations/status: + get: + description: Report the credential's current validation attempt + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: credentialId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDASTCredentialValidationRun' + description: OK + summary: Credential Validation Status + tags: + - Credentials + - Validation + - Vault + /dast/credentials/validate: + post: + description: >- + Validate a batch of credentials against a service. Interactive checks may be queued: results with an + inconclusive outcome and empty validatedAt are still in progress. Poll GET + /dast/credentials/{credentialId}/validations/status for each queued credential. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateCredentialsInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateCredentialsOutput' + description: OK + summary: Validate Credentials + tags: + - Credentials + - Validation + - Vault + /dast/exploit-validation/attempts: + get: + description: >- + Returns a tenant-scoped, newest-first, paginated list of finding exploit-validation attempts and their outcomes. + Paginate with the opaque nextToken. + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListExploitValidationAttemptsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Exploit Validation Attempts + tags: + - Pentest + - Validation + /dast/exploit-validation/findings/{findingId}/evidence/{evidenceId}: + get: + description: >- + Returns a short-lived presigned URL to download one finalized proof file an exploit-validation verdict cites. + The file is resolved tenant and finding scoped and read at the exact version the verdict recorded; it is never + cited by key from the request. + parameters: + - in: query + name: findingType + required: true + schema: + enum: + - sast + - sca_dependencies + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + - in: path + name: evidenceId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetExploitEvidenceOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get an Exploit Validation Evidence File + /dast/exploit-validation/findings/{findingId}/validate: + post: + description: >- + Decline SAST findings that cannot be proven over HTTP before evaluating tenant policies. Start asynchronous + finding-scoped exploit-validation runs against matching web services when eligible. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartExploitValidationOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Start Exploit Validation for a Finding + tags: + - Pentest + - Validation + /dast/exploit-validation/policies: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTExploitValidationPoliciesOutput' + description: OK + summary: List Exploit Validation Policies + tags: + - Pentest + - Validation + - Configuration + post: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTExploitValidationPolicyInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTExploitValidationPolicyOutput' + description: OK + summary: Create Exploit Validation Policy + tags: + - Pentest + - Validation + - Configuration + /dast/exploit-validation/policies/{policyId}: + delete: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: policyId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteDASTExploitValidationPolicyOutput' + description: OK + summary: Delete Exploit Validation Policy + tags: + - Pentest + - Validation + - Configuration + put: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: policyId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTExploitValidationPolicyInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTExploitValidationPolicyOutput' + description: OK + summary: Update Exploit Validation Policy + tags: + - Pentest + - Validation + - Configuration + /dast/exploit-validation/policies/{policyId}/arm: + post: + description: >- + Grant a policy authority to dispatch exploit-validation runs at its targets. Requires the safety contract + version this build enforces and the policy revision the consent was given against. Separate from policy write, + which can revoke arming but never grant it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: policyId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTExploitValidationPolicyArmInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTExploitValidationPolicyArmOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Arm an Exploit Validation Policy + tags: + - Pentest + - Validation + - Configuration + /dast/exploit-validation/policies/{policyId}/disarm: + post: + description: Revoke a policy's authority to dispatch exploit-validation runs, and the consent record granted with it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: policyId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTExploitValidationPolicyDisarmOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Disarm an Exploit Validation Policy + tags: + - Pentest + - Validation + - Configuration + /dast/exploit-validation/runs/{runId}: + get: + description: >- + Returns the status of the exploit-validation run a start request returned as runId: each finding's decision, and + for a dispatched finding its verdict and proof once the run records one. + parameters: + - in: query + name: executionArn + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: runId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetExploitValidationRunOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Exploit Validation Run + tags: + - Pentest + - Validation + /dast/pentest/applications: + get: + description: Get all pentest application configs for a tenant + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestAppConfigsOutput' + description: OK + summary: Get Pentest App Configs + tags: + - Applications + - Vault + post: + description: Create a new application + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostPentestAppConfigInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostPentestAppConfigOutput' + description: OK + summary: Create Application + tags: + - Applications + - Vault + /dast/pentest/applications/{applicationId}: + delete: + description: Delete a pentest application config + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeletePentestAppConfigOutput' + description: OK + summary: Delete Pentest App Config + tags: + - Applications + - Vault + get: + description: Get a specific pentest application config by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestAppConfigOutput' + description: OK + summary: Get Pentest App Config + tags: + - Applications + - Vault + patch: + description: >- + Partially update an existing application. Omitted or null targets preserve existing target links; an empty + targets array detaches all targets. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchPentestAppConfigInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchPentestAppConfigOutput' + description: OK + summary: Partially Update Application + tags: + - Applications + - Vault + put: + description: >- + Update an existing application. Omitted or null targets preserve existing target links; an empty targets array + detaches all targets. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutPentestAppConfigInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutPentestAppConfigOutput' + description: OK + summary: Update Application + tags: + - Applications + - Vault + /dast/pentest/applications/{applicationId}/estimate: + get: + description: >- + Predicts the duration and LLM cost of a pentest for an application using a closed-form heuristic over the + application's size signals and its own run history. Runs no agent and issues no LLM calls. Sharpens the estimate + with the application's stored preflight when one exists, and reports which of the two sources it used. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestEstimateOutput' + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Cost Estimate + tags: + - Applications + - Pentest + - Preflight + /dast/pentest/applications/{applicationId}/mutation-consent: + put: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutMutationConsentInput' + responses: + '204': + description: No Content + summary: Create Interactor [] + tags: + - Applications + /dast/pentest/applications/{applicationId}/preflight: + post: + description: >- + Runs a readiness check for an application before a pentest scan. Validates credentials, retrieves application + context, enumerates network-reachable findings, and produces a typed three-level summary plus a duration / cost + estimate for the upcoming pentest. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartPentestPreflightInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartPentestPreflightOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Start Pentest Preflight + tags: + - Applications + - Pentest + - Preflight + /dast/pentest/applications/{applicationId}/preflight/latest: + get: + description: Returns the most recent pentest preflight for an application, or null if the customer has never run one. + parameters: + - in: query + name: webServiceId + schema: + type: string + - in: query + name: targetId + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetLatestPentestPreflightOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Latest Pentest Preflight for Application + tags: + - Applications + - Pentest + - Preflight + /dast/pentest/applications/{applicationId}/preflight/quota: + get: + description: >- + Returns the daily preflight usage and limit for an application. Used by the UI to render an indicator and + disable buttons when the limit is reached. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: applicationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestPreflightQuotaOutput' + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Preflight Quota + tags: + - Applications + - Pentest + - Preflight + /dast/pentest/budget: + get: + description: >- + Returns the tenant's remaining pentest budget for the tightest applicable calendar window so an estimate can be + compared with current headroom. Proxies the internal billing admission budget; the browser cannot reach that + endpoint directly. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestBudgetOutput' + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Pentest Budget + tags: + - Pentest + - Billing + /dast/pentest/findings: + get: + description: Returns the list of all pentest findings + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - in: query + name: scanId + schema: + nullable: true + type: string + - in: query + name: priorityLabel + schema: + nullable: true + type: string + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isLatest + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: sortBy + schema: + type: string + - in: query + name: sort + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Findings + /dast/pentest/findings/{findingId}: + get: + description: Get all the details of a pentest finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Finding + /dast/pentest/findings/{findingId}/allowlist: + post: + description: Allowlist a pentest finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistPentestFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + summary: Allowlist Pentest Finding + /dast/pentest/findings/{findingId}/autofix/activity: + get: + description: >- + Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get DAST Pentest Finding Autofix Activity + /dast/pentest/findings/{findingId}/autofix/fix: + post: + description: Creates a pull request to fix a given DAST pentest finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAutofixDASTPentestFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAutofixDASTPentestFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Post DAST Pentest Finding AutoFix + /dast/pentest/findings/{findingId}/autofix/state: + get: + description: >- + Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; + the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTFindingAutofixStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get DAST Pentest Finding Autofix State + /dast/pentest/findings/{findingId}/autofix/status: + get: + description: Lightweight per-finding autofix lifecycle status for UI polling. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTFindingAutofixStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get DAST Pentest Finding Autofix Status + /dast/pentest/findings/{findingId}/events: + get: + description: Returns the list of all the events for a given Pentest finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + summary: Get Pentest Finding Events + /dast/pentest/findings/{findingId}/full: + get: + description: Get the full pentest finding, including the triage + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestFindingFullOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Finding Full + /dast/pentest/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a pentest finding: closes it on the configured integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the pentest finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the pentest finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketPentestFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for Pentest Finding + post: + description: Creates a ticket for a given pentest finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketPentestFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketPentestFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket for Pentest Finding + /dast/pentest/findings/{findingId}/triage: + get: + description: Get the full pentest finding, including the triage + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestFindingFullOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Finding Full + /dast/pentest/findings/{findingId}/unallowlist: + post: + description: Unallowlist a pentest finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistPentestFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + summary: Unallowlist Pentest Finding + /dast/pentest/mutation-warning: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetMutationWarningOutput' + description: OK + summary: Create Interactor [] + tags: + - Applications + /dast/pentest/preflights/{preflightId}: + get: + description: Returns a single pentest preflight by ID, including the readiness summary when complete. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: preflightId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestPreflightOutput' + description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Preflight + tags: + - Applications + - Pentest + - Preflight + /dast/pentest/preflights/{preflightId}/events: + get: + description: >- + Returns the live event stream for a preflight execution. Use the `afterSeq` query parameter (echoing the + previous response's `highestSeq`) for incremental polling. + parameters: + - in: query + name: afterSeq + schema: + format: int64 + type: integer + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: preflightId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestPreflightEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Preflight Events + tags: + - Applications + - Pentest + - Preflight + /dast/pentest/scans: + get: + description: Returns all pentest scans for a tenant + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: Pagination offset; overrides nextToken when > 0 + in: query + name: offset + schema: + description: Pagination offset; overrides nextToken when > 0 + type: integer + - description: Server-side text search over app id / status + in: query + name: search + schema: + description: Server-side text search over app id / status + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScansOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scans + /dast/pentest/scans/{scanId}: + get: + description: Returns the details of a pentest scan + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan + /dast/pentest/scans/{scanId}/activity: + get: + description: >- + Cursor-paginated pentest activity log for UI polling. Returns an empty list when the scan has produced no feed + rows yet. `limit` defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client + has already seen (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanActivityOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Activity + /dast/pentest/scans/{scanId}/auth-matrix/cases: + get: + description: >- + Returns one page of the scan's frozen auth-matrix cases, ordered by case key. Filters combine with AND; total + counts the filtered cases. + parameters: + - description: >- + Keep one raw outcome: accepted, authz_denied, schema_rejected, policy_skipped, not_found, conflict, + server_error or unknown + in: query + name: outcome + schema: + description: >- + Keep one raw outcome: accepted, authz_denied, schema_rejected, policy_skipped, not_found, conflict, + server_error or unknown + type: string + - description: Keep cases whose acting identity is this credential id (scope.users[].credentialId) + in: query + name: identity + schema: + description: Keep cases whose acting identity is this credential id (scope.users[].credentialId) + type: string + - description: 'Drop cases the run never attempted: policy_skipped, and unknown with reason not_started' + in: query + name: hideNotRun + schema: + description: 'Drop cases the run never attempted: policy_skipped, and unknown with reason not_started' + type: boolean + - description: Page size, default 50, at most 200 + in: query + name: limit + schema: + description: Page size, default 50, at most 200 + type: integer + - description: Rows to skip + in: query + name: offset + schema: + description: Rows to skip + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestAuthMatrixCasesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List pentest auth-matrix cases + /dast/pentest/scans/{scanId}/auth-matrix/evidence: + get: + description: >- + Returns tenant-owned durable attempt metadata and verified scrubbed body links independently of proxy capture. + Requires a terminal scan and an evidence reference or attempt ID. Filters combine with AND. Download links + expire after 15 minutes and require the returned conditional headers. + parameters: + - in: query + name: stage + schema: + type: string + - in: query + name: since + schema: + type: string + - in: query + name: until + schema: + type: string + - in: query + name: identityId + schema: + type: string + - in: query + name: method + schema: + type: string + - in: query + name: path + schema: + type: string + - in: query + name: evidenceRef + schema: + type: string + - in: query + name: attemptId + schema: + type: string + - in: query + name: cursor + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestAuthMatrixEvidenceOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get retained pentest attempt evidence + /dast/pentest/scans/{scanId}/events: + get: + description: >- + Returns the lifecycle-event feed for a pentest scan. Use the `afterSeq` query parameter (echoing the previous + response's `highestSeq`) for incremental polling. Returns an empty list when the scan has no events. + parameters: + - in: query + name: afterSeq + schema: + format: int64 + type: integer + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Events + tags: + - Applications + - Pentest + - Scans + /dast/pentest/scans/{scanId}/findings: + get: + description: Returns the list of all the pentest findings from a scan + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Findings + /dast/pentest/scans/{scanId}/findings/links: + get: + description: Returns the findings mapped to a pentest scan (native, manually attached, and exploit-analysis validated) + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanFindingLinksOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Finding Links + /dast/pentest/scans/{scanId}/hypotheses: + get: + description: Returns the auth matrix hypotheses with full evidence for a pentest scan + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAuthMatrixHypothesesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Auth Matrix Hypotheses + /dast/pentest/scans/{scanId}/logs: + get: + description: Returns a short-lived presigned URL for downloading the pentest sub-agent network log + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSubAgentNetworkLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Sub-Agent Network Log + /dast/pentest/scans/{scanId}/logs/transactions: + get: + description: >- + Returns bounded terminal capture pages with attempt correlation. Stage filters represent recorded time windows, + which can overlap. + parameters: + - in: query + name: stage + schema: + type: string + - in: query + name: since + schema: + type: string + - in: query + name: until + schema: + type: string + - in: query + name: method + schema: + type: string + - in: query + name: path + schema: + type: string + - in: query + name: identityId + schema: + type: string + - in: query + name: evidenceRef + schema: + type: string + - in: query + name: cursor + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanNetworkTransactionsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get filtered pentest capture transactions + /dast/pentest/scans/{scanId}/report: + get: + description: Returns the report of a completed pentest scan + parameters: + - description: >- + Leave report parts out of the response; repeat for several. cases: auth-matrix case rows (counts stay). + exploitAnalysisResult, appendices: those sections. + in: query + name: exclude + schema: + description: >- + Leave report parts out of the response; repeat for several. cases: auth-matrix case rows (counts stay). + exploitAnalysisResult, appendices: those sections. + items: + type: string + type: array + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanReportOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Report + /dast/pentest/scans/{scanId}/report/download: + get: + description: Returns the download URL of a completed pentest scan report + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanReportDownloadURLOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Report Download URL + /dast/pentest/scans/{scanId}/report/external/pdf: + get: + description: >- + Returns a presigned URL to download the summary PDF report of a completed pentest scan: findings, severities and + statuses without the captured evidence behind them. Scans published before this edition existed have none and + return not found + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanReportExternalPDFOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan External Report PDF + /dast/pentest/scans/{scanId}/report/pdf: + get: + description: >- + Returns a presigned URL to download the internal PDF report until the summary edition is published, then the + customer-facing report with findings, evidence and remediation + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanReportPDFOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Report PDF + /dast/pentest/scans/{scanId}/status: + get: + description: >- + Lightweight pentest scan live-status poll. Returns the scan's lifecycle status, coarse progress, and the latest + agent-emitted phase / activity. `terminal` indicates the lifecycle has stopped progressing so the UI can stop + polling. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPentestScanProgressStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Scan Progress Status + /dast/pentest/scans/{scanId}/stop: + post: + description: Request to stop a pentest scan + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: scanId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStopPentestScanOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Stop Pentest Scan + /dast/pentest/start: + post: + description: >- + Customer requests are held for manual review without launching a pentest or probing the target. Only an approved + operator or the enabled internal onboarding dispatcher can launch the pentest workflow. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartPentestScanFromApplicationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartPentestScanFromApplicationOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Request Pentest Assessment + tags: + - Applications + - Pentest + /dast/scans/status/last: + get: + description: Returns the status of the most recent BugHunt scan for the tenant. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTLastScanStatusesOutput' + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Pentest Last Scan Status + /dast/sourceips: + get: + description: >- + Returns the public IP addresses from which DAST scans originate: the pentest rig elastic IPs and the NAT gateway + addresses hosted scans egress through + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSourceIPsOutput' + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Source IPs + /dast/targets: + get: + description: List DAST targets for the tenant + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTTargetsOutput' + description: OK + summary: List Targets + tags: + - Applications + - Vault + post: + description: Create (or reuse) a DAST target — a network endpoint applications are deployed on + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTTargetInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTTargetOutput' + description: OK + summary: Create Target + tags: + - Applications + - Vault + /dast/targets/{targetId}: + delete: + description: Soft-delete a DAST target + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteDASTTargetOutput' + description: OK + summary: Delete Target + tags: + - Applications + - Vault + get: + description: Get a DAST target by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTTargetOutput' + description: OK + summary: Get Target + tags: + - Applications + - Vault + put: + description: Update a DAST target + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTTargetInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTTargetOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Target + tags: + - Applications + - Vault + /dast/targets/{targetId}/classification: + put: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutTargetClassificationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTTargetOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Create Interactor [] + tags: + - Applications + /dast/targets/{targetId}/exploit-validation-consent: + delete: + description: Revoke the acceptance for runs that have not started; a running validation is not stopped + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsExploitValidationConsentOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Revoke Exploit Validation Write Risk + tags: + - Applications + get: + description: Read whether exploit validation may send mutating requests to a target, with the warning to show + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsExploitValidationConsentOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Exploit Validation Consent + tags: + - Applications + put: + description: >- + Accept that exploit validation may send mutating requests to a confirmed non-production target. A customer needs + the arming permission; Nullify staff record a customer's approval with the contact and evidence link + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutExploitValidationConsentInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsExploitValidationConsentOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Accept Exploit Validation Write Risk + tags: + - Applications + /dast/targets/{targetId}/validate: + post: + description: Check that a target is reachable — DNS resolves, the port is open, and (for TLS) the handshake completes + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTTargetValidationOutput' + description: OK + summary: Validate Target + tags: + - Applications + - Validation + - Vault + /dast/targets/{targetId}/validations: + get: + description: List a target's reachability-validation history + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: targetId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPaginatedValidations' + description: OK + summary: Target Validation History + tags: + - Applications + - Validation + - Vault + /dast/targets/validate: + post: + description: Check reachability for a batch of targets + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateTargetsInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsValidateTargetsOutput' + description: OK + summary: Validate Targets + tags: + - Applications + - Validation + - Vault + /dast/web-services: + get: + description: List DAST web services for the tenant + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTWebServicesOutput' + description: OK + summary: List Web Services + tags: + - Applications + - Vault + post: + description: Create a DAST web service — a source mapping deployed to one or more targets, reusable across applications + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTWebServiceInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTWebServiceOutput' + description: OK + summary: Create Web Service + tags: + - Applications + - Vault + /dast/web-services/{webServiceId}: + delete: + description: Soft-delete a DAST web service (refused while referenced by an application) + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteDASTWebServiceOutput' + description: OK + summary: Delete Web Service + tags: + - Applications + - Vault + get: + description: Get a DAST web service by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTWebServiceOutput' + description: OK + summary: Get Web Service + tags: + - Applications + - Vault + put: + description: Update a DAST web service + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTWebServiceInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutDASTWebServiceOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Update Web Service + tags: + - Applications + - Vault + /dast/web-services/{webServiceId}/access-validation: + post: + description: Check that a credential grants authenticated access to the web service + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTWebServiceAccessValidationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTWebServiceAccessValidationOutput' + description: OK + summary: Validate Web Service Access + tags: + - Applications + - Validation + - Vault + /dast/web-services/{webServiceId}/access-validations: + get: + description: List a web service's access-validation history + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPaginatedValidations' + description: OK + summary: Web Service Access Validation History + tags: + - Applications + - Validation + - Vault + /dast/web-services/{webServiceId}/credentials: + get: + description: List the credentials mapped to a DAST web service + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDASTWebServiceCredentialsOutput' + description: OK + summary: List Web Service Credentials + tags: + - Applications + - Vault + post: + description: Map a credential to a DAST web service + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTWebServiceCredentialInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTWebServiceCredentialOutput' + description: OK + summary: Map Credential to Web Service + tags: + - Applications + - Vault + /dast/web-services/{webServiceId}/credentials/{credentialId}: + delete: + description: Remove a credential mapping from a DAST web service + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + - in: path + name: credentialId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteDASTWebServiceCredentialOutput' + description: OK + summary: Unmap Credential from Web Service + tags: + - Applications + - Vault + /dast/web-services/{webServiceId}/status-validation: + post: + description: Check that the web service is live/reachable at its path (and whether it is blocked by a WAF/allowlist) + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDASTWebServiceStatusValidationOutput' + description: OK + summary: Validate Web Service Status + tags: + - Applications + - Validation + - Vault + /dast/web-services/{webServiceId}/status-validations: + get: + description: List a web service's status-validation history + parameters: + - in: query + name: nextToken + schema: + type: string + - in: query + name: limit + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: webServiceId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPaginatedValidations' + description: OK + summary: Web Service Status Validation History + tags: + - Applications + - Validation + - Vault + /manager/action-items: + get: + description: >- + List action items filtered by status / kind / team / finding / answer type / state / group. Ordered by priority + (severity, then how long the item has waited, then kind) unless sort=newest. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: query + name: status + schema: + type: string + - in: query + name: kind + schema: + type: string + - in: query + name: teamId + schema: + type: string + - description: if true, only items with team_id IS NULL (central security) + in: query + name: unassignedOnly + schema: + description: if true, only items with team_id IS NULL (central security) + type: boolean + - description: filter to items linked to this finding; must be paired with findingType + in: query + name: findingId + schema: + description: filter to items linked to this finding; must be paired with findingType + type: string + - description: required when findingId is set + in: query + name: findingType + schema: + description: required when findingId is set + type: string + - description: filter to one answer type, for example yes_no or team_picker + in: query + name: answerType + schema: + description: filter to one answer type, for example yes_no or team_picker + type: string + - description: >- + snoozed lists items snoozed until a later date; active lists the rest; waiting lists the active items that + are not blocked behind another item + in: query + name: state + schema: + description: >- + snoozed lists items snoozed until a later date; active lists the rest; waiting lists the active items that + are not blocked behind another item + type: string + - description: filter to the items of one group + in: query + name: groupKey + schema: + description: filter to the items of one group + type: string + - description: >- + priority (the default) orders by severity, then how long the item has waited, then kind; newest orders by + creation time, newest first; completed orders by the time the item was closed, most recent first + in: query + name: sort + schema: + description: >- + priority (the default) orders by severity, then how long the item has waited, then kind; newest orders by + creation time, newest first; completed orders by the time the item was closed, most recent first + type: string + - in: query + name: page + schema: + default: 1 + type: integer + - in: query + name: pageSize + schema: + default: 20 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetActionItemsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Action Items + /manager/action-items/{actionItemId}: + delete: + description: >- + Janitorial soft-delete, distinct from the agent-driven DISMISSED transition. A dismissed item recorded as + decided cannot be deleted: revoke the classification or reopen the item instead. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Soft-Delete Action Item + get: + description: Fetch a single action item with its linked findings. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Action Item + patch: + description: Reassign an action item's team. teamId="" is rejected; pass null to clear to central security. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Patch Action Item Team + /manager/action-items/{actionItemId}/answer: + post: + description: >- + Answer an OPEN action item with a typed answer. The answer is validated against the item's answerType and + answerSpec: an option must be one of the offered ones, a value must fit its bounds, and a reason is required + where an option asks for one. What the answer does is the chosen option's effect: a snooze hides the item for + the chosen days, a team becomes the owner of the repository, a chat account is mapped, a tacit-knowledge or + context answer is stored as memory and re-triages the findings, an escalation decision is recorded, a strategy + or the round's campaigns are accepted or declined. Only a dashboard user or the operator CLI may answer; + automation is refused. Giving a team ownership needs team management rights and mapping a chat account needs + user management rights. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAnswerActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAnswerActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Answer Action Item + /manager/action-items/{actionItemId}/assign-repo: + post: + description: >- + Resolve an UNASSIGNED_TEAM action item by making the picked team the owner of the item's whole repository, then + completing the item as decided. The team becomes the repository's only manual code owner and survives every + sync. Only a dashboard user or the operator CLI may; automation is refused. Rejected unless the item's + resolution mode is WIDGET_TEAM_PICKER. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAssignRepoActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAssignRepoActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Assign Repository Owner To Action Item + /manager/action-items/{actionItemId}/assign-team: + post: + description: >- + Resolve an UNASSIGNED_TEAM action item by assigning the owning team to every linked finding, then completing the + item. Rejected unless the item's resolution mode is WIDGET_TEAM_PICKER. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAssignTeamActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAssignTeamActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Assign Team To Action Item + /manager/action-items/{actionItemId}/chat: + put: + description: Returns an active action item's canonical Operator chat, creating the first binding when absent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutActionItemChatOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get or create action item chat + /manager/action-items/{actionItemId}/dismiss: + post: + description: >- + Dismiss an OPEN action item the human says needs no action (OPEN → DISMISSED) with a required reason. The + disposition is not_now (default, asked again after a cooldown) or decided (not asked again for the same subject + until someone reopens it; a person or the operator only). On an UNMAPPED_USER item, classify also records the + identity as a service account or as having no chat account. Classifying, and a decided dismissal of an + UNMAPPED_USER item, also need user management rights (administrator or operator). Recoverable via reopen. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDismissActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDismissActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Dismiss Action Item + /manager/action-items/{actionItemId}/map-user: + post: + description: >- + Resolve an UNMAPPED_USER action item by mapping its git user to a chat identity or marking it as a service + account, then completing the item. Rejected unless the item's resolution mode is WIDGET_USER_MAPPING. Answers + 409 and leaves the item open when the chat account was not stored: it was rejected earlier for this git user, + the mapping already holds a different one, or another git user holds it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsMapUserActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsMapUserActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Map User For Action Item + /manager/action-items/{actionItemId}/messages: + get: + description: Initial chat-history load for an action item's conversation; further updates stream over the chat WebSocket. + parameters: + - in: query + name: includeReplay + schema: + type: boolean + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: query + name: page + schema: + default: 1 + type: integer + - in: query + name: pageSize + schema: + default: 100 + type: integer + - in: path + name: actionItemId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetActionItemMessagesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Action Item Messages + /manager/action-items/{actionItemId}/nudge: + post: + description: Send another escalation direct message for an open action item. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsNudgeActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsNudgeActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Nudge Escalation Action Item + /manager/action-items/{actionItemId}/reopen: + post: + description: >- + Reopen an action item (→ OPEN) with a required reason. Accepts a DISMISSED item, or a COMPLETED item that + Nullify auto-resolved. A person or operator may also reopen a completed decided repository assignment; other + human completions are final. An UNMAPPED_USER item whose identity is classified is refused: revoke the + classification instead. Automation cannot reopen an item a person or the operator decided, and reopening a + decided UNMAPPED_USER item needs user management rights (administrator or operator). + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsReopenActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsReopenActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Reopen Action Item + /manager/action-items/{actionItemId}/snooze: + post: + description: >- + Hide an OPEN action item until a later date. The duration must be one the item's answerSpec offers (3, 7, 14 or + 30 days when it names none) and a reason is required and recorded. The item stays OPEN and is not nudged or + reported until snoozedUntil passes; answering it earlier is still possible. Only a dashboard user or the + operator CLI may snooze. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: actionItemId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsSnoozeActionItemInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsSnoozeActionItemOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Snooze Action Item + /manager/action-items/summary: + get: + description: >- + Counts of action items by status / kind / team / answer type, the waiting, snoozed and blocked split of the open + items, and the unrouted bucket (items the follow-up pass found no route for). + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetActionItemsSummaryOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Action Items Summary + /manager/campaigns: + get: + description: Returns a list of campaigns containing full campaign details. + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: List Campaigns + post: + description: Register a new campaign + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCampaignInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCampaignOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Post Campaign + /manager/campaigns/{campaignId}: + delete: + description: Delete a campaign (remove permanently) + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Delete Campaign + get: + description: Returns a campaign + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Campaign by ID + patch: + description: Update an existing campaign + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchCampaignInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchCampaignOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Patch Campaign + /manager/campaigns/{campaignId}/events: + get: + description: >- + Returns a list of events for a campaign. Alongside the agent's own actions it carries ticket creates and closes + on findings currently in the campaign (metaData.origin=ticket_audit), the newest 5000 of them; hasNextPage + counts within that retained inventory. + parameters: + - description: 'Page number, 1-indexed (default: 1)' + in: query + name: page + schema: + description: 'Page number, 1-indexed (default: 1)' + type: integer + - description: 'Number of events per page (default: 1000)' + in: query + name: pageSize + schema: + description: 'Number of events per page (default: 1000)' + type: integer + - description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) + in: query + name: actionTypes + schema: + description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) + items: + type: string + type: array + - description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) + in: query + name: statuses + schema: + description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) + items: + type: string + type: array + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Campaign Events + /manager/campaigns/{campaignId}/findings: + get: + description: Returns a list of findingIDs for current and historical findings within the campaign scope. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get (Triaged) Findings Associated with a campaign + /manager/campaigns/{campaignId}/preview: + get: + description: >- + Returns a campaign preview model, with title, description, and mapped finding IDs. For full campaign details use + the GetCampaign endpoint. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignPreviewOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Campaign Preview Details + /manager/campaigns/{campaignId}/runs: + get: + description: Returns the run history (one row per execution) for a campaign, ordered newest first. + parameters: + - in: query + name: cursor + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: Number of runs to skip; use instead of cursor to jump to a page + in: query + name: offset + schema: + description: Number of runs to skip; use instead of cursor to jump to a page + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignRunsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: List Campaign Runs + /manager/campaigns/{campaignId}/runs/{runId}: + get: + description: Returns a single campaign run with the resolved plan blob. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: campaignId + required: true + schema: + type: string + - in: path + name: runId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignRunOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Campaign Run + /manager/campaigns/default: + get: + description: Returns a list of generated default campaigns + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetDefaultCampaignsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Default Campaigns + /manager/campaigns/default/generate: + post: + description: >- + Trigger the campaign generator to create default campaigns. Follow the returned runId with GET + /manager/runs/{runId}. + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGenerateDefaultCampaignsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Generate Default Campaigns + /manager/campaigns/findings: + get: + description: Returns a list of all findings across all campaigns + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAllCampaignsFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get All Campaigns Findings + /manager/campaigns/metrics/refresh: + get: + description: Refresh and recalculate campaign metrics + parameters: + - description: 'Whether to include expired campaigns in the metrics refresh (default: false)' + in: query + name: includeExpired + schema: + description: 'Whether to include expired campaigns in the metrics refresh (default: false)' + type: boolean + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignMetricsRefreshOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Refresh Campaign Metrics + /manager/campaigns/previews: + get: + description: Returns a list of campaign previews with title, description, and mapped finding IDs + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - description: Maximum number of campaign previews to return; overrides pageSize when set + in: query + name: limit + schema: + description: Maximum number of campaign previews to return; overrides pageSize when set + nullable: true + type: integer + - description: Number of campaign previews to skip; overrides page when set + in: query + name: offset + schema: + description: Number of campaign previews to skip; overrides page when set + nullable: true + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignPreviewsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Campaign Previews + /manager/campaigns/summaries: + get: + description: Returns a list of campaign summaries from plans + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCampaignSummariesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Campaign Summaries + /manager/chat/general: + put: + description: Returns the authenticated user's single owner-scoped Operator General chat, creating it when absent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutGeneralChatOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get or create Operator General chat + /manager/chat/sessions: + get: + description: Returns a paginated list of chat sessions for the authenticated user. + parameters: + - in: query + name: limit + schema: + type: integer + - in: query + name: nextToken + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListChatSessionsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Chat Sessions + /manager/chat/sessions/{chatID}: + delete: + description: Delete a chat session and its associated chat history. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: chatID + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteChatSessionOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Delete Chat Session + get: + description: Returns a single chat session by ID. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: chatID + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetChatSessionOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Chat Session + patch: + description: Update the title of a chat session. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: chatID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchChatSessionInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchChatSessionOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Patch Chat Session + /manager/chat/sessions/{chatID}/actions: + get: + description: Returns the pending actions for a chat session. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: chatID + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetChatSessionActionsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Chat Session Actions + /manager/chat/sessions/{chatID}/audit: + get: + description: Returns the audit trail of actions taken in a chat session. + parameters: + - in: query + name: limit + schema: + type: integer + - in: query + name: nextToken + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: chatID + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetChatSessionAuditOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get chat session audit trail + /manager/chat/sessions/{chatID}/history: + get: + description: Returns the paginated message history for a chat session. + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - in: query + name: includeReplay + schema: + type: boolean + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: chatID + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetChatSessionHistoryOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Chat Session History + /manager/config: + get: + description: Fetches the Manager configuration for this tenant. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerConfigOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Manager config + post: + description: Stores the Manager configuration for this tenant. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostManagerConfigInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostManagerConfigOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Update Manager config + /manager/daily-summary/trigger: + post: + description: >- + Starts a manager run that writes the tenant's daily summary for the audience and posts it to the channel the + tenant has configured for that audience. Follow the returned runId with GET /manager/runs/{runId}. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriggerManagerDailySummaryInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriggerManagerDailySummaryOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Start a daily summary run + /manager/engagement/users: + get: + description: Returns developer messaging activity for a campaign over the retained delivery window + parameters: + - in: query + name: campaignId + schema: + type: string + - in: query + name: since + schema: + type: string + - in: query + name: cursor + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetEngagementUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Developer Engagement + /manager/escalation-recipients: + get: + description: List mapped chat accounts eligible for manual escalation nudges. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetEscalationRecipientsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Escalation Recipients + /manager/escalations/config: + get: + description: >- + Get the per-tenant escalation routing config: where Nullify delivers escalations (direct message, channel, or + both) and which channel. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerEscalationConfigOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Escalation Config + put: + description: >- + Set the per-tenant escalation routing config: deliver escalations as a direct message, a channel post, or both. + A channel is required when the mode includes channel delivery. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutManagerEscalationConfigInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutManagerEscalationConfigOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Put Escalation Config + /manager/events: + get: + description: Returns a list of events across all campaigns + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Events + /manager/events/{eventId}: + delete: + description: Delete a single event by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: eventId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteEventOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Delete Event + /manager/events/deduplicate: + post: + description: Remove duplicate events + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDeduplicateEventsInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostDeduplicateEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Deduplicate Events + /manager/findings/{findingId}/events: + get: + description: Returns a list of events associated with a finding + parameters: + - description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) + in: query + name: actionTypes + schema: + description: Filter by action types (e.g., PR_CREATE, TICKET_CREATE) + items: + type: string + type: array + - description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) + in: query + name: statuses + schema: + description: Filter by statuses (e.g., PENDING, SUCCESSFUL, ERROR) + items: + type: string + type: array + - description: Maximum number of events to return (default 100, max 1000) + in: query + name: limit + schema: + description: Maximum number of events to return (default 100, max 1000) + type: integer + - description: Pagination cursor from previous request + in: query + name: cursor + schema: + description: Pagination cursor from previous request + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Finding Events + /manager/fix-prs/{recordId}/nudge: + get: + description: Show who a reviewer nudge on a fix pull request would reach, and the message it would send. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: recordId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetFixPRNudgeOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Preview Fix PR Nudge + post: + description: Send a governed direct message asking a fix pull request's reviewers, or the chosen chat accounts, to review it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: recordId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsNudgeFixPRInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsNudgeFixPROutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Nudge Fix PR Reviewers + /manager/groundrules: + get: + description: Fetches the ground rules Nullify follows for this tenant. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerGroundRulesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Manager ground rules + patch: + description: Update an existing ground rules + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchGroundRulesInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchGroundRulesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Patch a GroundRules object + post: + description: Provide a list of enabled/disabled action types + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostManagerGroundRulesInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostManagerGroundRulesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Post a GroundRules object + /manager/identity-classifications: + get: + description: >- + List the git identities classified as service accounts or as having no chat account, newest first, optionally + for one decision. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: service_account or no_chat_account; empty lists both + in: query + name: decision + schema: + description: service_account or no_chat_account; empty lists both + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListIdentityClassificationsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Git Identity Classifications + post: + description: >- + Record that a git identity is a service account or has no chat account, and close its live UNMAPPED_USER item as + decided so the question is not asked again. An administrator or the operator only; undo with the revoke + endpoint. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsClassifyIdentityInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsClassifyIdentityOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Classify Git Identity + /manager/identity-classifications/{provider}/{providerUserId}: + delete: + description: >- + Undo a classification and reopen the identity's latest UNMAPPED_USER item so the question is asked again. An + administrator or the operator only. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: why the classification is being undone; recorded in the audit row + in: query + name: reason + schema: + description: why the classification is being undone; recorded in the audit row + maxLength: 500 + type: string + - in: path + name: provider + required: true + schema: + type: string + - in: path + name: providerUserId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsRevokeIdentityClassificationOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Revoke Git Identity Classification + /manager/metrics: + get: + description: Returns metrics for the manager + parameters: + - in: query + name: asOf + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerMetricsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Metrics + /manager/onboarding/wizard-progress: + post: + description: >- + Stream a per-step onboarding-wizard progress update to the tenant's internal Slack channel. Fail-open: a Slack + miss never blocks the wizard. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWizardProgressInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsWizardProgressOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Onboarding Wizard Progress + /manager/plans: + get: + description: Returns a list of plans + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - in: query + name: campaignId + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetPlansOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Plans + /manager/program: + get: + description: >- + Return the standing doctrine for how the security program runs. A tenant that has not stated one gets the + default, which delegates nothing. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecurityProgramOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Security Program + patch: + description: >- + State or restate how the security program runs: how much Manager may do unattended, how much work it may commit + to, and how often the program is reviewed. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecurityProgramInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecurityProgramOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: State Security Program + /manager/proposals: + get: + description: >- + Return the proposed campaigns still waiting on a human decision, newest round first. A proposed strategy version + is decided through its own surface and is not listed here. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetProposalsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Open Proposals + /manager/proposals/decision: + post: + description: >- + Accept or reject a proposed campaign. Accepting starts it; the campaign already exists and acceptance moves it + out of PROPOSED. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostProposalDecisionInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostProposalDecisionOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Decide Proposed Campaign + /manager/runs/{runId}: + get: + description: >- + Returns the state of a strategy, campaign-generation or campaign run and the strategy, campaigns and campaign + runs it wrote. A run that succeeded without writing anything is reported SKIPPED. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: runId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerRunOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Manager Run + /manager/state: + get: + description: Returns the current state of the manager + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Manager State + /manager/state/latest: + get: + description: Returns the current state of the manager (legacy endpoint) + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Manager State (Legacy) + /manager/states: + get: + description: Returns a history of manager states + parameters: + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetManagerStatesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Manager States + /manager/strategy: + get: + description: Get the currently active security program strategy. A tenant with no strategy yet gets an empty object. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetStrategyOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Active Strategy + patch: + description: Edit the active security program strategy. Each edit creates a new version. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchStrategyInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchStrategyOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Patch Active Strategy + /manager/strategy/proposal: + get: + description: >- + Return the strategy version awaiting a decision, if any. A version written by an agent is a proposal until a + human accepts it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetStrategyProposalOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Proposed Strategy + /manager/strategy/proposal/decision: + post: + description: >- + Accept or reject the proposed strategy version. Accepting puts it in force and points the security program at + it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostStrategyProposalDecisionInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostStrategyProposalDecisionOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Decide Proposed Strategy + /manager/strategy/trigger: + post: + description: >- + Trigger the strategy agent to generate a new security program strategy. Follow the returned runId with GET + /manager/runs/{runId}. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriggerStrategyOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Trigger Strategy Generation + /manager/strategy/versions: + get: + description: Get historical security program strategy versions in descending order. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: query + name: page + schema: + type: integer + - in: query + name: pageSize + schema: + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListStrategyVersionsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Strategy Versions + /manager/tacit-knowledge/trigger: + post: + description: Trigger the tacit knowledge to process findings and generate customer questions + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriggerTacitKnowledgeOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Trigger TacitKnowledge + /manager/threat-investigations: + get: + description: Returns a list of threat investigations detected by threat intelligence + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: query + name: page + schema: + default: 1 + type: integer + - in: query + name: pageSize + schema: + default: 20 + type: integer + - description: Maximum number of investigations to return; overrides pageSize when set + in: query + name: limit + schema: + description: Maximum number of investigations to return; overrides pageSize when set + nullable: true + type: integer + - description: Number of investigations to skip; overrides page when set + in: query + name: offset + schema: + description: Number of investigations to skip; overrides page when set + nullable: true + type: integer + - description: Case-insensitive title, CVE, package or ecosystem substring + in: query + name: search + schema: + description: Case-insensitive title, CVE, package or ecosystem substring + type: string + - in: query + name: severity + schema: + type: string + - in: query + name: ecosystem + schema: + type: string + - description: >- + Case-insensitive status: PENDING, INVESTIGATING, INVESTIGATED, REMEDIATING, RESOLVED, FAILED, + NEEDS_REINVESTIGATION or WITHDRAWN + in: query + name: status + schema: + description: >- + Case-insensitive status: PENDING, INVESTIGATING, INVESTIGATED, REMEDIATING, RESOLVED, FAILED, + NEEDS_REINVESTIGATION or WITHDRAWN + type: string + - description: Only investigations with at least one affected repository + in: query + name: affectedOnly + schema: + description: Only investigations with at least one affected repository + type: boolean + - description: 'recent (default) or affected: most affected repositories first' + in: query + name: sort + schema: + description: 'recent (default) or affected: most affected repositories first' + enum: + - recent + - affected + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetThreatInvestigationsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Threat Investigations + post: + description: Create a new threat investigation in PENDING status + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatInvestigationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatInvestigationOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Post Threat Investigation + /manager/threat-investigations/{threatInvestigationId}: + get: + description: Returns a single threat investigation with its events + parameters: + - in: query + name: includeVersions + schema: + type: boolean + - in: query + name: versionLimit + schema: + default: 20 + type: integer + - in: query + name: versionOffset + schema: + default: 0 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: threatInvestigationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetThreatInvestigationOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Threat Investigation + patch: + description: Perform an action on a threat investigation (e.g. activate) + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: threatInvestigationId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchThreatInvestigationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchThreatInvestigationOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Patch Threat Investigation + /manager/threat-investigations/{threatInvestigationId}/progress: + get: + description: Returns the stages of the investigation's newest run, oldest first + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: threatInvestigationId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetThreatInvestigationProgressOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Threat Investigation Progress + /manager/threat-reports: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: query + name: page + schema: + default: 1 + type: integer + - in: query + name: pageSize + schema: + default: 20 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsListThreatReportsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List My Reported Threats + post: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatReportInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatReportOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Report a Threat + /manager/threat-reports/{requestId}: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: requestId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatReportOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Threat Report Status + /manager/threat-reports/{requestId}/resubmit: + post: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: requestId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatReportOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Resubmit a Reported Threat + /manager/threat-reports/{requestId}/withdraw: + post: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: requestId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatReportOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Withdraw a Reported Threat + /manager/threats: + get: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: query + name: page + schema: + default: 1 + type: integer + - in: query + name: pageSize + schema: + default: 20 + type: integer + - in: query + name: cveId + schema: + nullable: true + type: string + - description: 'Matches a threat known by this id in any database: its Nullify id, a CVE, GHSA, OSV or vendor advisory id' + in: query + name: advisoryId + schema: + description: 'Matches a threat known by this id in any database: its Nullify id, a CVE, GHSA, OSV or vendor advisory id' + nullable: true + type: string + - in: query + name: ecosystem + schema: + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - description: Case-insensitive search over threat title, CVE/GHSA/MAL identifiers and affected package names + in: query + name: q + schema: + description: Case-insensitive search over threat title, CVE/GHSA/MAL identifiers and affected package names + maxLength: 200 + nullable: true + type: string + - description: affected keeps threats your assessment found affecting a repository + in: query + name: verdict + schema: + description: affected keeps threats your assessment found affecting a repository + enum: + - affected + nullable: true + type: string + - description: >- + malware has an OSV MAL id, vulnerability a CVE or another public advisory id, campaign none but its Nullify + id + in: query + name: kind + schema: + description: >- + malware has an OSV MAL id, vulnerability a CVE or another public advisory id, campaign none but its + Nullify id + enum: + - malware + - vulnerability + - campaign + nullable: true + type: string + - description: 'YYYY-MM-DD or RFC 3339: keeps threats whose advisory was published at or after it' + in: query + name: publishedAfter + schema: + description: 'YYYY-MM-DD or RFC 3339: keeps threats whose advisory was published at or after it' + nullable: true + type: string + - description: 'YYYY-MM-DD or RFC 3339: keeps threats whose advisory was published before it' + in: query + name: publishedBefore + schema: + description: 'YYYY-MM-DD or RFC 3339: keeps threats whose advisory was published before it' + nullable: true + type: string + - description: published (default) lists the newest advisory publication first; researched the newest research + in: query + name: sort + schema: + description: published (default) lists the newest advisory publication first; researched the newest research + enum: + - published + - researched + nullable: true + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetThreatCatalogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Threat Catalog + /manager/threats/{threatId}/investigate: + post: + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: threatId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatCatalogInvestigationInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostThreatInvestigationOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Investigate Threat in My Environment + /manager/trigger: + post: + description: Starts a Manager run for this tenant. Follow the returned runId with GET /manager/runs/{runId}. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriggerCampaignsOrchestratorInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriggerCampaignsOrchestratorOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Start a Manager run + /orchestrator/autofix/batch: + post: + description: Start a batch autofix job to fix multiple findings + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBatchAutofixInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBatchAutofixOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start Batch Autofix + /orchestrator/autofix/batch/{executionId}: + get: + description: Get the status of a batch autofix execution + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: executionId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetBatchAutofixStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Batch Autofix Status + /orchestrator/autofix/iterate-pr: + post: + description: Queue an existing Nullify autofix PR for rebase onto its base branch and promotion to ready for review. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostIterateAutofixPRInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostIterateAutofixPROutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Iterate Autofix PR + /orchestrator/checkruns: + get: + description: List Nullify check runs for explicitly addressed or reachable commits + parameters: + - description: Only return check runs started at or after this RFC3339 timestamp + in: query + name: since + schema: + description: Only return check runs started at or after this RFC3339 timestamp + type: string + - description: Also read check runs on each repository's default branch head + in: query + name: includeDefaultBranch + schema: + description: Also read check runs on each repository's default branch head + type: boolean + - description: Maximum repositories to read (default 50, max 200) + in: query + name: maxRepositories + schema: + description: Maximum repositories to read (default 50, max 200) + type: integer + - description: Filter by provider repository IDs + in: query + name: repositoryId + schema: + description: Filter by provider repository IDs + items: + type: string + type: array + - description: Read exact repository and commit pairs formatted as : + in: query + name: repositoryCommit + schema: + description: Read exact repository and commit pairs formatted as : + items: + type: string + type: array + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCheckRunsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Check Runs + /orchestrator/checkruns/override: + post: + description: Force-complete an eligible Nullify check run as passing and record the override audit event + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCheckRunOverrideInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCheckRunOverrideOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Override Check Run + /orchestrator/codereviews: + get: + description: >- + Get the list of code reviews for the tenant. blocked=true returns only pull requests whose latest run failed the + Nullify check and was not overridden, scoped to the caller's team repositories. + parameters: + - description: Pagination token for the next page of results + in: query + name: nextToken + schema: + description: Pagination token for the next page of results + nullable: true + type: string + - description: Pagination offset; overrides nextToken when set + in: query + name: offset + schema: + description: Pagination offset; overrides nextToken when set + nullable: true + type: integer + - description: Maximum number of code reviews to return per page + in: query + name: limit + schema: + description: Maximum number of code reviews to return per page + nullable: true + type: integer + - description: >- + Only pull requests whose latest run failed the Nullify check (findings or a blocking incomplete scan) and + was not overridden + in: query + name: blocked + schema: + description: >- + Only pull requests whose latest run failed the Nullify check (findings or a blocking incomplete scan) and + was not overridden + nullable: true + type: boolean + - description: RFC 3339 lower bound on a blocked run's start time; defaults to 14 days ago. Only applies with blocked=true + in: query + name: since + schema: + description: >- + RFC 3339 lower bound on a blocked run's start time; defaults to 14 days ago. Only applies with + blocked=true + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCodeReviewsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Code Reviews + /orchestrator/codereviews/{id}: + get: + description: Get a specific code review by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetCodeReviewOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Code Review + /orchestrator/findings/{findingID}/autofix-iterations: + get: + description: Returns the autofix iteration timeline for a finding, oldest first. + parameters: + - in: query + name: findingType + required: true + schema: + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingID + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetFindingAutofixIterationsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Autofix Iterations + /orchestrator/findings/{findingID}/ticket/close: + post: + description: 'Close the ticket attached to a finding. Idempotent: a no-op when the ticket is already in a terminal state.' + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingID + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCloseFindingTicketInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCloseFindingTicketOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Close Finding Ticket + /orchestrator/findings/retriage: + post: + description: >- + Queue findings for retriage processing. At most 100 finding ids per request. debounceBypass and + filters.forceRetriage are reserved for internal and admin callers. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostRetriageFindingsInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostRetriageFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Retriage Findings + /orchestrator/findings/retriage/{activityId}: + get: + description: Report a re-triage activity and the outcome of each of its findings + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: activityId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetRetriageActivityOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Retriage Activity + /orchestrator/onboarding/requirements: + get: + description: >- + The setup items the tenant must finish before submitting onboarding, and the ones its connected integrations do + not yet satisfy + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsOnboardingRequirementsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Onboarding Requirements + /orchestrator/onboarding/start: + post: + description: Start the onboarding pipeline for the tenant + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartOnboardingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartOnboardingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Start Onboarding + /orchestrator/onboarding/status: + get: + description: Get the current onboarding status for the tenant + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetOnboardingStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Onboarding Status + /orchestrator/repositories/{repositoryId}/pull-requests/{number}/reviews: + post: + description: >- + Run the AI code review on an open pull request's head commit and return the pipeline run id to poll through GET + /orchestrator/repositories/{repositoryId}/scans/{runId}. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: number + required: true + schema: + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartPullRequestReviewOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start Pull Request Review + /orchestrator/repositories/{repositoryId}/scans: + post: + description: >- + Scan the head of a repository's default branch with the chosen scanners and return the pipeline run id to poll. + A branch with a run in flight returns that run instead; a Nullify scan scope backfill is queued behind it + (queued). The scan runs the push pipeline, which also opens the commit's check run and runs its repo-context + preflight and SBOM; sideEffects lists them. triage=off runs no AI triage; sca and scpm refuse it. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: Repository to scan + in: path + name: repositoryId + required: true + schema: + description: Repository to scan + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartRepositoryScanInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsStartRepositoryScanOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Start Repository Scan + /orchestrator/repositories/{repositoryId}/scans/{runId}: + get: + description: Read a pipeline run's state and the scanner runs recorded for its commit. + parameters: + - description: Comma-separated scanners the run is waited on; defaults to every scanner the run dispatches + in: query + name: services + schema: + description: Comma-separated scanners the run is waited on; defaults to every scanner the run dispatches + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: repositoryId + required: true + schema: + type: string + - in: path + name: runId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetRepositoryScanOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Repository Scan + /orchestrator/runs/{kind}/{runId}/control: + post: + description: >- + Stop, steer, approve or deny a running agent. Records a control row in the run's stream; the agent answers with + a control.ack event. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: 'Run kind: pentest, autofix, threat_investigation or scan' + in: path + name: kind + required: true + schema: + description: 'Run kind: pentest, autofix, threat_investigation or scan' + type: string + - description: The run id the kind's feed streams under + in: path + name: runId + required: true + schema: + description: The run id the kind's feed streams under + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostRunControlInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostRunControlOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Too Many Requests + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Control Run + /orchestrator/runs/{kind}/{runId}/control/capabilities: + get: + description: Which control actions the caller can use on a run right now + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: kind + required: true + schema: + type: string + - in: path + name: runId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetRunControlCapabilitiesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Run Control Capabilities + /sast/events: + get: + description: "Returns SAST events after a specified timestamp or event ID.\n\t\tAll events are returned if no timestamp or event ID is provided.\n\t\tA maximum of 100 events can be returned per request." + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: fromTime + schema: + nullable: true + type: string + - in: query + name: eventType + schema: + items: + type: string + type: array + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: findingId + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SAST Events + /sast/findings: + get: + description: Returns a filtered set of SAST findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: priorityLabel + schema: + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: hasPullRequest + schema: + nullable: true + type: boolean + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if not provided, all repositories will be included + in: query + name: repositoryIds + schema: + description: if not provided, all repositories will be included + items: + type: string + type: array + - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isArchived + schema: + nullable: true + type: boolean + - description: true = AI code-review only, false = rule-only, omitted = both + in: query + name: aiGenerated + schema: + description: true = AI code-review only, false = rule-only, omitted = both + nullable: true + type: boolean + - in: query + name: isLatest + schema: + nullable: true + type: boolean + - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) + in: query + name: autoFixState + schema: + $ref: '#/components/schemas/ModelsAutoFixState' + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SAST Findings + /sast/findings/{findingId}: + get: + description: Returns a given finding with explanation and impact + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding + patch: + description: Update a given finding with the fields provided + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSASTFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSASTFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Finding + /sast/findings/{findingId}/allowlist: + post: + description: Allowlists a finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSASTFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSASTFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Finding + /sast/findings/{findingId}/autofix/activity: + get: + description: >- + Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SAST Finding Autofix Activity + /sast/findings/{findingId}/autofix/cache/diff: + get: + description: Gets the git diffs for a finding's proposed autofix, or empty diffs when no cached fix exists. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingFixOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Finding Autofix Diff + /sast/findings/{findingId}/autofix/fix: + post: + description: Creates a pull request to fix a given finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAutofixSASTFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAutofixSASTFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Post Finding AutoFix + /sast/findings/{findingId}/autofix/state: + get: + description: >- + Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; + the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingAutofixStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SAST Finding Autofix State + /sast/findings/{findingId}/autofix/status: + get: + description: Lightweight per-finding autofix lifecycle status for UI polling. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingAutofixStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SAST Finding Autofix Status + /sast/findings/{findingId}/events: + get: + description: Returns a list of events for a given finding. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Events + /sast/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a finding: closes it on the configured ticket integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketSASTFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket + post: + description: Creates a ticket for a given finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the finding to create a Jira ticket for + in: path + name: findingId + required: true + schema: + description: The ID of the finding to create a Jira ticket for + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSASTFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSASTFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket + /sast/findings/{findingId}/triage: + get: + description: Returns triage data with disposition flags and priority from the current finding; report text remains historical + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Triaged Finding + /sast/findings/{findingId}/unallowlist: + post: + description: Unallowlists a finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistSASTFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist Finding + /sast/findings/{findingId}/users: + get: + description: Returns the users associated with a specific finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Users + /sast/findings/allowlist: + post: + description: Allowlist a list of SAST findings, by findingsID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowListSASTFindingBatchInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Batch of SAST Findings + /sast/findings/detailed: + get: + description: Returns current SAST findings in default branches + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: priorityLabel + schema: + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - in: query + name: language + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: hasPullRequest + schema: + nullable: true + type: boolean + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if set, only findings for this repository are returned + in: query + name: repositoryId + schema: + description: if set, only findings for this repository are returned + nullable: true + type: string + - description: if set, only findings in one of these files are returned + in: query + name: filePath + schema: + description: if set, only findings in one of these files are returned + items: + type: string + type: array + - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isArchived + schema: + nullable: true + type: boolean + - description: true = AI code-review only, false = rule-only, omitted = both + in: query + name: aiGenerated + schema: + description: true = AI code-review only, false = rule-only, omitted = both + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingsDetailedOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Findings Detailed + /sast/findings/preview: + get: + description: Returns a filtered set of SAST findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: priorityLabel + schema: + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: hasPullRequest + schema: + nullable: true + type: boolean + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if not provided, all repositories will be included + in: query + name: repositoryIds + schema: + description: if not provided, all repositories will be included + items: + type: string + type: array + - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isArchived + schema: + nullable: true + type: boolean + - description: true = AI code-review only, false = rule-only, omitted = both + in: query + name: aiGenerated + schema: + description: true = AI code-review only, false = rule-only, omitted = both + nullable: true + type: boolean + - in: query + name: isLatest + schema: + nullable: true + type: boolean + - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) + in: query + name: autoFixState + schema: + $ref: '#/components/schemas/ModelsAutoFixState' + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SAST Findings + /sast/repositories: + get: + description: >- + Returns a map of repository stats. The map is sorted by repositoryID and contains a list of repository stats for + each repositoryID. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTRepositoriesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Repositories + /sast/repositories/{repositoryId}: + get: + description: >- + Returns a sorted map of repository stats. The map is sorted by repositoryID and contains a list of repository + stats for each repositoryID. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: repositoryId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSASTRepositoryOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Repository Stats + /sast/scan-runs: + get: + parameters: + - description: Repository ID to list scan runs for + in: query + name: repositoryId + required: true + schema: + description: Repository ID to list scan runs for + type: string + - description: Max scan runs per page (default 10, max 50) + in: query + name: limit + schema: + description: Max scan runs per page (default 10, max 50) + nullable: true + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + nullable: true + type: integer + - description: Sort order by start time (default newest) + in: query + name: sort + schema: + description: Sort order by start time (default newest) + enum: + - newest + - oldest + nullable: true + type: string + - description: Only include scan runs started at or after this RFC3339 timestamp + in: query + name: from + schema: + description: Only include scan runs started at or after this RFC3339 timestamp + nullable: true + type: string + - description: Only include scan runs started at or before this RFC3339 timestamp + in: query + name: to + schema: + description: Only include scan runs started at or before this RFC3339 timestamp + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetScanRunsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Scan Runs + /sca/containers/findings: + get: + description: Returns a filtered set of SCA container findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: package + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - description: combination of isFixed, isFalsePositive and isAllowlisted + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive and isAllowlisted + nullable: true + type: boolean + - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) + in: query + name: autoFixState + schema: + $ref: '#/components/schemas/ModelsAutoFixState' + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Container Findings + /sca/containers/findings/{findingId}: + get: + description: Returns a given finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Container Finding + patch: + description: Update a given finding with the fields provided + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSCAContainerFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSCAContainerFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Container Finding + /sca/containers/findings/{findingId}/allowlist: + post: + description: Allowlist a container finding and record reason + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSCAContainerFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Container Finding + /sca/containers/findings/{findingId}/autofix/activity: + get: + description: >- + Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Container Finding Autofix Activity + /sca/containers/findings/{findingId}/autofix/fix: + post: + description: Raises fix PRs for existing container findings given their IDs + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSCAContainerFindingFixInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSCAContainerFindingFixOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Fix Container Findings + /sca/containers/findings/{findingId}/autofix/state: + get: + description: >- + Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; + the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingAutofixStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Container Finding Autofix State + /sca/containers/findings/{findingId}/autofix/status: + get: + description: Lightweight per-finding autofix lifecycle status for UI polling. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingAutofixStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Container Finding Autofix Status + /sca/containers/findings/{findingId}/events: + get: + description: Returns a list of events for a given finding. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Container Finding Events + /sca/containers/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a container finding: closes it on the configured integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the SCA finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the SCA finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketSCAFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for Container Finding + post: + description: Creates a ticket for a given container finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketContainerFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketDependencyFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket + /sca/containers/findings/{findingId}/triage: + get: + description: Returns current finding and priority with historical assessment text, severity and factors + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Triaged Finding + /sca/containers/findings/{findingId}/triage/activity: + get: + description: >- + Cursor-paginated triage activity log for UI polling. Returns empty list when no triage run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetTriageActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Container Finding Triage Activity + /sca/containers/findings/{findingId}/triage/status: + get: + description: >- + Lightweight per-finding triage lifecycle status for UI polling. Missing required context reports `status: + deferred`, `currentPhase: waiting_for_context` and `terminal: false`. Budget or capacity can defer resumed + triage independently. Completed/failed runs are terminal; status is empty when no triage run or deferral exists. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriageStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Container Finding Triage Status + /sca/containers/findings/{findingId}/unallowlist: + post: + description: Unallowlist a container finding and record reason + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistSCAContainerFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist Container Finding + /sca/containers/findings/{findingId}/users: + get: + description: Returns the users related to a given finding based on git history + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Related Users + /sca/containers/findings/detailed: + get: + description: Returns current SCA container findings in default branches based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: package + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if set, only findings for this repository are returned + in: query + name: repositoryId + schema: + description: if set, only findings for this repository are returned + nullable: true + type: string + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - description: combination of isFixed, isFalsePositive and isAllowlisted + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive and isAllowlisted + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingsDetailedOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get SCA Container Findings [DEPRECATED - TO BE REMOVED BY 2025] + /sca/containers/findings/preview: + get: + description: Returns a filtered set of SCA container findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: package + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - description: combination of isFixed, isFalsePositive and isAllowlisted + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive and isAllowlisted + nullable: true + type: boolean + - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) + in: query + name: autoFixState + schema: + $ref: '#/components/schemas/ModelsAutoFixState' + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAContainerFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Container Findings Preview + /sca/dependencies/findings: + get: + description: Returns a filtered set of SCA dependency findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: package + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - description: combination of isFixed, isFalsePositive and isAllowlisted + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive and isAllowlisted + nullable: true + type: boolean + - description: true to return only findings where one lockfile resolved the package to multiple versions + in: query + name: hasMultipleVersions + schema: + description: true to return only findings where one lockfile resolved the package to multiple versions + nullable: true + type: boolean + - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) + in: query + name: autoFixState + schema: + $ref: '#/components/schemas/ModelsAutoFixState' + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Dependency Findings + /sca/dependencies/findings/{findingId}: + get: + description: Returns a given finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding + patch: + description: Update a given finding with the fields provided + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSCADependencyFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSCADependencyFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Dependencies Finding + /sca/dependencies/findings/{findingId}/allowlist: + post: + description: Allowlist a dependency finding and record reason + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSCADependencyFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Dependency Finding + /sca/dependencies/findings/{findingId}/autofix/activity: + get: + description: >- + Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Dependency Finding Autofix Activity + /sca/dependencies/findings/{findingId}/autofix/cache/diff: + get: + description: Gets the git diffs for a finding's proposed fix + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingFixOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get SCA Dependency Finding Fix + /sca/dependencies/findings/{findingId}/autofix/fix: + post: + description: Raises fix PRs for existing dependency finding given its ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSCADependencyFindingFixInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostSCADependencyFindingFixOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Fix Dependency Finding + /sca/dependencies/findings/{findingId}/autofix/state: + get: + description: >- + Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; + the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingAutofixStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Dependency Finding Autofix State + /sca/dependencies/findings/{findingId}/autofix/status: + get: + description: Lightweight per-finding autofix lifecycle status for UI polling. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingAutofixStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Dependency Finding Autofix Status + /sca/dependencies/findings/{findingId}/events: + get: + description: Returns a list of events for a given finding. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Dependency Finding Events + /sca/dependencies/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a dependency finding: closes it on the configured integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the SCA finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the SCA finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketSCAFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for Dependency Finding + post: + description: Creates a ticket for a given dependency finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketDependencyFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketDependencyFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket + /sca/dependencies/findings/{findingId}/triage: + get: + description: Returns current finding and priority with historical assessment text, severity and factors + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Triaged Finding + /sca/dependencies/findings/{findingId}/triage/activity: + get: + description: >- + Cursor-paginated triage activity log for UI polling. Returns empty list when no triage run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetTriageActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Dependency Finding Triage Activity + /sca/dependencies/findings/{findingId}/triage/status: + get: + description: >- + Lightweight per-finding triage lifecycle status for UI polling. Missing required context reports `status: + deferred`, `currentPhase: waiting_for_context` and `terminal: false`. Budget or capacity can defer resumed + triage independently. Completed/failed runs are terminal; status is empty when no triage run or deferral exists. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsTriageStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Dependency Finding Triage Status + /sca/dependencies/findings/{findingId}/unallowlist: + post: + description: Unallowlist a dependency finding and record reason + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistSCADependencyFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist Dependency Finding + /sca/dependencies/findings/{findingId}/users: + get: + description: Returns the users related to a given finding based on git history + parameters: + - in: query + name: sourceOwnerOnly + required: false + schema: + type: boolean + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Get Finding Related Users + /sca/dependencies/findings/detailed: + get: + description: Returns current SCA findings in default branches based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: package + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if set, only findings for this repository are returned + in: query + name: repositoryId + schema: + description: if set, only findings for this repository are returned + nullable: true + type: string + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - description: combination of isFixed, isFalsePositive and isAllowlisted + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive and isAllowlisted + nullable: true + type: boolean + - description: true to return only findings where one lockfile resolved the package to multiple versions + in: query + name: hasMultipleVersions + schema: + description: true to return only findings where one lockfile resolved the package to multiple versions + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingsDetailedOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Dependency Findings Detailed [DEPRECATED - TO BE REMOVED BY 2025] + /sca/dependencies/findings/preview: + get: + description: Returns a filtered set of SCA dependency findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: package + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - description: combination of isFixed, isFalsePositive and isAllowlisted + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive and isAllowlisted + nullable: true + type: boolean + - description: true to return only findings where one lockfile resolved the package to multiple versions + in: query + name: hasMultipleVersions + schema: + description: true to return only findings where one lockfile resolved the package to multiple versions + nullable: true + type: boolean + - description: filter by AutoFixState (e.g. 'none' for findings with no cached fix) + in: query + name: autoFixState + schema: + $ref: '#/components/schemas/ModelsAutoFixState' + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCADependencyFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Dependency Findings Preview + /sca/events: + get: + description: "Returns SCA events after a specified timestamp or event ID.\n\t\tAll events are returned if no timestamp or event ID is provided.\n\t\tA maximum of 100 events can be returned per request." + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: fromTime + schema: + nullable: true + type: string + - in: query + name: eventType + schema: + items: + type: string + type: array + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: findingId + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCA Events + /sca/repositories: + get: + description: >- + Returns a sorted map of repository stats. The map is sorted by repositoryID and contains a list of repository + stats for each repositoryID. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCARepositoriesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Repository Stats + /sca/repositories/{repositoryId}: + get: + description: >- + Returns a sorted map of repository stats. The map is sorted by repositoryID and contains a list of repository + stats for each repositoryID. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: repositoryId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCARepositoryOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Repository Stats + /sca/scan-runs: + get: + parameters: + - description: Repository ID to list scan runs for + in: query + name: repositoryId + required: true + schema: + description: Repository ID to list scan runs for + type: string + - description: SCA scan type + in: query + name: scanType + required: true + schema: + description: SCA scan type + enum: + - sca_dependencies + - sca_containers + type: string + - description: Max scan runs per page (default 10, max 50) + in: query + name: limit + schema: + description: Max scan runs per page (default 10, max 50) + nullable: true + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + nullable: true + type: integer + - description: Sort order by start time (default newest) + in: query + name: sort + schema: + description: Sort order by start time (default newest) + enum: + - newest + - oldest + nullable: true + type: string + - description: Only include scan runs started at or after this RFC3339 timestamp + in: query + name: from + schema: + description: Only include scan runs started at or after this RFC3339 timestamp + nullable: true + type: string + - description: Only include scan runs started at or before this RFC3339 timestamp + in: query + name: to + schema: + description: Only include scan runs started at or before this RFC3339 timestamp + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetScanRunsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Scan Runs + /sca/threat-feed: + get: + deprecated: true + description: >- + Deprecated: use GET /manager/threats, which lists the same research with this tenant's assessment of each + threat. Responses carry Deprecation and Link (rel=successor-version) headers. Returns Nullify's global + threat-research feed, newest first, optionally filtered by CVE, ecosystem, or severity. The feed is + tenant-agnostic intelligence and carries no tenant data. Returns 503 when the feed backend is unreachable rather + than faking an empty feed. + parameters: + - description: only threats referencing this CVE + in: query + name: cveId + schema: + description: only threats referencing this CVE + nullable: true + type: string + - in: query + name: ecosystem + schema: + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: offset + schema: + nullable: true + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAThreatFeedOutput' + description: OK + headers: + Deprecation: + description: RFC 9745 date this operation was deprecated + schema: + description: RFC 9745 date this operation was deprecated + type: string + style: simple + Link: + description: The successor-version operation + schema: + description: The successor-version operation + type: string + style: simple + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: List Threat Intelligence Feed + /sca/threat-feed/{threatId}: + get: + deprecated: true + description: >- + Deprecated: use GET /manager/threats, which lists the same research with this tenant's assessment of each + threat. Responses carry Deprecation and Link (rel=successor-version) headers. Returns one threat from Nullify's + global threat-research feed, including its description, article links, and affected packages. Returns 503 when + the feed backend is unreachable. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: threatId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAThreatFeedThreatOutput' + description: OK + headers: + Deprecation: + description: RFC 9745 date this operation was deprecated + schema: + description: RFC 9745 date this operation was deprecated + type: string + style: simple + Link: + description: The successor-version operation + schema: + description: The successor-version operation + type: string + style: simple + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get Threat Intelligence Detail + /sca/vulnerabilities: + get: + description: >- + Returns one row per distinct CVE in the caller's findings with blast-radius aggregates, sorted by repository + reach by default. Scores reflect KEV/EPSS/CVSS as recorded at each finding's last Review (snapshot); each row's + kev flag is additionally overlaid with the current CISA catalog from vuln-database. kevOnly keeps CVEs a Review + recorded as listed plus CVEs no Review could check that the current catalog lists; when the catalog cannot be + read it keeps those unchecked CVEs flagged kevUnknown instead. kevOverlayApplied reports whether that overlay + ran — when false the kev flags are snapshot-only. + parameters: + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: offset + schema: + nullable: true + type: integer + - description: KEV as recorded at each finding's last Review (snapshot) + in: query + name: kevOnly + schema: + description: KEV as recorded at each finding's last Review (snapshot) + nullable: true + type: boolean + - description: only CVEs with >=1 unresolved finding (default true) + in: query + name: openOnly + schema: + description: only CVEs with >=1 unresolved finding (default true) + nullable: true + type: boolean + - description: severity|repositories|findings|epss|cvss|firstSeen (default repositories) + in: query + name: sortBy + schema: + description: severity|repositories|findings|epss|cvss|firstSeen (default repositories) + nullable: true + type: string + - description: only CVEs carried by a finding of this package or container artifact (exact name, case-insensitive) + in: query + name: package + schema: + description: only CVEs carried by a finding of this package or container artifact (exact name, case-insensitive) + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAVulnerabilitiesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: List CVE Exposure Across The Fleet + /sca/vulnerabilities/{cveId}: + get: + description: >- + Returns current vulnerability intelligence from vuln-database plus the caller's own exposure to the CVE. Intel + is null when the source has no record or is unavailable; the exposure verdict remains meaningful. Exposure + scores are snapshots frozen at each finding's last Review. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: CVE identifier, e.g. CVE-2021-44228 + in: path + name: cveId + required: true + schema: + description: CVE identifier, e.g. CVE-2021-44228 + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAVulnerabilityOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get CVE Intelligence + /sca/vulnerabilities/{cveId}/findings: + get: + description: >- + Returns the caller's dependency or container findings referencing a CVE, priority-ordered. Exactly one list is + populated, matching the requested type. + parameters: + - description: dependency (default) or container + in: query + name: type + schema: + description: dependency (default) or container + nullable: true + type: string + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: offset + schema: + nullable: true + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: cveId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAVulnerabilityFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Findings For A CVE + /sca/vulnerabilities/{cveId}/packages: + get: + description: >- + Returns the dependency packages and container artifacts through which a CVE reaches the caller's estate, with + observed and fixed versions. Ecosystem is derived from lockfile paths or artifact PURLs and may be empty. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: cveId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCAVulnerabilityPackagesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Packages Affected By A CVE + /scpm/containers/analyze: + post: + description: >- + Queues a container image for malware analysis. Idempotent within 24h on (registry, repository, reference) OR + caller-supplied idempotencyKey. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAnalyzeContainerInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAnalyzeContainerOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Request malware analysis for an OCI container image + /scpm/dependencies/analyze: + post: + description: >- + Queues a dependency version for malware analysis. Idempotent within 24h on (ecosystem, name, version) OR the + caller-supplied idempotencyKey. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAnalyzeDependencyInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsAnalyzeDependencyOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Request malware analysis for a dependency + /scpm/dependencies/query/batch: + post: + description: >- + Batch vulnerability and malware-verdict lookup for authenticated callers, the route the Nullify Defender action + asks. Caps at 1000 packages per request. Each row carries the resolved artifact identity the index checked + (registryHost, resolvedUrl, integrity, integrityVerified, provenanceVerified, provenanceMissing) and whether the + tenant's own package allowlist covers the coordinate, with the entry's reason and expiry. A coordinate the index + has never seen is returned with analysisStatus unknown and found false, never as a clean row; + integrityBudgetExhausted reports that some rows were never digest-compared at all. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsBatchQueryDependenciesInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsBatchQueryDependenciesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Batch query vulnerabilities + malware verdict for dependencies + /scpm/events: + get: + description: "Returns the tenant's SCPM events, newest first by default.\n\t\tFilter by fromTime (RFC 3339), eventType (repeatable) and findingId; page with nextToken and limit (at most 100 per request); sort asc or desc." + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: fromTime + schema: + nullable: true + type: string + - in: query + name: eventType + schema: + items: + type: string + type: array + - in: query + name: findingId + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: Get SCPM Events + /scpm/findings: + get: + description: Returns a filtered set of SCPM findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: priorityLabel + schema: + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - description: only findings that do (or do not) have a linked pull request + in: query + name: hasPullRequest + schema: + description: only findings that do (or do not) have a linked pull request + nullable: true + type: boolean + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if not provided, all repositories will be included + in: query + name: repositoryIds + schema: + description: if not provided, all repositories will be included + items: + type: string + type: array + - description: only findings produced by this rule (rule source id such as scpm-cicd-unpinned-action, or the finding type) + in: query + name: ruleId + schema: + description: >- + only findings produced by this rule (rule source id such as scpm-cicd-unpinned-action, or the finding + type) + nullable: true + type: string + - description: only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...) + in: query + name: findingType + schema: + description: only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...) + items: + type: string + type: array + - description: only findings in these languages + in: query + name: language + schema: + description: only findings in these languages + items: + type: string + type: array + - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isArchived + schema: + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCPM Findings + /scpm/findings/{findingId}: + get: + description: Returns a given finding with explanation and impact + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding + patch: + description: Update a given finding with the fields provided + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSCPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSCPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Finding + /scpm/findings/{findingId}/allowlist: + post: + description: Allowlists a finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSCPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSCPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Finding + /scpm/findings/{findingId}/autofix/activity: + get: + description: >- + Cursor-paginated autofix activity log for UI polling. Returns empty list when no autofix run exists. `limit` + defaults to 50 and is clamped to [1, 200]; `since_id` is the ID of the last entry the client has already seen + (use the `nextCursor` value from a prior response). + parameters: + - in: query + name: since_id + schema: + type: string + - in: query + name: limit + schema: + format: int32 + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetAutofixActivityLogOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCPM Finding Autofix Activity + /scpm/findings/{findingId}/autofix/fix: + post: + description: Generates a fresh fix against the current target branch and creates a pull request. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAutofixSCPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAutofixSCPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Conflict + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Autofix Finding + /scpm/findings/{findingId}/autofix/state: + get: + description: >- + Authoritative per-finding autofix state — runs stale-state rescue + live git-platform reconcile. Slow by design; + the dashboard polls this on a ~30s cadence alongside the fast /autofix/status. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingAutofixStateOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCPM Finding Autofix State + /scpm/findings/{findingId}/autofix/status: + get: + description: Lightweight per-finding autofix lifecycle status for UI polling. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingAutofixStatusOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCPM Finding Autofix Status + /scpm/findings/{findingId}/events: + get: + description: Returns the events recorded against a given finding, newest first. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Events + /scpm/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with an SCPM finding: closes it on the configured integration and clears Nullify's + tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the SCPM finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the SCPM finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketSCPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for SCPM Finding + post: + description: Creates a ticket for a given SCPM finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the SCPM finding to create a ticket for + in: path + name: findingId + required: true + schema: + description: The ID of the SCPM finding to create a ticket for + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSCPMFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSCPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket for SCPM Finding + /scpm/findings/{findingId}/triage: + get: + description: Returns the triage data for a specific finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Triaged Finding + /scpm/findings/{findingId}/unallowlist: + post: + description: Unallowlists a finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistSCPMFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist Finding + /scpm/findings/{findingId}/unmark-false-positive: + post: + description: >- + Clears the false-positive state and its justification from an SCPM finding and reopens its ticket if the finding + is no longer resolved. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the SCPM finding to unmark as false positive + in: path + name: findingId + required: true + schema: + description: The ID of the SCPM finding to unmark as false positive + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnmarkFalsePositiveSCPMFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unmark SCPM Finding as False Positive + /scpm/findings/{findingId}/users: + get: + description: Returns the users associated with a specific finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Users + /scpm/findings/allowlist: + post: + description: Allowlist a list of SCPM findings, by findingsID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowListSCPMFindingBatchInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Batch of SCPM Findings + /scpm/findings/detailed: + get: + description: Returns current SCPM findings in default branches + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: priorityLabel + schema: + nullable: true + type: string + - description: only findings produced by this rule (rule source id or finding type) + in: query + name: ruleId + schema: + description: only findings produced by this rule (rule source id or finding type) + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - description: only findings that do (or do not) have a linked pull request + in: query + name: hasPullRequest + schema: + description: only findings that do (or do not) have a linked pull request + nullable: true + type: boolean + - description: only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...) + in: query + name: findingType + schema: + description: only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...) + items: + type: string + type: array + - description: only findings in these languages + in: query + name: language + schema: + description: only findings in these languages + items: + type: string + type: array + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if set, only findings for this repository are returned + in: query + name: repositoryId + schema: + description: if set, only findings for this repository are returned + nullable: true + type: string + - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isArchived + schema: + nullable: true + type: boolean + - description: >- + orchestrator net-new base set: current-branch latest, resolution-agnostic (includes + allowlisted/false-positive rows) + in: query + name: gateBase + schema: + description: >- + orchestrator net-new base set: current-branch latest, resolution-agnostic (includes + allowlisted/false-positive rows) + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingsDetailedOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Findings Detailed + /scpm/findings/preview: + get: + description: Returns a filtered set of SCPM findings based on query parameters + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: priorityLabel + schema: + nullable: true + type: string + - in: query + name: severity + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - description: only findings that do (or do not) have a linked pull request + in: query + name: hasPullRequest + schema: + description: only findings that do (or do not) have a linked pull request + nullable: true + type: boolean + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: workflow + schema: + nullable: true + type: string + - description: if not provided, all repositories will be included + in: query + name: repositoryIds + schema: + description: if not provided, all repositories will be included + items: + type: string + type: array + - description: only findings produced by this rule (rule source id such as scpm-cicd-unpinned-action, or the finding type) + in: query + name: ruleId + schema: + description: >- + only findings produced by this rule (rule source id such as scpm-cicd-unpinned-action, or the finding + type) + nullable: true + type: string + - description: only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...) + in: query + name: findingType + schema: + description: only findings of these supply-chain types (known_malware, cicd_unpinned_action, ...) + items: + type: string + type: array + - description: only findings in these languages + in: query + name: language + schema: + description: only findings in these languages + items: + type: string + type: array + - description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + in: query + name: isResolved + schema: + description: combination of isFixed, isFalsePositive, isAllowlisted and isArchived + nullable: true + type: boolean + - in: query + name: isFixed + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isArchived + schema: + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCPM Findings + /scpm/findings/upload: + post: + description: Returns a presigned URL + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostGetUploadSCPMFindingsURLInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostGetUploadSCPMFindingsURLOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Presigned URL to Upload SCPM Findings + /scpm/repositories: + get: + description: >- + Returns the repositories carrying SCPM findings, keyed by repositoryID, each with its severity histogram and the + timestamp of its most recent finding. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMRepositoriesOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Repositories + /scpm/scan-runs: + get: + description: Lists SCPM scan runs for a repository, newest first + parameters: + - description: Repository ID to list scan runs for; omit to list the whole tenant + in: query + name: repositoryId + schema: + description: Repository ID to list scan runs for; omit to list the whole tenant + type: string + - description: Max scan runs per page (default 10, max 50) + in: query + name: limit + schema: + description: Max scan runs per page (default 10, max 50) + nullable: true + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + nullable: true + type: integer + - description: Sort order by start time (default newest) + in: query + name: sort + schema: + description: Sort order by start time (default newest) + enum: + - newest + - oldest + nullable: true + type: string + - description: Only include scan runs started at or after this RFC3339 timestamp + in: query + name: from + schema: + description: Only include scan runs started at or after this RFC3339 timestamp + nullable: true + type: string + - description: Only include scan runs started at or before this RFC3339 timestamp + in: query + name: to + schema: + description: Only include scan runs started at or before this RFC3339 timestamp + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetScanRunsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + summary: List Scan Runs + /scpm/settings: + get: + description: >- + Returns the per-tenant SCPM policy: dependency-cooldown settings, the accepted-license list and the package + allowlist. Tenants who have never saved settings get the platform defaults (cooldown enabled, 7-day window). + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSCPMSettingsOutput' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get SCPM Settings + put: + description: >- + Upsert the per-tenant SCPM policy: dependency-cooldown settings, the accepted-license list and the package + allowlist. Every field except cooldownEnabled and cooldownDays preserves its stored value when absent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutSCPMSettingsInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPutSCPMSettingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Put SCPM Settings + /secrets/credentials/findings: + get: + description: >- + Returns a filtered set of Secrets credential findings based on query parameters. One unique secret hash per + repository. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: secretType + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Secrets Credential Findings + /secrets/credentials/findings/{findingId}: + get: + description: Returns a given credential finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Credential Finding + patch: + description: Update a given credential finding with the fields provided + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecretsFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Credential Finding + /secrets/credentials/findings/{findingId}/allowlist: + post: + description: Allowlist a credential secret + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowListSecretsCredentialFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Credential Finding + /secrets/credentials/findings/{findingId}/events: + get: + description: Returns a list of events for a given finding. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Events + /secrets/credentials/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a credential finding: closes it on the configured integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the credential finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the credential finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for Credential Finding + post: + description: Creates a ticket for a given credential finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the finding to create a Jira ticket for + in: path + name: findingId + required: true + schema: + description: The ID of the finding to create a Jira ticket for + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket for Credential Finding + /secrets/credentials/findings/{findingId}/triage: + get: + description: Returns the triage data for a specific credential finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Triaged Credential Finding + /secrets/credentials/findings/{findingId}/unallowlist: + post: + description: Unallowlist a credential secret + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowListSecretsFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist Credential Finding + /secrets/credentials/findings/{findingId}/users: + get: + description: Get users related to a credential finding based on git blame and repository contributions. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Credential Finding Related Users + /secrets/credentials/findings/allowlist/batch: + post: + description: Allowlist a list of credential findings, by findingsID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowListSecretsFindingBatchInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Batch of Credential Findings + /secrets/credentials/findings/detailed: + get: + description: Returns credential secrets summary. One unique secret hash per repository + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: secretType + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - description: if set, only findings for this repository are returned + in: query + name: repositoryId + schema: + description: if set, only findings for this repository are returned + nullable: true + type: string + - description: if set, only findings in one of these files are returned + in: query + name: filePath + schema: + description: if set, only findings in one of these files are returned + items: + type: string + type: array + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingsDetailedOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Secrets Credential Findings Detailed + /secrets/events: + get: + description: >- + Returns events after a specified timestamp or event ID. All events are returned if no timestamp or event ID is + provided + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: fromTime + schema: + nullable: true + type: string + - in: query + name: numItems + schema: + nullable: true + type: integer + - in: query + name: eventType + schema: + items: + type: string + type: array + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: findingId + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Secret Events + /secrets/findings: + get: + description: >- + Returns a filtered set of Secrets credential findings based on query parameters. One unique secret hash per + repository. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: secretType + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Secrets Credential Findings + /secrets/findings/{findingId}: + get: + description: Returns a given credential finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Credential Finding + patch: + description: Update a given credential finding with the fields provided + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecretsFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Credential Finding + /secrets/findings/{findingId}/allowlist: + post: + description: Allowlist a credential secret + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowListSecretsCredentialFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Credential Finding + /secrets/findings/{findingId}/events: + get: + description: Returns a list of events for a given finding. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingEventsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Finding Events + /secrets/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a credential finding: closes it on the configured integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the credential finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the credential finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for Credential Finding + post: + description: Creates a ticket for a given credential finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the finding to create a Jira ticket for + in: path + name: findingId + required: true + schema: + description: The ID of the finding to create a Jira ticket for + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket for Credential Finding + /secrets/findings/{findingId}/triage: + get: + description: Returns the triage data for a specific credential finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Triaged Credential Finding + /secrets/findings/{findingId}/unallowlist: + post: + description: Unallowlist a credential secret + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowListSecretsFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist Credential Finding + /secrets/findings/{findingId}/users: + get: + description: Get users related to a credential finding based on git blame and repository contributions. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Credential Finding Related Users + /secrets/findings/allowlist/batch: + post: + description: Allowlist a list of credential findings, by findingsID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowListSecretsFindingBatchInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Batch of Credential Findings + /secrets/findings/detailed: + get: + description: Returns secrets summary. One unique secret hash per repository + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: secretType + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - description: if set, only findings for this repository are returned + in: query + name: repositoryId + schema: + description: if set, only findings for this repository are returned + nullable: true + type: string + - description: if set, only findings in one of these files are returned + in: query + name: filePath + schema: + description: if set, only findings in one of these files are returned + items: + type: string + type: array + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingsDetailedOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Secrets Credential Findings Detailed - [DEPRECATED - TO BE REMOVED BY 2025] + /secrets/findings/preview: + get: + description: >- + Returns a filtered set of Secrets credential findings based on query parameters. One unique secret hash per + repository. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: secretType + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Secrets Credential Findings + /secrets/scan-runs: + get: + parameters: + - description: Repository ID to list scan runs for + in: query + name: repositoryId + required: true + schema: + description: Repository ID to list scan runs for + type: string + - description: Max scan runs per page (default 10, max 50) + in: query + name: limit + schema: + description: Max scan runs per page (default 10, max 50) + nullable: true + type: integer + - description: Pagination offset (default 0) + in: query + name: offset + schema: + description: Pagination offset (default 0) + nullable: true + type: integer + - description: Sort order by start time (default newest) + in: query + name: sort + schema: + description: Sort order by start time (default newest) + enum: + - newest + - oldest + nullable: true + type: string + - description: Only include scan runs started at or after this RFC3339 timestamp + in: query + name: from + schema: + description: Only include scan runs started at or after this RFC3339 timestamp + nullable: true + type: string + - description: Only include scan runs started at or before this RFC3339 timestamp + in: query + name: to + schema: + description: Only include scan runs started at or before this RFC3339 timestamp + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetScanRunsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: List Scan Runs + /secrets/sensitivedata/findings: + get: + description: Returns a filtered set of sensitive data findings based on query parameters. + parameters: + - in: query + name: nextToken + schema: + nullable: true + type: string + - in: query + name: limit + schema: + nullable: true + type: integer + - in: query + name: branch + schema: + nullable: true + type: string + - in: query + name: secretType + schema: + nullable: true + type: string + - in: query + name: fileOwnerName + schema: + items: + type: string + type: array + - in: query + name: isResolved + schema: + nullable: true + type: boolean + - in: query + name: isAllowlisted + schema: + nullable: true + type: boolean + - in: query + name: isFalsePositive + schema: + nullable: true + type: boolean + - in: query + name: sortBy + schema: + nullable: true + type: string + - in: query + name: sort + schema: + nullable: true + type: string + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingsOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Sensitive Data Findings + /secrets/sensitivedata/findings/{findingId}: + get: + description: Returns a specific sensitive data finding by ID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Sensitive Data Finding + patch: + description: Update a given sensitive data finding with the fields provided + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecretsSensitiveDataFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPatchSecretsSensitiveDataFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Update Sensitive Data Finding + /secrets/sensitivedata/findings/{findingId}/allowlist: + post: + description: Allowlist a sensitive data (PII) finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSecretsSensitiveDataFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Sensitive Data Finding + /secrets/sensitivedata/findings/{findingId}/ticket: + delete: + description: >- + Removes the ticket associated with a sensitive-data finding: closes it on the configured integration and clears + Nullify's tracking. Idempotent. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the sensitive-data finding whose ticket should be removed + in: path + name: findingId + required: true + schema: + description: The ID of the sensitive-data finding whose ticket should be removed + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsDeleteTicketSecretsSensitiveDataFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + summary: Delete Ticket for Sensitive Data Finding + post: + description: Creates a ticket for a given sensitive data finding on the tenant's configured ticket integration + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - description: The ID of the finding to create a ticket for + in: path + name: findingId + required: true + schema: + description: The ID of the finding to create a ticket for + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsSensitiveDataFindingInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostCreateTicketSecretsSensitiveDataFindingOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Precondition Failed + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Implemented + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Service Unavailable + '504': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Gateway Timeout + summary: Create Ticket for Sensitive Data Finding + /secrets/sensitivedata/findings/{findingId}/triage: + get: + description: Returns the triage data for a specific sensitive data finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingTriageOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Triaged Sensitive Data Finding + /secrets/sensitivedata/findings/{findingId}/unallowlist: + post: + description: Unallowlist a sensitive data (PII) finding + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostUnallowlistSecretsSensitiveDataFindingInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Unallowlist Sensitive Data Finding + /secrets/sensitivedata/findings/{findingId}/users: + get: + description: Get users related to a sensitive data (PII) finding based on git blame and repository contributions. + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + - in: path + name: findingId + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsGetSecretsSensitiveDataFindingUsersOutput' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Get Sensitive Data Finding Related Users + /secrets/sensitivedata/findings/allowlist/batch: + post: + description: Allowlist a list of sensitive data findings, by findingsID + parameters: + - description: The Azure organization ID + in: query + name: azureOrganizationId + schema: + description: The Azure organization ID + type: string + - description: The Bitbucket workspace ID + in: query + name: bitbucketWorkspaceId + schema: + description: The Bitbucket workspace ID + type: string + - description: The Github owner ID + in: query + name: githubOwnerId + schema: + description: The Github owner ID + format: int64 + type: integer + - description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's stored + record has none. Ignored on customer routes. + in: query + name: githubInstallationId + schema: + description: >- + Operator routes only: the GitHub App installation ID to use alongside githubOwnerId when the tenant's + stored record has none. Ignored on customer routes. + format: int64 + type: integer + - description: The GitLab group ID + in: query + name: gitlabGroupId + schema: + description: The GitLab group ID + format: int64 + type: integer + - description: The Nullify installation ID + in: query + name: installationId + schema: + description: The Nullify installation ID + type: string + - description: Filter by Azure repository IDs + in: query + name: azureRepositoryId + schema: + description: Filter by Azure repository IDs + items: + type: string + type: array + - description: Filter by GitHub repository IDs + in: query + name: githubRepositoryId + schema: + description: Filter by GitHub repository IDs + items: + format: int64 + type: integer + type: array + - description: Filter by GitHub team ID + in: query + name: githubTeamId + schema: + description: Filter by GitHub team ID + format: int64 + type: integer + - description: Filter by Bitbucket repository IDs + in: query + name: bitbucketRepositoryId + schema: + description: Filter by Bitbucket repository IDs + items: + type: string + type: array + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostAllowlistSecretsSensitiveDataFindingBatchInput' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Not Found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Allowlist Batch of Sensitive Data Findings + /core/bitbucket/descriptor: + get: + description: Bitbucket connect descriptor json for installing Nullify into a Bitbucket workspace + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBitbucketConnectDescriptorOutput' + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bitbucket Connect Descriptor + /core/bitbucket/disabled: + post: + description: Callback endpoint for when the Bitbucket app is disabled + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBitbucketDisabledInput' + responses: + '204': + description: No Content + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bitbucket App Disabled + /core/bitbucket/enabled: + post: + description: Callback endpoint for when the Bitbucket app is enabled + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBitbucketEnabledInput' + responses: + '204': + description: No Content + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bitbucket App Enabled + /core/bitbucket/installed: + post: + description: Callback endpoint for when the Bitbucket app is installed + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBitbucketInstalledInput' + responses: + '204': + description: No Content + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bitbucket App Installed + /core/bitbucket/uninstalled: + post: + description: Callback endpoint for when the Bitbucket app is installed + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EndpointsPostBitbucketUninstalledInput' + responses: + '204': + description: No Content + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/RestErrResponse' + description: Internal Server Error + summary: Bitbucket App Uninstalled +components: + schemas: + ConnectorsConfigField: + properties: + description: + type: string + enumValues: + items: + type: string + type: array + key: + type: string + label: + type: string + required: + type: boolean + secret: + type: boolean + type: + $ref: '#/components/schemas/ConnectorsFieldType' + type: object + ConnectorsFieldType: + enum: + - string + - secret + - url + - enum + - bool + type: string + ConnectorsLifecycleOps: + properties: + configure: + type: boolean + connect: + type: boolean + disconnect: + type: boolean + test: + type: boolean + type: object + DatabaseFindingType: + enum: + - sast + - sca_dependencies + - sca_containers + - secrets_credentials + - secrets_sensitive_data + - scpm + - cspm + - dast_bughunt + - dast_pentest + type: string + DatabaseTicketAuditActor: + enum: + - system + - user + - reconciler + - webhook + - manager_agent + type: string + DatabaseTicketAuditEventType: + enum: + - created + - closed + - reopened + - moved + - eligibility_flagged + - bulk_close + - bulk_reopen + - bulk_move + - bulk_resync + - bulk_reassign_team + - bulk_reassign_assignee + - bulk_add_comment + - bulk_relabel + - bulk_set_priority + - bulk_action_reaped + - settings_applied + - external_synced + - stale_terminal_cleared + - create_failed + type: string + DatabaseTicketBulkActionType: + enum: + - bulk_close + - bulk_reopen + - bulk_move + - bulk_resync + - bulk_reassign_team + - bulk_reassign_assignee + - bulk_add_comment + - bulk_relabel + - bulk_set_priority + type: string + DatabaseTicketBulkOperationStatus: + enum: + - pending + - running + - done + - failed + - cancelled + type: string + DatabaseTicketMigrationAction: + enum: + - none + - close_auto_created + - close_all_out_of_scope + - migrate_board + type: string + DatabaseTicketPlatform: + enum: + - GitHub + - Jira + - Linear + - Azure + - Asana + type: string + DatabaseTicketSource: + enum: + - scan_pipeline + - reconciliation + - manager_agent + - rest_api + - dashboard + - unknown + type: string + DatabaseTicketStatus: + enum: + - pending + - open + - in_progress + - resolved + - closed + - wont_fix + type: string + EndpointsAdminAccountValidationResult: + properties: + assumedRole: + type: string + errorMessage: + type: string + isValid: + type: boolean + status: + type: string + required: + - isValid + - status + type: object + EndpointsAdminActivateUserTarget: + properties: + role: + description: The role to grant on activation + enum: + - builtin:admin + - builtin:editor + - builtin:viewer + type: string + teamIds: + description: Teams to add the user to on activation + items: + type: string + type: array + userId: + description: ID of an already-synced Nullify user to activate + type: string + required: + - userId + - role + type: object + EndpointsAdminActivateUsersInput: + properties: + users: + description: The already-synced users to activate, each with a role and optional teams + items: + $ref: '#/components/schemas/EndpointsAdminActivateUserTarget' + minItems: 1 + nullable: true + type: array + required: + - users + type: object + EndpointsAdminActivateUsersOutput: + properties: + users: + items: + $ref: '#/components/schemas/EndpointsAdminUserRole' + nullable: true + type: array + version: + type: string + required: + - users + type: object + EndpointsAdminAsanaConfigOutput: + properties: + createdAt: + format: date-time + type: string + projectGid: + type: string + updatedAt: + format: date-time + type: string + workspaceId: + type: string + workspaceName: + type: string + required: + - createdAt + - updatedAt + type: object + EndpointsAdminAzureConfigOutput: + properties: + clientId: + type: string + createdAt: + format: date-time + type: string + organization: + type: string + projectName: + type: string + tenantId: + type: string + updatedAt: + format: date-time + type: string + workItemType: + type: string + required: + - clientId + - tenantId + - createdAt + - updatedAt + type: object + EndpointsAdminAzureHookFailure: + properties: + event: + description: Azure DevOps service-hook event type + type: string + message: + type: string + projectId: + description: Azure DevOps project id (UUID) + type: string + repositoryId: + description: Azure DevOps repository id (UUID). Empty for project-scoped events such as workitem.updated + type: string + required: + - projectId + - event + - message + type: object + EndpointsAdminAzureInstallation: + properties: + adminDisabledAt: + description: Set while the install is disabled, by the customer's suspend or by Nullify; adminDisabledBy says which. + format: date-time + nullable: true + type: string + adminDisabledBy: + description: >- + Who disabled the install: customer (a suspend the customer can resume) or nullify (only Nullify support can + re-enable it). Empty while enabled. + enum: + - customer + - nullify + type: string + createdAt: + format: date-time + type: string + hooksHealth: + $ref: '#/components/schemas/EndpointsAdminAzureProjectHooksHealth' + id: + type: string + organizationId: + description: Azure DevOps account id (resourceContainers.account.id), the value webhook deliveries are matched on + type: string + organizationName: + description: Azure DevOps organization name from the organization's connection; empty when it has none + type: string + projectId: + description: Azure DevOps project id (UUID) + type: string + projectName: + description: Azure DevOps project name as the last provisioning run saw it; empty when it is not known + type: string + sourceControlReady: + description: >- + Whether this active installation has a usable source-control connection. Native app installs require + successful route, repository, and subscription checks; an installation row alone is not readiness proof. + type: boolean + tenantId: + type: string + ungranted: + description: >- + Whether the organization's last connect could not grant Nullify its Azure DevOps permissions on this + project; a Retry or reconnect grants it + type: boolean + updatedAt: + format: date-time + type: string + webhookSecretRotatable: + description: >- + Whether POST /admin/integrations/azure/installations can rotate this install's webhook secret. False for + organizations connected through the Nullify router, whose secret only a reconnect replaces. + type: boolean + workItemsEnabled: + description: >- + Whether this active installation has an explicitly enabled Azure Boards work-item connection. False for + disabled, unconfigured, or unverified connections. + type: boolean + required: + - sourceControlReady + - workItemsEnabled + - id + - organizationId + - projectId + - ungranted + - tenantId + - createdAt + - updatedAt + - webhookSecretRotatable + type: object + EndpointsAdminAzureMergeGateHealth: + properties: + detail: + type: string + state: + description: >- + blocking on an opted-in active project, non_blocking while it is suspended, not_opted_in when the + organization did not ask for the gate, skipped when the project's hooks are not healthy enough to gate on + enum: + - blocking + - non_blocking + - not_opted_in + - skipped + - failed + type: string + required: + - state + type: object + EndpointsAdminAzureProjectHooksHealth: + properties: + deleted: + description: The project no longer exists in Azure DevOps and its Nullify hooks were removed + type: boolean + failures: + description: Calls that failed this run and are retried on the next one + items: + type: string + type: array + mergeGate: + $ref: '#/components/schemas/EndpointsAdminAzureMergeGateHealth' + needsHuman: + description: Checks a person has to fix in Azure DevOps; Nullify does not retry these on its own + items: + type: string + type: array + newProject: + description: The project was created after the organization was connected and was installed by this reconcile + type: boolean + outcome: + enum: + - healthy + - repaired + - needs_attention + - failed + type: string + projectId: + description: Azure DevOps project id (UUID) + type: string + pullRequestsMissingReview: + description: Active pull requests whose latest iteration has no Nullify status, counted after deliveries resumed + type: integer + reconciledAt: + format: date-time + type: string + subscriptions: + items: + $ref: '#/components/schemas/EndpointsAdminAzureSubscriptionHealth' + nullable: true + type: array + suspended: + description: The project is suspended, so its hooks are kept disabled + type: boolean + trigger: + description: What started the reconcile + enum: + - schedule + - connect + - manual + type: string + required: + - projectId + - reconciledAt + - trigger + - outcome + - subscriptions + - mergeGate + type: object + EndpointsAdminAzureSubscriptionHealth: + properties: + action: + description: What the reconcile did, or would do on a dry run + enum: + - none + - created + - reenabled + - replaced + - suspended + - left_disabled + - removed + - failed + type: string + detail: + description: Customer-safe explanation, naming the exact check to fix where a person has to act + type: string + event: + description: Azure DevOps service-hook event type + type: string + notificationType: + description: git.pullrequest.updated notificationType filter, when the subscription has one + type: string + rootCause: + description: Why Azure DevOps had stopped delivering, from the subscription's failed notifications or its status + enum: + - secret_mismatch + - nullify_unavailable + - endpoint_missing + - delivery_failed + - customer_disabled + - inactive_identity + type: string + status: + description: Status Azure DevOps reported before the reconcile acted + enum: + - enabled + - onProbation + - disabledByUser + - disabledBySystem + - disabledByInactiveIdentity + - missing + type: string + subscriptionId: + description: Azure DevOps subscription id; empty for one that did not exist + type: string + required: + - event + - status + - action + type: object + EndpointsAdminBatchSetUserRolesInput: + properties: + role: + description: The role to assign to all listed users + enum: + - builtin:admin + - builtin:editor + - builtin:viewer + type: string + users: + description: The users whose role to set; each entry is an existing user id or a new-user spec + items: + $ref: '#/components/schemas/EndpointsAdminSetUserRoleTarget' + minItems: 1 + nullable: true + type: array + required: + - users + - role + type: object + EndpointsAdminBatchSetUserRolesOutput: + properties: + users: + items: + $ref: '#/components/schemas/EndpointsAdminUserRole' + nullable: true + type: array + version: + type: string + required: + - users + type: object + EndpointsAdminBotInteraction: + properties: + campaignId: + nullable: true + type: string + eventCreatedAt: + nullable: true + type: string + eventDescription: + nullable: true + type: string + eventId: + nullable: true + type: string + eventStatus: + nullable: true + type: string + findingId: + type: string + findingTitle: + type: string + findingType: + $ref: '#/components/schemas/ModelsFindingType' + interactionType: + type: string + prLink: + nullable: true + type: string + prNumber: + nullable: true + type: string + prStatus: + nullable: true + type: string + repository: + type: string + ticketKey: + nullable: true + type: string + ticketUrl: + nullable: true + type: string + required: + - findingType + - findingId + - findingTitle + - repository + - interactionType + type: object + EndpointsAdminBotInteractionSummary: + properties: + autofixPR: + type: integer + internetSearch: + type: integer + other: + type: integer + prComment: + type: integer + ticketCreate: + type: integer + total: + type: integer + required: + - autofixPR + - internetSearch + - ticketCreate + - prComment + - other + - total + type: object + EndpointsAdminBotInteractionsOutput: + properties: + interactions: + items: + $ref: '#/components/schemas/EndpointsAdminBotInteraction' + nullable: true + type: array + summary: + $ref: '#/components/schemas/EndpointsAdminBotInteractionSummary' + required: + - summary + - interactions + type: object + EndpointsAdminCLIPackageFeedControlInput: + properties: + connectionId: + type: string + displayName: + type: string + expectedRevision: + description: Required for existing connections; must match the reviewed authority revision + format: int64 + type: integer + fields: + additionalProperties: + type: string + description: Complete replacement fields for create or rotate; includes credentials + type: object + operation: + enum: + - create + - rotate + - probe + - disconnect + type: string + providerId: + description: Required only when creating a connection + type: string + reason: + maxLength: 1024 + type: string + required: + - operation + - reason + type: object + EndpointsAdminCLIPackageFeedControlOutput: + properties: + connection: + $ref: '#/components/schemas/EndpointsIntegrationConnectionInstanceView' + maxOutstandingLeaseExpiry: + type: string + upstreamRevocationRequired: + type: boolean + type: object + EndpointsAdminCLIPackageFeedsOutput: + properties: + connections: + items: + $ref: '#/components/schemas/EndpointsIntegrationConnectionInstanceView' + nullable: true + type: array + type: object + EndpointsAdminChecklistOutput: + properties: + items: + items: + $ref: '#/components/schemas/ModelsChecklistItem' + nullable: true + type: array + required: + - items + type: object + EndpointsAdminConfigureIntegrationInput: + properties: + fields: + additionalProperties: + type: string + nullable: true + type: object + type: object + EndpointsAdminConfigureIntegrationOutput: + properties: + connection: + $ref: '#/components/schemas/EndpointsIntegrationConnectionView' + type: object + EndpointsAdminConnectIntegrationInput: + properties: + fields: + additionalProperties: + type: string + description: Field values keyed by the connector's config schema keys + nullable: true + type: object + type: object + EndpointsAdminConnectIntegrationOutput: + properties: + connection: + $ref: '#/components/schemas/EndpointsIntegrationConnectionView' + type: object + EndpointsAdminCreateIntegrationConnectionInput: + properties: + displayName: + description: Human label distinguishing this instance from others of the same provider + type: string + fields: + additionalProperties: + type: string + description: Field values keyed by the connector's config schema keys + nullable: true + type: object + type: object + EndpointsAdminCreateIntegrationConnectionOutput: + properties: + connection: + $ref: '#/components/schemas/EndpointsIntegrationConnectionInstanceView' + type: object + EndpointsAdminDeactivateUserInput: + properties: + userId: + description: ID of the Nullify user to deactivate + type: string + required: + - userId + type: object + EndpointsAdminDeactivateUserOutput: + properties: + lifecycleState: + enum: + - active + - deactivated + type: string + userId: + type: string + username: + type: string + version: + type: string + required: + - userId + - lifecycleState + type: object + EndpointsAdminDeleteAWSSettingsOutput: + properties: + message: + type: string + success: + type: boolean + required: + - success + - message + type: object + EndpointsAdminDeleteAzureConnectOutput: + properties: + failures: + items: + type: string + type: array + version: + type: string + type: object + EndpointsAdminDeleteAzureInstallationOutput: + properties: + failures: + description: >- + ADO service-hook subscriptions, and Nullify branch policies, that could not be removed before the install + row was deleted; the row is deleted regardless, so operators may need to remove these by hand in Azure + DevOps' Service Hooks and branch-policy UIs. + items: + type: string + type: array + version: + type: string + type: object + EndpointsAdminDeleteAzureSettingsOutput: + properties: + message: + type: string + success: + type: boolean + required: + - success + - message + type: object + EndpointsAdminDeleteGCPSettingsOutput: + properties: + message: + type: string + success: + type: boolean + required: + - success + - message + type: object + EndpointsAdminDeleteK8SClusterOutput: + properties: + deleted: + type: boolean + required: + - deleted + type: object + EndpointsAdminDeleteK8SSettingsOutput: + properties: + deleted: + type: boolean + required: + - deleted + type: object + EndpointsAdminDisconnectIntegrationConnectionOutput: + properties: + connectionId: + type: string + maxOutstandingLeaseExpiry: + format: date-time + nullable: true + type: string + newLeasesBlocked: + type: boolean + status: + type: string + storedSecretDeleted: + type: boolean + upstreamRevocationRequired: + type: boolean + type: object + EndpointsAdminDisconnectIntegrationOutput: + properties: + disconnected: + type: boolean + type: object + EndpointsAdminDiscoverGitHubPackagesCredentialInput: + properties: + token: + description: A classic GitHub PAT to resolve identity and readable npm packages for + type: string + required: + - token + type: object + EndpointsAdminDiscoverGitHubPackagesCredentialOutput: + properties: + packageOrigin: + description: The inferred npm registry origin; omitted for GitHub Enterprise Server + type: string + packages: + items: + $ref: '#/components/schemas/EndpointsGitHubPackagesDiscoveredPackage' + nullable: true + type: array + username: + type: string + required: + - username + - packages + type: object + EndpointsAdminElevateSupportAccessInput: + properties: + agent: + description: Self-reported agent acting for the staff member + type: string + reason: + description: Why support access is needed; at least 10 characters + minLength: 10 + type: string + ttlSeconds: + description: Requested duration in seconds; defaults to 8h for a human and 1h for an agent, capped at 72h and 1h + format: int64 + type: integer + required: + - reason + type: object + EndpointsAdminElevateSupportAccessOutput: + properties: + extended: + description: Whether an already-active grant was extended rather than a new one created + type: boolean + grant: + $ref: '#/components/schemas/EndpointsAdminSupportAccessGrant' + version: + type: string + required: + - grant + type: object + EndpointsAdminFileContentsOutput: + properties: + data: + type: string + required: + - data + type: object + EndpointsAdminFileOwnersInput: + properties: + files: + items: + $ref: '#/components/schemas/EndpointsFileOwnersRequest' + nullable: true + type: array + required: + - files + type: object + EndpointsAdminFileOwnersOutput: + properties: + data: + items: + $ref: '#/components/schemas/ModelsFileOwners' + nullable: true + type: array + required: + - data + type: object + EndpointsAdminFindingsDownloadInput: + properties: + query: + $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + required: + - query + type: object + EndpointsAdminFindingsDownloadOutput: + properties: + csv: + type: string + type: object + EndpointsAdminFindingsGroupsInput: + properties: + groupBy: + $ref: '#/components/schemas/ModelsFindingsGroupBy' + limit: + description: Maximum number of groups to return, largest first; defaults to 100 + maximum: 500 + minimum: 1 + type: integer + page: + description: Group page, starting at 1; defaults to 1 + minimum: 1 + nullable: true + type: integer + query: + $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + required: + - query + - groupBy + type: object + EndpointsAdminFindingsGroupsOutput: + properties: + groups: + items: + $ref: '#/components/schemas/ModelsFindingsGroup' + nullable: true + type: array + page: + type: integer + totalGroups: + type: integer + truncated: + description: More groups exist after this page + type: boolean + ungrouped: + description: Findings in scope with no value for the grouping dimension + type: integer + required: + - totalGroups + - page + - groups + - ungrouped + - truncated + type: object + EndpointsAdminFixEffortMapInput: + properties: + easy: + type: integer + hard: + type: integer + id: + type: string + medium: + type: integer + required: + - id + - easy + - medium + - hard + type: object + EndpointsAdminFixEffortMapOutput: + properties: + createdAt: + type: string + easy: + type: integer + hard: + type: integer + id: + type: string + medium: + type: integer + updatedAt: + type: string + required: + - id + - easy + - medium + - hard + type: object + EndpointsAdminGetAWSSettingsOutput: + properties: + awsAccounts: + items: + $ref: '#/components/schemas/ModelsAWSAccountWithStatus' + nullable: true + type: array + connectorPermissionGaps: + items: + $ref: '#/components/schemas/ModelsAWSConnectorPermissionGap' + type: array + connectorPermissionProbe: + $ref: '#/components/schemas/EndpointsConnectorPermissionProbeStatus' + createdAt: + type: string + externalId: + type: string + iamRoleName: + type: string + lastValidatedAt: + type: string + lastValidationStatus: + type: string + nullifyK8sCollectorRoleArn: + type: string + nullifyKMSKeyArn: + type: string + nullifyRoleArn: + type: string + nullifyS3AccessPointArn: + type: string + nullifyS3Bucket: + type: string + overallStatus: + type: string + preferredDeployment: + $ref: '#/components/schemas/ModelsDeploymentType' + updatedAt: + type: string + required: + - iamRoleName + - externalId + - awsAccounts + - preferredDeployment + - nullifyRoleArn + - nullifyS3Bucket + - nullifyKMSKeyArn + - createdAt + - updatedAt + - overallStatus + type: object + EndpointsAdminGetAzureConfigOutput: + properties: + clientSecretUploaded: + type: boolean + configUploaded: + type: boolean + configuration: + $ref: '#/components/schemas/EndpointsAdminAzureConfigOutput' + redactedClientSecret: + type: string + version: + type: string + required: + - configUploaded + - clientSecretUploaded + type: object + EndpointsAdminGetAzureConnectStatusOutput: + properties: + adminConsentUrl: + description: >- + Set when consent is blocked for the signed-in user; a directory admin can complete tenant-wide consent at + this URL to unblock the pending connect. + type: string + checklist: + items: + $ref: '#/components/schemas/EndpointsAzureConnectChecklistItem' + nullable: true + type: array + continueUrl: + description: >- + Set once a directory admin granted consent from another browser; the user who started the connect continues + at this URL in their own browser. + type: string + enableBuildGate: + description: >- + Whether this connect asked for Nullify's required-status branch policy. When false, a failed + organization-wide branch_policy item does not keep an organization from being connected. + type: boolean + errorCode: + description: >- + Set with status failed when organization discovery ended without a choice to offer: the same code the + callback's connectError carries (no_orgs, tenant_mismatch, not_entra_backed, organizations_unavailable, + azure_devops_refused). + type: string + organizations: + items: + $ref: '#/components/schemas/EndpointsAzureConnectOrganization' + nullable: true + type: array + status: + $ref: '#/components/schemas/EndpointsAzureConnectStatus' + version: + type: string + required: + - status + type: object + EndpointsAdminGetAzureSettingsOutput: + properties: + authMode: + type: string + clientId: + type: string + createdAt: + type: string + displayName: + type: string + lastValidatedAt: + type: string + lastValidationStatus: + type: string + overallStatus: + type: string + subscriptions: + items: + $ref: '#/components/schemas/ModelsAzureSubscriptionWithStatus' + nullable: true + type: array + tenantId: + type: string + updatedAt: + type: string + wifIssuerUrl: + type: string + wifSubject: + type: string + required: + - tenantId + - authMode + - subscriptions + - createdAt + - updatedAt + - overallStatus + type: object + EndpointsAdminGetCallerAccessOutput: + properties: + lifecycleState: + description: The caller's account lifecycle state (active/deactivated/deleted). Empty if the caller has no local account. + type: string + managedBy: + description: 'Which source manages the caller''s account: scm, scim, or manual. Empty if the caller has no local account.' + type: string + permissions: + description: Permission keys granted by the caller's role; empty if the role is unknown. The UI gates on these. + items: + type: string + nullable: true + type: array + role: + description: The caller's resolved RBAC role, empty if unknown + type: string + supportAccessExpiresAt: + description: When the caller's Nullify support access elevation ends; absent when the caller is not elevated + format: date-time + nullable: true + type: string + teamIds: + description: The caller's team memberships + items: + type: string + nullable: true + type: array + teamScopeEnabled: + type: boolean + userCanonicalId: + description: The canonical identity authenticated by this tenant stack + type: string + version: + type: string + type: object + EndpointsAdminGetFindingOutput: + properties: + finding: + $ref: '#/components/schemas/ModelsUnifiedFindingPreview' + required: + - finding + type: object + EndpointsAdminGetFixEffortOutput: + properties: + fixEffort: + $ref: '#/components/schemas/EndpointsAdminFixEffortMapOutput' + version: + type: string + required: + - fixEffort + type: object + EndpointsAdminGetGCPSettingsOutput: + properties: + createdAt: + type: string + displayName: + type: string + gkeClusterOidcIssuerUrls: + items: + type: string + type: array + gkeServiceAccountUniqueId: + type: string + lastValidatedAt: + type: string + lastValidationStatus: + type: string + nullifyK8sCollectorRoleArn: + type: string + overallStatus: + type: string + projects: + items: + $ref: '#/components/schemas/ModelsGCPProjectWithStatus' + nullable: true + type: array + updatedAt: + type: string + workloadIdentityProvider: + type: string + workloadIdentityServiceAccountEmail: + type: string + required: + - workloadIdentityProvider + - workloadIdentityServiceAccountEmail + - projects + - createdAt + - updatedAt + - overallStatus + type: object + EndpointsAdminGetGCPSetupOutput: + properties: + attributeMapping: + type: string + customRoleId: + type: string + customRoleNote: + type: string + discoveryRoles: + items: + type: string + nullable: true + type: array + installerEnv: + type: string + oidcIssuerUrl: + type: string + requiredApis: + items: + type: string + nullable: true + type: array + roleGrantNote: + type: string + serviceAccountBindingMember: + type: string + serviceAccountBindingRole: + type: string + serviceAccountId: + type: string + tenantId: + type: string + terraformVariables: + type: string + viewerRoles: + items: + type: string + nullable: true + type: array + workloadIdentityPoolId: + type: string + workloadIdentityProviderAttributeCondition: + type: string + workloadIdentityProviderId: + type: string + required: + - oidcIssuerUrl + - tenantId + - terraformVariables + - workloadIdentityPoolId + - workloadIdentityProviderId + - serviceAccountId + - workloadIdentityProviderAttributeCondition + - attributeMapping + - serviceAccountBindingRole + - serviceAccountBindingMember + - requiredApis + - viewerRoles + - discoveryRoles + - customRoleId + - roleGrantNote + - customRoleNote + - installerEnv + type: object + EndpointsAdminGetGitHubAppSettingsOutput: + properties: + error: + type: string + events: + items: + type: string + nullable: true + type: array + incorrect_permissions: + additionalProperties: + $ref: '#/components/schemas/EndpointsIncorrectPermission' + nullable: true + type: object + installation_id: + format: int64 + type: integer + managed_by_shared_app: + description: The installation belongs to the shared Nullify GitHub App, so its webhook events are not reported + type: boolean + missing_events: + items: + type: string + nullable: true + type: array + missing_permissions: + additionalProperties: + type: string + nullable: true + type: object + permissions: + additionalProperties: + type: string + nullable: true + type: object + required: + - events + - permissions + - installation_id + - missing_events + - missing_permissions + - incorrect_permissions + - managed_by_shared_app + type: object + EndpointsAdminGetIntegrationTeamsOutput: + properties: + teams: + items: + $ref: '#/components/schemas/ModelsTeam' + nullable: true + type: array + version: + type: string + required: + - teams + type: object + EndpointsAdminGetIntegrationUsersOutput: + properties: + users: + items: + $ref: '#/components/schemas/ModelsUser' + nullable: true + type: array + version: + type: string + required: + - users + type: object + EndpointsAdminGetIntegrationsCatalogOutput: + properties: + connectors: + items: + $ref: '#/components/schemas/EndpointsCatalogConnector' + nullable: true + type: array + type: object + EndpointsAdminGetJiraConfigOutput: + properties: + configuration: + $ref: '#/components/schemas/ModelsJiraConfig' + enabled: + type: boolean + version: + type: string + required: + - enabled + type: object + EndpointsAdminGetK8SCollectorAccountsOutput: + properties: + accountIds: + items: + type: string + nullable: true + type: array + initialized: + type: boolean + legacyAccessPreserved: + type: boolean + revision: + format: int64 + type: integer + stateId: + type: string + required: + - stateId + - accountIds + - revision + - initialized + - legacyAccessPreserved + type: object + EndpointsAdminGetK8SSettingsOutput: + properties: + clusters: + items: + $ref: '#/components/schemas/ModelsK8SClusterWithStatus' + nullable: true + type: array + createdAt: + type: string + lastValidatedAt: + type: string + lastValidationStatus: + type: string + nullifyRoleArn: + type: string + updatedAt: + type: string + required: + - clusters + type: object + EndpointsAdminGetLinearConfigOutput: + properties: + clientSecretUploaded: + type: boolean + configUploaded: + type: boolean + configuration: + $ref: '#/components/schemas/EndpointsAdminLinearConfigOutput' + redactedClientSecret: + type: string + version: + type: string + required: + - configUploaded + - clientSecretUploaded + type: object + EndpointsAdminGetLinearMembersOutput: + properties: + hasMore: + type: boolean + members: + items: + $ref: '#/components/schemas/EndpointsAdminLinearMember' + nullable: true + type: array + version: + type: string + required: + - members + - hasMore + type: object + EndpointsAdminGetLinearTeamsOutput: + properties: + teams: + items: + $ref: '#/components/schemas/EndpointsAdminLinearTeam' + nullable: true + type: array + version: + type: string + required: + - teams + type: object + EndpointsAdminGetOrganizationOutput: + properties: + organization: + $ref: '#/components/schemas/ModelsOrganization' + version: + type: string + type: object + EndpointsAdminGetPRGateSettingsOutput: + properties: + allowApprovingReviews: + type: boolean + allowRequestChangesReviews: + type: boolean + createdAt: + type: string + cvssEnforcement: + type: boolean + enabled: + type: boolean + failOnIncompleteCoverage: + type: boolean + findingsPolicy: + $ref: '#/components/schemas/EndpointsPRGateFindingsPolicy' + minPriority: + $ref: '#/components/schemas/ModelsPriorityEnum' + mode: + deprecated: true + description: >- + Deprecated: never_block is findingsPolicy none, block_on_confirmed_net_new is confirmed, + block_on_any_failure is confirmed with failOnIncompleteCoverage. never_block can coexist with + cvssEnforcement or failOnIncompleteCoverage, which this field does not show. Derived from findingsPolicy and + failOnIncompleteCoverage. Read those and cvssEnforcement instead. + enum: + - never_block + - block_on_confirmed_net_new + - block_on_any_failure + type: string + prReviewsEnabled: + nullable: true + type: boolean + prScansEnabled: + nullable: true + type: boolean + pushScansEnabled: + nullable: true + type: boolean + scaBlockCvssThreshold: + maximum: 10 + minimum: 0 + nullable: true + type: number + scpm: + $ref: '#/components/schemas/EndpointsEffectiveSCPMGateSettings' + updatedAt: + type: string + version: + type: string + required: + - findingsPolicy + - enabled + - minPriority + type: object + EndpointsAdminGetPullRequestRecordOutput: + properties: + pullRequest: + $ref: '#/components/schemas/ModelsFindingPullRequestRecord' + version: + type: string + type: object + EndpointsAdminGetRBACPreferencesOutput: + properties: + createdAt: + type: string + defaultInviteeRole: + enum: + - builtin:admin + - builtin:editor + - builtin:viewer + type: string + teamScopedRoles: + description: Roles whose members only see findings of teams they belong to + items: + type: string + nullable: true + type: array + updatedAt: + type: string + version: + type: string + required: + - defaultInviteeRole + - teamScopedRoles + type: object + EndpointsAdminGetRepoRecommendationsOutput: + properties: + generatedAt: + type: string + recommended: + items: + $ref: '#/components/schemas/EndpointsRepoRecommendation' + nullable: true + type: array + scanId: + type: string + uncoveredCaps: + items: + type: string + nullable: true + type: array + required: + - scanId + - generatedAt + - recommended + - uncoveredCaps + type: object + EndpointsAdminGetRepositoriesOutput: + properties: + nextToken: + type: string + numItems: + type: integer + repositories: + items: + $ref: '#/components/schemas/ModelsRepositoryPublic' + nullable: true + type: array + totalCount: + type: integer + version: + type: string + required: + - repositories + - numItems + - totalCount + - nextToken + type: object + EndpointsAdminGetSupportAccessOutput: + properties: + active: + $ref: '#/components/schemas/EndpointsAdminSupportAccessGrant' + grants: + items: + $ref: '#/components/schemas/EndpointsAdminSupportAccessGrant' + nullable: true + type: array + version: + type: string + required: + - grants + type: object + EndpointsAdminGetThreatNotificationDestinationsOutput: + properties: + destinations: + $ref: '#/components/schemas/EndpointsThreatNotificationDestinations' + required: + - destinations + type: object + EndpointsAdminGetUserInstallationsOutput: + properties: + installations: + items: + $ref: '#/components/schemas/EndpointsAdminInstallationOutput' + nullable: true + type: array + version: + type: string + required: + - installations + type: object + EndpointsAdminGetUsersOutput: + properties: + users: + items: + $ref: '#/components/schemas/EndpointsAdminUserWithRole' + type: array + version: + type: string + type: object + EndpointsAdminGitLabConnectConfirmInput: + properties: + handle: + type: string + required: + - handle + type: object + EndpointsAdminGitLabConnectOutput: + properties: + authorizeUrl: + type: string + handle: + type: string + required: + - authorizeUrl + - handle + type: object + EndpointsAdminGitLabConnectStatusOutput: + properties: + available: + type: boolean + completedRepositories: + type: integer + connected: + type: boolean + error: + type: string + group: + $ref: '#/components/schemas/GitlabauthGroup' + handle: + type: string + repositories: + items: + $ref: '#/components/schemas/GitlabauthProject' + type: array + status: + type: string + type: object + EndpointsAdminInstallationOutput: + properties: + avatarUrl: + type: string + isOnboarded: + nullable: true + type: boolean + name: + type: string + nullifyBaseUrl: + nullable: true + type: string + provider: + $ref: '#/components/schemas/ModelsOwnerProvider' + provisioningStatus: + enum: + - ready + - pending + - unavailable + type: string + queryParameters: + additionalProperties: + type: string + nullable: true + type: object + required: + - provider + - name + - avatarUrl + - queryParameters + type: object + EndpointsAdminK8SConnectorWhitelistInput: + properties: + accountIds: + description: >- + AWS collector account IDs. With expectedRevision, an empty list removes only managed grants; legacy callers + without a revision use stored AWS accounts. + items: + type: string + type: array + expectedRevision: + description: Expected durable collector account revision; zero adopts an uninitialized account list. + nullable: true + type: integer + expectedStateId: + description: Expected settings-row identity; empty only when no row exists. + nullable: true + type: string + type: object + EndpointsAdminK8SConnectorWhitelistOutput: + properties: + accessPointError: + type: string + accessPointPolicyUpdated: + type: boolean + kmsError: + type: string + kmsPolicyUpdated: + type: boolean + kmsSkipped: + type: boolean + message: + type: string + revision: + format: int64 + type: integer + s3Error: + type: string + s3PolicyUpdated: + type: boolean + stateId: + type: string + required: + - stateId + - revision + - s3PolicyUpdated + - kmsPolicyUpdated + - kmsSkipped + type: object + EndpointsAdminLinearConfigOutput: + properties: + autoCreate: + type: boolean + clientId: + type: string + createdAt: + format: date-time + type: string + defaultAssigneeId: + nullable: true + type: string + enabledFindingTypes: + items: + type: string + type: array + priorityThreshold: + type: string + teamId: + type: string + updatedAt: + format: date-time + type: string + required: + - clientId + - createdAt + - updatedAt + type: object + EndpointsAdminLinearMember: + properties: + email: + type: string + id: + type: string + name: + type: string + required: + - id + - name + type: object + EndpointsAdminLinearTeam: + properties: + id: + type: string + key: + type: string + name: + type: string + required: + - id + - name + type: object + EndpointsAdminListAzureInstallationsOutput: + properties: + installations: + items: + $ref: '#/components/schemas/EndpointsAdminAzureInstallation' + nullable: true + type: array + version: + type: string + required: + - installations + type: object + EndpointsAdminListIntegrationConnectionsOutput: + properties: + connections: + items: + $ref: '#/components/schemas/EndpointsIntegrationConnectionInstanceView' + nullable: true + type: array + type: object + EndpointsAdminListOrgOwnersOutput: + properties: + userIds: + description: >- + Member ids (admin_users.id) of the GitHub organization's owners, matched on GitHub user id. Empty for other + providers or when GitHub refused the owner listing. + items: + type: string + nullable: true + type: array + version: + type: string + required: + - userIds + type: object + EndpointsAdminListUnifiedEventsByTeamInput: + properties: + afterId: + nullable: true + type: string + afterTimeUnix: + nullable: true + type: integer + autofixId: + nullable: true + type: string + beforeTimeUnix: + nullable: true + type: integer + campaignId: + nullable: true + type: string + eventTypes: + items: + type: string + type: array + excludeEventTypes: + items: + type: string + type: array + excludeServices: + items: + type: string + type: array + findingIds: + items: + type: string + type: array + hideNoise: + type: boolean + limit: + nullable: true + type: integer + prCanonicalId: + nullable: true + type: string + query: + maxLength: 256 + type: string + queryEventTypes: + items: + type: string + maxItems: 512 + type: array + runId: + nullable: true + type: string + services: + items: + type: string + type: array + type: object + EndpointsAdminListUnifiedEventsInput: + properties: + afterId: + nullable: true + type: string + afterTimeUnix: + nullable: true + type: integer + autofixId: + nullable: true + type: string + beforeTimeUnix: + nullable: true + type: integer + campaignId: + nullable: true + type: string + eventTypes: + items: + type: string + type: array + excludeEventTypes: + items: + type: string + type: array + excludeServices: + items: + type: string + type: array + findingIds: + items: + type: string + type: array + hideNoise: + type: boolean + limit: + nullable: true + type: integer + prCanonicalId: + nullable: true + type: string + query: + maxLength: 256 + type: string + queryEventTypes: + items: + type: string + maxItems: 512 + type: array + runId: + nullable: true + type: string + services: + items: + type: string + type: array + type: object + EndpointsAdminListUnifiedEventsOutput: + properties: + events: + items: + $ref: '#/components/schemas/EndpointsUnifiedEventOutput' + nullable: true + type: array + hasMore: + type: boolean + nextCursorId: + nullable: true + type: string + nextCursorTime: + nullable: true + type: integer + version: + type: string + type: object + EndpointsAdminListUserRolesOutput: + properties: + nextKey: + type: string + total: + description: Total users matching the search filter across all pages + type: integer + users: + items: + $ref: '#/components/schemas/EndpointsAdminUserRole' + nullable: true + type: array + version: + type: string + type: object + EndpointsAdminMintGCPAccessTokenOutput: + properties: + accessToken: + type: string + expiresAt: + format: date-time + type: string + required: + - accessToken + - expiresAt + type: object + EndpointsAdminNewRoleUser: + properties: + email: + description: The user's email address + type: string + name: + description: The user's display name + type: string + username: + description: The user's provider login + type: string + required: + - username + type: object + EndpointsAdminPostAsanaTicketConfigInput: + properties: + accessToken: + description: The Asana Personal Access Token (encrypted at rest, never echoed back) + type: string + projectGid: + description: The default Asana project GID tasks are created in + type: string + workspaceId: + description: The Asana workspace GID work items are filed against + type: string + workspaceName: + description: The human-readable Asana workspace name + type: string + required: + - accessToken + - workspaceId + - projectGid + type: object + EndpointsAdminPostAsanaTicketConfigOutput: + properties: + configuration: + $ref: '#/components/schemas/EndpointsAdminAsanaConfigOutput' + version: + type: string + type: object + EndpointsAdminPostAzureCodeownersPreviewInput: + properties: + organizationId: + description: Azure DevOps organization (account) id the tenant has connected + type: string + path: + description: >- + One of CODEOWNERS, .github/CODEOWNERS or docs/CODEOWNERS (a leading slash is accepted); any other path is + refused. Empty tries them in that order. + type: string + projectId: + description: Azure DevOps project id or name + type: string + ref: + type: string + repositoryId: + description: Azure DevOps repository id or name + type: string + required: + - organizationId + - projectId + - repositoryId + type: object + EndpointsAdminPostAzureCodeownersPreviewOutput: + properties: + applied: + description: 'Always false: the preview never writes to Azure DevOps' + type: boolean + found: + type: boolean + path: + description: Where the CODEOWNERS file was found + type: string + plans: + items: + $ref: '#/components/schemas/EndpointsAzureCodeownersPolicyPlan' + nullable: true + type: array + ref: + description: The branch it was read from + type: string + rules: + type: integer + unresolved: + items: + type: string + nullable: true + type: array + version: + type: string + required: + - found + - rules + - plans + - unresolved + - applied + type: object + EndpointsAdminPostAzureConnectConfirmInput: + properties: + organizationIds: + items: + type: string + nullable: true + type: array + projects: + type: string + required: + - organizationIds + - projects + type: object + EndpointsAdminPostAzureConnectConfirmOutput: + properties: + status: + $ref: '#/components/schemas/EndpointsAzureConnectStatus' + version: + type: string + required: + - status + type: object + EndpointsAdminPostAzureConnectInput: + properties: + alsoEnableSignIn: + type: boolean + enableBuildGate: + type: boolean + enableWorkItems: + type: boolean + organizationName: + type: string + reauthorizeHandle: + type: string + requestAdminConsent: + type: boolean + returnPath: + description: >- + In-app page the Microsoft callback returns to: /settings (the connectors tab, the default) or /onboarding. + Any other value returns to /settings. The callback appends connect= and, on failure, + connectError=. + type: string + type: object + EndpointsAdminPostAzureConnectOutput: + properties: + authorizeUrl: + type: string + version: + type: string + required: + - authorizeUrl + type: object + EndpointsAdminPostAzureConnectRetryInput: + properties: + organizationId: + type: string + required: + - organizationId + type: object + EndpointsAdminPostAzureConnectRetryOutput: + properties: + status: + $ref: '#/components/schemas/EndpointsAzureConnectStatus' + version: + type: string + required: + - status + type: object + EndpointsAdminPostAzureCredentialsInput: + properties: + clientId: + type: string + clientSecret: + type: string + organization: + type: string + projectName: + type: string + tenantId: + type: string + workItemType: + type: string + required: + - clientId + - tenantId + type: object + EndpointsAdminPostAzureCredentialsOutput: + properties: + clientId: + type: string + clientSecret: + type: string + createdAt: + format: date-time + type: string + organization: + type: string + projectName: + type: string + tenantId: + type: string + updatedAt: + format: date-time + type: string + version: + type: string + workItemType: + type: string + required: + - clientId + - tenantId + - createdAt + - updatedAt + type: object + EndpointsAdminPostAzureInstallOutput: + properties: + dryRun: + description: 'Whether this was a plan only: nothing in Azure DevOps or Nullify changed' + type: boolean + failures: + description: Subscriptions that could not be created + items: + $ref: '#/components/schemas/EndpointsAdminAzureHookFailure' + type: array + hooksCreated: + description: Number of service-hook subscriptions created by this call + type: integer + hooksReplaced: + description: Number of existing subscriptions rewritten in place. Always 0 unless reconcile was requested + type: integer + hooksSkipped: + description: Number of subscriptions that already existed and were left untouched + type: integer + outcome: + description: >- + Worst project outcome of the reconcile. Empty for an organization with no stored connection, which is + provisioned through this stack's service principal without a reconcile report + enum: + - healthy + - repaired + - needs_attention + - failed + type: string + projects: + description: Per-project plan (dryRun) or result of the reconcile + items: + $ref: '#/components/schemas/EndpointsAdminAzureProjectHooksHealth' + type: array + routerManaged: + description: >- + Whether the organization's webhook secret is owned by the Nullify router. Such an organization is repaired + with the secret the router handed this stack at connect; the secret is never returned + type: boolean + version: + type: string + type: object + EndpointsAdminPostLinearTicketConfigInput: + properties: + autoCreate: + type: boolean + defaultAssigneeId: + nullable: true + type: string + enabledFindingTypes: + items: + type: string + nullable: true + type: array + priorityThreshold: + type: string + teamId: + type: string + required: + - teamId + type: object + EndpointsAdminPostLinearTicketConfigOutput: + properties: + configuration: + $ref: '#/components/schemas/EndpointsAdminLinearConfigOutput' + version: + type: string + type: object + EndpointsAdminPutFixEffortInput: + properties: + fixEffort: + $ref: '#/components/schemas/EndpointsAdminFixEffortMapInput' + required: + - fixEffort + type: object + EndpointsAdminPutFixEffortOutput: + properties: + version: + type: string + type: object + EndpointsAdminPutPRGateSettingsInput: + properties: + allowApprovingReviews: + type: boolean + allowRequestChangesReviews: + type: boolean + cvssEnforcement: + nullable: true + type: boolean + enabled: + type: boolean + expectedPrScansEnabled: + nullable: true + type: boolean + expectedPushScansEnabled: + nullable: true + type: boolean + failOnIncompleteCoverage: + nullable: true + type: boolean + findingsPolicy: + $ref: '#/components/schemas/EndpointsPRGateFindingsPolicy' + minPriority: + $ref: '#/components/schemas/ModelsPriorityEnum' + mode: + deprecated: true + description: >- + Deprecated: never_block is findingsPolicy none, block_on_confirmed_net_new is confirmed, + block_on_any_failure is confirmed with failOnIncompleteCoverage. never_block can coexist with + cvssEnforcement or failOnIncompleteCoverage, which this field does not show. On a PUT it is mapped onto + findingsPolicy and failOnIncompleteCoverage only when it differs from the mode the stored settings already + read as; otherwise the stored findingsPolicy, cvssEnforcement and failOnIncompleteCoverage are kept. Sent + with either of those it must agree, or the request is rejected with 400. + enum: + - never_block + - block_on_confirmed_net_new + - block_on_any_failure + nullable: true + type: string + prReviewsEnabled: + nullable: true + type: boolean + prScansEnabled: + nullable: true + type: boolean + pushScansEnabled: + nullable: true + type: boolean + scaBlockCvssThreshold: + maximum: 10 + minimum: 0 + nullable: true + type: number + required: + - enabled + - minPriority + type: object + EndpointsAdminPutPRGateSettingsOutput: + properties: + allowApprovingReviews: + type: boolean + allowRequestChangesReviews: + type: boolean + createdAt: + type: string + cvssEnforcement: + type: boolean + enabled: + type: boolean + failOnIncompleteCoverage: + type: boolean + findingsPolicy: + $ref: '#/components/schemas/EndpointsPRGateFindingsPolicy' + minPriority: + $ref: '#/components/schemas/ModelsPriorityEnum' + mode: + deprecated: true + description: >- + Deprecated: never_block is findingsPolicy none, block_on_confirmed_net_new is confirmed, + block_on_any_failure is confirmed with failOnIncompleteCoverage. never_block can coexist with + cvssEnforcement or failOnIncompleteCoverage, which this field does not show. Derived from findingsPolicy and + failOnIncompleteCoverage. + enum: + - never_block + - block_on_confirmed_net_new + - block_on_any_failure + type: string + prReviewsEnabled: + type: boolean + prScansEnabled: + type: boolean + pushScansEnabled: + type: boolean + scaBlockCvssThreshold: + maximum: 10 + minimum: 0 + nullable: true + type: number + updatedAt: + type: string + version: + type: string + required: + - findingsPolicy + - enabled + - minPriority + type: object + EndpointsAdminPutRBACPreferencesInput: + properties: + defaultInviteeRole: + description: Role newly-synced users land on + enum: + - builtin:admin + - builtin:editor + - builtin:viewer + type: string + teamScopedRoles: + description: Roles whose members only see findings of teams they belong to; builtin:admin is not allowed + items: + type: string + nullable: true + type: array + required: + - defaultInviteeRole + - teamScopedRoles + type: object + EndpointsAdminPutRBACPreferencesOutput: + properties: + createdAt: + type: string + defaultInviteeRole: + enum: + - builtin:admin + - builtin:editor + - builtin:viewer + type: string + teamScopedRoles: + description: Roles whose members only see findings of teams they belong to + items: + type: string + nullable: true + type: array + updatedAt: + type: string + version: + type: string + required: + - defaultInviteeRole + - teamScopedRoles + type: object + EndpointsAdminPutRoutingExclusionsInput: + properties: + users: + items: + $ref: '#/components/schemas/EndpointsAdminRoutingExclusionUser' + nullable: true + type: array + required: + - users + type: object + EndpointsAdminPutSecurityOwnerInput: + properties: + teamId: + type: string + userId: + type: string + required: + - teamId + - userId + type: object + EndpointsAdminPutThreatNotificationDestinationsInput: + properties: + microsoftTeamsWebhookUrl: + description: Teams incoming webhook or Workflows webhook URL (https, Microsoft host). Write-only. Empty removes it. + nullable: true + type: string + nullifySharedSlack: + description: Post to the Slack channel Nullify shares with you. + nullable: true + type: boolean + tenantSlackChannelId: + description: Slack channel ID in your own workspace. Empty removes it. Requires Nullify's Slack app in your workspace. + nullable: true + type: string + type: object + EndpointsAdminPutThreatNotificationDestinationsOutput: + properties: + destinations: + $ref: '#/components/schemas/EndpointsThreatNotificationDestinations' + required: + - destinations + type: object + EndpointsAdminQueryFindingsFrameworksOutput: + properties: + frameworks: + items: + $ref: '#/components/schemas/ModelsFrameworkFindingsSummary' + nullable: true + type: array + version: + type: string + required: + - frameworks + type: object + EndpointsAdminQueryFindingsInput: + properties: + query: + $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + required: + - query + type: object + EndpointsAdminQueryFindingsMetricsByRepositoryInput: + properties: + query: + $ref: '#/components/schemas/ModelsLimitedUnifiedFindingsQuery' + required: + - query + type: object + EndpointsAdminQueryFindingsMetricsByRepositoryOutput: + properties: + repositories: + items: + $ref: '#/components/schemas/ModelsFindingsRepositoryMetrics' + nullable: true + type: array + version: + type: string + required: + - repositories + type: object + EndpointsAdminQueryFindingsMetricsInput: + properties: + includeFunnel: + type: boolean + query: + $ref: '#/components/schemas/ModelsLimitedUnifiedFindingsQuery' + required: + - query + type: object + EndpointsAdminQueryFindingsMetricsOutput: + properties: + findingsAnalysis: + $ref: '#/components/schemas/ModelsFindingsMetrics' + version: + type: string + required: + - findingsAnalysis + type: object + EndpointsAdminQueryFindingsOutput: + properties: + findings: + items: + $ref: '#/components/schemas/ModelsUnifiedFindingPreview' + nullable: true + type: array + hasMoreData: + type: boolean + page: + type: integer + scrollId: + nullable: true + type: string + total: + type: integer + version: + type: string + required: + - findings + - page + - hasMoreData + - total + type: object + EndpointsAdminQueryFindingsProgressInput: + properties: + query: + $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + required: + - query + type: object + EndpointsAdminQueryFindingsProgressOutput: + properties: + hasMoreData: + type: boolean + progress: + items: + $ref: '#/components/schemas/ModelsFindingProgress' + nullable: true + type: array + total: + type: integer + version: + type: string + required: + - progress + - hasMoreData + - total + type: object + EndpointsAdminQueryPullRequestMetricsInput: + properties: + query: + $ref: '#/components/schemas/ModelsPullRequestMetricsQuery' + required: + - query + type: object + EndpointsAdminQueryPullRequestMetricsOutput: + properties: + pullRequests: + $ref: '#/components/schemas/ModelsPullRequestMetrics' + version: + type: string + required: + - pullRequests + type: object + EndpointsAdminQueryPullRequestsInput: + properties: + query: + $ref: '#/components/schemas/ModelsFindingPullRequestQuery' + type: object + EndpointsAdminQueryPullRequestsOutput: + properties: + pullRequests: + items: + $ref: '#/components/schemas/ModelsFindingPullRequestRecord' + nullable: true + type: array + version: + type: string + required: + - pullRequests + type: object + EndpointsAdminQueryTicketMetricsInput: + properties: + query: + $ref: '#/components/schemas/ModelsTicketMetricsQuery' + required: + - query + type: object + EndpointsAdminQueryTicketMetricsOutput: + properties: + tickets: + $ref: '#/components/schemas/ModelsTicketMetrics' + version: + type: string + required: + - tickets + type: object + EndpointsAdminReactivateUserInput: + properties: + userId: + description: ID of the Nullify user to reactivate + type: string + required: + - userId + type: object + EndpointsAdminReactivateUserOutput: + properties: + lifecycleState: + enum: + - active + - deactivated + type: string + userId: + type: string + username: + type: string + version: + type: string + required: + - userId + - lifecycleState + type: object + EndpointsAdminRefreshPullRequestsCIInput: + properties: + ids: + items: + type: string + nullable: true + type: array + required: + - ids + type: object + EndpointsAdminRefreshPullRequestsCIOutput: + properties: + failedIds: + items: + type: string + nullable: true + type: array + refreshedIds: + items: + type: string + nullable: true + type: array + rejectedIds: + items: + type: string + nullable: true + type: array + version: + type: string + required: + - refreshedIds + - failedIds + - rejectedIds + type: object + EndpointsAdminRevokeSupportAccessOutput: + properties: + revoked: + $ref: '#/components/schemas/EndpointsAdminSupportAccessGrant' + version: + type: string + type: object + EndpointsAdminRotateIntegrationConnectionInput: + properties: + expectedAuthorityRevision: + description: Reject a rotation if the reviewed connection version has changed + nullable: true + type: integer + fields: + additionalProperties: + type: string + description: Field values to replace; absent or blank fields keep their stored value + nullable: true + type: object + type: object + EndpointsAdminRotateIntegrationConnectionOutput: + properties: + connection: + $ref: '#/components/schemas/EndpointsIntegrationConnectionInstanceView' + type: object + EndpointsAdminRoutingExclusion: + properties: + currentLogin: + type: string + gitUserRefs: + items: + type: string + nullable: true + type: array + jiraId: + type: string + linearId: + type: string + login: + type: string + providerId: + $ref: '#/components/schemas/ModelsProviderID' + providerUserId: + type: string + slackId: + type: string + source: + type: string + teamsId: + type: string + unresolved: + items: + type: string + nullable: true + type: array + userId: + type: string + required: + - providerId + - login + - currentLogin + - userId + - providerUserId + - gitUserRefs + - slackId + - teamsId + - linearId + - jiraId + - unresolved + - source + type: object + EndpointsAdminRoutingExclusionUser: + properties: + login: + type: string + providerId: + $ref: '#/components/schemas/ModelsProviderID' + source: + type: string + required: + - providerId + - login + type: object + EndpointsAdminRoutingExclusionsOutput: + properties: + fallback: + $ref: '#/components/schemas/EndpointsAdminRoutingFallback' + users: + items: + $ref: '#/components/schemas/EndpointsAdminRoutingExclusion' + nullable: true + type: array + required: + - users + - fallback + type: object + EndpointsAdminRoutingFallback: + properties: + eligible: + type: boolean + gitUserRefs: + items: + type: string + nullable: true + type: array + login: + type: string + name: + type: string + providerId: + $ref: '#/components/schemas/ModelsProviderID' + providerUserId: + type: string + reason: + type: string + slackId: + type: string + teamsId: + type: string + userId: + type: string + required: + - eligible + - reason + - userId + - name + - providerId + - login + - providerUserId + - gitUserRefs + - slackId + - teamsId + type: object + EndpointsAdminSecurityOwnerContact: + properties: + interactionCount: + format: int64 + type: integer + name: + type: string + userId: + type: string + required: + - userId + - name + - interactionCount + type: object + EndpointsAdminSecurityOwnerOutput: + properties: + resolvedUserId: + type: string + suggestions: + items: + $ref: '#/components/schemas/EndpointsAdminSecurityOwnerContact' + nullable: true + type: array + teamId: + type: string + userId: + type: string + required: + - teamId + - userId + - resolvedUserId + - suggestions + type: object + EndpointsAdminSetUserRoleTarget: + properties: + newUser: + $ref: '#/components/schemas/EndpointsAdminNewRoleUser' + userId: + description: ID of an existing Nullify user + type: string + type: object + EndpointsAdminSupportAccessGrant: + properties: + actor: + description: Canonical id of the staff member who holds the grant + type: string + agent: + description: Self-reported agent acting for the staff member; attribution, not a control + type: string + createdAt: + format: date-time + type: string + expiresAt: + format: date-time + type: string + id: + type: string + reason: + type: string + revokedAt: + format: date-time + nullable: true + type: string + revokedBy: + description: Canonical id of who revoked it, or "expired" when it lapsed + type: string + role: + enum: + - builtin:admin + type: string + username: + description: The staff member's login when the grant was made; display only + type: string + required: + - id + - username + - role + - reason + - actor + - createdAt + - expiresAt + type: object + EndpointsAdminSuspendAzureInstallationInput: + properties: + organizationId: + type: string + suspended: + type: boolean + required: + - organizationId + - suspended + type: object + EndpointsAdminSuspendAzureInstallationOutput: + properties: + failures: + description: >- + Projects whose ADO subscriptions could not be updated, including any project for which no subscription + matched this deployment's ingest host. The install row's admin_disabled_at still changes, so a non-empty + list means Nullify and Azure DevOps disagree until the operator retries. + items: + type: string + type: array + installationsAffected: + type: integer + subscriptionsAffected: + description: >- + ADO service-hook subscriptions whose status was actually rewritten. Zero with a non-empty failures list + means Azure DevOps was not changed at all. + type: integer + suspended: + type: boolean + version: + type: string + required: + - suspended + - installationsAffected + - subscriptionsAffected + type: object + EndpointsAdminTestAzureInstallationInput: + properties: + organizationId: + type: string + required: + - organizationId + type: object + EndpointsAdminTestAzureInstallationOutput: + properties: + checklist: + items: + $ref: '#/components/schemas/EndpointsAzureConnectChecklistItem' + nullable: true + type: array + ok: + type: boolean + version: + type: string + required: + - ok + - checklist + type: object + EndpointsAdminTestIntegrationConnectionOutput: + properties: + healthy: + type: boolean + lastError: + type: string + status: + type: string + type: object + EndpointsAdminTestIntegrationOutput: + properties: + healthy: + type: boolean + lastError: + type: string + status: + type: string + type: object + EndpointsAdminTriageContextCensusInput: + properties: + findingIds: + description: finding IDs to census for missing triage context + items: + type: string + nullable: true + type: array + required: + - findingIds + type: object + EndpointsAdminTriageContextCensusOutput: + properties: + blind: + items: + $ref: '#/components/schemas/EndpointsTriageContextCensusFinding' + nullable: true + type: array + requested: + type: integer + tenantSummary: + items: + $ref: '#/components/schemas/EndpointsTriageContextCensusSummary' + nullable: true + type: array + version: + type: string + required: + - requested + - blind + - tenantSummary + type: object + EndpointsAdminUpsertAWSSettingsInput: + properties: + awsAccounts: + items: + $ref: '#/components/schemas/ModelsAWSAccount' + nullable: true + type: array + externalId: + type: string + iamRoleName: + type: string + preferredDeployment: + type: string + required: + - iamRoleName + - awsAccounts + - preferredDeployment + type: object + EndpointsAdminUpsertAWSSettingsOutput: + properties: + awsAccounts: + items: + $ref: '#/components/schemas/ModelsAWSAccountWithStatus' + nullable: true + type: array + externalId: + type: string + lastValidatedAt: + type: string + lastValidationStatus: + type: string + message: + type: string + nullifyKMSKeyArn: + type: string + nullifyRoleArn: + type: string + nullifyS3Bucket: + type: string + overallStatus: + type: string + required: + - externalId + - nullifyRoleArn + - nullifyS3Bucket + - nullifyKMSKeyArn + - awsAccounts + - overallStatus + type: object + EndpointsAdminUpsertAzureInstallationInput: + properties: + organizationId: + description: >- + Azure DevOps account id (resourceContainers.account.id), not the collection/organization id used by the REST + API + type: string + projectId: + description: Azure DevOps project id (resourceContainers.project.id) + type: string + required: + - organizationId + - projectId + type: object + EndpointsAdminUpsertAzureInstallationOutput: + properties: + installation: + $ref: '#/components/schemas/EndpointsAdminAzureInstallation' + version: + type: string + webhookSecret: + description: >- + The shared secret to configure in Azure DevOps service hooks. Returned once; subsequent reads return only + the install metadata. + type: string + required: + - installation + - webhookSecret + type: object + EndpointsAdminUpsertAzureSettingsInput: + properties: + authMode: + type: string + clientId: + type: string + clientSecret: + type: string + displayName: + type: string + subscriptions: + items: + $ref: '#/components/schemas/ModelsAzureSubscriptionInput' + type: array + tenantId: + type: string + required: + - tenantId + - authMode + type: object + EndpointsAdminUpsertAzureSettingsOutput: + properties: + authMode: + type: string + clientId: + type: string + displayName: + type: string + lastValidatedAt: + type: string + lastValidationStatus: + type: string + message: + type: string + overallStatus: + type: string + subscriptions: + items: + $ref: '#/components/schemas/ModelsAzureSubscriptionWithStatus' + nullable: true + type: array + tenantId: + type: string + required: + - tenantId + - authMode + - subscriptions + - overallStatus + type: object + EndpointsAdminUpsertGCPSettingsInput: + properties: + discoveryScope: + type: string + displayName: + type: string + folderId: + type: string + gkeClusterOidcIssuerUrls: + items: + type: string + type: array + gkeServiceAccountUniqueId: + type: string + organizationId: + type: string + projects: + items: + $ref: '#/components/schemas/ModelsGCPProjectInput' + type: array + workloadIdentityProvider: + type: string + workloadIdentityServiceAccountEmail: + type: string + required: + - workloadIdentityProvider + - workloadIdentityServiceAccountEmail + type: object + EndpointsAdminUpsertGCPSettingsOutput: + properties: + displayName: + type: string + gkeClusterOidcIssuerUrls: + items: + type: string + type: array + gkeServiceAccountUniqueId: + type: string + lastValidatedAt: + type: string + lastValidationStatus: + type: string + message: + type: string + nullifyK8sCollectorRoleArn: + type: string + overallStatus: + type: string + projects: + items: + $ref: '#/components/schemas/ModelsGCPProjectWithStatus' + nullable: true + type: array + workloadIdentityProvider: + type: string + workloadIdentityServiceAccountEmail: + type: string + required: + - workloadIdentityProvider + - workloadIdentityServiceAccountEmail + - projects + - overallStatus + type: object + EndpointsAdminUpsertK8SClusterInput: + properties: + cloudAccountId: + type: string + clusterName: + type: string + clusterType: + type: string + collectConfigMaps: + description: Collect v1 ConfigMaps. Omit to keep the stored value; new clusters default to true. + nullable: true + type: boolean + collectSecrets: + description: Collect v1 Secrets (metadata only). Omit to keep the stored value; new clusters default to true. + nullable: true + type: boolean + isEnabled: + type: boolean + region: + type: string + resourceId: + type: string + required: + - clusterName + - clusterType + type: object + EndpointsAdminUpsertK8SClusterOutput: + properties: + cluster: + $ref: '#/components/schemas/ModelsK8SClusterWithStatus' + created: + description: True when no existing cluster matched and a new row was created. + type: boolean + required: + - cluster + - created + type: object + EndpointsAdminUpsertK8SSettingsInput: + properties: + clusters: + items: + $ref: '#/components/schemas/ModelsK8SClusterInput' + type: array + nullifyRoleArn: + description: Omit to keep the stored role ARN; an empty string clears it. + nullable: true + type: string + type: object + EndpointsAdminUpsertK8SSettingsOutput: + properties: + clusters: + items: + $ref: '#/components/schemas/ModelsK8SClusterWithStatus' + nullable: true + type: array + lastValidatedAt: + type: string + lastValidationStatus: + type: string + message: + type: string + nullifyRoleArn: + type: string + overallStatus: + type: string + required: + - clusters + - overallStatus + type: object + EndpointsAdminUsageAggregateGroup: + properties: + agent: + nullable: true + type: string + branchType: + nullable: true + type: string + class: + nullable: true + type: string + type: object + EndpointsAdminUsageLedgerEntry: + properties: + agent: + type: string + at: + type: string + branchType: + type: string + budgetKeys: + items: + type: string + nullable: true + type: array + class: + type: string + commitSha: + type: string + entryId: + type: string + environment: + type: string + findingId: + type: string + llm: + additionalProperties: {} + type: object + notes: + type: string + prNumber: + nullable: true + type: integer + projectId: + type: string + repo: + type: string + runId: + type: string + status: + type: string + trigger: + type: string + usd: + format: double + type: number + required: + - entryId + - at + - runId + - agent + - class + - branchType + - usd + - status + - trigger + - budgetKeys + type: object + EndpointsAdminUsageLedgerResponse: + properties: + entries: + items: + $ref: '#/components/schemas/EndpointsAdminUsageLedgerEntry' + nullable: true + type: array + nextToken: + nullable: true + type: string + required: + - entries + type: object + EndpointsAdminUsageMetricsAggregateItem: + properties: + group: + $ref: '#/components/schemas/EndpointsAdminUsageAggregateGroup' + inputTokens: + format: int64 + type: integer + outputTokens: + format: int64 + type: integer + runCount: + format: int64 + type: integer + usd: + format: double + type: number + required: + - group + - usd + - runCount + - inputTokens + - outputTokens + type: object + EndpointsAdminUsageMetricsAggregateOutput: + properties: + asOf: + type: string + totals: + items: + $ref: '#/components/schemas/EndpointsAdminUsageMetricsAggregateItem' + nullable: true + type: array + window: + type: string + required: + - window + - asOf + - totals + type: object + EndpointsAdminUsageMetricsTimeseriesBucket: + properties: + agent: + type: string + class: + type: string + inputTokens: + format: int64 + type: integer + outputTokens: + format: int64 + type: integer + timestamp: + type: string + usd: + format: double + type: number + required: + - timestamp + - agent + - class + - usd + - inputTokens + - outputTokens + type: object + EndpointsAdminUsageMetricsTimeseriesOutput: + properties: + buckets: + items: + $ref: '#/components/schemas/EndpointsAdminUsageMetricsTimeseriesBucket' + nullable: true + type: array + from: + type: string + granularity: + type: string + to: + type: string + required: + - granularity + - from + - to + - buckets + type: object + EndpointsAdminUserRole: + properties: + email: + type: string + isActivated: + description: Whether this user has platform access under the invite-activation gate + type: boolean + isCaller: + description: >- + Whether this row is the signed-in caller, matched on the session's verified provider identity (never on + name, username or email) + type: boolean + lifecycleState: + description: >- + The account's lifecycle: active, deactivated or deleted. Deactivated and deleted accounts are denied access + whatever their role. Absent from older servers. + enum: + - active + - deactivated + - deleted + type: string + name: + type: string + operatorGranted: + description: Whether a Nullify operator granted this user access, outside the tenant's git org membership + type: boolean + role: + enum: + - builtin:admin + - builtin:editor + - builtin:viewer + type: string + userId: + type: string + username: + type: string + required: + - userId + - role + type: object + EndpointsAdminUserSource: + enum: + - nullify + - git_provider + - slack + - jira + - teams + type: string + EndpointsAdminUserWithRole: + properties: + asana: + $ref: '#/components/schemas/ModelsAsanaUserProvider' + azure: + $ref: '#/components/schemas/ModelsAzureUserProvider' + azureEntra: + $ref: '#/components/schemas/ModelsAzureEntraUserProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketUserProvider' + createdAt: + type: string + createdBy: + type: string + deleted: + description: Whether the account is deactivated + type: boolean + displayName: + description: The user's display name + type: string + email: + description: The user's email address + type: string + github: + $ref: '#/components/schemas/ModelsGitHubUserProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabUserProvider' + googleWorkspace: + $ref: '#/components/schemas/ModelsGoogleWorkspaceUserProvider' + id: + description: The user's ID + type: string + isBot: + description: Whether the user is a bot + type: boolean + isRestricted: + description: Whether the account is restricted + type: boolean + jira: + $ref: '#/components/schemas/ModelsJiraUserProvider' + lastUpdatedBy: + type: string + linear: + $ref: '#/components/schemas/ModelsLinearUserProvider' + name: + description: The user's name + type: string + okta: + $ref: '#/components/schemas/ModelsOktaUserProvider' + provider: + $ref: '#/components/schemas/ModelsUserProvider' + realName: + description: The user's real name + type: string + role: + description: The user's RBAC role (builtin:admin|editor|viewer); empty when the user has no Nullify account + type: string + slack: + $ref: '#/components/schemas/ModelsSlackUserProvider' + slug: + description: The user's slug + type: string + source: + $ref: '#/components/schemas/EndpointsAdminUserSource' + teams: + $ref: '#/components/schemas/ModelsTeamsUserProvider' + updatedAt: + type: string + username: + description: The user's username + type: string + required: + - provider + - id + - name + - slug + - username + - isBot + type: object + EndpointsAdminValidateAWSRoleInput: + properties: + accountIds: + items: + type: string + nullable: true + type: array + onboarding: + type: boolean + roleNameToAssume: + type: string + required: + - accountIds + type: object + EndpointsAdminValidateAWSRoleOutput: + properties: + connectorPermissionGaps: + items: + $ref: '#/components/schemas/ModelsAWSConnectorPermissionGap' + type: array + connectorPermissionProbe: + $ref: '#/components/schemas/EndpointsConnectorPermissionProbeStatus' + lastValidatedAt: + type: string + lastValidationStatus: + type: string + overallStatus: + type: string + results: + additionalProperties: + $ref: '#/components/schemas/EndpointsAdminAccountValidationResult' + nullable: true + type: object + required: + - results + - overallStatus + type: object + EndpointsAdminValidateAzureInput: + properties: + subscriptionIds: + items: + type: string + type: array + type: object + EndpointsAdminValidateAzureOutput: + properties: + connectorPermissionProbe: + $ref: '#/components/schemas/EndpointsConnectorPermissionProbeStatus' + lastValidatedAt: + type: string + lastValidationStatus: + $ref: '#/components/schemas/EndpointsCloudValidationStatus' + overallStatus: + $ref: '#/components/schemas/EndpointsCloudValidationStatus' + results: + additionalProperties: + $ref: '#/components/schemas/EndpointsAzureSubscriptionValidationResult' + nullable: true + type: object + type: object + EndpointsAdminValidateGCPInput: + properties: + projectIds: + items: + type: string + type: array + type: object + EndpointsAdminValidateGCPOutput: + properties: + connectorPermissionProbe: + $ref: '#/components/schemas/EndpointsConnectorPermissionProbeStatus' + lastValidatedAt: + type: string + lastValidationStatus: + $ref: '#/components/schemas/EndpointsCloudValidationStatus' + overallStatus: + $ref: '#/components/schemas/EndpointsCloudValidationStatus' + results: + additionalProperties: + $ref: '#/components/schemas/EndpointsGCPProjectValidationResult' + nullable: true + type: object + type: object + EndpointsAzureCodeownersPolicyPlan: + properties: + filenamePatterns: + description: The Azure DevOps filenamePatterns this pattern translates to + items: + type: string + nullable: true + type: array + owners: + description: The raw CODEOWNERS owner tokens + items: + type: string + nullable: true + type: array + requiredReviewerIds: + description: Azure DevOps identity ids the owners resolved to + items: + type: string + nullable: true + type: array + sourceLine: + type: integer + sourcePattern: + description: The CODEOWNERS pattern this plan came from + type: string + required: + - sourcePattern + - sourceLine + - filenamePatterns + - owners + - requiredReviewerIds + type: object + EndpointsAzureConnectChecklistCode: + enum: + - not_collection_admin + - authorization_expired + - projects_excluded + type: string + EndpointsAzureConnectChecklistItem: + properties: + code: + $ref: '#/components/schemas/EndpointsAzureConnectChecklistCode' + fix: + description: One-line operator-facing fix for a failed step, e.g. "org not Entra-backed -- use a PAT instead" + type: string + message: + type: string + organizationId: + type: string + projectId: + description: >- + The Azure DevOps project id a per-project step is about; empty for a step about the whole organization. A + failed per-project item leaves only that project not ready. + type: string + state: + $ref: '#/components/schemas/EndpointsAzureConnectChecklistState' + step: + $ref: '#/components/schemas/EndpointsAzureConnectChecklistStep' + required: + - organizationId + - step + - state + type: object + EndpointsAzureConnectChecklistState: + enum: + - pending + - ok + - failed + type: string + EndpointsAzureConnectChecklistStep: + enum: + - entitlement + - service_hooks_permission + - git_permission + - autofix_branch_permission + - permission_cleanup + - project_permission + - work_item_permission + - build_permission + - library_permission + - access_probe_read + - access_probe_write + - access_probe_work_items + - org_roster_read + - org_membership_read + - code_search_available + - route_binding + - subscriptions + - repositories + - branch_policy + - first_scan + - microsoft_sign_in + type: string + EndpointsAzureConnectEligibility: + enum: + - allowed + - denied + - unavailable + type: string + EndpointsAzureConnectEligibilityReason: + enum: + - not_collection_admin + - authorization_expired + - check_failed + - not_checked + - disconnected + - other_directory + - not_entra_backed + type: string + EndpointsAzureConnectOrganization: + properties: + connected: + description: >- + Whether this organization is connected by the same rule the connect status is settled with: selected, not + disconnected, its route bound, at least one tenant-stack step settled, and no pending item or failure that + leaves the whole organization unconnected. A failure confined to some projects, an advisory step, or a + branch policy the connect did not ask for leaves it connected. + type: boolean + eligibility: + $ref: '#/components/schemas/EndpointsAzureConnectEligibility' + eligibilityReason: + $ref: '#/components/schemas/EndpointsAzureConnectEligibilityReason' + entraTenantId: + description: The organization's connected Entra directory, resolved via x-vss-resourcetenant + type: string + id: + description: Azure DevOps organization id (UUID) + type: string + name: + type: string + selected: + type: boolean + required: + - id + - name + - entraTenantId + - eligibility + type: object + EndpointsAzureConnectStatus: + enum: + - discovering + - pending_selection + - connecting + - done + - failed + type: string + EndpointsAzurePrepareOutcome: + enum: + - prepared + - busy + - stale + - disabled + type: string + EndpointsAzureSubscriptionValidationResult: + properties: + displayName: + type: string + errorMessage: + type: string + isValid: + type: boolean + state: + type: string + status: + $ref: '#/components/schemas/EndpointsAzureSubscriptionValidationStatus' + subscriptionId: + type: string + type: object + EndpointsAzureSubscriptionValidationStatus: + enum: + - valid + - invalid + type: string + EndpointsBoardImpactCount: + properties: + boardId: + type: string + count: + type: integer + type: object + EndpointsBuildkiteOrganization: + properties: + name: + type: string + slug: + type: string + required: + - slug + - name + type: object + EndpointsBulkActionDryRunResult: + properties: + confirmationToken: + type: string + count: + format: int64 + type: integer + sample: + items: + $ref: '#/components/schemas/EndpointsFindingTicketRow' + nullable: true + type: array + type: object + EndpointsBulkActionStartResult: + properties: + operationId: + type: string + type: object + EndpointsBulkAddCommentParams: + properties: + comment: + type: string + required: + - comment + type: object + EndpointsBulkCloseParams: + properties: + comment: + type: string + includeManualSource: + type: boolean + settingsOutOfScopeFindingType: + $ref: '#/components/schemas/DatabaseFindingType' + type: object + EndpointsBulkMoveParams: + properties: + targetBoardId: + type: string + required: + - targetBoardId + type: object + EndpointsBulkOperationStatusEntry: + properties: + actionType: + $ref: '#/components/schemas/DatabaseTicketBulkActionType' + actor: + $ref: '#/components/schemas/DatabaseTicketAuditActor' + actorId: + type: string + affectedCount: + format: int32 + type: integer + cancellationRequestedAt: + type: string + completedAt: + type: string + createdAt: + type: string + errorCount: + format: int32 + type: integer + filterSnapshotJson: + format: base64 + type: string + id: + type: string + paramsJson: + format: base64 + type: string + startedAt: + type: string + status: + $ref: '#/components/schemas/DatabaseTicketBulkOperationStatus' + updatedAt: + type: string + type: object + EndpointsBulkReassignAssigneeParams: + properties: + targetAssigneeEmail: + type: string + required: + - targetAssigneeEmail + type: object + EndpointsBulkReassignTeamParams: + properties: + targetTeamId: + type: string + required: + - targetTeamId + type: object + EndpointsBulkRelabelParams: + properties: + addLabels: + items: + type: string + type: array + removeLabels: + items: + type: string + type: array + type: object + EndpointsBulkReopenParams: + type: object + EndpointsBulkResyncParams: + type: object + EndpointsBulkSetPriorityParams: + properties: + targetPriority: + $ref: '#/components/schemas/ModelsPriorityLabel' + required: + - targetPriority + type: object + EndpointsCSPMScanCadenceOutput: + properties: + cspmScanCadence: + description: daily | weekly | fortnightly | monthly | on_change | manual; empty means unconfigured (daily) + type: string + required: + - cspmScanCadence + type: object + EndpointsCapabilityFitPublic: + properties: + reason: + type: string + requiresConfirmation: + type: boolean + score: + type: integer + strength: + type: string + required: + - score + - strength + - reason + - requiresConfirmation + type: object + EndpointsCatalogConnector: + properties: + auth: + type: string + capability: + type: string + category: + type: string + configSchema: + items: + $ref: '#/components/schemas/ConnectorsConfigField' + type: array + description: + type: string + displayName: + type: string + externalId: + type: string + featureFlag: + type: string + iconRef: + type: string + instanceCount: + type: integer + lastError: + type: string + lastVerifiedAt: + format: date-time + nullable: true + type: string + lifecycle: + $ref: '#/components/schemas/ConnectorsLifecycleOps' + multiInstance: + type: boolean + providerId: + type: string + status: + type: string + type: object + EndpointsCloudValidationStatus: + enum: + - healthy + - unhealthy + type: string + EndpointsConnectorPermissionProbeStatus: + enum: + - complete + - incomplete + - not_probed + type: string + EndpointsContextEnvironment: + enum: + - development + - staging + - production + - unknown + type: string + EndpointsContextIngestCreds: + properties: + accessKeyId: + type: string + expiration: + type: string + secretAccessKey: + type: string + sessionToken: + type: string + type: object + EndpointsContextIngestInput: + properties: + branch: + description: Git branch name (e.g. main, feat/add-vpc) + type: string + commitSha: + description: Git commit SHA + type: string + contextType: + description: Context data type (e.g. terraform, ci_logs) + type: string + environment: + $ref: '#/components/schemas/EndpointsContextEnvironment' + fromPR: + description: PR number that originated this deployment (set on push-to-main after merge) + type: integer + name: + description: >- + Logical name for this context (e.g. networking, ecs-api, CI). Auto-detected by CLI from plan file path or + workflow name. + type: string + prNumber: + description: Pull request number (for PR-scoped uploads) + type: integer + repository: + description: Repository in org/repo format + type: string + required: + - contextType + - repository + - name + type: object + EndpointsContextIngestOutput: + properties: + bucket: + type: string + credentials: + $ref: '#/components/schemas/EndpointsContextIngestCreds' + keyPrefix: + type: string + kmsKeyArn: + type: string + region: + type: string + type: object + EndpointsCount: + properties: + number: + type: integer + startTimeStamp: + format: int64 + type: integer + required: + - startTimeStamp + - number + type: object + EndpointsDeleteBuildkiteIntegrationOutput: + properties: + message: + type: string + version: + type: string + required: + - version + - message + type: object + EndpointsDeleteCircleCIIntegrationOutput: + properties: + message: + type: string + version: + type: string + required: + - version + - message + type: object + EndpointsDeleteIdentityScimCredentialOutput: + properties: + version: + type: string + type: object + EndpointsDeleteJenkinsIntegrationOutput: + properties: + message: + type: string + version: + type: string + required: + - version + - message + type: object + EndpointsDeleteRepositoryPropertyTeamKeyOutput: + properties: + version: + type: string + type: object + EndpointsDeleteServiceAccountOutput: + properties: + version: + type: string + type: object + EndpointsDeleteTeamOutput: + properties: + version: + type: string + type: object + EndpointsDeleteTicketSavedFilterOutput: + properties: + deleted: + type: boolean + required: + - deleted + type: object + EndpointsDeleteUIPreferencesOutput: + properties: + deleted: + description: Always true on success; the delete is idempotent, so this does not confirm that a row existed + type: boolean + required: + - deleted + type: object + EndpointsDeleteUISavedViewOutput: + properties: + id: + type: string + required: + - id + type: object + EndpointsDeleteUserErasureOutput: + properties: + report: + $ref: '#/components/schemas/EndpointsErasureReport' + type: object + EndpointsDeleteUserMappingOutput: + properties: + userMapping: + $ref: '#/components/schemas/ModelsUserMapping' + type: object + EndpointsEffectiveSCPMGateSettings: + properties: + detectionsFeatureFlagKey: + type: string + exemptRuleGatePriority: + $ref: '#/components/schemas/ModelsPriorityLabel' + findingsPolicy: + $ref: '#/components/schemas/EndpointsPRGateFindingsPolicy' + floorExemptRuleIds: + items: + type: string + type: array + gateEnabled: + type: boolean + minPriority: + $ref: '#/components/schemas/ModelsPriorityEnum' + mode: + deprecated: true + description: >- + Deprecated: never_block is findingsPolicy none, block_on_confirmed_net_new is confirmed, + block_on_any_failure is confirmed with failOnIncompleteCoverage. never_block can coexist with + cvssEnforcement or failOnIncompleteCoverage, which this field does not show. Derived from the tenant's + controls. Read findingsPolicy instead. + enum: + - never_block + - block_on_confirmed_net_new + - block_on_any_failure + type: string + platformEnforcementFloor: + $ref: '#/components/schemas/ModelsSeverity' + required: + - gateEnabled + - findingsPolicy + - minPriority + - platformEnforcementFloor + - exemptRuleGatePriority + - detectionsFeatureFlagKey + type: object + EndpointsErasureReport: + properties: + adminUserDeleted: + type: boolean + auditLogsAnonymized: + format: int64 + type: integer + erasedAt: + type: string + privacyAcknowledgmentsDeleted: + format: int64 + type: integer + teamMembershipsDeleted: + format: int64 + type: integer + userId: + type: string + type: object + EndpointsExternalWriteView: + properties: + enabled: + type: boolean + lockReason: + type: string + locked: + description: Nullify staff set this switch; the tenant cannot change it + type: boolean + required: + - enabled + - locked + type: object + EndpointsExternalWritesOutput: + properties: + externalWrites: + $ref: '#/components/schemas/EndpointsExternalWritesView' + required: + - externalWrites + type: object + EndpointsExternalWritesView: + properties: + gitWrites: + $ref: '#/components/schemas/EndpointsExternalWriteView' + messaging: + $ref: '#/components/schemas/EndpointsExternalWriteView' + pullRequestReviews: + $ref: '#/components/schemas/EndpointsExternalWriteView' + pullRequests: + $ref: '#/components/schemas/EndpointsExternalWriteView' + tickets: + $ref: '#/components/schemas/EndpointsExternalWriteView' + required: + - gitWrites + - pullRequestReviews + - pullRequests + - tickets + - messaging + type: object + EndpointsFacetCount: + properties: + count: + format: int64 + type: integer + value: + type: string + type: object + EndpointsFileOwnersRequest: + properties: + branchName: + type: string + filePath: + type: string + id: + type: string + repositoryName: + type: string + required: + - id + - repositoryName + - branchName + - filePath + type: object + EndpointsFindingFeedbackEntry: + properties: + axis: + type: string + commentText: + nullable: true + type: string + createdAt: + type: string + id: + type: string + raterKind: + type: string + raterUserId: + nullable: true + type: string + source: + type: string + verdict: + $ref: '#/components/schemas/EndpointsFindingFeedbackVerdict' + required: + - id + - verdict + - axis + - source + - raterKind + - createdAt + type: object + EndpointsFindingFeedbackVerdict: + enum: + - up + - down + - helpful + - wrong + - noisy + - fix_good + - fix_bad + - worth_fixing + - explanation_clear + - explanation_unclear + - severity_right + - severity_wrong + type: string + EndpointsFindingTicketRow: + properties: + assigneeEmail: + type: string + assigneeName: + type: string + boardId: + type: string + closedAt: + type: string + createdAt: + type: string + findingId: + type: string + findingType: + $ref: '#/components/schemas/DatabaseFindingType' + id: + type: string + lastSyncedAt: + type: string + outOfEligibilitySince: + type: string + platform: + $ref: '#/components/schemas/DatabaseTicketPlatform' + priorityName: + type: string + projectKey: + type: string + source: + $ref: '#/components/schemas/DatabaseTicketSource' + syncError: + type: string + ticketIdentifier: + type: string + ticketStatus: + $ref: '#/components/schemas/DatabaseTicketStatus' + ticketTitle: + type: string + ticketUrl: + type: string + updatedAt: + type: string + type: object + EndpointsFindingTicketSummary: + properties: + boardId: + type: string + findingId: + type: string + findingPriorityLabel: + $ref: '#/components/schemas/ModelsPriorityLabel' + findingType: + $ref: '#/components/schemas/DatabaseFindingType' + platform: + $ref: '#/components/schemas/DatabaseTicketPlatform' + source: + $ref: '#/components/schemas/DatabaseTicketSource' + ticketId: + type: string + ticketIdentifier: + type: string + ticketStatus: + $ref: '#/components/schemas/DatabaseTicketStatus' + ticketTitle: + type: string + ticketUrl: + type: string + type: object + EndpointsFunnelData: + properties: + CRITICAL: + type: integer + HIGH: + type: integer + INFO: + description: Findings whose severity is informational. + type: integer + LOW_ONLY: + description: Findings whose severity is exactly low. + type: integer + MEDIUM: + type: integer + UNRATED: + description: Findings with no severity. + type: integer + funnelKey: + type: string + required: + - CRITICAL + - HIGH + - MEDIUM + - LOW_ONLY + - INFO + - UNRATED + - funnelKey + type: object + EndpointsGCPProjectValidationResult: + properties: + displayName: + type: string + errorMessage: + type: string + isValid: + type: boolean + projectId: + type: string + state: + type: string + status: + $ref: '#/components/schemas/EndpointsGCPProjectValidationStatus' + type: object + EndpointsGCPProjectValidationStatus: + enum: + - valid + - invalid + type: string + EndpointsGetAdminNotificationConfigOutput: + properties: + centralSecurityChannel: + $ref: '#/components/schemas/ModelsMessageChannelProvider' + notifications: + items: + $ref: '#/components/schemas/ModelsNotification' + nullable: true + type: array + version: + type: string + type: object + EndpointsGetAsanaStatusOutput: + properties: + installed: + description: True if the tenant has configured an Asana PAT + type: boolean + installedAt: + description: When the Asana config was last updated + format: date-time + nullable: true + type: string + required: + - installed + type: object + EndpointsGetAtlassianInstallationOutput: + properties: + cloudId: + type: string + compassInstalled: + type: boolean + confluenceInstalled: + type: boolean + installUnavailableReason: + type: string + installUrl: + type: string + installationId: + type: string + linked: + type: boolean + settings: + $ref: '#/components/schemas/ModelsForgeProductSettings' + siteUrl: + type: string + type: object + EndpointsGetBuildkiteIntegrationOutput: + properties: + configured: + type: boolean + orgSlug: + type: string + version: + type: string + required: + - version + - configured + type: object + EndpointsGetBulkOperationOutput: + properties: + operation: + $ref: '#/components/schemas/EndpointsBulkOperationStatusEntry' + required: + - operation + type: object + EndpointsGetCircleCIIntegrationOutput: + properties: + configured: + type: boolean + version: + type: string + required: + - version + - configured + type: object + EndpointsGetCurrentUserOutput: + properties: + userMapping: + $ref: '#/components/schemas/ModelsUserMapping' + username: + type: string + required: + - userMapping + - username + type: object + EndpointsGetFindingFeedbackOutput: + properties: + feedback: + items: + $ref: '#/components/schemas/EndpointsFindingFeedbackEntry' + nullable: true + type: array + required: + - feedback + type: object + EndpointsGetIdentityScimOutput: + properties: + baseUrl: + type: string + credentials: + items: + $ref: '#/components/schemas/EndpointsScimCredentialView' + nullable: true + type: array + version: + type: string + required: + - baseUrl + - credentials + type: object + EndpointsGetIntegrationOAuthInstallOutput: + properties: + authorizeUrl: + description: OAuth authorize URL the UI should navigate to + type: string + required: + - authorizeUrl + type: object + EndpointsGetJenkinsIntegrationOutput: + properties: + configured: + type: boolean + version: + type: string + required: + - version + - configured + type: object + EndpointsGetJiraForgeStatusOutput: + properties: + cloudId: + description: Atlassian cloudId of the linked Jira site + type: string + linked: + description: True if the tenant has a linked Jira Forge installation + type: boolean + siteUrl: + description: Site URL of the linked Jira site + type: string + required: + - linked + type: object + EndpointsGetJiraInstallOutput: + properties: + authorizeUrl: + description: Atlassian 3LO authorize URL the UI should navigate to + type: string + required: + - authorizeUrl + type: object + EndpointsGetLinearInstallOutput: + properties: + authorizeUrl: + description: Linear OAuth authorize URL the UI should navigate to + type: string + required: + - authorizeUrl + type: object + EndpointsGetLinearOAuthStatusOutput: + properties: + configured: + description: True if this deployment can start a Linear install and renew its tokens + type: boolean + credentialsRejectedAt: + description: >- + When Linear last rejected this deployment's client credentials while renewing the install's token; absent + after a reinstall or a successful renewal + format: date-time + nullable: true + type: string + installed: + description: True if the tenant has completed the Linear OAuth install + type: boolean + installedAt: + description: When the install was last completed + format: date-time + nullable: true + type: string + message: + description: Why Linear is unavailable on this deployment, safe to show the tenant + type: string + reconnectRequired: + description: True if the stored token chain is broken and the tenant must reconnect + type: boolean + reconnectRequiredAt: + description: When the broken token chain was detected + format: date-time + nullable: true + type: string + state: + $ref: '#/components/schemas/ModelsLinearInstallState' + required: + - installed + type: object + EndpointsGetManagerSettingsOutput: + properties: + installed: + $ref: '#/components/schemas/EndpointsManagerIntegrationInstalled' + settings: + $ref: '#/components/schemas/EndpointsManagerSettings' + required: + - settings + - installed + type: object + EndpointsGetPrivacyAcknowledgmentOutput: + properties: + acknowledged: + description: Whether the user has acknowledged this policy version + type: boolean + acknowledgedAt: + description: Timestamp when the user acknowledged (RFC3339) + nullable: true + type: string + policyVersion: + description: The policy version that was checked + type: string + type: object + EndpointsGetProviderUsersOutput: + properties: + numItems: + type: integer + users: + items: + $ref: '#/components/schemas/ModelsUser' + nullable: true + type: array + version: + type: string + required: + - users + type: object + EndpointsGetPullRequestStateOutput: + properties: + pullRequestState: + $ref: '#/components/schemas/ModelsPullRequestStateWithDiffs' + type: object + EndpointsGetRepositoryDirectoriesOutput: + properties: + directories: + items: + $ref: '#/components/schemas/EndpointsRepositoryDirectory' + nullable: true + type: array + path: + type: string + ref: + type: string + repositoryId: + type: string + truncated: + description: The platform returned a partial listing + type: boolean + required: + - repositoryId + - ref + - path + - directories + - truncated + type: object + EndpointsGetRepositoryPropertyTeamKeysOutput: + properties: + keys: + items: + $ref: '#/components/schemas/EndpointsRepositoryPropertyTeamKey' + nullable: true + type: array + version: + type: string + required: + - keys + type: object + EndpointsGetSLAsOutput: + properties: + slas: + items: + $ref: '#/components/schemas/ModelsSLA' + nullable: true + type: array + required: + - slas + type: object + EndpointsGetScanCoverageFindingsOutput: + properties: + findings: + items: + $ref: '#/components/schemas/EndpointsScanCoverageFinding' + nullable: true + type: array + source: + type: string + totalCount: + type: integer + type: object + EndpointsGetScanCoverageOutput: + properties: + activeScannedCount: + description: Active roster repositories with a scan. + type: integer + activeTotalCount: + description: Active roster repositories, the denominator coverage should use. + type: integer + repositories: + items: + $ref: '#/components/schemas/EndpointsScanCoverageRepo' + nullable: true + type: array + scannedCount: + description: Roster repositories with a scan, including deactivated ones. + type: integer + totalCount: + description: Every repository on the roster, including deactivated ones. + type: integer + type: object + EndpointsGetServiceAccountsOutput: + properties: + serviceAccounts: + items: + $ref: '#/components/schemas/EndpointsServiceAccount' + nullable: true + type: array + version: + type: string + required: + - serviceAccounts + type: object + EndpointsGetSlackConfigOutput: + properties: + enabled: + type: boolean + healthy: + type: boolean + message: + type: string + required: + - enabled + - healthy + type: object + EndpointsGetSlackDistributedInstallOutput: + properties: + authorizeUrl: + description: Slack OAuth v2 authorize URL the UI should navigate to + type: string + required: + - authorizeUrl + type: object + EndpointsGetSuggestedUserMappingsOutput: + properties: + suggestions: + items: + $ref: '#/components/schemas/EndpointsUserMappingSuggestion' + nullable: true + type: array + unavailable: + items: + $ref: '#/components/schemas/EndpointsPlatformUnavailable' + type: array + version: + type: string + required: + - suggestions + type: object + EndpointsGetTeamFindingsOutput: + properties: + findings: + items: + $ref: '#/components/schemas/ModelsTeamFinding' + nullable: true + type: array + team: + $ref: '#/components/schemas/ModelsTeam' + version: + type: string + type: object + EndpointsGetTeamOutput: + properties: + team: + $ref: '#/components/schemas/ModelsTeam' + type: object + EndpointsGetTeamSourcePreferencesOutput: + properties: + preferences: + $ref: '#/components/schemas/EndpointsTeamSourcePreferences' + version: + type: string + required: + - preferences + type: object + EndpointsGetTeamSyncRunsOutput: + properties: + runs: + items: + $ref: '#/components/schemas/EndpointsTeamSyncRun' + nullable: true + type: array + version: + type: string + required: + - runs + type: object + EndpointsGetTeamsAppZipOutput: + properties: + presignedUrl: + type: string + required: + - presignedUrl + type: object + EndpointsGetTeamsOutput: + properties: + nextToken: + type: string + numItems: + type: integer + teams: + items: + $ref: '#/components/schemas/ModelsTeam' + nullable: true + type: array + required: + - teams + - nextToken + - numItems + type: object + EndpointsGetTicketActivityOutput: + properties: + entries: + items: + $ref: '#/components/schemas/EndpointsTicketActivityEntry' + nullable: true + type: array + required: + - entries + type: object + EndpointsGetTicketSavedFiltersOutput: + properties: + filters: + items: + $ref: '#/components/schemas/EndpointsSavedFilterEntry' + nullable: true + type: array + required: + - filters + type: object + EndpointsGetTicketSettingsHistoryOutput: + properties: + entries: + items: + $ref: '#/components/schemas/EndpointsTicketSettingsHistoryEntry' + nullable: true + type: array + required: + - entries + type: object + EndpointsGetTicketWorkbenchCountsOutput: + properties: + byFindingType: + items: + $ref: '#/components/schemas/EndpointsFacetCount' + nullable: true + type: array + byPlatform: + items: + $ref: '#/components/schemas/EndpointsFacetCount' + nullable: true + type: array + bySource: + items: + $ref: '#/components/schemas/EndpointsFacetCount' + nullable: true + type: array + byStatus: + items: + $ref: '#/components/schemas/EndpointsFacetCount' + nullable: true + type: array + required: + - bySource + - byPlatform + - byStatus + - byFindingType + type: object + EndpointsGetTicketWorkbenchDrilldownOutput: + properties: + auditHistory: + items: + $ref: '#/components/schemas/EndpointsTicketWorkbenchAuditEntry' + nullable: true + type: array + ticket: + $ref: '#/components/schemas/EndpointsFindingTicketRow' + required: + - ticket + - auditHistory + type: object + EndpointsGetTicketWorkbenchListOutput: + properties: + tickets: + items: + $ref: '#/components/schemas/EndpointsFindingTicketRow' + nullable: true + type: array + total: + format: int64 + type: integer + required: + - tickets + - total + type: object + EndpointsGetUIPreferencesOutput: + properties: + preferences: + additionalProperties: {} + nullable: true + type: object + updatedAt: + type: string + required: + - preferences + type: object + EndpointsGetUISavedViewsOutput: + properties: + savedViews: + items: + $ref: '#/components/schemas/ModelsUISavedView' + nullable: true + type: array + required: + - savedViews + type: object + EndpointsGetUserDataExportOutput: + properties: + export: + $ref: '#/components/schemas/EndpointsUserDataExport' + type: object + EndpointsGetUserMappingOutput: + properties: + user: + $ref: '#/components/schemas/ModelsUserMapping' + required: + - user + type: object + EndpointsGetUserMappingsOutput: + properties: + users: + items: + $ref: '#/components/schemas/ModelsUserMapping' + nullable: true + type: array + required: + - users + type: object + EndpointsGetUserOutput: + properties: + user: + $ref: '#/components/schemas/ModelsUser' + version: + type: string + type: object + EndpointsGitHubPackagesDiscoveredPackage: + properties: + name: + description: The npm-scoped package name, e.g. @acme/foo + type: string + owner: + description: The GitHub login (user or organization) that owns it + type: string + required: + - name + - owner + type: object + EndpointsGitHubTenantRouteOperatorInput: + properties: + deploymentId: + type: string + dryRun: + nullable: true + type: boolean + expectedBaseDomain: + type: string + expectedRegion: + type: string + expectedStackOwnerIds: + items: + format: int64 + type: integer + type: array + githubOwnerId: + format: int64 + type: integer + inspect: + type: boolean + installationId: + format: int64 + type: integer + operationId: + type: string + prepareBeforeInstallation: + type: boolean + reason: + type: string + type: object + EndpointsIPAllowlistEntryInput: + properties: + cidr: + type: string + description: + maxLength: 200 + type: string + required: + - cidr + type: object + EndpointsIPAllowlistEntryView: + properties: + cidr: + type: string + createdAt: + format: date-time + type: string + createdBy: + type: string + description: + type: string + id: + type: string + required: + - id + - cidr + - description + - createdBy + - createdAt + type: object + EndpointsIdentityEntraConnectPostOutput: + properties: + redirectUrl: + description: Microsoft admin-consent URL the UI should navigate to + type: string + required: + - redirectUrl + type: object + EndpointsIdentityEntraGetOutput: + properties: + configured: + description: True if this deployment has a Microsoft Entra application configured + type: boolean + connected: + description: True if the tenant has an Entra directory binding + type: boolean + directoryId: + description: The bound Entra directory (tenant) GUID + type: string + status: + description: pending, verified or disabled + type: string + verifiedAt: + description: When the binding was last verified + format: date-time + nullable: true + type: string + verifiedDomains: + description: Verified domains read from Microsoft Graph at connect time + items: + type: string + type: array + required: + - configured + - connected + type: object + EndpointsIdentityEntraHandoff: + properties: + createdAt: + format: date-time + type: string + createdBy: + description: Workspace administrator who created the link + type: string + directoryId: + description: Microsoft Entra directory the link is pinned to + type: string + expiresAt: + format: date-time + type: string + id: + description: Consent link identifier, for revoking it + type: string + status: + description: waiting until the recipient opens the link, in_progress while they are part-way through Microsoft + enum: + - waiting + - in_progress + type: string + required: + - id + - status + - directoryId + - createdBy + - createdAt + - expiresAt + type: object + EndpointsIdentityEntraHandoffListOutput: + properties: + handoffs: + items: + $ref: '#/components/schemas/EndpointsIdentityEntraHandoff' + type: array + lastOutcome: + $ref: '#/components/schemas/EndpointsIdentityEntraHandoffOutcome' + required: + - handoffs + type: object + EndpointsIdentityEntraHandoffOutcome: + properties: + at: + description: When the outcome was recorded + format: date-time + type: string + code: + description: Microsoft AADSTS error code, when Microsoft returned one + type: string + result: + description: 'How the link ended: connected, a failed Microsoft step, expired unused or abandoned, or revoked' + enum: + - connected + - not_directory_admin + - consent_declined + - oauth_error + - directory_mismatch + - directory_in_use + - directory_conflict + - policy_in_progress + - workspace_not_bootstrapped + - creator_revoked + - expired + - revoked + - error + type: string + required: + - result + - at + type: object + EndpointsIdentityEntraHandoffPostInput: + properties: + directoryId: + description: Approved customer's Microsoft Entra directory GUID + type: string + required: + - directoryId + type: object + EndpointsIdentityEntraHandoffPostOutput: + properties: + createdAt: + description: When this link was created, used to distinguish its outcome from an earlier link + format: date-time + type: string + expiresAt: + description: When the link stops working, 24 hours after creation + format: date-time + type: string + handoffUrl: + description: >- + Single-use consent link, shown only in this response; it replaces any earlier link for the workspace and + does not grant workspace membership + type: string + required: + - handoffUrl + - expiresAt + type: object + EndpointsIdentityEntraLinkPostOutput: + properties: + redirectUrl: + description: Microsoft authorization-code sign-in URL the UI should navigate to + type: string + required: + - redirectUrl + type: object + EndpointsIdentityEntraSignInPostOutput: + properties: + upgraded: + description: >- + True if this call upgraded the caller's SCIM or migrated Microsoft identity to a proven sign-in; false if it + was already proven or is not bound + type: boolean + required: + - upgraded + type: object + EndpointsIncorrectPermission: + properties: + actual: + type: string + expected: + type: string + required: + - expected + - actual + type: object + EndpointsInferenceRegionOutput: + properties: + inferenceRegion: + $ref: '#/components/schemas/ModelsInferenceRegion' + required: + - inferenceRegion + type: object + EndpointsInitializeExternalWritesInput: + properties: + dryRun: + type: boolean + reason: + type: string + tenantId: + type: string + required: + - tenantId + - reason + type: object + EndpointsInitializeExternalWritesOutput: + properties: + dryRun: + type: boolean + externalWrites: + $ref: '#/components/schemas/EndpointsExternalWritesView' + initialized: + type: boolean + tenantId: + type: string + required: + - tenantId + - dryRun + - initialized + - externalWrites + type: object + EndpointsIntegrationConnectionInstanceView: + properties: + authorityRevision: + description: Version of the credential and configuration used for a reviewed change + format: int64 + type: integer + capability: + type: string + category: + type: string + config: + additionalProperties: {} + type: object + externalId: + type: string + hasCredentials: + type: boolean + id: + type: string + lastError: + type: string + lastVerifiedAt: + format: date-time + nullable: true + type: string + providerId: + type: string + status: + type: string + type: object + EndpointsIntegrationConnectionView: + properties: + authorityRevision: + description: Version of the credential and configuration used for a reviewed change + format: int64 + type: integer + capability: + type: string + category: + type: string + config: + additionalProperties: {} + type: object + externalId: + type: string + hasCredentials: + type: boolean + lastError: + type: string + lastVerifiedAt: + format: date-time + nullable: true + type: string + providerId: + type: string + status: + type: string + type: object + EndpointsListMergedScansOutput: + properties: + scans: + items: + $ref: '#/components/schemas/EndpointsMergedScanSummary' + nullable: true + type: array + totalCount: + type: integer + type: object + EndpointsListTeamFindingsOutput: + properties: + teamFindings: + items: + $ref: '#/components/schemas/ModelsTeamFindings' + nullable: true + type: array + version: + type: string + type: object + EndpointsManagerIntegrationInstalled: + properties: + messaging: + type: boolean + prCreation: + type: boolean + tickets: + type: boolean + type: object + EndpointsManagerSettings: + properties: + automatedThreatInvestigations: + type: boolean + blockedActionTypes: + items: + type: string + nullable: true + type: array + createdAt: + type: string + dailyUpdatesEnabled: + type: boolean + groundRules: + type: string + updatedAt: + type: string + weeklyUpdatesEnabled: + type: boolean + type: object + EndpointsMappedCanonicalIDs: + properties: + jira: + type: string + slack: + type: string + teams: + type: string + required: + - slack + - jira + - teams + type: object + EndpointsMergedScanSummary: + properties: + branch: + type: string + commitHash: + type: string + completedAt: + nullable: true + type: string + completedCount: + type: integer + coverageStatus: + type: string + failedCount: + type: integer + fixedFindingsCount: + type: integer + hasRunningScanForCommit: + type: boolean + isDefaultBranch: + type: boolean + latestScanStartedAtForCommit: + nullable: true + type: string + liveFindingsCount: + type: integer + newFindingsCount: + type: integer + overallStatus: + type: string + owner: + type: string + platform: + type: string + reintroducedFindingsCount: + type: integer + repository: + type: string + repositoryId: + type: string + runningCount: + type: integer + scannerCount: + type: integer + scanners: + items: + $ref: '#/components/schemas/EndpointsScannerRun' + nullable: true + type: array + severityCritical: + type: integer + severityHigh: + type: integer + severityLow: + type: integer + severityMedium: + type: integer + skippedCount: + type: integer + startedAt: + nullable: true + type: string + triggerType: + type: string + required: + - hasRunningScanForCommit + type: object + EndpointsMetricData: + properties: + lastMonth: + format: float + type: number + thisMonth: + format: float + type: number + required: + - thisMonth + - lastMonth + type: object + EndpointsMetricWithValue: + properties: + important: + type: integer + lastMonth: + type: integer + negligible: + type: integer + thisMonth: + type: integer + urgent: + type: integer + value: + type: string + required: + - value + - thisMonth + - lastMonth + - urgent + - important + - negligible + type: object + EndpointsNativeTenantRouteOperatorInput: + properties: + administrators: + items: + $ref: '#/components/schemas/ServiceNativeBootstrapAdministrator' + nullable: true + type: array + baseDomain: + type: string + deploymentId: + type: string + directoryId: + type: string + dryRun: + nullable: true + type: boolean + expectedState: + type: string + inspect: + type: boolean + operationId: + type: string + operator: + type: string + reason: + type: string + region: + type: string + stage: + type: string + tenantId: + type: string + type: object + EndpointsNetworkIPAllowlistOutput: + properties: + callerAllowed: + description: Whether the submitted list admits the caller's own address; set on a replace or dry run + type: boolean + callerIp: + type: string + dryRun: + description: True only on a preview, which stores nothing + type: boolean + entries: + items: + $ref: '#/components/schemas/EndpointsIPAllowlistEntryView' + nullable: true + type: array + version: + type: string + warnings: + description: What the submitted list does that should be confirmed before it takes effect + items: + type: string + type: array + required: + - entries + - callerIp + type: object + EndpointsOperatorRepositoryScanScopeView: + properties: + codeEnrolled: + type: boolean + codePaths: + $ref: '#/components/schemas/ModelsPathScope' + effective: + $ref: '#/components/schemas/ModelsScanScope' + excluded: + description: The customer excluded the repository; applies only while scoping is off + type: boolean + explanation: + $ref: '#/components/schemas/ModelsScanScopeExplanation' + owner: + type: string + repository: + type: string + repositoryId: + type: string + scopeUpdatedAt: + description: >- + When the scope was last changed; null when never. An opaque stamp with microsecond precision: send it back + unchanged as expectedScopeUpdatedAt, never through a millisecond date type + format: date-time + nullable: true + type: string + secretsEnrolled: + description: Stored secrets enrollment; read only while secretsMode is independent + type: boolean + secretsExcludes: + items: + type: string + nullable: true + type: array + staffAllowed: + description: Nullify allowed this repository; read only while staffRepositoryAllowlist is on + type: boolean + staffCodePaths: + $ref: '#/components/schemas/ModelsPathScope' + staffUpdatedAt: + description: >- + When staff last changed this repository's limits; null when never. An opaque stamp with microsecond + precision: send it back unchanged as expectedStaffUpdatedAt, never through a millisecond date type + format: date-time + nullable: true + type: string + staffUpdatedBy: + description: Staff actor that last changed this repository's limits; empty when never + type: string + required: + - repositoryId + - owner + - repository + - codeEnrolled + - secretsEnrolled + - excluded + - codePaths + - secretsExcludes + - staffAllowed + - staffCodePaths + - staffUpdatedBy + - effective + - explanation + type: object + EndpointsOperatorRepositoryScanScopesOutput: + properties: + repositories: + items: + $ref: '#/components/schemas/EndpointsOperatorRepositoryScanScopeView' + nullable: true + type: array + scopingEnabled: + type: boolean + secretsMode: + enum: + - follow_code + - independent + type: string + staffRepositoryAllowlist: + type: boolean + tenantId: + type: string + required: + - tenantId + - scopingEnabled + - secretsMode + - staffRepositoryAllowlist + - repositories + type: object + EndpointsOperatorRepositoryStaffScopesOutput: + properties: + backfill: + description: Default-branch scans dispatched because the change widened a scope + items: + $ref: '#/components/schemas/EndpointsScanScopeBackfill' + nullable: true + type: array + coverageLost: + description: Repositories and families the change stopped scanning wholly or in part + items: + $ref: '#/components/schemas/EndpointsScanScopeCoverageLoss' + nullable: true + type: array + enrollmentReset: + description: >- + Newly allowed repositories whose stored customer enrollment was reset, because counting it would put a + family over its cap + items: + $ref: '#/components/schemas/EndpointsScanScopeEnrollmentReset' + nullable: true + type: array + repositories: + description: Each named repository after the change + items: + $ref: '#/components/schemas/EndpointsOperatorRepositoryScanScopeView' + nullable: true + type: array + tenantId: + type: string + required: + - tenantId + - repositories + - coverageLost + - enrollmentReset + - backfill + type: object + EndpointsOperatorRepositoryStaffScopesPutInput: + properties: + reason: + maxLength: 500 + minLength: 1 + type: string + repositories: + items: + $ref: '#/components/schemas/EndpointsRepositoryStaffScopeChange' + maxItems: 100 + minItems: 1 + nullable: true + type: array + tenantId: + description: Canonical tenant id; must equal the selected tenant + type: string + required: + - tenantId + - repositories + - reason + type: object + EndpointsOperatorScanEntitlementOutput: + properties: + backfill: + description: Default-branch scans a write dispatched because it brought a family into scope + items: + $ref: '#/components/schemas/EndpointsScanScopeBackfill' + type: array + coverageLost: + description: >- + Set by a write: repositories the tenant's repository allowlist admits and the families the write stopped + scanning wholly or in part, such as by turning the staff repository allowlist on + items: + $ref: '#/components/schemas/EndpointsScanScopeCoverageLoss' + type: array + enrollmentReset: + description: >- + Set by a write: repositories whose stored customer enrollment turning the staff repository allowlist off + reset, because counting it again would put a family over its cap + items: + $ref: '#/components/schemas/EndpointsScanScopeEnrollmentReset' + type: array + entitlement: + $ref: '#/components/schemas/EndpointsOperatorScanEntitlementView' + tenantId: + type: string + version: + type: string + required: + - tenantId + - entitlement + type: object + EndpointsOperatorScanEntitlementPutInput: + properties: + codeRepositoryCap: + description: Repositories that may be enrolled for code scanning; null is unlimited + minimum: 0 + nullable: true + type: integer + expectedUpdatedAt: + description: >- + entitlementUpdatedAt exactly as read, microseconds included; null when it was never set. Any other value, a + millisecond-truncated one included, is refused (409) + format: date-time + nullable: true + type: string + reason: + maxLength: 500 + minLength: 1 + type: string + scopingEnabled: + description: >- + false turns enrollment scoping off and is accepted only with both caps null; omitted or true leaves scoping + on + nullable: true + type: boolean + secretsMode: + description: >- + Switches the secrets mode under the new caps; independent with a null secrets cap enrolls every repository + for secrets, otherwise secrets enrollment is seeded from code enrollment. Omit to keep the mode. + enum: + - follow_code + - independent + type: string + secretsRepositoryCap: + description: Repositories that may be enrolled for secrets scanning; null is unlimited + minimum: 0 + nullable: true + type: integer + staffRepositoryAllowlist: + description: true limits scanning to the repositories staff allowed; false lifts the limit. Omit to keep it. + nullable: true + type: boolean + tenantId: + description: Canonical tenant id; must equal the selected tenant + type: string + required: + - tenantId + - reason + type: object + EndpointsOperatorScanEntitlementView: + properties: + codeEnrolledCount: + description: Live repositories enrolled for code scanning + type: integer + codeExcludedCount: + description: >- + Repositories in codeEnrolledCount that are turned off while every repository is scanned; turning scoping on + un-enrolls them. Zero while scoping is on + type: integer + codeRepositoryCap: + description: Repositories that may be enrolled for code scanning; null is unlimited + nullable: true + type: integer + entitlementUpdatedAt: + description: >- + When staff last changed the caps; null when never. An opaque stamp with microsecond precision: send it back + unchanged as expectedUpdatedAt, never through a millisecond date type + format: date-time + nullable: true + type: string + entitlementUpdatedBy: + description: Staff actor that last changed the caps; empty when never + type: string + legacyCapInert: + description: >- + A cap is stored while enrollment scoping is off, as a customer-set legacy cap is: it is not enforced and + every repository is scanned until scoping is turned on + type: boolean + maxChangesPerRequest: + description: Most repositories one scope change may name + type: integer + maxPathsPerList: + description: Most directories one include or exclude list may hold + type: integer + scopingEnabled: + description: Whether per-repository enrollment is enforced + type: boolean + secretsEnrolledCount: + description: Live repositories in secrets scope; the code count while secretsMode is follow_code + type: integer + secretsExcludedCount: + description: >- + Repositories in secretsEnrolledCount that are turned off while every repository is scanned; turning scoping + on un-enrolls them. Zero while scoping is on + type: integer + secretsMode: + enum: + - follow_code + - independent + type: string + secretsRepositoryCap: + description: Repositories that may be enrolled for secrets scanning; null is unlimited + nullable: true + type: integer + staffRepositoryAllowlist: + description: >- + Nullify limits scanning to the repositories it allowed (staffAllowed); no other repository may be enrolled + or scanned + type: boolean + warningThresholdPercent: + description: Usage percentage of a cap at which the dashboard warns + type: integer + required: + - codeEnrolledCount + - secretsEnrolledCount + - codeExcludedCount + - secretsExcludedCount + - scopingEnabled + - secretsMode + - staffRepositoryAllowlist + - warningThresholdPercent + - maxPathsPerList + - maxChangesPerRequest + - entitlementUpdatedBy + - legacyCapInert + type: object + EndpointsOperatorTenantCapabilitiesOutput: + properties: + capabilities: + items: + $ref: '#/components/schemas/EndpointsOperatorTenantCapabilityView' + nullable: true + type: array + tenantId: + type: string + required: + - tenantId + - capabilities + type: object + EndpointsOperatorTenantCapabilityPutInput: + properties: + capability: + type: string + expectedStaffUpdatedAt: + description: >- + Opaque staffUpdatedAt version exactly as read, microseconds included; null when no version exists. Any other + value is refused (409); re-read after repository normalization + format: date-time + nullable: true + type: string + lockReason: + description: Customer-facing reason; required when forcing + maxLength: 280 + type: string + reason: + description: Audit reason + maxLength: 500 + minLength: 1 + type: string + repository: + description: Repository name, for a repository-scoped capability only; empty is tenant-wide + type: string + seedCustomerEnabled: + description: >- + Seeds the tenant's own choice of a customer-visible capability as the system seed actor, only when the + tenant has none and staff have not forced it; staffState must be unset and the force is left alone + nullable: true + type: boolean + seedRepositoryDisabled: + description: >- + Seed a repository force-off only while neither its tenant nor repository is forced; repository and + forced_off are required + type: boolean + seedStaffIfAbsent: + description: >- + Initialize a staff-only tenant capability only if it is not yet initialized: a row with no staff version + takes staffState, an existing row whose force or reset already resolves to staffState keeps it and is marked + initialized, and one that resolves otherwise is refused (409) + type: boolean + staffState: + description: unset lifts the force, so the customer's choice or the Nullify default decides + enum: + - unset + - forced_on + - forced_off + type: string + tenantId: + description: Canonical tenant id; must equal the selected tenant + type: string + required: + - tenantId + - capability + - staffState + - reason + type: object + EndpointsOperatorTenantCapabilityPutOutput: + properties: + capability: + $ref: '#/components/schemas/EndpointsOperatorTenantCapabilityView' + tenantId: + type: string + required: + - tenantId + - capability + type: object + EndpointsOperatorTenantCapabilityView: + properties: + capability: + type: string + customerEnabled: + description: The tenant's choice; null when none + nullable: true + type: boolean + customerUpdatedAt: + format: date-time + nullable: true + type: string + customerUpdatedBy: + type: string + customerVisible: + description: The customer sees the capability and may choose a value unless staff forced one + type: boolean + enabled: + description: The value in force; null while the Nullify default decides + nullable: true + type: boolean + fallback: + description: The label of the value in force while nothing stored decides + type: string + initialized: + description: >- + Whether the exact stored row is initialized: decided by the initializer or a staff or customer write since + initialization existed. False for no row, a row stored earlier, or a lock row; null from older admin builds + that cannot safely initialize + nullable: true + type: boolean + lockReason: + description: Customer-facing reason for the staff force; empty when unset + type: string + repository: + description: Repository name of a per-repository value; empty is tenant-wide + type: string + scope: + enum: + - tenant + - repository + type: string + source: + enum: + - staff + - customer + - fallback + type: string + staffState: + enum: + - unset + - forced_on + - forced_off + type: string + staffUpdatedAt: + description: >- + Opaque staff version with microsecond precision; send it back unchanged as expectedStaffUpdatedAt. + Repository normalization may advance it without a staff action; use the audit log for action times. Null + when no version exists + format: date-time + nullable: true + type: string + staffUpdatedBy: + type: string + title: + type: string + required: + - capability + - title + - scope + - customerVisible + - fallback + - staffState + - lockReason + - staffUpdatedBy + - customerUpdatedBy + - source + type: object + EndpointsOverviewType: + properties: + api: + $ref: '#/components/schemas/EndpointsMetricWithValue' + code: + $ref: '#/components/schemas/EndpointsMetricWithValue' + container: + $ref: '#/components/schemas/EndpointsMetricWithValue' + dependency: + $ref: '#/components/schemas/EndpointsMetricWithValue' + secret: + $ref: '#/components/schemas/EndpointsMetricWithValue' + supplychain: + $ref: '#/components/schemas/EndpointsMetricWithValue' + required: + - code + - secret + - dependency + - container + - supplychain + - api + type: object + EndpointsPRGateFindingsPolicy: + enum: + - none + - confirmed + type: string + EndpointsPatchSLAInput: + properties: + allowExtensions: + nullable: true + type: boolean + maxDaysToFix: + nullable: true + type: integer + priority: + $ref: '#/components/schemas/ModelsPriorityLabel' + nullable: true + severity: + $ref: '#/components/schemas/ModelsSeverity' + nullable: true + type: object + EndpointsPatchSLAOutput: + properties: + sla: + $ref: '#/components/schemas/ModelsSLA' + required: + - sla + type: object + EndpointsPatchTeamInput: + properties: + addMemberIds: + description: Members to add atomically; cannot be combined with metadata or memberIds + items: + type: string + type: array + clearLead: + description: Clear the team lead; cannot be combined with a nonempty leadId or member deltas + type: boolean + codeOwnerships: + items: + $ref: '#/components/schemas/ModelsTeamCodeOwnership' + type: array + github: + $ref: '#/components/schemas/ModelsTeamProviderGitHub' + gitlab: + $ref: '#/components/schemas/ModelsTeamProviderGitLab' + groundRules: + items: + $ref: '#/components/schemas/ModelsGroundRule' + nullable: true + type: array + jira: + $ref: '#/components/schemas/ModelsTeamProviderJira' + leadId: + nullable: true + type: string + memberIds: + items: + type: string + type: array + messageChannelProvider: + $ref: '#/components/schemas/ModelsMessageChannelProvider' + name: + nullable: true + type: string + privacy: + $ref: '#/components/schemas/ModelsTeamPrivacy' + nullable: true + removeMemberIds: + description: Members to remove atomically; the current lead cannot be removed + items: + type: string + type: array + slug: + nullable: true + type: string + ticketBoardId: + description: >- + Destination ticket board for this team's findings (free-text provider-native project/team/repo id). Empty + value preserves the existing board. + nullable: true + type: string + ticketProjectProvider: + $ref: '#/components/schemas/ModelsTicketProjectProvider' + type: object + EndpointsPatchTeamOutput: + properties: + team: + $ref: '#/components/schemas/ModelsTeam' + required: + - team + type: object + EndpointsPatchTicketSavedFilterInput: + properties: + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + name: + type: string + type: object + EndpointsPatchTicketSavedFilterOutput: + properties: + filter: + $ref: '#/components/schemas/EndpointsSavedFilterEntry' + required: + - filter + type: object + EndpointsPatchUISavedViewInput: + properties: + savedView: + $ref: '#/components/schemas/ModelsUISavedViewAPIInput' + required: + - savedView + type: object + EndpointsPatchUISavedViewOutput: + properties: + savedView: + $ref: '#/components/schemas/ModelsUISavedView' + required: + - savedView + type: object + EndpointsPlatformUnavailable: + properties: + platform: + type: string + reason: + type: string + required: + - platform + - reason + type: object + EndpointsPostAtlassianSettingsInput: + properties: + installationId: + type: string + settings: + $ref: '#/components/schemas/ModelsForgeProductSettings' + type: object + EndpointsPostAtlassianSettingsOutput: + properties: + revision: + format: int64 + type: integer + type: object + EndpointsPostBuildkiteOrganizationsInput: + properties: + apiToken: + type: string + required: + - apiToken + type: object + EndpointsPostBuildkiteOrganizationsOutput: + properties: + organizations: + items: + $ref: '#/components/schemas/EndpointsBuildkiteOrganization' + nullable: true + type: array + version: + type: string + required: + - version + - organizations + type: object + EndpointsPostBuildkiteTokenInput: + properties: + apiToken: + type: string + orgSlug: + type: string + required: + - apiToken + type: object + EndpointsPostBuildkiteTokenOutput: + properties: + message: + type: string + orgSlug: + type: string + version: + type: string + required: + - version + - message + - orgSlug + type: object + EndpointsPostBulkAddCommentInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkAddCommentParams' + required: + - filter + type: object + EndpointsPostBulkAddCommentOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkCloseInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkCloseParams' + required: + - filter + type: object + EndpointsPostBulkCloseOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkGetUserMappingsInput: + properties: + gitCanonicalUserIds: + items: + type: string + type: array + githubCanonicalUserIds: + items: + type: string + type: array + type: object + EndpointsPostBulkGetUserMappingsOutput: + properties: + users: + additionalProperties: + $ref: '#/components/schemas/EndpointsMappedCanonicalIDs' + type: object + version: + type: string + type: object + EndpointsPostBulkMoveInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkMoveParams' + required: + - filter + type: object + EndpointsPostBulkMoveOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkOperationCancelOutput: + properties: + operation: + $ref: '#/components/schemas/EndpointsBulkOperationStatusEntry' + required: + - operation + type: object + EndpointsPostBulkReassignAssigneeInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkReassignAssigneeParams' + required: + - filter + type: object + EndpointsPostBulkReassignAssigneeOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkReassignTeamInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkReassignTeamParams' + required: + - filter + type: object + EndpointsPostBulkReassignTeamOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkRelabelInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkRelabelParams' + required: + - filter + type: object + EndpointsPostBulkRelabelOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkReopenInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkReopenParams' + required: + - filter + type: object + EndpointsPostBulkReopenOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkResyncInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkResyncParams' + required: + - filter + type: object + EndpointsPostBulkResyncOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostBulkSetPriorityInput: + properties: + confirmationToken: + type: string + dryRun: + type: boolean + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + params: + $ref: '#/components/schemas/EndpointsBulkSetPriorityParams' + required: + - filter + type: object + EndpointsPostBulkSetPriorityOutput: + properties: + dryRun: + $ref: '#/components/schemas/EndpointsBulkActionDryRunResult' + start: + $ref: '#/components/schemas/EndpointsBulkActionStartResult' + type: object + EndpointsPostCircleCITokenInput: + properties: + apiToken: + type: string + required: + - apiToken + type: object + EndpointsPostCircleCITokenOutput: + properties: + message: + type: string + version: + type: string + required: + - version + - message + type: object + EndpointsPostCompassTeamInput: + properties: + displayName: + description: Team display name + type: string + lead: + description: Atlassian accountId of the team lead + type: string + members: + description: List of Atlassian accountIds for team members + items: + type: string + nullable: true + type: array + providerId: + $ref: '#/components/schemas/ModelsProviderID' + repositories: + description: List of repo URLs (owner/repo) + items: + type: string + nullable: true + type: array + teamKey: + description: Compass/Atlassian team key (unique identifier) + type: string + required: + - displayName + - lead + - members + - repositories + type: object + EndpointsPostCompassTeamOutput: + properties: + team: + $ref: '#/components/schemas/ModelsTeam' + required: + - team + type: object + EndpointsPostFindingFeedbackInput: + properties: + commentText: + nullable: true + type: string + findingType: + deprecated: true + description: Compatibility hint; the server derives the finding type from the authorized finding + type: string + verdict: + $ref: '#/components/schemas/EndpointsFindingFeedbackVerdict' + required: + - verdict + type: object + EndpointsPostFindingFeedbackOutput: + properties: + feedback: + $ref: '#/components/schemas/EndpointsFindingFeedbackEntry' + required: + - feedback + type: object + EndpointsPostIdentityScimCredentialOutput: + properties: + id: + type: string + token: + type: string + version: + type: string + required: + - id + - token + type: object + EndpointsPostJenkinsTokenInput: + properties: + apiToken: + type: string + url: + type: string + username: + type: string + required: + - url + - username + - apiToken + type: object + EndpointsPostJenkinsTokenOutput: + properties: + message: + type: string + version: + type: string + required: + - version + - message + type: object + EndpointsPostPrivacyAcknowledgmentInput: + properties: + policyVersion: + description: The version of the privacy policy being acknowledged + type: string + required: + - policyVersion + type: object + EndpointsPostPrivacyAcknowledgmentOutput: + properties: + acknowledgedAt: + description: Timestamp when the acknowledgment was recorded (RFC3339) + type: string + success: + description: Whether the acknowledgment was recorded successfully + type: boolean + type: object + EndpointsPostPublicFindingFeedbackConfirmInput: + properties: + commentText: + nullable: true + type: string + feedbackId: + type: string + keyId: + type: string + required: + - keyId + - feedbackId + type: object + EndpointsPostPublicFindingFeedbackConfirmOutput: + properties: + confirmed: + type: boolean + required: + - confirmed + type: object + EndpointsPostPublicFindingFeedbackInput: + properties: + commentText: + nullable: true + type: string + dedupKey: + type: string + interactionUnconfirmed: + type: boolean + keyId: + type: string + verdict: + $ref: '#/components/schemas/EndpointsFindingFeedbackVerdict' + required: + - keyId + - verdict + - dedupKey + type: object + EndpointsPostPublicFindingFeedbackOutput: + properties: + feedbackId: + type: string + recorded: + type: boolean + required: + - recorded + - feedbackId + type: object + EndpointsPostRepositoryPropertyTeamKeyInput: + properties: + propertyKey: + type: string + providerId: + $ref: '#/components/schemas/ModelsProviderID' + required: + - providerId + - propertyKey + type: object + EndpointsPostRepositoryPropertyTeamKeyOutput: + properties: + key: + $ref: '#/components/schemas/EndpointsRepositoryPropertyTeamKey' + version: + type: string + required: + - key + type: object + EndpointsPostSLAInput: + properties: + allowExtensions: + type: boolean + maxDaysToFix: + type: integer + priority: + $ref: '#/components/schemas/ModelsPriorityLabel' + severity: + $ref: '#/components/schemas/ModelsSeverity' + required: + - severity + - priority + - maxDaysToFix + - allowExtensions + type: object + EndpointsPostSLAOutput: + properties: + sla: + $ref: '#/components/schemas/ModelsSLA' + required: + - sla + type: object + EndpointsPostServiceAccountInput: + properties: + name: + type: string + platform: + $ref: '#/components/schemas/ModelsProviderID' + role: + description: 'The service account role: builtin:admin | builtin:editor | builtin:viewer' + type: string + required: + - platform + - name + type: object + EndpointsPostServiceAccountOutput: + properties: + serviceAccount: + $ref: '#/components/schemas/EndpointsServiceAccount' + version: + type: string + required: + - serviceAccount + type: object + EndpointsPostSlackAPIKeyInput: + properties: + apiKey: + type: string + required: + - apiKey + type: object + EndpointsPostSlackAPIKeyOutput: + properties: + message: + type: string + version: + type: string + required: + - version + - message + type: object + EndpointsPostTeamCodeOwnershipInput: + properties: + actor: + description: Who an internal service call acted for; ignored on any other call + type: string + repositoryId: + description: The repository the team owns + type: string + required: + - repositoryId + type: object + EndpointsPostTeamCodeOwnershipOutput: + properties: + repositoryId: + type: string + teamId: + type: string + version: + type: string + required: + - version + - teamId + - repositoryId + type: object + EndpointsPostTeamFindingsInput: + properties: + actor: + description: Who an internal service call acted for; ignored on any other call + type: string + mappings: + description: List of finding-to-team mappings (max 1000) + items: + $ref: '#/components/schemas/EndpointsPostTeamFindingsMapping' + nullable: true + type: array + required: + - mappings + type: object + EndpointsPostTeamFindingsMapping: + properties: + findingId: + description: The finding ID to assign + type: string + findingType: + $ref: '#/components/schemas/ModelsFindingType' + teamId: + description: The team ID to assign the finding to + type: string + required: + - findingId + - teamId + - findingType + type: object + EndpointsPostTeamFindingsOutput: + properties: + upserted: + description: Number of mappings upserted + type: integer + version: + type: string + required: + - version + type: object + EndpointsPostTeamFindingsSyncInput: + properties: + async: + type: boolean + findingIds: + items: + type: string + type: array + findingTypes: + items: + type: string + type: array + repositoryIds: + items: + type: string + type: array + repositoryNames: + items: + type: string + type: array + type: object + EndpointsPostTeamFindingsSyncOutput: + properties: + async: + type: boolean + matched: + type: integer + message: + type: string + unmatched: + type: integer + version: + type: string + required: + - version + type: object + EndpointsPostTeamInput: + properties: + codeOwnerships: + items: + $ref: '#/components/schemas/ModelsTeamCodeOwnership' + type: array + github: + $ref: '#/components/schemas/ModelsTeamProviderGitHub' + gitlab: + $ref: '#/components/schemas/ModelsTeamProviderGitLab' + groundRules: + items: + $ref: '#/components/schemas/ModelsGroundRule' + type: array + jira: + $ref: '#/components/schemas/ModelsTeamProviderJira' + leadId: + type: string + memberIds: + items: + type: string + type: array + messageChannelProvider: + $ref: '#/components/schemas/ModelsMessageChannelProvider' + name: + type: string + privacy: + $ref: '#/components/schemas/ModelsTeamPrivacy' + slug: + type: string + ticketProjectProvider: + $ref: '#/components/schemas/ModelsTicketProjectProvider' + required: + - name + - slug + - privacy + - messageChannelProvider + - ticketProjectProvider + type: object + EndpointsPostTeamMergeInput: + properties: + sources: + items: + $ref: '#/components/schemas/EndpointsTeamMergeSource' + nullable: true + type: array + targetTeamId: + type: string + required: + - sources + type: object + EndpointsPostTeamMergeOutput: + properties: + team: + $ref: '#/components/schemas/ModelsTeam' + required: + - team + type: object + EndpointsPostTeamOutput: + properties: + team: + $ref: '#/components/schemas/ModelsTeam' + required: + - team + type: object + EndpointsPostTeamSLABreakdownInput: + properties: + findingIDs: + items: + type: string + nullable: true + type: array + required: + - findingIDs + type: object + EndpointsPostTeamSLABreakdownOutput: + properties: + teams: + items: + $ref: '#/components/schemas/EndpointsTeamSLABreakdown' + nullable: true + type: array + required: + - teams + type: object + EndpointsPostTeamSyncRunInput: + properties: + source: + type: string + type: object + EndpointsPostTeamSyncRunOutput: + properties: + runs: + items: + $ref: '#/components/schemas/EndpointsTeamSyncRun' + nullable: true + type: array + version: + type: string + required: + - runs + type: object + EndpointsPostTicketSavedFilterInput: + properties: + filter: + $ref: '#/components/schemas/EndpointsTicketWorkbenchFilter' + name: + type: string + required: + - name + - filter + type: object + EndpointsPostTicketSavedFilterOutput: + properties: + filter: + $ref: '#/components/schemas/EndpointsSavedFilterEntry' + required: + - filter + type: object + EndpointsPostTicketSettingsInput: + properties: + migrationAction: + $ref: '#/components/schemas/DatabaseTicketMigrationAction' + proposal: + $ref: '#/components/schemas/EndpointsTicketSettingsProposal' + userCanonicalId: + description: Canonical ID of the user persisting the settings; recorded in ticket_settings_history.applied_by + type: string + required: + - proposal + type: object + EndpointsPostTicketSettingsOutput: + properties: + historyId: + type: string + migrationAction: + $ref: '#/components/schemas/DatabaseTicketMigrationAction' + settings: + $ref: '#/components/schemas/EndpointsSavedTicketSettings' + required: + - settings + - historyId + - migrationAction + type: object + EndpointsPostTicketSettingsPreviewInput: + properties: + proposal: + $ref: '#/components/schemas/EndpointsTicketSettingsProposal' + userCanonicalId: + description: Canonical ID of the user (informational; preview is read-only) + type: string + required: + - proposal + type: object + EndpointsPostTicketSettingsPreviewOutput: + properties: + preview: + $ref: '#/components/schemas/EndpointsTicketSettingsImpactPreview' + required: + - preview + type: object + EndpointsPostUISavedViewInput: + properties: + savedView: + $ref: '#/components/schemas/ModelsUISavedViewAPIInput' + required: + - savedView + type: object + EndpointsPostUISavedViewOutput: + properties: + savedView: + $ref: '#/components/schemas/ModelsUISavedView' + required: + - savedView + type: object + EndpointsPostUserInput: + properties: + user: + $ref: '#/components/schemas/EndpointsUserInput' + required: + - user + type: object + EndpointsPostUserMappingInput: + properties: + useSuggestions: + type: boolean + userMappings: + items: + $ref: '#/components/schemas/EndpointsUserMappingInput' + nullable: true + type: array + required: + - userMappings + - useSuggestions + type: object + EndpointsPostUserMappingOutput: + properties: + skippedMappings: + description: Requested mappings that could not be stored, with the reason for each + items: + $ref: '#/components/schemas/EndpointsSkippedUserMapping' + type: array + unavailable: + description: Platforms that could not be queried while computing suggestions, with the reason for each + items: + $ref: '#/components/schemas/EndpointsPlatformUnavailable' + type: array + userMappings: + items: + $ref: '#/components/schemas/ModelsUserMapping' + nullable: true + type: array + required: + - userMappings + type: object + EndpointsPostUserOutput: + properties: + user: + $ref: '#/components/schemas/ModelsUser' + version: + type: string + required: + - user + type: object + EndpointsPreviewNetworkIPAllowlistInput: + properties: + entries: + items: + $ref: '#/components/schemas/EndpointsIPAllowlistEntryInput' + maxItems: 50 + nullable: true + type: array + required: + - entries + type: object + EndpointsPrivacyAcknowledgmentExport: + properties: + acknowledgedAt: + type: string + policyVersion: + type: string + tenantId: + type: string + type: object + EndpointsPublicWorkspaceBootstrapInput: + properties: + action: + enum: + - begin + - status + - recipient + - resend + - microsoft + - organizations + - confirm + - activate + type: string + challenge: + maxLength: 256 + type: string + csrfToken: + maxLength: 64 + type: string + invitationToken: + maxLength: 64 + type: string + organizationName: + maxLength: 200 + type: string + required: + - action + type: object + EndpointsPublicWorkspaceBootstrapOutput: + properties: + codeAttemptsRemaining: + type: integer + codeRejected: + type: boolean + codeState: + enum: + - active + - expired + - locked + type: string + codesRemaining: + type: integer + complete: + type: boolean + csrfToken: + type: string + organizations: + items: + type: string + type: array + redirectUrl: + type: string + status: + type: string + workspaceName: + type: string + type: object + EndpointsPutAdminNotificationConfigInput: + properties: + centralSecurityChannel: + $ref: '#/components/schemas/ModelsMessageChannelProvider' + notifications: + items: + $ref: '#/components/schemas/ModelsNotification' + nullable: true + type: array + required: + - notifications + type: object + EndpointsPutAdminNotificationConfigOutput: + properties: + version: + type: string + type: object + EndpointsPutBulkSLAInput: + properties: + slas: + items: + $ref: '#/components/schemas/ModelsSLA' + nullable: true + type: array + required: + - slas + type: object + EndpointsPutBulkSLAOutput: + properties: + slaIds: + items: + type: string + nullable: true + type: array + required: + - slaIds + type: object + EndpointsPutCSPMScanCadenceInput: + properties: + cspmScanCadence: + description: daily | weekly | fortnightly | monthly | on_change | manual; empty clears the cadence (daily) + type: string + type: object + EndpointsPutEditUserMappingInput: + properties: + azure: + $ref: '#/components/schemas/ModelsAzureUserProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketUserProvider' + clearSlack: + description: >- + Clear the mapping's Slack identity and remember the cleared id as rejected. Clearing an already-empty + identity changes nothing. Cannot be combined with a Slack id in the same request. Refused for internal + automation callers + type: boolean + clearTeams: + description: >- + Clear the mapping's Teams identity and remember the cleared id as rejected. Clearing an already-empty + identity changes nothing. Cannot be combined with a Teams id in the same request. Refused for internal + automation callers + type: boolean + github: + $ref: '#/components/schemas/ModelsGitHubUserProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabUserProvider' + jira: + $ref: '#/components/schemas/ModelsJiraUserProvider' + linear: + $ref: '#/components/schemas/ModelsLinearUserProvider' + slack: + $ref: '#/components/schemas/ModelsSlackUserProvider' + teams: + $ref: '#/components/schemas/ModelsTeamsUserProvider' + type: object + EndpointsPutEditUserMappingOutput: + properties: + userMapping: + $ref: '#/components/schemas/ModelsUserMapping' + type: object + EndpointsPutExternalWritesInput: + properties: + gitWrites: + nullable: true + type: boolean + messaging: + nullable: true + type: boolean + pullRequestReviews: + nullable: true + type: boolean + pullRequests: + nullable: true + type: boolean + tickets: + nullable: true + type: boolean + type: object + EndpointsPutInferenceRegionInput: + properties: + inferenceRegion: + $ref: '#/components/schemas/ModelsInferenceRegion' + required: + - inferenceRegion + type: object + EndpointsPutManagerSettingsInput: + properties: + automatedThreatInvestigations: + nullable: true + type: boolean + blockedActionTypes: + items: + type: string + nullable: true + type: array + dailyUpdatesEnabled: + nullable: true + type: boolean + expectedUpdatedAt: + nullable: true + type: string + groundRules: + nullable: true + type: string + weeklyUpdatesEnabled: + nullable: true + type: boolean + type: object + EndpointsPutManagerSettingsOutput: + properties: + settings: + $ref: '#/components/schemas/EndpointsManagerSettings' + required: + - settings + type: object + EndpointsPutNetworkIPAllowlistInput: + properties: + entries: + items: + $ref: '#/components/schemas/EndpointsIPAllowlistEntryInput' + maxItems: 50 + nullable: true + type: array + expectedCidrs: + description: Ranges the caller last read; the change is refused if the stored list differs + items: + type: string + maxItems: 50 + type: array + required: + - entries + type: object + EndpointsPutRepositoryScanScopesInput: + properties: + repositories: + items: + $ref: '#/components/schemas/EndpointsRepositoryScanScopeChange' + maxItems: 100 + minItems: 1 + nullable: true + type: array + required: + - repositories + type: object + EndpointsPutRepositoryScanScopesOutput: + properties: + backfill: + items: + $ref: '#/components/schemas/EndpointsScanScopeBackfill' + nullable: true + type: array + codeEnrolledCount: + description: Repositories newly enrolled for code + type: integer + codeUnenrolledCount: + type: integer + entitlement: + $ref: '#/components/schemas/EndpointsScanEntitlementView' + repositories: + description: Scope of each named repository after the change + items: + $ref: '#/components/schemas/EndpointsRepositoryScanScopeView' + nullable: true + type: array + secretsEnrolledCount: + description: Repositories newly enrolled for secrets + type: integer + required: + - repositories + - codeEnrolledCount + - codeUnenrolledCount + - secretsEnrolledCount + - entitlement + - backfill + type: object + EndpointsPutScanScopeInput: + properties: + scopingEnabled: + description: >- + true turns enrollment scoping on, so only enrolled repositories are scanned. false turns it off for both + code and secrets, so every repository is scanned; it is refused unless the code and secrets repository caps + are both unlimited. Directory rules still apply either way. Omit to keep the setting. + nullable: true + type: boolean + secretsMode: + description: >- + follow_code: secrets scope equals code scope; independent: repositories are enrolled for secrets separately. + Omit to keep the mode. + enum: + - follow_code + - independent + type: string + type: object + EndpointsPutScanScopeOutput: + properties: + backfill: + description: Default-branch scans dispatched because the change brought a family into scope + items: + $ref: '#/components/schemas/EndpointsScanScopeBackfill' + nullable: true + type: array + entitlement: + $ref: '#/components/schemas/EndpointsScanEntitlementView' + required: + - entitlement + - backfill + type: object + EndpointsPutTeamSourcePreferencesInput: + properties: + githubTeamsEnabled: + type: boolean + repositoryPropertyEnabled: + type: boolean + required: + - githubTeamsEnabled + - repositoryPropertyEnabled + type: object + EndpointsPutTeamSourcePreferencesOutput: + properties: + preferences: + $ref: '#/components/schemas/EndpointsTeamSourcePreferences' + syncQueued: + type: boolean + version: + type: string + required: + - preferences + - syncQueued + type: object + EndpointsPutTenantCapabilityInput: + properties: + enabled: + description: true or false is the tenant's choice; null clears it, so the Nullify default decides + nullable: true + type: boolean + expectedUpdatedAt: + description: >- + customerUpdatedAt exactly as read, microseconds included; null when it was never set. Any other value is + refused (409) + format: date-time + nullable: true + type: string + type: object + EndpointsPutTenantCapabilityOutput: + properties: + capability: + $ref: '#/components/schemas/EndpointsTenantCapabilityView' + required: + - capability + type: object + EndpointsPutUIPreferencesInput: + properties: + preferences: + additionalProperties: {} + nullable: true + type: object + required: + - preferences + type: object + EndpointsPutUIPreferencesOutput: + properties: + preferences: + additionalProperties: {} + nullable: true + type: object + updatedAt: + type: string + required: + - preferences + type: object + EndpointsQueryMetricsOverTimeInput: + properties: + query: + $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + required: + - query + type: object + EndpointsQueryMetricsOverTimeOutput: + properties: + introduced: + items: + $ref: '#/components/schemas/EndpointsCount' + nullable: true + type: array + resolved: + description: >- + Cumulative count of findings resolved for any reason, so false positives, allowlisted, archived, duplicate, + pending verification and no longer detected findings are included. Use verifiedFixed for fixes. + items: + $ref: '#/components/schemas/EndpointsCount' + nullable: true + type: array + verifiedFixed: + items: + $ref: '#/components/schemas/EndpointsCount' + nullable: true + type: array + version: + type: string + required: + - introduced + - resolved + - verifiedFixed + type: object + EndpointsQueryMetricsRawInput: + properties: + query: + $ref: '#/components/schemas/ModelsUnifiedFindingsMetricsQuery' + required: + - query + type: object + EndpointsQueryMetricsRawOutput: + properties: + metrics: + additionalProperties: + $ref: '#/components/schemas/ModelsUnifiedFindingsRawMetricsQueryResultItem' + nullable: true + type: object + version: + type: string + required: + - metrics + type: object + EndpointsQueryOverviewInput: + properties: + query: + $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + required: + - query + type: object + EndpointsQueryOverviewOutput: + properties: + appName: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + autofixMerged: + $ref: '#/components/schemas/EndpointsMetricData' + branch: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + canonical: + $ref: '#/components/schemas/ModelsOverviewCanonical' + cve: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + cwe: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + estimatedTriageWorkHours: + allOf: + - $ref: '#/components/schemas/EndpointsMetricData' + description: >- + Estimated manual triage workload in hours at six minutes per visible finding in the requested scope; not + realized savings. + falsePositives: + $ref: '#/components/schemas/EndpointsMetricData' + funnelData: + items: + $ref: '#/components/schemas/EndpointsFunnelData' + nullable: true + type: array + host: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + imageName: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + inSLAFindings: + $ref: '#/components/schemas/EndpointsMetricData' + investigateData: + $ref: '#/components/schemas/EndpointsMetricData' + language: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + meanTriageDurationMs: + $ref: '#/components/schemas/EndpointsMetricData' + openPastSLAFindings: + $ref: '#/components/schemas/EndpointsMetricData' + openWithSLAFindings: + $ref: '#/components/schemas/EndpointsMetricData' + overviewCWE: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + overviewLanguage: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + overviewRepos: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + overviewType: + $ref: '#/components/schemas/EndpointsOverviewType' + owners: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + package: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + repos: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + resolvedPastSLAFindings: + $ref: '#/components/schemas/EndpointsMetricData' + ruleId: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + secretType: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + teams: + items: + $ref: '#/components/schemas/EndpointsMetricWithValue' + nullable: true + type: array + triageableFindings: + $ref: '#/components/schemas/EndpointsMetricData' + triagedFindings: + $ref: '#/components/schemas/EndpointsMetricData' + version: + type: string + required: + - funnelData + - canonical + - investigateData + - autofixMerged + - estimatedTriageWorkHours + - falsePositives + - inSLAFindings + - resolvedPastSLAFindings + - openPastSLAFindings + - openWithSLAFindings + - triagedFindings + - triageableFindings + - meanTriageDurationMs + - overviewRepos + - overviewLanguage + - overviewCWE + - overviewType + - repos + - branch + - owners + - teams + - language + - cwe + - cve + - ruleId + - package + - imageName + - secretType + - appName + - host + type: object + EndpointsRepoRecommendation: + properties: + capabilityFit: + additionalProperties: + $ref: '#/components/schemas/EndpointsCapabilityFitPublic' + nullable: true + type: object + covers: + items: + type: string + nullable: true + type: array + importanceScore: + type: integer + isEnrolled: + type: boolean + isRecommended: + type: boolean + owner: + type: string + primaryCapability: + type: string + repository: + type: string + repositoryId: + type: string + requiresConfirmation: + type: boolean + required: + - repositoryId + - repository + - owner + - isRecommended + - covers + - primaryCapability + - requiresConfirmation + - importanceScore + - capabilityFit + - isEnrolled + type: object + EndpointsRepositoryDirectory: + properties: + name: + type: string + path: + type: string + required: + - name + - path + type: object + EndpointsRepositoryPropertyTeamKey: + properties: + createdAt: + format: date-time + type: string + id: + type: string + propertyKey: + type: string + providerId: + $ref: '#/components/schemas/ModelsProviderID' + tenantId: + type: string + updatedAt: + format: date-time + type: string + required: + - id + - tenantId + - providerId + - propertyKey + - createdAt + - updatedAt + type: object + EndpointsRepositoryScanScopeChange: + properties: + codeEnrolled: + nullable: true + type: boolean + codePaths: + $ref: '#/components/schemas/ModelsPathScope' + excluded: + description: >- + Scan the repository for no family. True is accepted only while scoping is off (412 otherwise); turning + scoping on un-enrolls every excluded repository + nullable: true + type: boolean + expectedScopeUpdatedAt: + description: >- + scopeUpdatedAt exactly as read, an opaque string echoed unchanged, or empty when it was null. It is compared + to the microsecond, so a repository changed since, or a millisecond-truncated stamp, is refused (409) and + nothing is applied. Omit to skip the check + nullable: true + type: string + repositoryId: + type: string + secretsEnrolled: + description: Accepted only while secretsMode is independent + nullable: true + type: boolean + secretsExcludes: + description: Replaces the secrets directory excludes + items: + type: string + nullable: true + type: array + required: + - repositoryId + type: object + EndpointsRepositoryScanScopeView: + properties: + codeEnrolled: + type: boolean + codePaths: + $ref: '#/components/schemas/ModelsPathScope' + excluded: + description: The customer excluded the repository; applies only while scoping is off + type: boolean + owner: + type: string + repository: + type: string + repositoryId: + type: string + scopeUpdatedAt: + description: >- + When the scope was last changed; null when never. An opaque stamp with microsecond precision: send it back + unchanged as expectedScopeUpdatedAt, never through a millisecond date type + format: date-time + nullable: true + type: string + secretsEnrolled: + description: Stored secrets enrollment; read only while secretsMode is independent + type: boolean + secretsExcludes: + items: + type: string + nullable: true + type: array + required: + - repositoryId + - owner + - repository + - codeEnrolled + - secretsEnrolled + - excluded + - codePaths + - secretsExcludes + type: object + EndpointsRepositoryStaffScopeChange: + properties: + allowed: + description: Puts the repository on (true) or off (false) the staff allowlist + nullable: true + type: boolean + codePaths: + $ref: '#/components/schemas/ModelsPathScope' + expectedStaffUpdatedAt: + description: >- + staffUpdatedAt exactly as read, an opaque string echoed unchanged, or empty when it was null. It is compared + to the microsecond, so a repository whose staff limits changed since, or a millisecond-truncated stamp, is + refused (409) and nothing is applied. Omit to skip the check + nullable: true + type: string + repositoryId: + type: string + required: + - repositoryId + type: object + EndpointsSavedFilterEntry: + properties: + createdAt: + type: string + filterSnapshotJson: + format: base64 + type: string + id: + type: string + name: + type: string + updatedAt: + type: string + userId: + type: string + type: object + EndpointsSavedTicketSettings: + properties: + createdAt: + type: string + defaultBoardId: + type: string + filtersCweAllowlist: + items: + type: string + type: array + filtersCweBlocklist: + items: + type: string + type: array + filtersRepoAllowlist: + items: + type: string + type: array + filtersRepoBlocklist: + items: + type: string + type: array + findingType: + $ref: '#/components/schemas/DatabaseFindingType' + isEnabled: + type: boolean + priorityThreshold: + $ref: '#/components/schemas/ModelsPriorityLabel' + severityThreshold: + $ref: '#/components/schemas/ModelsSeverity' + teamRoutingEnabled: + type: boolean + unroutedBehavior: + type: string + updatedAt: + type: string + type: object + EndpointsScanCoverageCVECounts: + properties: + critical: + type: integer + high: + type: integer + low: + type: integer + medium: + type: integer + type: object + EndpointsScanCoverageFinding: + properties: + allowlistType: + nullable: true + type: string + author: + nullable: true + type: string + category: + type: string + createdAt: + type: string + cveCounts: + $ref: '#/components/schemas/EndpointsScanCoverageCVECounts' + cwe: + type: integer + filePath: + type: string + id: + type: string + imageName: + nullable: true + type: string + imageTag: + nullable: true + type: string + isAllowlisted: + type: boolean + isDirect: + nullable: true + type: boolean + language: + type: string + package: + nullable: true + type: string + priorityLabel: + type: string + ruleId: + type: string + secretType: + nullable: true + type: string + severityLabel: + type: string + startLine: + type: integer + status: + type: string + title: + type: string + updatedAt: + type: string + verified: + nullable: true + type: boolean + version: + nullable: true + type: string + type: object + EndpointsScanCoverageFindingsType: + enum: + - sast + - sca_dependencies + - sca_containers + - secrets + - scpm + type: string + EndpointsScanCoverageRepo: + properties: + criticalCount: + type: integer + highCount: + type: integer + infoCount: + type: integer + lastCommitAt: + nullable: true + type: string + lastCommitHash: + nullable: true + type: string + lastScanAt: + nullable: true + type: string + lastScanCommitHash: + nullable: true + type: string + lastScanIncomplete: + description: The last run could not vouch for every scope, so its counts are a floor + type: boolean + lastScanIncompleteReason: + description: 'Why the last run was incomplete: an SBOM failure class or degraded' + type: string + lowCount: + type: integer + mediumCount: + type: integer + owner: + type: string + platform: + type: string + repository: + type: string + repositoryId: + type: string + totalCount: + type: integer + type: object + EndpointsScanCoverageType: + enum: + - sast + - sca_dependencies + - sca_containers + - secrets + - scpm + type: string + EndpointsScanEntitlementView: + properties: + codeEnrolledCount: + description: Live repositories enrolled for code scanning + type: integer + codeExcludedCount: + description: >- + Repositories in codeEnrolledCount that are turned off while every repository is scanned; turning scoping on + un-enrolls them. Zero while scoping is on + type: integer + codeRepositoryCap: + description: Repositories that may be enrolled for code scanning; null is unlimited + nullable: true + type: integer + entitlementUpdatedAt: + description: >- + When staff last changed the caps; null when never. An opaque stamp with microsecond precision: send it back + unchanged as expectedUpdatedAt, never through a millisecond date type + format: date-time + nullable: true + type: string + maxChangesPerRequest: + description: Most repositories one scope change may name + type: integer + maxPathsPerList: + description: Most directories one include or exclude list may hold + type: integer + scopingEnabled: + description: Whether per-repository enrollment is enforced + type: boolean + secretsEnrolledCount: + description: Live repositories in secrets scope; the code count while secretsMode is follow_code + type: integer + secretsExcludedCount: + description: >- + Repositories in secretsEnrolledCount that are turned off while every repository is scanned; turning scoping + on un-enrolls them. Zero while scoping is on + type: integer + secretsMode: + enum: + - follow_code + - independent + type: string + secretsRepositoryCap: + description: Repositories that may be enrolled for secrets scanning; null is unlimited + nullable: true + type: integer + staffRepositoryAllowlist: + description: >- + Nullify limits scanning to the repositories it allowed (staffAllowed); no other repository may be enrolled + or scanned + type: boolean + warningThresholdPercent: + description: Usage percentage of a cap at which the dashboard warns + type: integer + required: + - codeEnrolledCount + - secretsEnrolledCount + - codeExcludedCount + - secretsExcludedCount + - scopingEnabled + - secretsMode + - staffRepositoryAllowlist + - warningThresholdPercent + - maxPathsPerList + - maxChangesPerRequest + type: object + EndpointsScanScopeBackfill: + properties: + dispatched: + type: boolean + error: + type: string + families: + items: + type: string + nullable: true + type: array + queued: + description: A scan was already running on the default branch; this backfill was queued to run after it + type: boolean + repositoryId: + type: string + runId: + type: string + required: + - repositoryId + - families + - dispatched + type: object + EndpointsScanScopeCoverageLoss: + properties: + families: + items: + type: string + nullable: true + type: array + repositoryId: + type: string + required: + - repositoryId + - families + type: object + EndpointsScanScopeEnrollmentReset: + properties: + families: + description: 'Families whose stored enrollment was reset: code, secrets' + items: + type: string + nullable: true + type: array + repositoryId: + type: string + required: + - repositoryId + - families + type: object + EndpointsScanScopeOutput: + properties: + entitlement: + $ref: '#/components/schemas/EndpointsScanEntitlementView' + unavailableFromGitHub: + $ref: '#/components/schemas/EndpointsUnavailableFromGitHub' + unavailableFromGitHubKnown: + description: >- + Whether unavailableFromGitHub was read. False means it is unknown, not that every repository is shared. True + with count 0 says nothing about repositories on other git platforms: the list covers GitHub repositories + only, so a tenant without GitHub repositories always reads 0 + type: boolean + required: + - entitlement + - unavailableFromGitHubKnown + type: object + EndpointsScannerRun: + properties: + completedAt: + nullable: true + type: string + coverageStatus: + type: string + degradedScanShards: + nullable: true + type: integer + fixedFindingsCount: + type: integer + incompleteEntrypoints: + nullable: true + type: integer + newFindingsCount: + type: integer + reintroducedFindingsCount: + type: integer + scanRunId: + type: string + scanType: + type: string + startedAt: + nullable: true + type: string + status: + type: string + totalScanShards: + nullable: true + type: integer + type: object + EndpointsScimCredentialView: + properties: + createdAt: + format: date-time + type: string + id: + type: string + lastUsedAt: + format: date-time + nullable: true + type: string + required: + - id + - createdAt + type: object + EndpointsServiceAccount: + properties: + createdAt: + format: date-time + type: string + name: + type: string + platform: + $ref: '#/components/schemas/ModelsProviderID' + role: + description: 'The service account role: builtin:admin | builtin:editor | builtin:viewer' + type: string + serviceAccountId: + type: string + tenantId: + type: string + token: + type: string + required: + - serviceAccountId + - tenantId + - platform + - name + - createdAt + type: object + EndpointsSkippedUserMapping: + properties: + providerId: + description: The provider the skipped mapping named + type: string + providerUserId: + description: The provider-specific user id that could not be mapped + type: string + reason: + description: Why the mapping was not stored + type: string + type: object + EndpointsSourceImpactCount: + properties: + count: + type: integer + source: + $ref: '#/components/schemas/DatabaseTicketSource' + type: object + EndpointsTeamMembershipExport: + properties: + role: + type: string + teamId: + type: string + teamName: + type: string + type: object + EndpointsTeamMergeSource: + properties: + providerId: + $ref: '#/components/schemas/ModelsProviderID' + teamId: + type: string + required: + - providerId + - teamId + type: object + EndpointsTeamSLABreakdown: + properties: + inSLA: + format: int64 + type: integer + outOfSLA: + format: int64 + type: integer + teamID: + type: string + teamName: + type: string + teamSlug: + type: string + required: + - teamID + - teamName + - teamSlug + - inSLA + - outOfSLA + type: object + EndpointsTeamSourcePreferences: + properties: + githubTeamsEnabled: + type: boolean + repositoryPropertyEnabled: + type: boolean + tenantId: + type: string + updatedAt: + format: date-time + type: string + required: + - tenantId + - githubTeamsEnabled + - repositoryPropertyEnabled + type: object + EndpointsTeamSyncRun: + properties: + completedAt: + format: date-time + nullable: true + type: string + errorMessage: + type: string + id: + type: string + source: + $ref: '#/components/schemas/ModelsTeamSource' + startedAt: + format: date-time + type: string + status: + type: string + tenantId: + type: string + triggeredBy: + type: string + required: + - id + - tenantId + - source + - status + - startedAt + - triggeredBy + type: object + EndpointsTenantCapabilitiesOutput: + properties: + capabilities: + items: + $ref: '#/components/schemas/EndpointsTenantCapabilityView' + nullable: true + type: array + required: + - capabilities + type: object + EndpointsTenantCapabilityView: + properties: + capability: + type: string + customerEnabled: + description: The tenant's own choice, kept while locked; null when none + nullable: true + type: boolean + customerUpdatedAt: + description: >- + When the tenant last changed its choice; null when never. An opaque stamp with microsecond precision: send + it back unchanged as expectedUpdatedAt + format: date-time + nullable: true + type: string + description: + type: string + disabledLabel: + description: What off means for this capability + type: string + enabled: + description: The value in force, including the Nullify default + nullable: true + type: boolean + enabledLabel: + description: What on means for this capability + type: string + lockReason: + description: Why Nullify forced the value; empty when not locked + type: string + locked: + description: Nullify forced the value; the tenant cannot change it until Nullify lifts it + type: boolean + source: + description: >- + What decides the value: staff (Nullify forced it), customer (the tenant's choice) or fallback (the Nullify + default) + enum: + - staff + - customer + - fallback + type: string + title: + type: string + required: + - capability + - title + - description + - enabledLabel + - disabledLabel + - source + - locked + - lockReason + type: object + EndpointsThreatNotificationDeliveryFailure: + properties: + failedAt: + description: When delivery was given up, RFC 3339. + type: string + message: + description: What to change so the next card is delivered. + type: string + reason: + description: Why the card could not be delivered. + enum: + - app_not_in_channel + - channel_unavailable + - app_access_revoked + - missing_scope + - webhook_rejected + - delivery_failed + type: string + required: + - failedAt + - reason + - message + type: object + EndpointsThreatNotificationDestinations: + properties: + microsoftTeams: + $ref: '#/components/schemas/EndpointsThreatNotificationTeams' + nullifySharedSlack: + $ref: '#/components/schemas/EndpointsThreatNotificationNullifySlack' + tenantSlack: + $ref: '#/components/schemas/EndpointsThreatNotificationTenantSlack' + required: + - nullifySharedSlack + - tenantSlack + - microsoftTeams + type: object + EndpointsThreatNotificationNullifySlack: + properties: + enabled: + description: Post to the Slack channel Nullify shares with you. On by default. + type: boolean + required: + - enabled + type: object + EndpointsThreatNotificationTeams: + properties: + enabled: + type: boolean + lastDeliveryFailure: + $ref: '#/components/schemas/EndpointsThreatNotificationDeliveryFailure' + webhookHost: + description: Host of the stored webhook URL. The URL itself is never returned. + type: string + required: + - enabled + type: object + EndpointsThreatNotificationTenantSlack: + properties: + available: + description: Whether Nullify's Slack app is installed in your own Slack workspace. + type: boolean + channelId: + description: Slack channel ID in your workspace, e.g. C0123456789. + type: string + enabled: + type: boolean + lastDeliveryFailure: + $ref: '#/components/schemas/EndpointsThreatNotificationDeliveryFailure' + required: + - available + - enabled + type: object + EndpointsTicketActivityEntry: + properties: + actor: + $ref: '#/components/schemas/DatabaseTicketAuditActor' + actorId: + type: string + createdAt: + type: string + detailsJson: + format: base64 + type: string + eventType: + $ref: '#/components/schemas/DatabaseTicketAuditEventType' + findingTicketId: + type: string + id: + type: string + type: object + EndpointsTicketSettingsHistoryEntry: + properties: + appliedAt: + type: string + appliedBy: + type: string + findingType: + $ref: '#/components/schemas/DatabaseFindingType' + id: + type: string + migrationAction: + $ref: '#/components/schemas/DatabaseTicketMigrationAction' + newSettingsJson: + format: base64 + type: string + oldSettingsJson: + format: base64 + type: string + type: object + EndpointsTicketSettingsImpactPreview: + properties: + byBoard: + items: + $ref: '#/components/schemas/EndpointsBoardImpactCount' + nullable: true + type: array + bySource: + items: + $ref: '#/components/schemas/EndpointsSourceImpactCount' + nullable: true + type: array + sampleTickets: + items: + $ref: '#/components/schemas/EndpointsFindingTicketSummary' + nullable: true + type: array + ticketsNowOutOfScopeCount: + type: integer + ticketsToCreateCount: + type: integer + type: object + EndpointsTicketSettingsProposal: + properties: + defaultBoardId: + type: string + filtersCweAllowlist: + items: + type: string + type: array + filtersCweBlocklist: + items: + type: string + type: array + filtersRepoAllowlist: + items: + type: string + type: array + filtersRepoBlocklist: + items: + type: string + type: array + isEnabled: + type: boolean + priorityThreshold: + $ref: '#/components/schemas/ModelsPriorityLabel' + severityThreshold: + $ref: '#/components/schemas/ModelsSeverity' + teamRoutingEnabled: + type: boolean + unroutedBehavior: + type: string + required: + - priorityThreshold + type: object + EndpointsTicketWorkbenchAuditEntry: + properties: + actor: + $ref: '#/components/schemas/DatabaseTicketAuditActor' + actorId: + type: string + createdAt: + type: string + detailsJson: + format: base64 + type: string + eventType: + $ref: '#/components/schemas/DatabaseTicketAuditEventType' + id: + type: string + type: object + EndpointsTicketWorkbenchFilter: + properties: + boardId: + type: string + closedAfter: + type: string + closedBefore: + type: string + createdAfter: + type: string + createdBefore: + type: string + findingTypes: + items: + $ref: '#/components/schemas/DatabaseFindingType' + type: array + hasSyncError: + nullable: true + type: boolean + ids: + items: + type: string + type: array + lastSyncedBefore: + type: string + outOfEligibilitySinceAfter: + type: string + platforms: + items: + $ref: '#/components/schemas/DatabaseTicketPlatform' + type: array + sources: + items: + $ref: '#/components/schemas/DatabaseTicketSource' + type: array + statuses: + items: + $ref: '#/components/schemas/DatabaseTicketStatus' + type: array + textSearch: + type: string + type: object + EndpointsTriageContextCensusFinding: + properties: + findingId: + type: string + findingType: + type: string + missingOrgContext: + type: boolean + missingRepoContext: + type: boolean + orgContextVersion: + type: string + repoContextVersion: + type: string + required: + - findingId + - findingType + - missingOrgContext + - missingRepoContext + type: object + EndpointsTriageContextCensusSummary: + properties: + findingType: + type: string + missingOrgContext: + format: int64 + type: integer + missingRepoContext: + format: int64 + type: integer + total: + format: int64 + type: integer + required: + - findingType + - total + - missingOrgContext + - missingRepoContext + type: object + EndpointsUnavailableFromGitHub: + description: >- + The GitHub repositories GitHub stopped sharing with Nullify. Repositories on other git platforms are never + listed or counted, so a tenant without GitHub repositories always reads count 0 + properties: + count: + description: >- + Every GitHub repository GitHub stopped sharing, including those beyond the listed ones; other platforms are + not counted + type: integer + repositories: + description: The first 200 by name + items: + $ref: '#/components/schemas/EndpointsUnavailableRepository' + maxItems: 200 + nullable: true + type: array + required: + - count + - repositories + type: object + EndpointsUnavailableRepository: + properties: + deactivatedAt: + description: When Nullify stopped seeing the repository; null when unknown + format: date-time + nullable: true + type: string + owner: + type: string + reason: + description: >- + installation_removed: taken out of the GitHub App installation; absent_from_sync: missing from the last + repository sync + enum: + - installation_removed + - absent_from_sync + type: string + repository: + type: string + repositoryId: + type: string + required: + - repositoryId + - owner + - repository + - reason + type: object + EndpointsUnifiedEventOutput: + properties: + autofixId: + nullable: true + type: string + campaignId: + nullable: true + type: string + createdAt: + nullable: true + type: string + data: {} + findingId: + nullable: true + type: string + id: + type: string + prCanonicalId: + nullable: true + type: string + repositoryId: + nullable: true + type: string + runId: + nullable: true + type: string + service: + $ref: '#/components/schemas/EventbusService' + tenantId: + type: string + timestampUnix: + format: int64 + type: integer + type: + $ref: '#/components/schemas/EventsEventType' + type: object + EndpointsUpdateJiraConfigInput: + properties: + autoCreate: + type: boolean + defaultAssigneeId: + nullable: true + type: string + enabledFindingTypes: + items: + type: string + nullable: true + type: array + issueType: + type: string + priorityThreshold: + type: string + projectKey: + type: string + required: + - projectKey + - priorityThreshold + - issueType + - autoCreate + - enabledFindingTypes + type: object + EndpointsUpdateJiraConfigOutput: + properties: + configuration: + $ref: '#/components/schemas/ModelsJiraConfig' + type: object + EndpointsUserDataExport: + properties: + auditLogEntryCount: + format: int64 + type: integer + exportVersion: + type: string + exportedAt: + type: string + privacyAcknowledgments: + items: + $ref: '#/components/schemas/EndpointsPrivacyAcknowledgmentExport' + nullable: true + type: array + teamMemberships: + items: + $ref: '#/components/schemas/EndpointsTeamMembershipExport' + nullable: true + type: array + user: + $ref: '#/components/schemas/EndpointsUserExport' + type: object + EndpointsUserExport: + properties: + email: + type: string + id: + type: string + isBot: + type: boolean + name: + type: string + providerId: + type: string + username: + type: string + type: object + EndpointsUserInput: + properties: + email: + description: The user's email address + type: string + isBot: + description: Whether the user is a bot + type: boolean + name: + description: The user's name + type: string + provider: + $ref: '#/components/schemas/ModelsUserProvider' + slug: + description: The user's slug + type: string + username: + description: The user's username + type: string + required: + - provider + - name + - slug + - username + - isBot + type: object + EndpointsUserMappingInput: + properties: + azure: + $ref: '#/components/schemas/ModelsAzureUserProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketUserProvider' + github: + $ref: '#/components/schemas/ModelsGitHubUserProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabUserProvider' + jira: + $ref: '#/components/schemas/ModelsJiraUserProvider' + linear: + $ref: '#/components/schemas/ModelsLinearUserProvider' + slack: + $ref: '#/components/schemas/ModelsSlackUserProvider' + teams: + $ref: '#/components/schemas/ModelsTeamsUserProvider' + type: object + EndpointsUserMappingSuggestion: + properties: + github: + $ref: '#/components/schemas/ModelsUser' + jira: + items: + $ref: '#/components/schemas/ModelsUser' + nullable: true + type: array + linear: + items: + $ref: '#/components/schemas/ModelsUser' + type: array + slack: + items: + $ref: '#/components/schemas/ModelsUser' + nullable: true + type: array + teams: + items: + $ref: '#/components/schemas/ModelsUser' + nullable: true + type: array + required: + - github + - slack + - jira + - teams + type: object + EndpointsWorkspaceBootstrapIssueOutput: + properties: + expiresAt: + type: string + invitationToken: + type: string + operationId: + type: string + type: object + EndpointsWorkspaceBootstrapOperatorInput: + properties: + deploymentId: + type: string + dryRun: + nullable: true + type: boolean + expectedDirectoryId: + description: Customer's Microsoft Entra tenant ID; only a member of this directory can complete setup + type: string + expectedState: + type: string + reason: + type: string + recipient: + type: string + type: object + EndpointsWorkspaceBootstrapOperatorOutput: + properties: + dryRun: + type: boolean + invitation: + $ref: '#/components/schemas/EndpointsWorkspaceBootstrapIssueOutput' + target: + $ref: '#/components/schemas/WorkspacebootstrapTarget' + type: object + EndpointsWorkspaceBootstrapRenewInput: + properties: + dryRun: + nullable: true + type: boolean + expectedRevision: + format: int64 + type: integer + expectedState: + type: string + operationId: + type: string + reason: + type: string + type: object + EndpointsWorkspaceBootstrapRevokeInput: + properties: + dryRun: + nullable: true + type: boolean + expectedRevision: + format: int64 + type: integer + expectedState: + type: string + operationId: + type: string + reason: + type: string + type: object + EndpointsWorkspaceEntraSSOPolicyInput: + properties: + dryRun: + type: boolean + expectedUpdatedAt: + format: date-time + type: string + reason: + type: string + required: + type: boolean + required: + - expectedUpdatedAt + - reason + type: object + EndpointsWorkspaceEntraSSOPolicyOutput: + properties: + directoryId: + type: string + dryRun: + type: boolean + minimumAdminCount: + description: Linked administrators required before Microsoft sign-in can be required; set on a dry run + type: integer + pending: + type: boolean + pendingRequired: + type: boolean + required: + type: boolean + unlinkedMemberCount: + description: >- + Active members with no Microsoft account linked to the connected directory, who lose access when Microsoft + sign-in is required; set on a dry run + type: integer + updatedAt: + format: date-time + type: string + usableAdminCount: + description: Active workspace administrators linked to the connected directory; set on a dry run + type: integer + type: object + EndpointsWorkspaceProvisioningApproveInput: + properties: + action: + enum: + - approve + - renew + - reject + - reopen + type: string + confirm: + type: boolean + deploymentId: + type: string + expectedOperationRevision: + format: int64 + type: integer + expectedRevision: + format: int64 + type: integer + reason: + type: string + requestId: + type: string + setupKind: + enum: + - existing_workspace + - azure_devops + type: string + type: object + EndpointsWorkspaceProvisioningApproveOutput: + properties: + decision: + $ref: '#/components/schemas/WorkspacebootstrapProvisioningDecision' + type: object + EndpointsWorkspaceProvisioningQueueOutput: + properties: + nextCursor: + type: string + requests: + items: + $ref: '#/components/schemas/WorkspacebootstrapProvisioningRequest' + nullable: true + type: array + type: object + EndpointsWorkspaceProvisioningRequestInput: + properties: + companyName: + type: string + contactEmail: + type: string + expectedRevision: + format: int64 + type: integer + usesAzureDevOps: + description: >- + The requester's own answer to whether their organization uses Azure DevOps; omitted leaves the stored answer + unchanged + nullable: true + type: boolean + type: object + EndpointsWorkspaceProvisioningRequestOutput: + properties: + companyName: + type: string + contactEmail: + type: string + message: + type: string + requestId: + type: string + revision: + format: int64 + type: integer + setupAvailable: + type: boolean + setupKind: + type: string + source: + enum: + - sign_in + - form + type: string + status: + type: string + usesAzureDevOps: + nullable: true + type: boolean + workspaceName: + type: string + type: object + EventbusService: + enum: + - sast + - sca + - secrets + - dast + - scpm + - cspm + - orchestrator + - context + - manager + - webhooks + - auth + - notifications + - billing + type: string + EventsEventType: + enum: + - repo_context_agent_started + - repo_context_agent_finished + - repo_context_agent_failed + - triage_agent_started + - triage_agent_finished + - triage_agent_failed + - triage_agent_skipped + - triage_agent_quality_degraded + - auto_fix_agent_finished + - auto-fix-run-started + - auto-fix-run-finished + - auto-fix-run-failed + - schema_reversing_agent_started + - schema_reversing_agent_finished + - schema_reversing_agent_failed + - auth-user-logged-in + - auth-user-role-changed + - auth-api-key-created + - auth-api-key-revoked + - auth-tenant-created + - auth-tenant-deleted + - auth-integration-enabled + - auth-integration-disabled + - billing-budget-exhausted + - billing-budget-warning + - billing-lease-started + - billing-lease-ended + - billing-lease-extended + - billing-usage-recorded + - repository-context-published + - account-scan-completed + - cloud-integration-scan-completed + - cspm-new-finding + - cspm-new-findings + - cspm-finding-triaged + - cspm-findings-triaged + - cspm-finding-retriaged + - cspm-new-allowlisted-finding + - cspm-finding-resolved + - cspm-finding-reintroduced + - cspm-findings-digest + - cspm-finding-overridden + - cspm-ticket-created + - cspm-ticket-updated + - cspm-ticket-assigned + - cspm-ticket-closed + - cspm-ticket-reopened + - account-scan-started + - account-scan-failed + - cspm-scan-started + - cspm-scan-completed + - cspm-scan-failed + - dast-new-findings + - dast-new-fixes + - dast-bughunt-new-finding + - dast-bughunt-finding-fixed + - dast-bughunt-finding-unfixed + - dast-bughunt-finding-allowlisted + - dast-bughunt-finding-unallowlisted + - dast-bughunt-triage-completed + - dast-bughunt-scan-failed + - dast-bughunt-scan-failsafe-invoked + - dast-pentest-new-finding + - dast-pentest-finding-fixed + - dast-pentest-finding-unfixed + - dast-pentest-finding-allowlisted + - dast-pentest-finding-unallowlisted + - dast-pentest-triage-completed + - dast-preflight-started + - dast-preflight-check-started + - dast-preflight-check-completed + - dast-preflight-estimate + - dast-preflight-completed + - dast-preflight-failed + - dast-preflight-failsafe-invoked + - dast-pentest-scan-aborted-config-error + - dast-pentest-scan-human-fallback + - dast-pentest-scan-failsafe-invoked + - dast-bughunt-ticket-updated + - dast-bughunt-ticket-assigned + - dast-bughunt-ticket-closed + - dast-bughunt-ticket-reopened + - dast-pentest-ticket-updated + - dast-pentest-ticket-assigned + - dast-pentest-ticket-closed + - dast-pentest-ticket-reopened + - dast-bughunt-scan-started + - dast-bughunt-scan-completed + - dast-pentest-scan-started + - dast-pentest-scan-completed + - dast-pentest-scan-failed + - dast-pentest-stage-transition + - bot-interaction + - bot-interaction-issue-dashboard-reply + - bot-interaction-pull-request-discussion-reply + - bot-interaction-pull-request-review-diff-thread-reply + - bot-interaction-pull-request-review-discussion-reply + - auto-fix-pull-request-created + - auto-fix-pull-request-accepted + - auto-fix-pull-request-closed + - auto-fix-suggestion-created + - auto-fix-suggestion-accepted + - scpm-new-branch-summary + - scpm-new-finding + - scpm-new-findings + - scpm-reintroduced-finding + - scpm-new-allowlisted-finding + - scpm-new-unallowlisted-finding + - scpm-new-fix + - scpm-new-pull-request-fix + - scpm-ticket-created + - scpm-ticket-updated + - scpm-ticket-assigned + - scpm-ticket-closed + - scpm-ticket-reopened + - scpm-scan-started + - scpm-scan-completed + - scpm-scan-failed + - scpm-finding-retriaged + - scpm-finding-resolved + - scpm-finding-overridden + - manager-campaign-created + - manager-campaign-updated + - manager-campaign-deleted + - manager-scheduled-plan-completed + - manager-plan-created + - manager-action-item-created + - manager-action-item-resolved + - manager-action-item-reopened + - manager-action-item-snoozed + - manager-action-item-updated + - manager-action-allowlist + - manager-action-escalate + - manager-action-ticket-create + - manager-action-ticket-comment + - manager-action-ticket-close + - manager-action-ticket-reassign + - manager-action-pr-create + - manager-action-pr-comment + - manager-action-pr-close + - manager-action-pr-reassign + - manager-action-pr-rebase + - manager-action-message-user + - manager-action-message-channel + - manager-action-assign-user-task + - manager-action-campaign-create + - notification-sent + - notification-failed + - notification-retried + - notification-dlqed + - orchestrator-pipeline-run-started + - orchestrator-pipeline-run-completed + - orchestrator-pipeline-run-failed + - orchestrator-batch-autofix-started + - orchestrator-batch-autofix-completed + - orchestrator-batch-autofix-failed + - orchestrator-onboarding-started + - orchestrator-onboarding-phase-advanced + - orchestrator-onboarding-completed + - orchestrator-onboarding-partial-completed + - orchestrator-onboarding-failed + - orchestrator-retriage-requested + - orchestrator-retriage-queued + - orchestrator-check-run-overridden + - pipeline-triggered + - pipeline-finished + - pipeline-failed + - run-started + - run-stage + - run-finished + - sast-new-branch-summary + - sast-new-finding + - sast-new-findings + - sast-new-fix + - sast-new-fixes + - sast-new-allowlisted-finding + - sast-new-unallowlisted-finding + - sast-new-pull-request-finding + - sast-new-pull-request-fix + - sast-new-pull-request-fixes + - sast-new-vulnerability-merged + - sast-reintroduced-finding + - sast-reintroduced-pull-request-finding + - sast-finding-retriaged + - sast-finding-triaged + - sast-finding-overridden + - sast-archived-finding + - sast-ticket-created + - sast-ticket-updated + - sast-ticket-assigned + - sast-ticket-closed + - sast-ticket-reopened + - sast-autofix-iteration-started + - sast-autofix-iteration-completed + - sast-scan-started + - sast-scan-completed + - sast-scan-failed + - sca-new-branch-summary + - sca-new-finding + - sca-new-findings + - sca-new-fix + - sca-new-fixes + - sca-new-allowlisted-finding + - sca-new-unallowlisted-finding + - sca-new-pull-request-finding + - sca-new-pull-request-fix + - sca-new-pull-request-fixes + - sca-dependency-reintroduced-finding + - sca-container-reintroduced-finding + - sca-finding-retriaged + - sca-finding-triaged + - sca-finding-overridden + - sca-ticket-created + - sca-ticket-updated + - sca-ticket-assigned + - sca-ticket-closed + - sca-ticket-reopened + - sca-autofix-iteration-started + - sca-autofix-iteration-completed + - sca-scan-started + - sca-scan-completed + - sca-scan-failed + - secrets-new-finding + - secrets-new-findings + - secrets-new-allowlisted-finding + - secrets-new-unallowlisted-finding + - secrets-archived-finding + - secrets-credential-triage-completed + - secrets-sensitivedata-triage-completed + - secrets-finding-retriaged + - secrets-finding-overridden + - secrets-ticket-created + - secrets-ticket-updated + - secrets-ticket-assigned + - secrets-ticket-closed + - secrets-ticket-reopened + - sensitivedata-new-finding + - sensitivedata-allowlisted + - sensitivedata-unallowlisted + - sensitivedata-ticket-created + - sensitivedata-ticket-updated + - sensitivedata-ticket-assigned + - sensitivedata-ticket-closed + - sensitivedata-ticket-reopened + - secrets-scan-started + - secrets-scan-completed + - secrets-scan-failed + - threat-investigation-created + - threat-investigation-completed + - webhook-repo-onboarded + - webhook-repo-removed + - webhook-integration-installed + - webhook-integration-uninstalled + - webhook-default-branch-changed + - webhook-pr-opened + - webhook-pr-merged + - webhook-pr-closed + - webhook-push-received + type: string + GitlabauthGroup: + properties: + full_path: + type: string + id: + format: int64 + type: integer + name: + type: string + parent_id: + nullable: true + type: integer + type: object + GitlabauthProject: + properties: + archived: + type: boolean + default_branch: + type: string + http_url_to_repo: + type: string + id: + format: int64 + type: integer + name: + type: string + path_with_namespace: + type: string + web_url: + type: string + type: object + MetricdefsPeriod: + properties: + days: + type: integer + end: + format: date-time + type: string + kind: + enum: + - rolling + type: string + label: + type: string + previousStart: + format: date-time + type: string + start: + format: date-time + type: string + required: + - kind + - days + - start + - end + - previousStart + - label + type: object + MetricdefsRatio: + properties: + available: + type: boolean + denominator: + format: int64 + type: integer + numerator: + format: int64 + type: integer + percent: + nullable: true + type: number + required: + - numerator + - denominator + - available + type: object + MetricdefsSpoke: + properties: + available: + type: boolean + definition: + type: string + denominator: + format: int64 + type: integer + key: + type: string + label: + type: string + numerator: + format: int64 + type: integer + sampleSize: + format: int64 + type: integer + unit: + type: string + value: + nullable: true + type: number + required: + - key + - label + - definition + - unit + - available + - numerator + - denominator + - sampleSize + type: object + MetricdefsState: + enum: + - open + - fixed + - fix_pending_verification + - no_longer_detected + - false_positive + - allowlisted + - archived + - duplicate + type: string + ModelsAWSAccount: + properties: + accountId: + type: string + accountName: + type: string + accountType: + type: string + isDefault: + type: boolean + lastVerifiedAt: + type: string + lastVerifiedStatus: + type: string + required: + - accountId + - accountName + - isDefault + type: object + ModelsAWSAccountWithStatus: + properties: + accountId: + type: string + accountName: + type: string + accountType: + type: string + assumedRole: + type: string + errorMessage: + type: string + isDefault: + type: boolean + lastVerifiedAt: + type: string + lastVerifiedStatus: + type: string + status: + type: string + required: + - accountId + - accountName + - isDefault + type: object + ModelsAWSConnectorPermissionGap: + properties: + accountId: + type: string + checkedAt: + type: string + permission: + type: string + service: + type: string + required: + - accountId + - permission + type: object + ModelsAllowlistState: + enum: + - none + - in_progress_requested + - pending_review + - failed_pr_generation + - failed_pr_creation + - pr_merged + type: string + ModelsAllowlistType: + enum: + - AI + - UserFixed + - UserAssumeRisk + - UserFalsePositive + - UserOther + - RuleException + - UserUnallowlisted + type: string + ModelsAsanaOwnerProvider: + properties: + accessToken: + description: The Asana access token + type: string + workspaceId: + description: The Asana workspace ID + type: string + workspaceName: + description: The Asana workspace name + type: string + required: + - accessToken + - workspaceId + - workspaceName + type: object + ModelsAsanaTicketProject: + properties: + projectGid: + description: The Asana project GID + type: string + projectName: + description: The Asana project name + type: string + teamGid: + description: The Asana team GID + type: string + workspaceGid: + description: The Asana workspace GID + type: string + required: + - projectGid + - projectName + - workspaceGid + type: object + ModelsAsanaTicketProvider: + properties: + projectGid: + description: The Asana project GID + type: string + taskGid: + description: The Asana task GID + type: string + url: + description: The Asana task URL + type: string + required: + - taskGid + - url + - projectGid + type: object + ModelsAsanaUserProvider: + properties: + id: + type: string + required: + - id + type: object + ModelsAutoFixState: + enum: + - none + - cancelled + - in_progress_requested + - in_progress_agent + - cached + - in_progress_preview_available + - in_progress_creating_pr + - in_progress_draft + - pending_review + - failed_retry + - failed_abort + - pr_merged + - pr_closed + - failed_pr_creation + - failed_iteration + type: string + ModelsAzureEntraOwnerProvider: + properties: + clientId: + description: The Azure Entra client ID + type: string + clientSecret: + description: The Azure Entra client secret + type: string + tenantId: + description: The Azure Entra tenant ID + type: string + required: + - tenantId + - clientId + - clientSecret + type: object + ModelsAzureEntraUserProvider: + properties: + id: + type: string + required: + - id + type: object + ModelsAzureGitPullRequest: + properties: + pullRequestId: + description: The Azure pull request ID + type: integer + required: + - pullRequestId + type: object + ModelsAzureGitRepositoryProvider: + properties: + projectId: + description: The ID of the Azure project + type: string + projectName: + description: The name of the Azure project + type: string + repositoryId: + description: The ID of the Azure repository + type: string + repositoryName: + description: The name of the Azure repository + type: string + required: + - projectId + - projectName + - repositoryId + - repositoryName + type: object + ModelsAzureOwnerProvider: + properties: + baseUrl: + description: The base URL for the Azure instance + type: string + organizationId: + description: The Azure organization ID + type: string + organizationName: + description: The Azure organization name + type: string + tenantId: + description: The Entra (Azure AD) tenant ID used to mint credentials + type: string + required: + - organizationId + - organizationName + - baseUrl + type: object + ModelsAzureSubscriptionInput: + properties: + displayName: + type: string + isDefault: + type: boolean + subscriptionId: + type: string + type: + type: string + required: + - subscriptionId + type: object + ModelsAzureSubscriptionWithStatus: + properties: + accountType: + type: string + isDefault: + type: boolean + isEnabled: + type: boolean + lastVerifiedAt: + type: string + lastVerifiedStatus: + type: string + state: + type: string + subscriptionId: + type: string + subscriptionName: + type: string + required: + - subscriptionId + - isDefault + - isEnabled + type: object + ModelsAzureTicketProject: + properties: + projectName: + description: The Azure DevOps project name + type: string + required: + - projectName + type: object + ModelsAzureTicketProvider: + properties: + url: + description: The Azure DevOps work item URL + type: string + workItemId: + description: The Azure DevOps work item ID + type: integer + required: + - workItemId + - url + type: object + ModelsAzureUserProvider: + properties: + id: + type: string + required: + - id + type: object + ModelsBitbucketGitPullRequest: + properties: + pullRequestId: + description: The GitHub pull request ID + format: int64 + type: integer + required: + - pullRequestId + type: object + ModelsBitbucketGitRepositoryProvider: + properties: + projectKey: + description: The key of a Bitbucket project + type: string + projectName: + description: The name of the Bitbucket project + type: string + repositoryId: + description: The ID of the Bitbucket repository + type: string + repositoryName: + description: The name of the Bitbucket repository + type: string + required: + - repositoryId + - repositoryName + - projectKey + - projectName + type: object + ModelsBitbucketOwnerProvider: + properties: + appKey: + description: The Bitbucket app key + type: string + baseUrl: + description: The Bitbucket base URL + type: string + clientKey: + description: The Bitbucket client key + type: string + ownerId: + description: The Bitbucket owner ID + type: string + ownerName: + description: The Bitbucket owner name + type: string + sharedSecret: + description: The Bitbucket shared secret + type: string + required: + - appKey + - baseUrl + - ownerId + - ownerName + - clientKey + - sharedSecret + type: object + ModelsBitbucketTicketProject: + type: object + ModelsBitbucketUserProvider: + properties: + id: + type: string + required: + - id + type: object + ModelsChecklistItem: + properties: + currentValue: + type: string + desiredValue: + type: string + name: + type: string + required: + - name + - currentValue + - desiredValue + type: object + ModelsCollection: + properties: + collectionId: + description: Unique identifier for the collection + type: string + collections: + description: List of sub-collections + items: + $ref: '#/components/schemas/ModelsSubCollection' + nullable: true + type: array + isSensitive: + description: Whether the collection contains sensitive data + type: boolean + name: + description: Name of the collection + type: string + required: + - collectionId + - name + - isSensitive + - collections + type: object + ModelsContainerImageMetadata: + properties: + digest: + type: string + distro: + properties: + name: + type: string + version: + type: string + type: object + fullReference: + type: string + registryDomain: + type: string + registryPath: + type: string + shortName: + type: string + tag: + type: string + type: object + ModelsDataMap: + additionalProperties: + type: string + type: object + ModelsDeploymentType: + enum: + - helm + - terraform + - cloudformation + - cloud_connector + type: string + ModelsDiffFile: + properties: + header: + type: string + hunks: + items: + $ref: '#/components/schemas/ModelsDiffHunk' + nullable: true + type: array + mode: + type: integer + newName: + type: string + origName: + type: string + required: + - header + - mode + - origName + - newName + - hunks + type: object + ModelsDiffHunk: + properties: + header: + type: string + wholeRange: + $ref: '#/components/schemas/ModelsDiffRange' + required: + - header + - wholeRange + type: object + ModelsDiffLine: + properties: + content: + type: string + mode: + $ref: '#/components/schemas/ModelsDiffLineMode' + number: + type: integer + required: + - mode + - number + - content + type: object + ModelsDiffLineMode: + format: int32 + type: integer + ModelsDiffRange: + properties: + length: + type: integer + lines: + items: + $ref: '#/components/schemas/ModelsDiffLine' + nullable: true + type: array + start: + type: integer + required: + - start + - length + - lines + type: object + ModelsDurationStats: + properties: + meanMs: + nullable: true + type: integer + medianMs: + nullable: true + type: integer + sample: + format: int64 + type: integer + required: + - sample + type: object + ModelsExternalOwnerProvider: + properties: + installationId: + description: The external installation ID + type: string + required: + - installationId + type: object + ModelsFamilyScope: + properties: + inScope: + type: boolean + paths: + $ref: '#/components/schemas/ModelsPathScope' + reason: + $ref: '#/components/schemas/ModelsScanScopeReason' + type: object + ModelsFileOwner: + properties: + name: + description: The name of the owner + type: string + type: + $ref: '#/components/schemas/ModelsOwnerType' + required: + - name + - type + type: object + ModelsFileOwners: + properties: + id: + description: A unique identifier for the file owners + type: string + owners: + description: A list of owners associated with the file + items: + $ref: '#/components/schemas/ModelsFileOwner' + nullable: true + type: array + required: + - id + - owners + type: object + ModelsFindingProgress: + properties: + autofixDuration: + nullable: true + type: integer + autofixedAt: + format: date-time + nullable: true + type: string + createdAt: + format: date-time + type: string + detectionDuration: + nullable: true + type: integer + discoveredAt: + format: date-time + nullable: true + type: string + findingId: + type: string + findingType: + $ref: '#/components/schemas/ModelsFindingType' + hasOpenAutoFixPR: + type: boolean + hasOpenTicket: + type: boolean + inProgressAt: + format: date-time + nullable: true + type: string + resolvedAt: + format: date-time + nullable: true + type: string + status: + $ref: '#/components/schemas/ModelsFindingStatus' + timeSaved: + nullable: true + type: integer + totalRemediationDuration: + nullable: true + type: integer + triageDuration: + nullable: true + type: integer + triagedAt: + format: date-time + nullable: true + type: string + updatedAt: + format: date-time + type: string + required: + - createdAt + - updatedAt + - findingId + - findingType + - status + type: object + ModelsFindingPullRequestQuery: + properties: + findingIds: + items: + type: string + type: array + page: + nullable: true + type: integer + pageSize: + nullable: true + type: integer + prIdentifiers: + items: + type: string + type: array + prTypes: + items: + type: string + type: array + repositoryNames: + items: + type: string + type: array + repositoryOwners: + items: + type: string + type: array + statuses: + items: + type: string + type: array + type: object + ModelsFindingPullRequestRecord: + properties: + autofixId: + nullable: true + type: string + azureProjectId: + nullable: true + type: string + bitbucketWorkspace: + nullable: true + type: string + ciCheckedAt: + format: date-time + nullable: true + type: string + ciDetailUrl: + nullable: true + type: string + ciState: + $ref: '#/components/schemas/ModelsPullRequestCIState' + nullable: true + closedAt: + format: date-time + nullable: true + type: string + closedAtSource: + enum: + - provider + - observed + nullable: true + type: string + closedBy: + enum: + - nullify_operator + - git_platform_user + nullable: true + type: string + createdAt: + format: date-time + nullable: true + type: string + currentIterationId: + nullable: true + type: string + findingId: + type: string + findingType: + type: string + firstReviewedAt: + format: date-time + nullable: true + type: string + gitlabProjectId: + nullable: true + type: integer + hasCustomerCommit: + nullable: true + type: boolean + hasCustomerFeedback: + nullable: true + type: boolean + id: + type: string + lastReviewedAt: + format: date-time + nullable: true + type: string + mergedAt: + format: date-time + nullable: true + type: string + platform: + type: string + prCustomerInteracted: + nullable: true + type: boolean + prIdentifier: + type: string + prStatus: + type: string + prTitle: + nullable: true + type: string + prType: + type: string + prUrl: + nullable: true + type: string + recovery: + $ref: '#/components/schemas/ModelsPullRequestRecoveryObservation' + repositoryId: + nullable: true + type: string + repositoryName: + nullable: true + type: string + repositoryOwner: + nullable: true + type: string + sourceBranch: + nullable: true + type: string + targetBranch: + nullable: true + type: string + updatedAt: + format: date-time + nullable: true + type: string + required: + - id + - findingId + - findingType + - platform + - prType + - prStatus + - prIdentifier + type: object + ModelsFindingStatus: + enum: + - BACKLOG + - IN_PROGRESS + - RESOLVED + type: string + ModelsFindingType: + enum: + - Unknown + - Code + - Dependencies + - Containers + - SecretsCredentials + - SecretsSensitiveData + - Pentest + - BugHunt + - Cloud + - SupplyChain + - AI Review + type: string + ModelsFindingsGroup: + properties: + count: + type: integer + key: + type: string + label: + type: string + required: + - key + - label + - count + type: object + ModelsFindingsGroupBy: + enum: + - repository + - branch + - type + - priority + - language + type: string + ModelsFindingsMetrics: + properties: + autofixTimeTotal: + minimum: 0 + type: integer + detectionTimeTotal: + minimum: 0 + type: integer + estimatedBacklogStoryPoints: + minimum: 0 + type: integer + findingsAllowlistedCount: + minimum: 0 + type: integer + findingsCount: + minimum: 0 + type: integer + findingsFixPendingVerificationCount: + minimum: 0 + type: integer + findingsFixedCount: + minimum: 0 + type: integer + findingsInBacklogCount: + minimum: 0 + type: integer + findingsInProgressCount: + minimum: 0 + type: integer + findingsNoLongerDetectedCount: + minimum: 0 + type: integer + findingsResolvedCount: + minimum: 0 + type: integer + findingsWithOpenAutoFixPRCount: + minimum: 0 + type: integer + findingsWithOpenTicketCount: + minimum: 0 + type: integer + fixedTimeToResolve: + $ref: '#/components/schemas/ModelsDurationStats' + funnel: + $ref: '#/components/schemas/ModelsRemediationFunnel' + meanTimeToAutofix: + minimum: 0 + type: integer + meanTimeToDetectAndTriage: + minimum: 0 + type: integer + meanTimeToMerge: + minimum: 0 + type: integer + meanTimeToPullRequestCreation: + minimum: 0 + type: integer + meanTimeToReview: + minimum: 0 + type: integer + meanTimeToTriage: + minimum: 0 + type: integer + medianTimeToAutofix: + minimum: 0 + type: integer + medianTimeToDetectAndTriage: + minimum: 0 + type: integer + medianTimeToMerge: + minimum: 0 + type: integer + medianTimeToPullRequestCreation: + minimum: 0 + type: integer + medianTimeToReview: + minimum: 0 + type: integer + medianTimeToTriage: + minimum: 0 + type: integer + stageSamples: + $ref: '#/components/schemas/ModelsStageSampleSizes' + triageTimeTotal: + minimum: 0 + type: integer + required: + - findingsCount + - findingsInBacklogCount + - findingsWithOpenAutoFixPRCount + - findingsWithOpenTicketCount + - findingsResolvedCount + type: object + ModelsFindingsRepositoryMetrics: + properties: + findingsCount: + minimum: 0 + type: integer + findingsFalsePositiveCount: + minimum: 0 + type: integer + findingsFixedCount: + minimum: 0 + type: integer + findingsNoLongerDetectedCount: + minimum: 0 + type: integer + findingsOtherResolvedCount: + minimum: 0 + type: integer + findingsResolvedCount: + minimum: 0 + type: integer + meanTimeToResolve: + minimum: 0 + type: integer + medianTimeToResolve: + minimum: 0 + type: integer + platform: + type: string + repository: + type: string + repositoryId: + type: string + repositoryOwner: + type: string + required: + - repositoryId + - repository + - findingsCount + - findingsResolvedCount + type: object + ModelsForgeProductSettings: + properties: + compassEnabled: + type: boolean + confluenceEnabled: + type: boolean + confluenceSpaceIds: + items: + type: string + nullable: true + type: array + jiraEnabled: + type: boolean + revision: + format: int64 + type: integer + type: object + ModelsFrameworkControlSummary: + properties: + control: + type: string + critical: + minimum: 0 + type: integer + high: + minimum: 0 + type: integer + total: + minimum: 0 + type: integer + version: + type: string + required: + - control + - total + - critical + - high + type: object + ModelsFrameworkFindingsSummary: + properties: + assessed: + type: boolean + controls: + items: + $ref: '#/components/schemas/ModelsFrameworkControlSummary' + type: array + critical: + minimum: 0 + type: integer + framework: + type: string + high: + minimum: 0 + type: integer + source: + $ref: '#/components/schemas/ModelsFrameworkSource' + title: + type: string + total: + minimum: 0 + type: integer + version: + type: string + required: + - framework + - title + - source + - total + - critical + - high + - assessed + type: object + ModelsFrameworkSource: + enum: + - code + - cloud + type: string + ModelsGCPDiscoveryScope: + enum: + - PROJECTS + - ORGANIZATION + - FOLDER + type: string + ModelsGCPProjectInput: + properties: + displayName: + type: string + isDefault: + type: boolean + projectId: + type: string + type: + type: string + required: + - projectId + type: object + ModelsGCPProjectWithStatus: + properties: + accountType: + type: string + autoDiscovered: + type: boolean + isDefault: + type: boolean + isEnabled: + type: boolean + lastDiscoveredAt: + type: string + lastVerifiedAt: + type: string + lastVerifiedStatus: + type: string + projectId: + type: string + projectName: + type: string + state: + type: string + required: + - projectId + - isDefault + - isEnabled + - autoDiscovered + type: object + ModelsGitBuildStatus: + enum: + - IN_PROGRESS + - SUCCESS + - SKIPPED + - FAILURE + - UNKNOWN + type: string + ModelsGitHubCredentialSource: + enum: + - dedicated_direct + - shared_router + type: string + ModelsGitHubExecutionIdentity: + properties: + appID: + format: int64 + type: integer + proof: + type: string + source: + $ref: '#/components/schemas/ModelsGitHubCredentialSource' + type: object + ModelsGitHubGitPullRequest: + properties: + pullRequestNodeId: + description: The GraphQL node ID for the GitHub pull request + type: string + pullRequestNumber: + description: The GitHub pull request number + format: int64 + type: integer + required: + - pullRequestNumber + - pullRequestNodeId + type: object + ModelsGitHubGitRepositoryProvider: + properties: + hasIssue: + description: Whether the repository has GitHub Issues + type: boolean + nodeId: + description: The GitHub Node ID of the repository + type: string + owner: + description: The owner of the repository + type: string + ownerId: + description: The GitHub ID of the repository owner + format: int64 + type: integer + repositoryId: + description: The GitHub ID of the repository + format: int64 + type: integer + repositoryName: + description: The name of the GitHub repository + type: string + required: + - owner + - ownerId + - repositoryName + - repositoryId + - hasIssue + type: object + ModelsGitHubOwnerProvider: + properties: + baseUrl: + description: The GitHub base URL + type: string + executionIdentity: + $ref: '#/components/schemas/ModelsGitHubExecutionIdentity' + installationId: + description: The GitHub installation ID + format: int64 + type: integer + owner: + description: The GitHub owner name + type: string + ownerId: + description: The GitHub owner ID + format: int64 + type: integer + ownerType: + description: The GitHub owner type + type: string + required: + - installationId + - ownerId + - owner + - ownerType + - baseUrl + type: object + ModelsGitHubTicketProject: + properties: + repositoryId: + description: The GitHub repository ID + format: int64 + type: integer + repositoryName: + description: The GitHub repository name + type: string + repositoryNodeId: + description: The GraphQL node ID for the GitHub repository + type: string + required: + - repositoryId + - repositoryNodeId + - repositoryName + type: object + ModelsGitHubTicketProvider: + properties: + issueId: + description: The GitHub issue ID + format: int64 + type: integer + nodeId: + description: The GitHub issue GraphQL node ID + type: string + number: + description: The GitHub issue number + format: int64 + type: integer + repositoryName: + description: The GitHub issue repository name + type: string + url: + description: The GitHub issue URL + type: string + required: + - number + - issueId + - nodeId + - repositoryName + - url + type: object + ModelsGitHubUserProvider: + properties: + id: + format: int64 + type: integer + nodeId: + type: string + required: + - id + type: object + ModelsGitLabGitPullRequest: + properties: + mergeRequestNumber: + description: The GitLab merge request ID + format: int64 + type: integer + required: + - mergeRequestNumber + type: object + ModelsGitLabGitRepositoryProvider: + properties: + projectId: + description: The ID of the GitLab project + format: int64 + type: integer + projectName: + description: The name of the GitLab project + type: string + required: + - projectId + - projectName + type: object + ModelsGitLabOwnerProvider: + properties: + baseUrl: + description: The GitLab base URL + type: string + groupId: + description: The GitLab group ID + format: int64 + type: integer + groupName: + description: The GitLab group name + type: string + oauth: + type: boolean + required: + - groupId + - groupName + - baseUrl + type: object + ModelsGitLabTicketProject: + type: object + ModelsGitLabTicketProvider: + type: object + ModelsGitLabUserProvider: + properties: + id: + type: integer + required: + - id + type: object + ModelsGitPullRequestProvider: + properties: + azure: + $ref: '#/components/schemas/ModelsAzureGitPullRequest' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketGitPullRequest' + github: + $ref: '#/components/schemas/ModelsGitHubGitPullRequest' + gitlab: + $ref: '#/components/schemas/ModelsGitLabGitPullRequest' + id: + $ref: '#/components/schemas/ModelsProviderID' + type: object + ModelsGitRepositoryProvider: + properties: + azure: + $ref: '#/components/schemas/ModelsAzureGitRepositoryProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketGitRepositoryProvider' + github: + $ref: '#/components/schemas/ModelsGitHubGitRepositoryProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabGitRepositoryProvider' + id: + $ref: '#/components/schemas/ModelsProviderID' + type: object + ModelsGoogleWorkspaceOwnerProvider: + properties: + adminEmail: + description: Admin email to impersonate via domain-wide delegation + type: string + domain: + description: The Google Workspace domain + type: string + serviceAccountJson: + description: The service account JSON key + type: string + required: + - domain + - serviceAccountJson + type: object + ModelsGoogleWorkspaceUserProvider: + properties: + id: + type: string + required: + - id + type: object + ModelsGroundRule: + properties: + description: + type: string + id: + type: string + title: + type: string + required: + - id + - title + - description + type: object + ModelsInferenceRegion: + enum: + - global + - us + type: string + ModelsJiraConfig: + properties: + autoCreate: + type: boolean + createdAt: + type: string + defaultAssigneeId: + nullable: true + type: string + enabledFindingTypes: + items: + type: string + nullable: true + type: array + issueType: + type: string + priorityThreshold: + $ref: '#/components/schemas/ModelsPriorityLabel' + projectKey: + type: string + updatedAt: + type: string + required: + - priorityThreshold + - projectKey + - issueType + - createdAt + - updatedAt + - autoCreate + - enabledFindingTypes + type: object + ModelsJiraOwnerProvider: + properties: + baseUrl: + description: The Forge Jira API base URL + type: string + installationId: + description: The Jira installation ID + type: string + ownerId: + description: The Jira cloud ID + type: string + required: + - installationId + - ownerId + - baseUrl + type: object + ModelsJiraTicketProject: + properties: + id: + description: The Jira project ID + type: string + projectKey: + description: The Jira project key + type: string + required: + - id + - projectKey + type: object + ModelsJiraTicketProvider: + properties: + issueId: + description: The Jira issue ID + type: string + issueKey: + description: The Jira issue key + type: string + url: + description: The Jira issue URL + type: string + required: + - issueId + - issueKey + - url + type: object + ModelsJiraUserProvider: + properties: + id: + type: string + name: + type: string + required: + - id + type: object + ModelsK8SClusterInput: + properties: + cloudAccountId: + type: string + clusterName: + type: string + clusterType: + $ref: '#/components/schemas/ModelsK8SClusterType' + collectConfigMaps: + description: Collect v1 ConfigMaps. Omit to keep the stored value; new clusters default to true. + nullable: true + type: boolean + collectSecrets: + description: Collect v1 Secrets (metadata only). Omit to keep the stored value; new clusters default to true. + nullable: true + type: boolean + isEnabled: + type: boolean + region: + type: string + resourceId: + type: string + required: + - clusterName + - clusterType + type: object + ModelsK8SClusterType: + enum: + - EKS + - AKS + - GKE + - ON_PREM + type: string + ModelsK8SClusterWithStatus: + properties: + cloudAccountId: + type: string + clusterName: + type: string + clusterType: + $ref: '#/components/schemas/ModelsK8SClusterType' + collectConfigMaps: + description: Whether v1 ConfigMaps are collected. Absent from admins that predate the option; treat absence as true. + nullable: true + type: boolean + collectSecrets: + description: >- + Whether v1 Secrets (metadata only) are collected. Absent from admins that predate the option; treat absence + as true. + nullable: true + type: boolean + id: + type: string + isEnabled: + type: boolean + lastVerificationCode: + type: string + lastVerificationDetail: + type: string + lastVerifiedAt: + type: string + lastVerifiedStatus: + type: string + region: + type: string + resourceId: + type: string + scanIdentity: + type: string + required: + - id + - scanIdentity + - clusterName + - clusterType + type: object + ModelsLanguageName: + enum: + - Apex + - Bash + - Bicep + - CloudFormation + - Containerfile + - Custom Rules + - C + - Cairo + - Clojure + - C/C++ + - C++ + - C# + - Dart + - Elixir + - Erlang + - Generic + - Go + - Haskell + - HCL + - HTML + - Java + - JavaScript + - JSON + - Jsonnet + - Julia + - Kotlin + - Kubernetes + - Lisp + - Lua + - OCaml + - OpenAPI + - PHP + - Python + - R + - Renovate + - Ruby + - Rust + - Scala + - Scheme + - Serverless + - Shell + - Solidity + - SQL + - Swift + - Terraform + - TypeScript + - YAML + - XML + type: string + ModelsLimitedUnifiedFindingsQuery: + properties: + aiGenerated: + description: >- + AI code review findings (Code type) only when true; pentest and bug hunt findings never match. False keeps + rule-scanner Code findings and every other type. + nullable: true + type: boolean + appName: + items: + type: string + nullable: true + type: array + asOf: + nullable: true + type: string + autoFixState: + items: + type: string + nullable: true + type: array + branch: + items: + type: string + nullable: true + type: array + campaignId: + nullable: true + type: string + cve: + items: + type: string + nullable: true + type: array + cwe: + items: + type: string + nullable: true + type: array + exploitValidated: + nullable: true + type: boolean + fileOwner: + items: + type: string + nullable: true + type: array + findingId: + items: + type: string + nullable: true + type: array + fixEvidence: + items: + type: string + nullable: true + type: array + frameworks: + items: + type: string + nullable: true + type: array + fromDate: + nullable: true + type: string + fromPriorityScore: + nullable: true + type: integer + hasAutoFix: + nullable: true + type: boolean + hasMultipleVersions: + nullable: true + type: boolean + hasTicket: + nullable: true + type: boolean + hasTicketOrPR: + nullable: true + type: boolean + host: + items: + type: string + nullable: true + type: array + imageName: + items: + type: string + nullable: true + type: array + importantMaxDays: + nullable: true + type: integer + includeEmpty: + nullable: true + type: boolean + informationalMaxDays: + nullable: true + type: integer + isAllowlisted: + nullable: true + type: boolean + isArchived: + nullable: true + type: boolean + isAutofixed: + nullable: true + type: boolean + isDefaultBranch: + description: SAST/SCA/SCPM current-roster branch filter; missing metadata is excluded; other types pass through + nullable: true + type: boolean + isDirect: + nullable: true + type: boolean + isFalsePositive: + nullable: true + type: boolean + isFixed: + nullable: true + type: boolean + isInternetReachable: + nullable: true + type: boolean + isPushWorkflow: + nullable: true + type: boolean + isRepositoryArchived: + nullable: true + type: boolean + isResolved: + nullable: true + type: boolean + language: + items: + type: string + nullable: true + type: array + metricState: + items: + type: string + nullable: true + type: array + notfindingId: + items: + type: string + nullable: true + type: array + package: + items: + type: string + nullable: true + type: array + platform: + items: + type: string + nullable: true + type: array + priorityLabel: + items: + type: string + nullable: true + type: array + repository: + items: + type: string + nullable: true + type: array + repositoryId: + items: + type: string + nullable: true + type: array + ruleId: + items: + type: string + nullable: true + type: array + scanRunId: + items: + type: string + nullable: true + type: array + search: + nullable: true + type: string + secretType: + items: + type: string + nullable: true + type: array + secretValidated: + nullable: true + type: boolean + severity: + items: + type: string + nullable: true + type: array + severityConfidence: + items: + type: string + nullable: true + type: array + sort: + items: + additionalProperties: + additionalProperties: {} + type: object + type: object + nullable: true + type: array + sortPreset: + $ref: '#/components/schemas/ModelsUnifiedFindingsSortPreset' + nullable: true + teamIDs: + items: + type: string + nullable: true + type: array + tenantId: + nullable: true + type: string + toDate: + nullable: true + type: string + toPriorityScore: + nullable: true + type: integer + type: + items: + type: string + nullable: true + type: array + urgentMaxDays: + nullable: true + type: integer + type: object + ModelsLinearInstallState: + enum: + - unavailable + - not_installed + - credentials_rejected + - reconnect_required + - installed + type: string + ModelsLinearOwnerProvider: + properties: + accessToken: + description: The Linear access token + type: string + clientId: + description: The Linear client ID + type: string + clientSecret: + description: The Linear client secret + type: string + urlKey: + description: The Linear domain key + type: string + workspaceId: + description: The Linear workspace ID + type: string + workspaceName: + description: The Linear workspace name + type: string + required: + - clientId + - clientSecret + - workspaceName + - workspaceId + - urlKey + type: object + ModelsLinearTicketProject: + properties: + projectId: + description: The Linear project ID + type: string + teamId: + description: The Linear team ID + type: string + teamKey: + description: The Linear team key + type: string + required: + - teamKey + - teamId + type: object + ModelsLinearTicketProvider: + properties: + issueId: + description: The Linear issue ID + type: string + teamId: + description: The Linear team ID + type: string + url: + description: The Linear issue URL + type: string + required: + - issueId + - url + - teamId + type: object + ModelsLinearUserProvider: + properties: + id: + type: string + required: + - id + type: object + ModelsMessageChannel: + properties: + channelProvider: + $ref: '#/components/schemas/ModelsMessageChannelProvider' + description: + type: string + name: + type: string + ownerProvider: + $ref: '#/components/schemas/ModelsOwnerProvider' + required: + - ownerProvider + - channelProvider + - name + - description + type: object + ModelsMessageChannelProvider: + properties: + id: + $ref: '#/components/schemas/ModelsProviderID' + slack: + $ref: '#/components/schemas/ModelsSlackMessageChannelProvider' + teams: + $ref: '#/components/schemas/ModelsTeamsMessageChannelProvider' + required: + - id + type: object + ModelsMetricsResolution: + enum: + - hour + - day + - week + type: string + ModelsNotification: + properties: + events: + $ref: '#/components/schemas/ModelsNotificationEvents' + repositories: + items: + type: string + type: array + targets: + $ref: '#/components/schemas/ModelsNotificationTargets' + type: object + ModelsNotificationEventAll: + properties: + cves: + items: + type: string + type: array + cwes: + items: + type: integer + type: array + minimumPriority: + type: integer + minimumSeverity: + $ref: '#/components/schemas/ModelsSeverity' + secretTypes: + items: + type: string + type: array + type: object + ModelsNotificationEventNewAPIFindings: + properties: + cwes: + items: + type: integer + type: array + minimumPriority: + type: integer + minimumSeverity: + $ref: '#/components/schemas/ModelsSeverity' + type: object + ModelsNotificationEventNewCloudFindings: + properties: + cloudProviders: + items: + type: string + type: array + minimumPriority: + type: integer + minimumSeverity: + $ref: '#/components/schemas/ModelsSeverity' + type: object + ModelsNotificationEventNewCodeFindings: + properties: + cwes: + items: + type: integer + type: array + minimumPriority: + type: integer + minimumSeverity: + $ref: '#/components/schemas/ModelsSeverity' + type: object + ModelsNotificationEventNewDependencyFindings: + properties: + cves: + items: + type: string + type: array + cwes: + items: + type: integer + type: array + minimumPriority: + type: integer + minimumSeverity: + $ref: '#/components/schemas/ModelsSeverity' + type: object + ModelsNotificationEventNewSecretFindings: + properties: + types: + items: + type: string + type: array + type: object + ModelsNotificationEventNewSupplyChainFindings: + properties: + findingTypes: + items: + type: string + type: array + minimumSeverity: + $ref: '#/components/schemas/ModelsSeverity' + type: object + ModelsNotificationEventThreatIntel: + properties: + cves: + items: + type: string + type: array + ecosystems: + items: + type: string + type: array + minimumSeverity: + $ref: '#/components/schemas/ModelsSeverity' + type: object + ModelsNotificationEvents: + properties: + all: + $ref: '#/components/schemas/ModelsNotificationEventAll' + newApiFindings: + $ref: '#/components/schemas/ModelsNotificationEventNewAPIFindings' + newCloudFindings: + $ref: '#/components/schemas/ModelsNotificationEventNewCloudFindings' + newCodeFindings: + $ref: '#/components/schemas/ModelsNotificationEventNewCodeFindings' + newDependencyFindings: + $ref: '#/components/schemas/ModelsNotificationEventNewDependencyFindings' + newSecretFindings: + $ref: '#/components/schemas/ModelsNotificationEventNewSecretFindings' + newSupplyChainFindings: + $ref: '#/components/schemas/ModelsNotificationEventNewSupplyChainFindings' + threatIntel: + $ref: '#/components/schemas/ModelsNotificationEventThreatIntel' + type: object + ModelsNotificationTargetEmail: + properties: + address: + type: string + addresses: + items: + type: string + type: array + type: object + ModelsNotificationTargetSlack: + properties: + channel: + type: string + channels: + items: + type: string + type: array + type: object + ModelsNotificationTargetWebhook: + properties: + url: + type: string + urls: + items: + type: string + type: array + type: object + ModelsNotificationTargets: + properties: + email: + $ref: '#/components/schemas/ModelsNotificationTargetEmail' + slack: + $ref: '#/components/schemas/ModelsNotificationTargetSlack' + webhook: + $ref: '#/components/schemas/ModelsNotificationTargetWebhook' + type: object + ModelsOccurrence: + properties: + columnNumber: + description: Column number in file + type: integer + excerpt: + description: Code excerpt + type: string + fileName: + description: Name of the file + type: string + lineNumber: + description: Line number in file + type: integer + sample: + description: Sample code snippet + type: string + required: + - sample + - lineNumber + - columnNumber + - fileName + - excerpt + type: object + ModelsOktaOwnerProvider: + properties: + apiToken: + description: The Okta API token + type: string + domain: + description: The Okta domain (e.g. dev-12345.okta.com) + type: string + required: + - domain + - apiToken + type: object + ModelsOktaUserProvider: + properties: + id: + type: string + required: + - id + type: object + ModelsOrganization: + properties: + id: + type: string + members: + items: + $ref: '#/components/schemas/ModelsUser' + nullable: true + type: array + name: + type: string + provider: + $ref: '#/components/schemas/ModelsOwnerProvider' + slug: + type: string + teams: + items: + $ref: '#/components/schemas/ModelsTeam' + nullable: true + type: array + required: + - provider + - id + - name + - slug + - teams + - members + type: object + ModelsOverviewBotSignal: + properties: + botPullRequests: + format: int64 + type: integer + issuesFoundInPullRequests: + format: int64 + type: integer + ratio: + $ref: '#/components/schemas/MetricdefsRatio' + required: + - issuesFoundInPullRequests + - botPullRequests + - ratio + type: object + ModelsOverviewCanonical: + properties: + fixes: + $ref: '#/components/schemas/ModelsOverviewFixes' + funnel: + items: + $ref: '#/components/schemas/ModelsOverviewFunnelStage' + nullable: true + type: array + lifecycle: + $ref: '#/components/schemas/ModelsOverviewLifecycle' + period: + $ref: '#/components/schemas/MetricdefsPeriod' + posture: + items: + $ref: '#/components/schemas/MetricdefsSpoke' + nullable: true + type: array + priority: + $ref: '#/components/schemas/ModelsOverviewPriorityBands' + pullRequests: + $ref: '#/components/schemas/ModelsOverviewPullRequests' + scope: + $ref: '#/components/schemas/ModelsOverviewScope' + severity: + $ref: '#/components/schemas/ModelsOverviewSeverityBands' + severityFunnels: + items: + $ref: '#/components/schemas/ModelsOverviewSeverityFunnel' + nullable: true + type: array + timeToResolve: + $ref: '#/components/schemas/ModelsOverviewTimeToResolve' + types: + items: + $ref: '#/components/schemas/ModelsOverviewTypeTile' + nullable: true + type: array + required: + - period + - scope + - lifecycle + - fixes + - severity + - severityFunnels + - priority + - funnel + - timeToResolve + - posture + - pullRequests + - types + type: object + ModelsOverviewFixEvidenceCounts: + properties: + baseImageChanged: + format: int64 + type: integer + dependencyRemoved: + format: int64 + type: integer + dependencyVersionChanged: + format: int64 + type: integer + fileRemoved: + format: int64 + type: integer + mergedFixPr: + format: int64 + type: integer + vulnerableLinesChanged: + format: int64 + type: integer + required: + - mergedFixPr + - vulnerableLinesChanged + - fileRemoved + - dependencyVersionChanged + - dependencyRemoved + - baseImageChanged + type: object + ModelsOverviewFixes: + properties: + byEvidence: + $ref: '#/components/schemas/ModelsOverviewFixEvidenceCounts' + dismissed: + format: int64 + type: integer + inPeriod: + format: int64 + type: integer + inPeriodStillReported: + format: int64 + type: integer + inPreviousPeriod: + format: int64 + type: integer + pendingVerification: + format: int64 + type: integer + removedWithMergedPrInPeriod: + format: int64 + type: integer + shippedInPeriod: + format: int64 + type: integer + toDate: + format: int64 + type: integer + required: + - toDate + - inPeriod + - inPeriodStillReported + - inPreviousPeriod + - removedWithMergedPrInPeriod + - shippedInPeriod + - pendingVerification + - dismissed + - byEvidence + type: object + ModelsOverviewFunnelStage: + properties: + count: + format: int64 + type: integer + key: + type: string + label: + type: string + required: + - key + - label + - count + type: object + ModelsOverviewLifecycle: + properties: + allowlisted: + format: int64 + type: integer + archived: + format: int64 + type: integer + duplicate: + format: int64 + type: integer + falsePositive: + format: int64 + type: integer + fixPendingVerification: + format: int64 + type: integer + fixed: + format: int64 + type: integer + noLongerDetected: + format: int64 + type: integer + open: + format: int64 + type: integer + required: + - open + - fixed + - fixPendingVerification + - noLongerDetected + - falsePositive + - allowlisted + - archived + - duplicate + type: object + ModelsOverviewPriorityBands: + properties: + important: + format: int64 + type: integer + negligible: + format: int64 + type: integer + urgent: + format: int64 + type: integer + required: + - urgent + - important + - negligible + type: object + ModelsOverviewPullRequests: + properties: + botSignal: + $ref: '#/components/schemas/ModelsOverviewBotSignal' + byType: + $ref: '#/components/schemas/ModelsPullRequestTypeCounts' + closed: + format: int64 + type: integer + closedUnmergedInPeriod: + format: int64 + type: integer + createdInPeriod: + format: int64 + type: integer + distinct: + format: int64 + type: integer + draft: + format: int64 + type: integer + mergeReady: + $ref: '#/components/schemas/MetricdefsRatio' + merged: + format: int64 + type: integer + mergedAtWithoutMergedStatus: + format: int64 + type: integer + mergedInPeriod: + format: int64 + type: integer + open: + format: int64 + type: integer + timeToMerge: + $ref: '#/components/schemas/ModelsDurationStats' + unclassified: + format: int64 + type: integer + required: + - distinct + - open + - merged + - closed + - draft + - createdInPeriod + - mergedInPeriod + - closedUnmergedInPeriod + - byType + - mergeReady + - unclassified + - mergedAtWithoutMergedStatus + - timeToMerge + - botSignal + type: object + ModelsOverviewScope: + properties: + description: + type: string + open: + format: int64 + type: integer + openFailedTriage: + format: int64 + type: integer + openUntriaged: + format: int64 + type: integer + total: + format: int64 + type: integer + required: + - description + - total + - open + - openUntriaged + - openFailedTriage + type: object + ModelsOverviewSeverityBands: + properties: + critical: + format: int64 + type: integer + high: + format: int64 + type: integer + info: + format: int64 + type: integer + low: + format: int64 + type: integer + medium: + format: int64 + type: integer + unrated: + format: int64 + type: integer + required: + - critical + - high + - medium + - low + - info + - unrated + type: object + ModelsOverviewSeverityFunnel: + properties: + critical: + format: int64 + type: integer + high: + format: int64 + type: integer + info: + format: int64 + type: integer + key: + type: string + low: + format: int64 + type: integer + medium: + format: int64 + type: integer + unrated: + format: int64 + type: integer + required: + - key + - critical + - high + - medium + - low + - info + - unrated + type: object + ModelsOverviewTimeToResolve: + properties: + inPeriod: + $ref: '#/components/schemas/ModelsDurationStats' + toDate: + $ref: '#/components/schemas/ModelsDurationStats' + required: + - toDate + - inPeriod + type: object + ModelsOverviewTypeTile: + properties: + important: + format: int64 + type: integer + key: + type: string + label: + type: string + negligible: + format: int64 + type: integer + open: + format: int64 + type: integer + urgent: + format: int64 + type: integer + required: + - key + - label + - open + - urgent + - important + - negligible + type: object + ModelsOwnerProvider: + properties: + asana: + $ref: '#/components/schemas/ModelsAsanaOwnerProvider' + azure: + $ref: '#/components/schemas/ModelsAzureOwnerProvider' + azureEntra: + $ref: '#/components/schemas/ModelsAzureEntraOwnerProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketOwnerProvider' + external: + $ref: '#/components/schemas/ModelsExternalOwnerProvider' + github: + $ref: '#/components/schemas/ModelsGitHubOwnerProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabOwnerProvider' + googleWorkspace: + $ref: '#/components/schemas/ModelsGoogleWorkspaceOwnerProvider' + id: + $ref: '#/components/schemas/ModelsProviderID' + jira: + $ref: '#/components/schemas/ModelsJiraOwnerProvider' + linear: + $ref: '#/components/schemas/ModelsLinearOwnerProvider' + okta: + $ref: '#/components/schemas/ModelsOktaOwnerProvider' + slack: + $ref: '#/components/schemas/ModelsSlackOwnerProvider' + teams: + $ref: '#/components/schemas/ModelsTeamsOwnerProvider' + required: + - id + type: object + ModelsOwnerType: + enum: + - email + - team + - username + type: string + ModelsPII: + properties: + collections: + description: List of data collections + items: + $ref: '#/components/schemas/ModelsCollection' + nullable: true + type: array + language: + description: The programming language + type: string + probableSinks: + description: List of probable data sinks + items: + type: string + nullable: true + type: array + processing: + description: List of processing activities + items: + $ref: '#/components/schemas/ModelsProcessing' + nullable: true + type: array + sinkProcessing: + description: List of sink processing activities + items: + $ref: '#/components/schemas/ModelsSinkProcessing' + nullable: true + type: array + sources: + description: List of data sources + items: + $ref: '#/components/schemas/ModelsSource' + nullable: true + type: array + required: + - language + - processing + - sources + - probableSinks + - sinkProcessing + - collections + type: object + ModelsPathScope: + properties: + exclude: + items: + type: string + type: array + include: + items: + type: string + type: array + type: object + ModelsPriorityEnum: + enum: + - FALSE_POSITIVE + - IMPORTANT + - INFORMATIONAL + - LOW + - MEDIUM + - NEGLIGIBLE + - UNKNOWN + - URGENT + type: string + ModelsPriorityLabel: + enum: + - URGENT + - IMPORTANT + - MEDIUM + - INFORMATIONAL + - LOW + - NEGLIGIBLE + - FALSE_POSITIVE + - UNKNOWN + type: string + ModelsPrioritySource: + enum: + - TRIAGE + - SCANNER + type: string + ModelsProcessing: + properties: + occurrences: + description: List of occurrences + items: + $ref: '#/components/schemas/ModelsOccurrence' + nullable: true + type: array + sourceId: + description: ID of the source + type: string + required: + - sourceId + - occurrences + type: object + ModelsProviderID: + enum: + - DX + - Nullify + - GitHub + - Bitbucket + - Azure + - GitLab + - Okta + - GoogleWorkspace + - AzureEntra + - GitHubNullify + - Jira + - Linear + - Asana + - Slack + - Teams + - AWS + - AzureCloud + - GCP + - Alibaba + - Oracle + - IBM + - DigitalOcean + - Heroku + - Datadog + - Grafana + - NewRelic + - Splunk + - Elastic + - Confluence + - Notion + - GoogleDrive + - SharePoint + - Buildkite + - Jenkins + - CircleCI + - CodeBuild + - Drone + - Semaphore + - TeamCity + - AzurePipelines + - Codefresh + - MicrosoftSentinel + - GenericSIEM + - Vanta + - Drata + - Secureframe + - Scrut + - Delve + - ServiceNowVR + - Tenable + - Kenna + - ArmorCode + - Brinqa + - Nucleus + - Phoenix + - Wiz + - Email + - Webhook + - PagerDuty + - Opsgenie + - ECR + - ACR + - GCR + - DockerHub + - Artifactory + - Harbor + - Quay + - GHCR + - GitLabRegistry + - PrivateNpm + - PrivateMaven + - PrivatePyPI + - PrivateGoProxy + - ArtifactoryPackages + - NexusPackages + - AWSCodeArtifact + - GitHubPackages + - GoogleArtifactRegistry + - External + - RepositoryProperty + type: string + ModelsPullRequestCIState: + enum: + - pending + - success + - failure + type: string + ModelsPullRequestClosedBy: + enum: + - nullify_operator + - git_platform_user + type: string + ModelsPullRequestDefinitions: + properties: + byType: + $ref: '#/components/schemas/ModelsPullRequestTypeCounts' + closed: + format: int64 + type: integer + closedUnmergedInPeriod: + format: int64 + type: integer + createdInPeriod: + format: int64 + type: integer + distinct: + format: int64 + type: integer + draft: + format: int64 + type: integer + mergeReady: + $ref: '#/components/schemas/MetricdefsRatio' + merged: + format: int64 + type: integer + mergedAtWithoutMergedStatus: + format: int64 + type: integer + mergedInPeriod: + format: int64 + type: integer + open: + format: int64 + type: integer + timeToMerge: + $ref: '#/components/schemas/ModelsDurationStats' + unclassified: + format: int64 + type: integer + required: + - distinct + - open + - merged + - closed + - draft + - createdInPeriod + - mergedInPeriod + - closedUnmergedInPeriod + - byType + - mergeReady + - unclassified + - mergedAtWithoutMergedStatus + - timeToMerge + type: object + ModelsPullRequestInfo: + properties: + ciCheckedAt: + format: date-time + nullable: true + type: string + ciDetailUrl: + nullable: true + type: string + ciState: + $ref: '#/components/schemas/ModelsPullRequestCIState' + nullable: true + createdAt: + format: date-time + type: string + explanation: + type: string + firstReviewedAt: + format: date-time + nullable: true + type: string + hasCustomerCommit: + nullable: true + type: boolean + hasCustomerFeedback: + nullable: true + type: boolean + id: + type: integer + lastReviewedAt: + format: date-time + nullable: true + type: string + link: + type: string + mergedAt: + format: date-time + nullable: true + type: string + pullRequestProvider: + $ref: '#/components/schemas/ModelsGitPullRequestProvider' + recordId: + type: string + status: + $ref: '#/components/schemas/ModelsPullRequestState' + title: + type: string + updatedAt: + format: date-time + nullable: true + type: string + required: + - pullRequestProvider + - id + - link + - status + - explanation + - createdAt + type: object + ModelsPullRequestMetrics: + properties: + definitions: + $ref: '#/components/schemas/ModelsPullRequestDefinitions' + period: + $ref: '#/components/schemas/MetricdefsPeriod' + required: + - period + - definitions + type: object + ModelsPullRequestMetricsQuery: + properties: + findingType: + items: + type: string + nullable: true + type: array + fromDate: + nullable: true + type: string + platform: + items: + type: string + nullable: true + type: array + prType: + items: + type: string + nullable: true + type: array + repositoryId: + items: + type: string + nullable: true + type: array + repositoryOwner: + items: + type: string + nullable: true + type: array + toDate: + nullable: true + type: string + type: object + ModelsPullRequestRecoveryObservation: + properties: + detail: + type: string + disposition: + type: string + kind: + type: string + observedAt: + format: date-time + type: string + stuckDetectedAt: + format: date-time + nullable: true + type: string + stuckReason: + nullable: true + type: string + required: + - kind + - observedAt + - disposition + type: object + ModelsPullRequestReviewState: + enum: + - APPROVED + - CHANGES_REQUESTED + - DISMISSED + - COMMENTED + type: string + ModelsPullRequestState: + enum: + - open + - closed + - merged + - unknown + type: string + ModelsPullRequestStateWithDiffs: + properties: + diffs: + items: + $ref: '#/components/schemas/ModelsDiffFile' + nullable: true + type: array + id: + type: string + state: + type: string + url: + type: string + required: + - id + - url + - state + - diffs + type: object + ModelsPullRequestTypeCounts: + properties: + allowlist: + format: int64 + type: integer + autofix: + format: int64 + type: integer + manualFix: + format: int64 + type: integer + required: + - autofix + - allowlist + - manualFix + type: object + ModelsRemediationFunnel: + properties: + aging: + $ref: '#/components/schemas/ModelsRemediationFunnelAging' + fixSourceBreakdown: + additionalProperties: + minimum: 0 + type: integer + nullable: true + type: object + stages: + $ref: '#/components/schemas/ModelsRemediationFunnelStages' + version: + type: integer + required: + - version + - stages + - aging + - fixSourceBreakdown + type: object + ModelsRemediationFunnelAging: + properties: + cachedNoPr: + $ref: '#/components/schemas/ModelsStageAge' + prOpenReviewedUnmerged: + $ref: '#/components/schemas/ModelsStageAge' + prOpenUnreviewed: + $ref: '#/components/schemas/ModelsStageAge' + required: + - cachedNoPr + - prOpenUnreviewed + - prOpenReviewedUnmerged + type: object + ModelsRemediationFunnelStages: + properties: + cachedNoPr: + minimum: 0 + type: integer + detected: + minimum: 0 + type: integer + prMerged: + minimum: 0 + type: integer + prOpenReviewed: + minimum: 0 + type: integer + prOpenUnreviewed: + minimum: 0 + type: integer + triaged: + minimum: 0 + type: integer + verifiedFixed: + minimum: 0 + type: integer + required: + - detected + - triaged + - cachedNoPr + - prOpenUnreviewed + - prOpenReviewed + - prMerged + - verifiedFixed + type: object + ModelsRepository: + properties: + cloneURL: + description: URL used to clone the repository + type: string + createdAt: + type: string + defaultBranch: + description: Name of the default branch + type: string + description: + type: string + forksCount: + type: integer + fullName: + description: The full name of the repository + type: string + hasIssues: + description: Whether issues are enabled for this repository + type: boolean + head: + description: Current HEAD commit SHA + type: string + htmlURL: + type: string + id: + description: The ID for the repository + type: string + isArchived: + description: Whether this repository is archived + type: boolean + isFork: + type: boolean + isGlobalConfig: + description: Whether this is a global config repository + type: boolean + isInitialized: + description: Whether this repository has been initialized + type: boolean + isPublic: + description: Whether this is a public repository + type: boolean + language: + type: string + license: + type: string + name: + description: Name of the repository + type: string + openIssues: + type: integer + ownerProvider: + $ref: '#/components/schemas/ModelsOwnerProvider' + provider: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + pushedAt: + type: string + repoSizeBytes: + description: Size of the repository in bytes + format: int64 + type: integer + repoSizeGiB: + description: Size of the repository in GiB + format: int32 + type: integer + starCount: + type: integer + topics: + items: + type: string + type: array + updatedAt: + type: string + visibility: + type: string + required: + - provider + - ownerProvider + - id + - name + - fullName + - isGlobalConfig + - hasIssues + - isPublic + - isInitialized + - isArchived + - cloneURL + - repoSizeGiB + - defaultBranch + - head + type: object + ModelsRepositoryPublic: + properties: + codePaths: + $ref: '#/components/schemas/ModelsPathScope' + countsBySeverity: + additionalProperties: + type: integer + description: Count of findings by severity level + nullable: true + type: object + countsByType: + additionalProperties: + type: integer + description: Count of findings by type + nullable: true + type: object + defaultBranch: + description: Default branch name + type: string + defaultBranchCommittedAt: + description: Timestamp of the default branch HEAD commit + format: date-time + nullable: true + type: string + defaultBranchSha: + description: HEAD commit SHA of the default branch + type: string + excluded: + description: The customer excluded the repository from scanning; applies only while scoping is off + type: boolean + id: + description: Unique identifier for the repository + type: string + isArchived: + description: Whether the repository is archived on its source platform + type: boolean + isDefaultBranch: + description: Whether this is the default branch + type: boolean + isEnrolled: + description: Whether the repository is enrolled (selected) for scanning + type: boolean + language: + description: Primary detected language of the repository + type: string + languages: + description: All detected languages of the repository + items: + type: string + nullable: true + type: array + owner: + description: Repository owner name + type: string + ownerType: + description: Type of repository owner (user/organization) + type: string + pii: + $ref: '#/components/schemas/ModelsPII' + platform: + description: Git platform name + type: string + repoSizeBytes: + description: Repository disk size in bytes + nullable: true + type: integer + repository: + description: Repository name + type: string + repositoryId: + description: Repository identifier + type: string + sbom: + description: Software Bill of Materials + type: string + scanScope: + $ref: '#/components/schemas/ModelsScanScopeExplanation' + scopeUpdatedAt: + description: >- + When the repository's scan scope was last changed; send it back as expectedScopeUpdatedAt. Absent when never + changed + format: date-time + nullable: true + type: string + secretsEnrolled: + description: Whether the repository is enrolled for secrets scanning (read while secretsMode is independent) + type: boolean + secretsExcludes: + description: >- + Directories the customer set secrets scanning to skip, as stored and whether or not the repository is in + scope; scanScope.secretsExcludes is what scans apply + items: + type: string + nullable: true + type: array + tenantId: + description: Tenant identifier + type: string + timestamp: + description: Timestamp of last scan + type: string + timestampUnix: + description: Unix timestamp of last scan + format: int64 + type: integer + required: + - id + - countsBySeverity + - sbom + - countsByType + - timestamp + - timestampUnix + - owner + - ownerType + - tenantId + - repository + - repositoryId + - isDefaultBranch + - platform + - isArchived + - isEnrolled + type: object + ModelsSCPMEnforcement: + properties: + mode: + $ref: '#/components/schemas/ModelsSCPMRuleMode' + severity: + $ref: '#/components/schemas/ModelsSeverity' + source: + $ref: '#/components/schemas/ModelsSCPMEnforcementSource' + suppressed: + type: boolean + suppressedBy: + $ref: '#/components/schemas/ModelsSCPMRuleSuppression' + required: + - mode + - severity + - suppressed + type: object + ModelsSCPMEnforcementSource: + enum: + - default + - organization + - repository + type: string + ModelsSCPMFindingMovement: + properties: + commitHash: + type: string + commitTime: + type: string + endLine: + type: integer + filePath: + type: string + packageVersion: + type: string + previousCommitHash: + type: string + previousFilePath: + type: string + reason: + type: string + startLine: + type: integer + required: + - reason + - commitHash + - filePath + type: object + ModelsSCPMRuleMode: + enum: + - 'off' + - warn + - block + type: string + ModelsSCPMRuleSuppression: + enum: + - '' + - rule_off + - path_excluded + - severity_floor + type: string + ModelsSLA: + properties: + allowExtensions: + type: boolean + id: + type: string + maxDaysToFix: + type: integer + priority: + $ref: '#/components/schemas/ModelsPriorityLabel' + severity: + $ref: '#/components/schemas/ModelsSeverity' + required: + - severity + - priority + - maxDaysToFix + - allowExtensions + type: object + ModelsScanFamily: + enum: + - code + - secrets + type: string + ModelsScanScope: + properties: + code: + $ref: '#/components/schemas/ModelsFamilyScope' + scoped: + type: boolean + secrets: + $ref: '#/components/schemas/ModelsFamilyScope' + type: object + ModelsScanScopeAvailability: + enum: + - in_scope + - customer_disabled + - staff_excluded + - github_not_installed + - unknown + type: string + ModelsScanScopeExplanation: + description: >- + lockedBy: who holds the repository out of the customer's reach: github when the platform no longer shares it, + staff when the staff allowlist leaves it out. staff still lets the customer un-enroll the repository and edit + its directories. none does not mean enrolling fits: check the entitlement's usage against its cap. An unscoped + tenant reports in_scope alongside lockedBy github for an inactive or missing row; lockedBy is authoritative for + display only, never for whether a family scans + properties: + code: + $ref: '#/components/schemas/ModelsScanScopeFamilyExplanation' + codePaths: + $ref: '#/components/schemas/ModelsScanScopePathProvenance' + lockedBy: + $ref: '#/components/schemas/ModelsScanScopeLock' + secrets: + $ref: '#/components/schemas/ModelsScanScopeFamilyExplanation' + secretsExcludes: + description: >- + Directories the customer set secrets scanning to skip, cleaned as scans apply them; reported also while the + repository is out of scope + items: + type: string + nullable: true + type: array + required: + - code + - secrets + - lockedBy + - codePaths + - secretsExcludes + type: object + ModelsScanScopeFamilyExplanation: + description: >- + reason: in_scope, or the first level that keeps the family out: github_not_installed, staff_excluded, then + customer_disabled. unknown is out of scope for a reason none of those names: treat it as out of scope and not + changeable + properties: + inScope: + type: boolean + reason: + $ref: '#/components/schemas/ModelsScanScopeAvailability' + required: + - inScope + - reason + type: object + ModelsScanScopeLock: + enum: + - none + - staff + - github + type: string + ModelsScanScopePathProvenance: + description: >- + effective: the directories code scans read, the customer rules cut to the staff rules, an empty scope being the + whole repository; absent when code scans read nothing, because code is out of scope or every stored include is + invalid. staff: the directories Nullify limits code scanning to and skips, as stored. customer: the directories + the customer chose, as stored + properties: + customer: + $ref: '#/components/schemas/ModelsPathScope' + effective: + $ref: '#/components/schemas/ModelsPathScope' + staff: + $ref: '#/components/schemas/ModelsPathScope' + required: + - staff + - customer + type: object + ModelsScanScopeReason: + enum: + - unscoped + - enrolled + - not_enrolled + - not_synced + - inactive + - not_allowlisted + - outside_staff_paths + - excluded + type: string + ModelsSecretsValidationResult: + enum: + - INVALID + - UNKNOWN + - VALID + type: string + ModelsSensitivity: + enum: + - LOW + - MEDIUM + - HIGH + type: string + ModelsSeverity: + enum: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - NONE + - INFORMATIONAL + - UNKNOWN + type: string + ModelsSinkProcessing: + properties: + occurrences: + description: List of occurrences + items: + $ref: '#/components/schemas/ModelsOccurrence' + nullable: true + type: array + sinkId: + description: ID of the sink + type: string + required: + - sinkId + - occurrences + type: object + ModelsSlackMessageChannelProvider: + properties: + id: + description: The Slack message channel ID + type: string + thread_ts: + description: The Slack message thread timestamp + type: string + required: + - id + type: object + ModelsSlackOwnerProvider: + properties: + teamId: + description: The Slack team ID + type: string + required: + - teamId + type: object + ModelsSlackUserProvider: + properties: + id: + type: string + name: + type: string + required: + - id + type: object + ModelsSource: + properties: + category: + description: Category of the source + type: string + id: + description: Unique identifier + type: string + isSensitive: + description: Whether the source contains sensitive data + type: boolean + name: + description: Name of the source + type: string + sensitivity: + $ref: '#/components/schemas/ModelsSensitivity' + sourceType: + description: Type of the source + type: string + tags: + $ref: '#/components/schemas/ModelsDataMap' + required: + - sourceType + - id + - name + - category + - sensitivity + - isSensitive + - tags + type: object + ModelsStageAge: + properties: + count: + minimum: 0 + type: integer + oldestMs: + minimum: 0 + type: integer + p50Ms: + minimum: 0 + type: integer + p90Ms: + minimum: 0 + type: integer + required: + - count + - p50Ms + - p90Ms + - oldestMs + type: object + ModelsStageSampleSizes: + properties: + autofix: + minimum: 0 + type: integer + detectAndTriage: + minimum: 0 + type: integer + detectAndTriageAfterOutliers: + minimum: 0 + type: integer + merge: + minimum: 0 + type: integer + mergeAfterOutliers: + minimum: 0 + type: integer + pullRequestCreation: + minimum: 0 + type: integer + pullRequestCreationAfterOutliers: + minimum: 0 + type: integer + review: + minimum: 0 + type: integer + reviewAfterOutliers: + minimum: 0 + type: integer + triage: + minimum: 0 + type: integer + type: object + ModelsSubCollection: + properties: + occurrences: + description: List of occurrences + items: + $ref: '#/components/schemas/ModelsOccurrence' + nullable: true + type: array + sourceId: + description: ID of the source + type: string + required: + - occurrences + - sourceId + type: object + ModelsTeam: + properties: + azure: + $ref: '#/components/schemas/ModelsTeamProviderAzure' + codeOwnerships: + items: + $ref: '#/components/schemas/ModelsTeamCodeOwnership' + type: array + github: + $ref: '#/components/schemas/ModelsTeamProviderGitHub' + gitlab: + $ref: '#/components/schemas/ModelsTeamProviderGitLab' + groundRules: + items: + $ref: '#/components/schemas/ModelsGroundRule' + type: array + id: + type: string + jira: + $ref: '#/components/schemas/ModelsTeamProviderJira' + lead: + $ref: '#/components/schemas/ModelsUser' + leadId: + type: string + linear: + $ref: '#/components/schemas/ModelsTeamProviderLinear' + memberIds: + items: + type: string + type: array + members: + items: + $ref: '#/components/schemas/ModelsUser' + type: array + messageChannelProvider: + $ref: '#/components/schemas/ModelsMessageChannelProvider' + messageChannels: + items: + $ref: '#/components/schemas/ModelsMessageChannel' + type: array + msteams: + $ref: '#/components/schemas/ModelsTeamProviderMSTeams' + name: + type: string + numMembers: + type: integer + okta: + $ref: '#/components/schemas/ModelsTeamProviderOkta' + privacy: + type: string + provider: + $ref: '#/components/schemas/ModelsProviderID' + repositories: + items: + $ref: '#/components/schemas/ModelsRepository' + type: array + repositoryIds: + items: + type: string + type: array + slack: + $ref: '#/components/schemas/ModelsTeamProviderSlack' + slug: + type: string + source: + $ref: '#/components/schemas/ModelsTeamSource' + sourceRepositoryPropertyName: + type: string + sourceRepositoryPropertyValue: + type: string + ticketBoardId: + type: string + ticketProjectProvider: + $ref: '#/components/schemas/ModelsTicketProjectProvider' + required: + - id + - provider + - source + - name + - slug + - privacy + - messageChannelProvider + - ticketProjectProvider + type: object + ModelsTeamCodeOwnership: + properties: + dataSource: + $ref: '#/components/schemas/ModelsTeamCodeOwnershipDataSource' + globPatterns: + items: + type: string + nullable: true + type: array + repository: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + required: + - dataSource + - globPatterns + type: object + ModelsTeamCodeOwnershipDataSource: + enum: + - dx + - github_teams + - atlassian_compass + - manual + - repository_property + type: string + ModelsTeamFinding: + properties: + findingType: + $ref: '#/components/schemas/ModelsFindingType' + id: + type: string + matchSource: + $ref: '#/components/schemas/ModelsTeamFindingMatchSource' + matchSourceUserID: + type: string + resolved: + type: boolean + slaBreached: + type: boolean + teamID: + type: string + type: object + ModelsTeamFindingMatchSource: + enum: + - codeowners_team + - codeowners_user + - github_teams + - atlassian_compass + - manual + - git_blame + - git_blame_directory + - repository_contributor + - repository_property + type: string + ModelsTeamFindings: + properties: + findings: + items: + $ref: '#/components/schemas/ModelsTeamFinding' + nullable: true + type: array + team: + $ref: '#/components/schemas/ModelsTeam' + type: object + ModelsTeamPrivacy: + enum: + - private + - public + - visible + - secret + type: string + ModelsTeamProviderAzure: + properties: + teamId: + type: string + type: object + ModelsTeamProviderGitHub: + properties: + orgLogin: + type: string + teamId: + format: int64 + type: integer + teamSlug: + type: string + type: object + ModelsTeamProviderGitLab: + properties: + groupId: + type: integer + type: object + ModelsTeamProviderJira: + properties: + teamId: + type: string + type: object + ModelsTeamProviderLinear: + properties: + teamId: + type: string + type: object + ModelsTeamProviderMSTeams: + properties: + channelId: + type: string + teamId: + type: string + type: object + ModelsTeamProviderOkta: + properties: + groupId: + type: string + type: object + ModelsTeamProviderSlack: + properties: + groupId: + type: string + type: object + ModelsTeamSource: + enum: + - dx + - github_teams + - repository_property + - manual + - atlassian_compass + - identity_provider + type: string + ModelsTeamsMessageChannelProvider: + properties: + channel: + description: The Teams channel name + type: string + id: + description: The Teams message channel ID + type: string + teamId: + description: The Teams team ID that owns the channel + type: string + required: + - id + - channel + - teamId + type: object + ModelsTeamsOwnerProvider: + properties: + teamId: + description: The Teams team ID + type: string + required: + - teamId + type: object + ModelsTeamsUserProvider: + properties: + id: + type: string + teamIDs: + items: + type: string + nullable: true + type: array + required: + - id + - teamIDs + type: object + ModelsTicketDisabledReason: + enum: + - not_configured + - reconnect_required + - not_connected + type: string + ModelsTicketMetrics: + properties: + autoResolvedTrend: + $ref: '#/components/schemas/ModelsTicketTrend' + byPlatform: + $ref: '#/components/schemas/ModelsTicketPlatformBreakdown' + closed: + minimum: 0 + type: integer + closedTrend: + $ref: '#/components/schemas/ModelsTicketTrend' + createdTrend: + $ref: '#/components/schemas/ModelsTicketTrend' + inProgress: + minimum: 0 + type: integer + open: + minimum: 0 + type: integer + resolved: + minimum: 0 + type: integer + total: + minimum: 0 + type: integer + wontFix: + minimum: 0 + type: integer + required: + - total + - open + - inProgress + - resolved + - closed + - wontFix + - byPlatform + - createdTrend + - closedTrend + - autoResolvedTrend + type: object + ModelsTicketMetricsQuery: + properties: + findingType: + items: + type: string + nullable: true + type: array + fromDate: + nullable: true + type: string + platform: + items: + type: string + nullable: true + type: array + source: + items: + type: string + nullable: true + type: array + toDate: + nullable: true + type: string + type: object + ModelsTicketPlatformBreakdown: + properties: + azure: + minimum: 0 + type: integer + github: + minimum: 0 + type: integer + jira: + minimum: 0 + type: integer + linear: + minimum: 0 + type: integer + required: + - jira + - linear + - github + - azure + type: object + ModelsTicketProjectProvider: + properties: + asana: + $ref: '#/components/schemas/ModelsAsanaTicketProject' + azure: + $ref: '#/components/schemas/ModelsAzureTicketProject' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketTicketProject' + github: + $ref: '#/components/schemas/ModelsGitHubTicketProject' + gitlab: + $ref: '#/components/schemas/ModelsGitLabTicketProject' + id: + $ref: '#/components/schemas/ModelsProviderID' + jira: + $ref: '#/components/schemas/ModelsJiraTicketProject' + linear: + $ref: '#/components/schemas/ModelsLinearTicketProject' + type: object + ModelsTicketProvider: + properties: + asana: + $ref: '#/components/schemas/ModelsAsanaTicketProvider' + azure: + $ref: '#/components/schemas/ModelsAzureTicketProvider' + github: + $ref: '#/components/schemas/ModelsGitHubTicketProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabTicketProvider' + jira: + $ref: '#/components/schemas/ModelsJiraTicketProvider' + linear: + $ref: '#/components/schemas/ModelsLinearTicketProvider' + providerId: + $ref: '#/components/schemas/ModelsProviderID' + required: + - providerId + type: object + ModelsTicketTrend: + properties: + lastMonth: + minimum: 0 + type: integer + thisMonth: + minimum: 0 + type: integer + required: + - thisMonth + - lastMonth + type: object + ModelsTriageSeverityConfidence: + enum: + - HIGH + - LOW + - MEDIUM + type: string + ModelsUISavedView: + properties: + createdAt: + type: string + createdBy: + type: string + data: + type: string + id: + type: string + lastUpdatedBy: + type: string + name: + type: string + updatedAt: + type: string + viewOwnerId: + type: string + viewOwnerType: + $ref: '#/components/schemas/ModelsUISavedViewOwnerType' + viewPageType: + $ref: '#/components/schemas/ModelsUISavedViewPageType' + required: + - id + - viewPageType + - viewOwnerType + - viewOwnerId + - name + - data + - createdAt + - createdBy + - updatedAt + - lastUpdatedBy + type: object + ModelsUISavedViewAPIInput: + properties: + data: + type: string + name: + type: string + viewOwnerId: + type: string + viewOwnerType: + $ref: '#/components/schemas/ModelsUISavedViewOwnerType' + viewPageType: + $ref: '#/components/schemas/ModelsUISavedViewPageType' + required: + - viewPageType + - viewOwnerType + - viewOwnerId + - name + - data + type: object + ModelsUISavedViewOwnerType: + enum: + - ORGANIZATION + - USER + type: string + ModelsUISavedViewPageType: + enum: + - OVERVIEW + - TRIAGE + type: string + ModelsUnifiedFindingPreview: + properties: + aiDevTitle: + type: string + aiGenerated: + description: True for AI code review findings (Code type) only; pentest and bug hunt findings are always false. + type: boolean + aiTitle: + type: string + allowlistReason: + type: string + allowlistState: + $ref: '#/components/schemas/ModelsAllowlistState' + allowlistType: + $ref: '#/components/schemas/ModelsAllowlistType' + nullable: true + appName: + type: string + appType: + type: string + assessmentFactors: + additionalProperties: + type: string + nullable: true + type: object + assignedTeamId: + type: string + assignedTeamName: + type: string + autoFixEndTime: + format: date-time + nullable: true + type: string + autoFixStartTime: + format: date-time + nullable: true + type: string + autoFixState: + $ref: '#/components/schemas/ModelsAutoFixState' + branch: + type: string + budgetExhausted: + type: boolean + budgetLimit: + format: double + type: number + budgetUsed: + format: double + type: number + category: + type: string + commit: + type: string + commitHash: + type: string + concurrencyLimit: + type: integer + createdAt: + type: string + cwe: + type: string + endLine: + type: integer + endpointMethod: + type: string + endpointPath: + type: string + enforcement: + $ref: '#/components/schemas/ModelsSCPMEnforcement' + entropy: + format: double + type: number + entrypoint: + type: string + errorDescription: + type: string + errorType: + type: string + exploitValidated: + nullable: true + type: boolean + exploitabilityLabel: + type: string + failedTriage: + nullable: true + type: boolean + falsePositiveReason: + type: string + fileOwners: + items: + $ref: '#/components/schemas/ModelsFileOwner' + nullable: true + type: array + filePath: + type: string + firstSeenCommit: + type: string + graphExists: + nullable: true + type: boolean + hasReachableCVEs: + type: boolean + host: + type: string + httpVersion: + type: string + hypothesis: + type: string + id: + type: string + imageMetadata: + $ref: '#/components/schemas/ModelsContainerImageMetadata' + installationId: + type: string + isAllowlisted: + nullable: true + type: boolean + isArchived: + nullable: true + type: boolean + isAutoFixable: + nullable: true + type: boolean + isCloudTriaged: + nullable: true + type: boolean + isDefaultBranch: + nullable: true + type: boolean + isDirect: + nullable: true + type: boolean + isFalsePositive: + type: boolean + isInternetReachable: + nullable: true + type: boolean + isLatest: + nullable: true + type: boolean + isRepositoryArchived: + nullable: true + type: boolean + isResolved: + nullable: true + type: boolean + language: + $ref: '#/components/schemas/ModelsLanguageName' + lastEvent: + type: string + lastObservedAt: + description: >- + Detail responses only; omitted from finding lists. Start of the latest finished scan run recording a + positive detection of this finding; independent of triage and resolution + format: date-time + nullable: true + type: string + lastScannedAt: + description: >- + Detail responses only; omitted from finding lists. Start of the latest successfully completed scan recording + a direct detection or covered resolution for this finding; held or unverified findings do not advance it + format: date-time + nullable: true + type: string + line: + type: integer + match: + type: string + message: + type: string + method: + type: string + metricState: + $ref: '#/components/schemas/MetricdefsState' + movements: + items: + $ref: '#/components/schemas/ModelsSCPMFindingMovement' + type: array + numCritical: + type: integer + numHigh: + type: integer + numLow: + type: integer + numMedium: + type: integer + numUnknown: + type: integer + package: + type: string + packageFilePath: + type: string + path: + type: string + previousResponse: + type: string + priorityLabel: + $ref: '#/components/schemas/ModelsPriorityLabel' + priorityOverride: + $ref: '#/components/schemas/ModelsPriorityLabel' + priorityScore: + type: integer + prioritySource: + $ref: '#/components/schemas/ModelsPrioritySource' + projectId: + type: string + projectName: + type: string + projectPathPrefix: + type: string + pullRequestsAllowlist: + items: + $ref: '#/components/schemas/ModelsPullRequestInfo' + nullable: true + type: array + pullRequestsAutofix: + items: + $ref: '#/components/schemas/ModelsPullRequestInfo' + nullable: true + type: array + queryParameters: + additionalProperties: + type: string + nullable: true + type: object + reachableSuggestedVersion: + type: string + redactedSecret: + type: string + repository: + type: string + repositoryId: + type: string + repositoryName: + type: string + requestBody: + type: string + requestHeader: + additionalProperties: + type: string + nullable: true + type: object + resolvedAt: + format: date-time + nullable: true + type: string + responseBody: + type: string + responseHeader: + additionalProperties: + type: string + nullable: true + type: object + roleDescription: + type: string + roleName: + type: string + ruleId: + type: string + ruleUrl: + type: string + scanConfigId: + type: string + scanId: + type: string + scanType: + type: string + scopes: + items: + type: string + nullable: true + type: array + secretHash: + type: string + secretType: + type: string + secretValidation: + $ref: '#/components/schemas/ModelsSecretsValidationResult' + severity: + $ref: '#/components/schemas/ModelsSeverity' + severityConfidence: + $ref: '#/components/schemas/ModelsTriageSeverityConfidence' + nullable: true + solution: + type: string + source: + type: string + startLine: + type: integer + suggestedImage: + items: + $ref: '#/components/schemas/ModelsContainerImageMetadata' + nullable: true + type: array + suggestedVersion: + type: string + summary: + type: string + tags: + type: string + targetUrl: + type: string + tenantId: + type: string + ticket: + $ref: '#/components/schemas/ModelsTicketProvider' + ticketState: + description: >- + Ticket observation (Pending, Open, InProgress, Resolved, Closed, WontFix); Pending has no provider link, and + empty means no reservation or ticket + type: string + ticketSyncPending: + description: Provider observation failed; ticketState is the last known state and automatic reconciliation will retry + type: boolean + timeSaved: + $ref: '#/components/schemas/TimeDuration' + title: + type: string + triageEnd: + format: date-time + nullable: true + type: string + triageStart: + format: date-time + nullable: true + type: string + triageStopReason: + nullable: true + type: string + triageTokenCount: + nullable: true + type: integer + triageVersion: + type: string + type: + $ref: '#/components/schemas/ModelsFindingType' + updatedAt: + type: string + uri: + type: string + userName: + type: string + version: + type: string + versions: + items: + type: string + type: array + vulnerabilitiesCVEIds: + items: + type: string + nullable: true + type: array + vulnerabilitiesCWEIds: + items: + type: string + nullable: true + type: array + vulnerabilitiesMaxPriority: + $ref: '#/components/schemas/ModelsPriorityLabel' + vulnerabilitiesMaxSeverity: + $ref: '#/components/schemas/ModelsSeverity' + vulnerableParameterName: + type: string + vulnerableParameterValue: + type: string + workflow: + type: string + required: + - type + - createdAt + - updatedAt + - tenantId + - repositoryId + - projectId + - projectName + - repository + - branch + - commitHash + - firstSeenCommit + - id + - title + - category + - severity + - language + - message + - filePath + - cwe + - ruleId + - ruleUrl + - entrypoint + - startLine + - endLine + - autoFixState + - allowlistState + - priorityOverride + - priorityScore + - priorityLabel + - isFalsePositive + - pullRequestsAllowlist + - pullRequestsAutofix + - fileOwners + - lastEvent + - triageVersion + - assessmentFactors + - aiTitle + - aiDevTitle + - aiGenerated + - line + - numCritical + - numHigh + - numMedium + - numLow + - numUnknown + - vulnerabilitiesCVEIds + - vulnerabilitiesMaxSeverity + - hasReachableCVEs + - installationId + - package + - packageFilePath + - suggestedVersion + - version + - vulnerabilitiesMaxPriority + - vulnerabilitiesCWEIds + - entropy + - secretHash + - redactedSecret + - scopes + - match + - secretType + - appName + - host + - commit + - imageMetadata + - suggestedImage + - scanId + - scanConfigId + - scanType + - appType + - targetUrl + - repositoryName + - projectPathPrefix + - summary + - source + - endpointMethod + - endpointPath + - solution + - httpVersion + - method + - path + - queryParameters + - vulnerableParameterName + - vulnerableParameterValue + - errorType + - errorDescription + - previousResponse + - uri + - requestHeader + - requestBody + - responseHeader + - responseBody + - tags + - hypothesis + - userName + - roleName + - roleDescription + - timeSaved + type: object + ModelsUnifiedFindingsMetricsQuery: + additionalProperties: + $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + type: object + ModelsUnifiedFindingsQuery: + properties: + aiGenerated: + description: >- + AI code review findings (Code type) only when true; pentest and bug hunt findings never match. False keeps + rule-scanner Code findings and every other type. + nullable: true + type: boolean + appName: + items: + type: string + nullable: true + type: array + asOf: + nullable: true + type: string + autoFixState: + items: + type: string + nullable: true + type: array + branch: + items: + type: string + nullable: true + type: array + campaignId: + nullable: true + type: string + cve: + items: + type: string + nullable: true + type: array + cwe: + items: + type: string + nullable: true + type: array + exploitValidated: + nullable: true + type: boolean + fileOwner: + items: + type: string + nullable: true + type: array + findingId: + items: + type: string + nullable: true + type: array + fixEvidence: + items: + type: string + nullable: true + type: array + frameworks: + items: + type: string + nullable: true + type: array + fromDate: + nullable: true + type: string + fromPriorityScore: + nullable: true + type: integer + hasAutoFix: + nullable: true + type: boolean + hasMultipleVersions: + nullable: true + type: boolean + hasTicket: + nullable: true + type: boolean + hasTicketOrPR: + nullable: true + type: boolean + host: + items: + type: string + nullable: true + type: array + imageName: + items: + type: string + nullable: true + type: array + importantMaxDays: + nullable: true + type: integer + includeEmpty: + nullable: true + type: boolean + informationalMaxDays: + nullable: true + type: integer + isAllowlisted: + nullable: true + type: boolean + isArchived: + nullable: true + type: boolean + isAutofixed: + nullable: true + type: boolean + isDefaultBranch: + description: SAST/SCA/SCPM current-roster branch filter; missing metadata is excluded; other types pass through + nullable: true + type: boolean + isDirect: + nullable: true + type: boolean + isFalsePositive: + nullable: true + type: boolean + isFixed: + nullable: true + type: boolean + isInternetReachable: + nullable: true + type: boolean + isPushWorkflow: + nullable: true + type: boolean + isRepositoryArchived: + nullable: true + type: boolean + isResolved: + nullable: true + type: boolean + language: + items: + type: string + nullable: true + type: array + metricState: + items: + type: string + nullable: true + type: array + notfindingId: + items: + type: string + nullable: true + type: array + package: + items: + type: string + nullable: true + type: array + page: + nullable: true + type: integer + pageSize: + nullable: true + type: integer + platform: + items: + type: string + nullable: true + type: array + priorityLabel: + items: + type: string + nullable: true + type: array + repository: + items: + type: string + nullable: true + type: array + repositoryId: + items: + type: string + nullable: true + type: array + ruleId: + items: + type: string + nullable: true + type: array + scanRunId: + items: + type: string + nullable: true + type: array + scrollId: + nullable: true + type: string + search: + nullable: true + type: string + secretType: + items: + type: string + nullable: true + type: array + secretValidated: + nullable: true + type: boolean + severity: + items: + type: string + nullable: true + type: array + severityConfidence: + items: + type: string + nullable: true + type: array + sort: + items: + additionalProperties: + additionalProperties: {} + type: object + type: object + nullable: true + type: array + sortPreset: + nullable: true + type: string + teamIDs: + items: + type: string + nullable: true + type: array + tenantId: + nullable: true + type: string + toDate: + nullable: true + type: string + toPriorityScore: + nullable: true + type: integer + type: + items: + type: string + nullable: true + type: array + urgentMaxDays: + nullable: true + type: integer + type: object + ModelsUnifiedFindingsRawMetricsQueryResultItem: + properties: + doc_count: + type: integer + type: object + ModelsUnifiedFindingsSortPreset: + enum: + - created_at_desc + - created_at_asc + - priority_desc + - severity_desc + - priority_asc + - severity_asc + - severity_confidence_desc + - severity_confidence_asc + - fix_stage_asc + - fix_stage_desc + type: string + ModelsUser: + properties: + asana: + $ref: '#/components/schemas/ModelsAsanaUserProvider' + azure: + $ref: '#/components/schemas/ModelsAzureUserProvider' + azureEntra: + $ref: '#/components/schemas/ModelsAzureEntraUserProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketUserProvider' + createdAt: + type: string + createdBy: + type: string + deleted: + description: Whether the account is deactivated + type: boolean + displayName: + description: The user's display name + type: string + email: + description: The user's email address + type: string + github: + $ref: '#/components/schemas/ModelsGitHubUserProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabUserProvider' + googleWorkspace: + $ref: '#/components/schemas/ModelsGoogleWorkspaceUserProvider' + id: + description: The user's ID + type: string + isBot: + description: Whether the user is a bot + type: boolean + isRestricted: + description: Whether the account is restricted + type: boolean + jira: + $ref: '#/components/schemas/ModelsJiraUserProvider' + lastUpdatedBy: + type: string + linear: + $ref: '#/components/schemas/ModelsLinearUserProvider' + name: + description: The user's name + type: string + okta: + $ref: '#/components/schemas/ModelsOktaUserProvider' + provider: + $ref: '#/components/schemas/ModelsUserProvider' + realName: + description: The user's real name + type: string + slack: + $ref: '#/components/schemas/ModelsSlackUserProvider' + slug: + description: The user's slug + type: string + teams: + $ref: '#/components/schemas/ModelsTeamsUserProvider' + updatedAt: + type: string + username: + description: The user's username + type: string + required: + - provider + - id + - name + - slug + - username + - isBot + type: object + ModelsUserMapping: + properties: + asana: + $ref: '#/components/schemas/ModelsAsanaUserProvider' + azure: + $ref: '#/components/schemas/ModelsAzureUserProvider' + azureEntra: + $ref: '#/components/schemas/ModelsAzureEntraUserProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketUserProvider' + createdAt: + type: string + createdBy: + type: string + github: + $ref: '#/components/schemas/ModelsGitHubUserProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabUserProvider' + googleWorkspace: + $ref: '#/components/schemas/ModelsGoogleWorkspaceUserProvider' + id: + type: string + jira: + $ref: '#/components/schemas/ModelsJiraUserProvider' + lastUpdatedBy: + type: string + linear: + $ref: '#/components/schemas/ModelsLinearUserProvider' + okta: + $ref: '#/components/schemas/ModelsOktaUserProvider' + slack: + $ref: '#/components/schemas/ModelsSlackUserProvider' + teams: + $ref: '#/components/schemas/ModelsTeamsUserProvider' + updatedAt: + type: string + required: + - id + - createdAt + - createdBy + - updatedAt + - lastUpdatedBy + type: object + ModelsUserProvider: + properties: + asana: + $ref: '#/components/schemas/ModelsAsanaUserProvider' + azure: + $ref: '#/components/schemas/ModelsAzureUserProvider' + azureEntra: + $ref: '#/components/schemas/ModelsAzureEntraUserProvider' + bitBucket: + $ref: '#/components/schemas/ModelsBitbucketUserProvider' + gitHub: + $ref: '#/components/schemas/ModelsGitHubUserProvider' + gitlab: + $ref: '#/components/schemas/ModelsGitLabUserProvider' + googleWorkspace: + $ref: '#/components/schemas/ModelsGoogleWorkspaceUserProvider' + id: + $ref: '#/components/schemas/ModelsProviderID' + jira: + $ref: '#/components/schemas/ModelsJiraUserProvider' + linear: + $ref: '#/components/schemas/ModelsLinearUserProvider' + okta: + $ref: '#/components/schemas/ModelsOktaUserProvider' + slack: + $ref: '#/components/schemas/ModelsSlackUserProvider' + teams: + $ref: '#/components/schemas/ModelsTeamsUserProvider' + required: + - id + type: object + RestErrResponse: + properties: + code: + description: Application-specific error code. + type: integer + context: + additionalProperties: {} + description: Application context. + type: object + error: + description: Error message. + type: string + status: + description: Status text. + type: string + type: object + RuneventsEngine: + enum: + - step_functions + - temporal + - fargate + - inline + type: string + RuneventsMachineRef: + properties: + definitionId: + type: string + definitionVersion: + type: string + engine: + $ref: '#/components/schemas/RuneventsEngine' + executionId: + type: string + type: object + RuneventsRunRef: + properties: + causationEventId: + type: string + id: + type: string + kind: + type: string + parentId: + type: string + parentKind: + type: string + rootId: + type: string + rootKind: + type: string + type: object + RuneventsRunStatus: + enum: + - pending + - running + - waiting_approval + - completed + - failed + - cancelled + - skipped + type: string + RunsnapshotChild: + properties: + run: + $ref: '#/components/schemas/RuneventsRunRef' + status: + $ref: '#/components/schemas/RuneventsRunStatus' + type: object + RunsnapshotSnapshot: + properties: + children: + items: + $ref: '#/components/schemas/RunsnapshotChild' + nullable: true + type: array + childrenTruncated: + type: boolean + cursor: + type: string + endedAt: + format: date-time + nullable: true + type: string + eventsTruncated: + type: boolean + machine: + $ref: '#/components/schemas/RuneventsMachineRef' + run: + $ref: '#/components/schemas/RuneventsRunRef' + skippedRows: + type: integer + stages: + items: + $ref: '#/components/schemas/RunsnapshotStage' + nullable: true + type: array + startedAt: + format: date-time + nullable: true + type: string + status: + $ref: '#/components/schemas/RuneventsRunStatus' + type: object + RunsnapshotStage: + properties: + completedAt: + format: date-time + nullable: true + type: string + enteredAt: + format: date-time + type: string + index: + type: integer + name: + type: string + state: + $ref: '#/components/schemas/RunsnapshotStageState' + total: + type: integer + type: object + RunsnapshotStageState: + enum: + - active + - done + - failed + type: string + ServiceGitHubTenantRouteInventory: + properties: + createdAt: + format: date-time + nullable: true + type: string + createdByUserId: + format: int64 + type: integer + firstSeenAt: + format: date-time + type: string + githubAppId: + format: int64 + type: integer + githubOwner: + type: string + githubOwnerType: + type: string + id: + type: string + installationId: + format: int64 + type: integer + lastObservedAction: + type: string + lastSeenAt: + format: date-time + type: string + type: object + ServiceGitHubTenantRouteResult: + properties: + dryRun: + type: boolean + inventory: + $ref: '#/components/schemas/ServiceGitHubTenantRouteInventory' + operationId: + type: string + route: + $ref: '#/components/schemas/ServiceGitHubTenantRouteRow' + siblings: + items: + $ref: '#/components/schemas/ServiceGitHubTenantRouteRow' + type: array + status: + type: string + tenantId: + type: string + type: object + ServiceGitHubTenantRouteRow: + properties: + baseDomain: + type: string + controlsUpdatedBy: + type: string + deploymentId: + type: string + githubOwner: + type: string + githubOwnerId: + format: int64 + type: integer + id: + type: string + installationId: + format: int64 + type: integer + paused: + type: boolean + pausedReason: + type: string + pendingAppId: + format: int64 + type: integer + region: + type: string + repoAllowlistEnforced: + type: boolean + scheduledWorkEnabled: + type: boolean + tenantId: + type: string + type: object + ServiceNativeBootstrapAdministrator: + properties: + email: + type: string + name: + type: string + subject: + type: string + type: object + ServiceNativeTenantBootstrapInput: + properties: + administrators: + items: + $ref: '#/components/schemas/ServiceNativeBootstrapAdministrator' + nullable: true + type: array + baseDomain: + type: string + deploymentId: + type: string + directoryId: + type: string + dryRun: + type: boolean + expectedState: + type: string + operationId: + type: string + operator: + type: string + reason: + type: string + region: + type: string + stage: + type: string + tenantId: + type: string + type: object + ServiceNativeTenantBootstrapResult: + properties: + administratorSubjects: + items: + type: string + nullable: true + type: array + desiredState: + $ref: '#/components/schemas/ServiceNativeTenantBootstrapInput' + directoryId: + type: string + dryRun: + type: boolean + identityReady: + type: boolean + routeReady: + type: boolean + stage: + type: string + tenantId: + type: string + type: object + TimeDuration: + format: int64 + type: integer + WorkspacebootstrapOperatorInspection: + properties: + canonicalTenantId: + type: string + expired: + type: boolean + expiresAt: + format: date-time + type: string + operationId: + type: string + pendingStage: + type: string + recipient: + type: string + renewAllowed: + type: boolean + renewedAt: + format: date-time + type: string + renewedBy: + type: string + renewedReason: + type: string + revision: + format: int64 + type: integer + revokeAllowed: + type: boolean + revokedAt: + format: date-time + type: string + revokedBy: + type: string + revokedReason: + type: string + status: + type: string + target: + $ref: '#/components/schemas/WorkspacebootstrapTarget' + type: object + WorkspacebootstrapProvisioningDecision: + properties: + after: + $ref: '#/components/schemas/WorkspacebootstrapProvisioningSecurityState' + before: + $ref: '#/components/schemas/WorkspacebootstrapProvisioningSecurityState' + dryRun: + type: boolean + type: object + WorkspacebootstrapProvisioningRequest: + properties: + companyName: + type: string + contactEmail: + type: string + createdAt: + format: date-time + type: string + directoryId: + type: string + operationId: + type: string + operationRevision: + format: int64 + type: integer + operationStatus: + type: string + providerId: + type: string + requestId: + type: string + reviewedBy: + type: string + reviewedReason: + type: string + revision: + format: int64 + type: integer + setupKind: + type: string + setupLive: + type: boolean + status: + type: string + subject: + type: string + target: + $ref: '#/components/schemas/WorkspacebootstrapTarget' + usesAzureDevOps: + nullable: true + type: boolean + type: object + WorkspacebootstrapProvisioningSecurityState: + properties: + operationId: + type: string + revision: + format: int64 + type: integer + setupKind: + type: string + status: + type: string + target: + $ref: '#/components/schemas/WorkspacebootstrapTarget' + type: object + WorkspacebootstrapTarget: + properties: + accountId: + type: string + apiOrigin: + type: string + deploymentId: + type: string + displayName: + type: string + region: + type: string + type: object + DotnetsetupSelection: + properties: + command: + type: string + configuration: + type: string + configurationInputs: + items: + type: string + type: array + framework: + type: string + invocation: + type: string + permittedTestPath: + type: string + platform: + type: string + productionProject: + type: string + projectSdk: + type: string + requestedSdk: + type: string + sdkAllowPrerelease: + type: string + sdkRollForward: + type: string + targetFrameworks: + items: + type: string + type: array + testPlatform: + type: string + testProject: + type: string + workingDir: + type: string + type: object + EndpointsAWSACMDetailsView: + type: object + EndpointsAWSALBDetailsView: + type: object + EndpointsAWSAPIGatewayDetailsView: + type: object + EndpointsAWSAppRunnerDetailsView: + type: object + EndpointsAWSAppSyncDetailsView: + type: object + EndpointsAWSAthenaDetailsView: + type: object + EndpointsAWSAutoscalingGroupDetailsView: + properties: + availabilityZones: + items: + type: string + type: array + desiredCapacity: + type: integer + healthCheckType: + type: string + launchTemplate: + type: string + loadBalancerNames: + items: + type: string + type: array + maxSize: + type: integer + minSize: + type: integer + targetGroupArns: + items: + type: string + type: array + terminationPolicies: + items: + type: string + type: array + type: object + EndpointsAWSBackupVaultDetailsView: + type: object + EndpointsAWSBedrockModelDetailsView: + type: object + EndpointsAWSCLBDetailsView: + type: object + EndpointsAWSCloudFrontDetailsView: + type: object + EndpointsAWSCloudTrailDetailsView: + type: object + EndpointsAWSCloudWatchAlarmDetailsView: + type: object + EndpointsAWSCloudWatchDashboardDetailsView: + type: object + EndpointsAWSCloudWatchLogGroupDetailsView: + type: object + EndpointsAWSCodeArtifactDetailsView: + type: object + EndpointsAWSCodeBuildDetailsView: + type: object + EndpointsAWSCodeCommitDetailsView: + type: object + EndpointsAWSCodeDeployDetailsView: + type: object + EndpointsAWSCodePipelineDetailsView: + type: object + EndpointsAWSCognitoUserPoolDetailsView: + type: object + EndpointsAWSConfigDetailsView: + type: object + EndpointsAWSDirectConnectDetailsView: + type: object + EndpointsAWSDynamoDBDetailsView: + type: object + EndpointsAWSEBSVolumeDetailsView: + type: object + EndpointsAWSEC2DetailsView: + properties: + architecture: + type: string + ebsVolumeIds: + items: + type: string + type: array + hypervisor: + type: string + iamInstanceProfile: + type: string + kernelId: + type: string + launchTime: + type: string + monitoring: + type: string + networkInterfaceIds: + items: + type: string + type: array + rootDeviceType: + type: string + securityGroupIds: + items: + type: string + type: array + tenancy: + type: string + userDataSha256: + type: string + type: object + EndpointsAWSECRDetailsView: + type: object + EndpointsAWSECSClusterDetailsView: + type: object + EndpointsAWSECSServiceDetailsView: + type: object + EndpointsAWSECSTaskDefinitionDetailsView: + type: object + EndpointsAWSECSTaskDetailsView: + type: object + EndpointsAWSEFSDetailsView: + type: object + EndpointsAWSEIPDetailsView: + type: object + EndpointsAWSEKSClusterDetailsView: + type: object + EndpointsAWSEMRDetailsView: + type: object + EndpointsAWSElastiCacheDetailsView: + type: object + EndpointsAWSEventBridgeDetailsView: + type: object + EndpointsAWSGlobalAcceleratorDetailsView: + type: object + EndpointsAWSGlueDetailsView: + type: object + EndpointsAWSGuardDutyDetailsView: + type: object + EndpointsAWSIAMGroupDetailsView: + type: object + EndpointsAWSIAMPolicyDetailsView: + type: object + EndpointsAWSIAMRoleDetailsView: + type: object + EndpointsAWSIAMUserDetailsView: + type: object + EndpointsAWSInternetGatewayDetailsView: + type: object + EndpointsAWSKMSDetailsView: + type: object + EndpointsAWSKinesisDetailsView: + type: object + EndpointsAWSLambdaDetailsView: + type: object + EndpointsAWSMQDetailsView: + type: object + EndpointsAWSMSKDetailsView: + type: object + EndpointsAWSMemoryDBDetailsView: + type: object + EndpointsAWSNACLDetailsView: + type: object + EndpointsAWSNATGatewayDetailsView: + type: object + EndpointsAWSNLBDetailsView: + type: object + EndpointsAWSNeptuneDetailsView: + type: object + EndpointsAWSNetworkFirewallDetailsView: + type: object + EndpointsAWSOpenSearchDetailsView: + type: object + EndpointsAWSPrivateLinkDetailsView: + type: object + EndpointsAWSRDSDetailsView: + type: object + EndpointsAWSRedshiftDetailsView: + type: object + EndpointsAWSRoute53HostedZoneDetailsView: + type: object + EndpointsAWSRouteTableDetailsView: + type: object + EndpointsAWSS3BucketDetailsView: + type: object + EndpointsAWSSESDetailsView: + type: object + EndpointsAWSSNSDetailsView: + type: object + EndpointsAWSSQSDetailsView: + type: object + EndpointsAWSSSMDetailsView: + type: object + EndpointsAWSSageMakerEndpointDetailsView: + type: object + EndpointsAWSSecretsManagerDetailsView: + type: object + EndpointsAWSSecurityGroupDetailsView: + type: object + EndpointsAWSStepFunctionDetailsView: + type: object + EndpointsAWSStorageGatewayDetailsView: + type: object + EndpointsAWSSubnetDetailsView: + type: object + EndpointsAWSTGWAttachmentDetailsView: + type: object + EndpointsAWSTargetGroupDetailsView: + type: object + EndpointsAWSVPCDetailsView: + type: object + EndpointsAWSVPCEndpointDetailsView: + type: object + EndpointsAWSVPNConnectionDetailsView: + type: object + EndpointsAWSWAFDetailsView: + type: object + EndpointsAWSWorkspaceDetailsView: + properties: + bundleId: + type: string + computerName: + type: string + directoryId: + type: string + rootVolumeSizeGb: + type: integer + runningMode: + type: string + userName: + type: string + userVolumeSizeGb: + type: integer + type: object + EndpointsAWSXRayDetailsView: + type: object + EndpointsAcceptSetupPentestAssessmentRecommendationInput: + properties: + applicationId: + description: DAST application created from the proposal; it is stored under the context application's id + minLength: 1 + type: string + required: + - applicationId + type: object + EndpointsAcceptSetupPentestTargetRecommendationInput: + properties: + targetId: + description: DAST target the customer created from the recommendation + minLength: 1 + type: string + required: + - targetId + type: object + EndpointsActiveDepsSummaryOldest: + properties: + ecosystem: + type: string + introducedAt: + format: date-time + type: string + name: + type: string + version: + type: string + required: + - name + - ecosystem + - introducedAt + type: object + EndpointsAiMlAssetDetailsView: + properties: + awsBedrockModel: + $ref: '#/components/schemas/EndpointsAWSBedrockModelDetailsView' + awsSageMakerEndpoint: + $ref: '#/components/schemas/EndpointsAWSSageMakerEndpointDetailsView' + azureMachineLearning: + $ref: '#/components/schemas/EndpointsAzureMachineLearningDetailsView' + azureMlWorkspace: + $ref: '#/components/schemas/EndpointsAzureMLWorkspaceDetailsView' + azureOpenAiDeployment: + $ref: '#/components/schemas/EndpointsAzureOpenAIDeploymentDetailsView' + gcpVertexEndpoint: + $ref: '#/components/schemas/EndpointsGCPVertexEndpointDetailsView' + subType: + $ref: '#/components/schemas/ModelsAiMlSubType' + required: + - subType + type: object + EndpointsAiMlAssetView: + properties: + accountId: + type: string + dataSourceRefs: + items: + type: string + type: array + deletedAtScanId: + type: string + endpointVisibility: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + framework: + type: string + gpuType: + type: string + guardrailsEnabled: + type: boolean + iamRoleArn: + type: string + id: + type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + kind: + type: string + lastInvocationAt: + type: string + lastSeenAt: + type: string + modelName: + type: string + name: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsAiMlSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsArtifactDeploymentSummary: + properties: + accountId: + type: string + artifactId: + type: string + cloudProvider: + type: string + cloudResourceId: + type: string + computeType: + type: string + createdAt: + format: date-time + type: string + deletedAt: + format: date-time + nullable: true + type: string + id: + type: string + isDeleted: + type: boolean + isInternetFacing: + type: boolean + matchConfidence: + type: string + matchDetail: + type: string + matchMethod: + type: string + metadata: + additionalProperties: {} + type: object + projectId: + type: string + region: + type: string + repositoryId: + type: string + serviceName: + type: string + updatedAt: + format: date-time + type: string + type: object + EndpointsArtifactRegistrySummary: + properties: + baseUrl: + type: string + id: + type: string + name: + type: string + path: + type: string + type: + type: string + type: object + EndpointsArtifactRepositoriesAssetDetailsView: + properties: + awsCodeArtifact: + $ref: '#/components/schemas/EndpointsAWSCodeArtifactDetailsView' + awsEcr: + $ref: '#/components/schemas/EndpointsAWSECRDetailsView' + azureAcr: + $ref: '#/components/schemas/EndpointsAzureACRDetailsView' + crates: + $ref: '#/components/schemas/EndpointsCratesDetailsView' + dockerhub: + $ref: '#/components/schemas/EndpointsDockerHubDetailsView' + gcpArtifactRegistry: + $ref: '#/components/schemas/EndpointsGCPArtifactRegistryDetailsView' + ghcr: + $ref: '#/components/schemas/EndpointsGHCRDetailsView' + maven: + $ref: '#/components/schemas/EndpointsMavenDetailsView' + npm: + $ref: '#/components/schemas/EndpointsNPMRegistryDetailsView' + nuget: + $ref: '#/components/schemas/EndpointsNuGetDetailsView' + other: + $ref: '#/components/schemas/EndpointsOtherRegistryDetailsView' + pypi: + $ref: '#/components/schemas/EndpointsPyPIDetailsView' + rubygems: + $ref: '#/components/schemas/EndpointsRubyGemsDetailsView' + subType: + $ref: '#/components/schemas/ModelsArtifactRepositoriesSubType' + required: + - subType + type: object + EndpointsArtifactRepositoriesAssetView: + properties: + accountId: + type: string + baseUrl: + type: string + deletedAtScanId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + id: + type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: + type: string + name: + type: string + pathTemplate: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + registryKind: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsArtifactRepositoriesSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsArtifactSummary: + properties: + artifactName: + type: string + createdAt: + format: date-time + type: string + deletedAt: + format: date-time + nullable: true + type: string + entrypointId: + type: string + id: + type: string + isDeleted: + type: boolean + name: + type: string + nonProduction: + type: boolean + projectId: + type: string + registries: + items: + $ref: '#/components/schemas/EndpointsArtifactRegistrySummary' + type: array + repositoryId: + type: string + subArtifactPath: + type: string + subArtifactType: + type: string + type: + type: string + updatedAt: + format: date-time + type: string + type: object + EndpointsArtifactsAssetDetailsView: + properties: + dockerImage: + $ref: '#/components/schemas/EndpointsDockerImageDetailsView' + executable: + $ref: '#/components/schemas/EndpointsExecutableDetailsView' + jar: + $ref: '#/components/schemas/EndpointsJARDetailsView' + npmPackage: + $ref: '#/components/schemas/EndpointsNPMPackageDetailsView' + other: + $ref: '#/components/schemas/EndpointsOtherArtifactDetailsView' + subType: + $ref: '#/components/schemas/ModelsArtifactsSubType' + wheel: + $ref: '#/components/schemas/EndpointsWheelDetailsView' + required: + - subType + type: object + EndpointsArtifactsAssetView: + properties: + accountId: + type: string + artifactType: + type: string + deletedAtScanId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + id: + type: string + imageDigest: + type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: + type: string + name: + type: string + nonProduction: + type: boolean + projectId: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subArtifactType: + type: string + subType: + $ref: '#/components/schemas/ModelsArtifactsSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsAssessmentContextReadiness: + properties: + assessmentVersion: + type: string + cloudState: + type: string + message: + type: string + needsReassessment: + type: boolean + runId: + type: string + sourceVersion: + type: string + state: + type: string + type: object + EndpointsAssetGraphComponent: + properties: + accountType: + type: string + componentType: + type: string + downloadUrl: + type: string + edgeCount: + type: integer + expiresAt: + format: date-time + type: string + id: + type: string + lastUpdated: + format: date-time + type: string + name: + type: string + nodeCount: + type: integer + ownerId: + type: string + platform: + type: string + services: + items: + type: string + type: array + required: + - componentType + - id + - downloadUrl + - expiresAt + - nodeCount + - edgeCount + type: object + EndpointsAssetGraphNodeSummary: + properties: + accountId: + type: string + childCounts: + additionalProperties: + type: integer + type: object + name: + type: string + nodeId: + type: string + nodeKind: + type: string + objectType: + type: string + region: + type: string + subType: + type: string + required: + - nodeId + - nodeKind + - objectType + - name + type: object + EndpointsAssetGraphRetrievedNode: + properties: + accountId: + type: string + name: + type: string + nodeId: + type: string + nodeKind: + type: string + objectType: + type: string + region: + type: string + score: + format: double + type: number + subType: + type: string + text: + type: string + type: object + EndpointsAssetGraphSearchResultEntry: + properties: + accountId: + type: string + name: + type: string + nodeId: + type: string + objectType: + type: string + region: + type: string + subTitle: + type: string + required: + - nodeId + - objectType + - name + type: object + EndpointsAssetGraphSyncCoverage: + properties: + complete: + type: boolean + message: + type: string + nodesDroppedNoCanonical: + format: int64 + type: integer + status: + enum: + - success + - partial + - failed + type: string + syncedAt: + format: date-time + type: string + required: + - status + - complete + - syncedAt + - nodesDroppedNoCanonical + type: object + EndpointsAssetLinks: + properties: + detail: + type: string + endpoints: + type: string + project: + type: string + repo: + type: string + self: + type: string + type: object + EndpointsAttackPathDTO: + properties: + computedAt: + type: string + edgeTypes: + items: + type: string + type: array + entryNodeId: + type: string + entryNodeKind: + type: string + hasCriticalFinding: + type: boolean + id: + type: string + maxFindingSeverity: + type: string + pathNodeIds: + items: + type: string + nullable: true + type: array + terminalNodeId: + type: string + terminalNodeKind: + type: string + required: + - id + - entryNodeId + - entryNodeKind + - terminalNodeId + - terminalNodeKind + - pathNodeIds + - hasCriticalFinding + - computedAt + type: object + EndpointsAttackPathTerminalNodeKind: + enum: + - k8sRouting + - inputSource + - bughuntFinding + - cspmFinding + - sensitiveDataFinding + - application + - authentication + - authorization + - autoScalingGroup + - buildArtifact + - buildArtifactRepository + - certificate + - cicdPipeline + - cloudAccount + - crossAccountReference + - codeArtifact + - codeLocation + - container + - containerfile + - credential + - cve + - daemonSet + - databaseTable + - dataClassification + - domain + - endpoint + - externalService + - function + - gateway + - host + - iamPolicy + - iamRole + - iamUser + - identity + - identityProvider + - internet + - ipAddress + - k8sCluster + - k8sConfigMap + - k8sDeployment + - k8sIngress + - k8sNamespace + - k8sNetworkPolicy + - k8sPersistentVolumeClaim + - k8sSecret + - k8sService + - k8sServiceAccount + - k8sVolume + - k8sPod + - k8sReplicaSet + - k8sEndpoint + - k8sNode + - k8sJob + - k8sCronJob + - managedCloudResource + - memory + - nacl + - networkInterface + - note + - package + - pentestFinding + - port + - product + - project + - repository + - routeTable + - sastFinding + - scpmFinding + - scaContainerFinding + - scaDependencyFinding + - secretFinding + - securityGroup + - ticket + - actionItem + - statefulSet + - subnet + - team + - threatActor + - user + - vpc + - prefixList + - unknownCloudResource + - httpEndpoint + - graphqlEndpoint + - grpcEndpoint + - websocketEndpoint + - messageQueueEndpoint + - document + - organization + - campaign + type: string + EndpointsAzureACIDetailsView: + type: object + EndpointsAzureACRDetailsView: + type: object + EndpointsAzureADGroupDetailsView: + type: object + EndpointsAzureADUserDetailsView: + type: object + EndpointsAzureAKSDetailsView: + type: object + EndpointsAzureAPIManagementDetailsView: + type: object + EndpointsAzureAppGatewayDetailsView: + type: object + EndpointsAzureAppServiceDetailsView: + type: object + EndpointsAzureApplicationDetailsView: + type: object + EndpointsAzureAutomationDetailsView: + type: object + EndpointsAzureBatchDetailsView: + type: object + EndpointsAzureBlobDetailsView: + type: object + EndpointsAzureCDNProfileDetailsView: + type: object + EndpointsAzureCosmosDetailsView: + type: object + EndpointsAzureDNSZoneDetailsView: + type: object + EndpointsAzureDataFactoryDetailsView: + type: object + EndpointsAzureDatabricksDetailsView: + type: object + EndpointsAzureDefenderDetailsView: + type: object + EndpointsAzureDevOpsPipelinesDetailsView: + type: object + EndpointsAzureDiskDetailsView: + type: object + EndpointsAzureEntraIDDetailsView: + type: object + EndpointsAzureEventGridDetailsView: + type: object + EndpointsAzureEventHubDetailsView: + type: object + EndpointsAzureExpressRouteDetailsView: + type: object + EndpointsAzureFilesDetailsView: + type: object + EndpointsAzureFirewallDetailsView: + type: object + EndpointsAzureFrontDoorDetailsView: + type: object + EndpointsAzureFunctionDetailsView: + type: object + EndpointsAzureHDInsightDetailsView: + type: object + EndpointsAzureIotHubDetailsView: + type: object + EndpointsAzureKeyVaultDetailsView: + type: object + EndpointsAzureLogicAppsDetailsView: + type: object + EndpointsAzureMLWorkspaceDetailsView: + type: object + EndpointsAzureMachineLearningDetailsView: + type: object + EndpointsAzureManagedIdentityDetailsView: + type: object + EndpointsAzureMonitorDetailsView: + type: object + EndpointsAzureMySQLDetailsView: + type: object + EndpointsAzureNSGDetailsView: + type: object + EndpointsAzureOpenAIDeploymentDetailsView: + type: object + EndpointsAzurePipelinesDetailsView: + type: object + EndpointsAzurePolicyDetailsView: + type: object + EndpointsAzurePostgresDetailsView: + type: object + EndpointsAzureRedisDetailsView: + type: object + EndpointsAzureRepoDetailsView: + type: object + EndpointsAzureRoleAssignmentDetailsView: + type: object + EndpointsAzureSQLDetailsView: + type: object + EndpointsAzureServiceBusDetailsView: + type: object + EndpointsAzureServicePrincipalDetailsView: + type: object + EndpointsAzureStorageAccountDetailsView: + type: object + EndpointsAzureSubnetDetailsView: + type: object + EndpointsAzureSynapseDetailsView: + type: object + EndpointsAzureVMDetailsView: + properties: + adminUsername: + type: string + availabilitySet: + type: string + azureTags: + additionalProperties: + type: string + type: object + dataDisks: + items: + type: string + type: array + networkProfile: + type: string + osDisk: + type: string + resourceGroup: + type: string + vmSize: + type: string + type: object + EndpointsAzureVMSSDetailsView: + properties: + capacity: + type: integer + overProvision: + type: boolean + resourceGroup: + type: string + skuName: + type: string + skuTier: + type: string + upgradePolicy: + type: string + type: object + EndpointsAzureVNetDetailsView: + type: object + EndpointsAzureVPNDetailsView: + type: object + EndpointsAzureVirtualDesktopDetailsView: + properties: + allowNewSession: + type: boolean + assignedUser: + type: string + hostPoolName: + type: string + sessionHostStatus: + type: string + updateState: + type: string + type: object + EndpointsBitbucketRepoDetailsView: + type: object + EndpointsBuildkiteDetailsView: + type: object + EndpointsCDNAndDNSAssetDetailsView: + properties: + awsApiGateway: + $ref: '#/components/schemas/EndpointsAWSAPIGatewayDetailsView' + awsAppSync: + $ref: '#/components/schemas/EndpointsAWSAppSyncDetailsView' + awsCloudFront: + $ref: '#/components/schemas/EndpointsAWSCloudFrontDetailsView' + awsRoute53HostedZone: + $ref: '#/components/schemas/EndpointsAWSRoute53HostedZoneDetailsView' + azureApiManagement: + $ref: '#/components/schemas/EndpointsAzureAPIManagementDetailsView' + azureCdnProfile: + $ref: '#/components/schemas/EndpointsAzureCDNProfileDetailsView' + azureDnsZone: + $ref: '#/components/schemas/EndpointsAzureDNSZoneDetailsView' + azureFrontDoor: + $ref: '#/components/schemas/EndpointsAzureFrontDoorDetailsView' + codeDeclaredHost: + $ref: '#/components/schemas/EndpointsCodeDeclaredHostDetailsView' + gcpApiGateway: + $ref: '#/components/schemas/EndpointsGCPAPIGatewayDetailsView' + gcpCloudCdn: + $ref: '#/components/schemas/EndpointsGCPCloudCDNDetailsView' + gcpCloudDnsRecord: + $ref: '#/components/schemas/EndpointsGCPCloudDNSRecordDetailsView' + gcpCloudDnsZone: + $ref: '#/components/schemas/EndpointsGCPCloudDNSZoneDetailsView' + subType: + $ref: '#/components/schemas/ModelsCDNAndDNSSubType' + required: + - subType + type: object + EndpointsCDNAndDNSAssetView: + properties: + accountId: + type: string + cachePolicy: + type: string + deletedAtScanId: + type: string + dnssecEnabled: + type: boolean + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + geoRestrictions: + type: string + id: + type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + kind: + type: string + lastSeenAt: + type: string + name: + type: string + originOrTarget: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + recordType: + type: string + region: + type: string + signedUrlsRequired: + type: boolean + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsCDNAndDNSSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + tlsCertificateArn: + type: string + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsCiCdAssetDetailsView: + properties: + awsCodeBuild: + $ref: '#/components/schemas/EndpointsAWSCodeBuildDetailsView' + awsCodeCommit: + $ref: '#/components/schemas/EndpointsAWSCodeCommitDetailsView' + awsCodeDeploy: + $ref: '#/components/schemas/EndpointsAWSCodeDeployDetailsView' + awsCodePipeline: + $ref: '#/components/schemas/EndpointsAWSCodePipelineDetailsView' + azureDevOpsPipelines: + $ref: '#/components/schemas/EndpointsAzureDevOpsPipelinesDetailsView' + gcpCloudBuild: + $ref: '#/components/schemas/EndpointsGCPCloudBuildDetailsView' + subType: + $ref: '#/components/schemas/ModelsCiCdSubType' + required: + - subType + type: object + EndpointsCiCdAssetView: + properties: + accountId: + type: string + defaultBranch: + type: string + deletedAtScanId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + iamRoleArn: + type: string + id: + type: string + imageScanningEnabled: + type: boolean + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + kind: + type: string + lastBuildAt: + type: string + lastBuildStatus: + type: string + lastSeenAt: + type: string + name: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + public: + type: boolean + region: + type: string + signingEnabled: + type: boolean + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsCiCdSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsCircleCIDetailsView: + type: object + EndpointsCloudConnectorAutomation: + properties: + actions: + items: + $ref: '#/components/schemas/EndpointsCloudConnectorAutomationAction' + nullable: true + type: array + attempt: + format: int32 + type: integer + maxAttempts: + format: int32 + type: integer + message: + type: string + nextAttemptAt: + type: string + onboardingStarted: + type: boolean + progress: + enum: + - selecting_repository + - reading_repository + - writing_changes + type: string + proposal: + $ref: '#/components/schemas/EndpointsCloudConnectorAutomationProposal' + reasonCode: + type: string + runId: + type: string + selectionRevision: + type: string + state: + enum: + - disabled + - disconnected + - unsupported_provider + - awaiting_installation + - awaiting_settings + - awaiting_source_ips + - awaiting_repository_sync + - awaiting_repository_selection + - awaiting_staff_start + - awaiting_billing_activation + - billing_blocked + - scope_blocked + - retry_wait + - queued + - preparing + - prepared + - expired + - no_iac_repo_found + - no_allowlist_found + - creating + - publication_unknown + - completed + - failed + - unavailable + type: string + required: + - state + type: object + EndpointsCloudConnectorAutomationAction: + properties: + code: + type: string + label: + type: string + requiresPermission: + type: string + type: object + EndpointsCloudConnectorAutomationProposal: + properties: + approvalAllowed: + type: boolean + digest: + type: string + expiresAt: + type: string + preparedAt: + type: string + runId: + type: string + staleReason: + type: string + type: object + EndpointsCloudConnectorPRRecord: + properties: + branch: + type: string + createdAt: + type: string + createdBy: + enum: + - agent + - manual + type: string + isDraft: + type: boolean + prNumber: + format: int64 + type: integer + prUrl: + type: string + repo: + type: string + required: + - prUrl + - createdBy + type: object + EndpointsCloudConnectorPRRunStatus: + properties: + completedAt: + type: string + errorMessage: + type: string + runId: + type: string + startedAt: + type: string + status: + enum: + - waiting + - retry_wait + - queued + - in_progress + - prepared + - creating + - completed + - failed + - no_iac_repo_found + - no_allowlist_found + - superseded + - canceled + type: string + required: + - runId + - status + - startedAt + type: object + EndpointsCloudConnectorProposal: + properties: + baseBranch: + type: string + baseSha: + type: string + body: + type: string + digest: + type: string + egressIps: + items: + type: string + type: array + files: + items: + $ref: '#/components/schemas/EndpointsCloudConnectorProposalFile' + nullable: true + type: array + prUrl: + type: string + preparedExclude: + items: + type: string + type: array + preparedInclude: + items: + type: string + type: array + repo: + type: string + repositoryId: + type: string + retiredEgressIps: + items: + type: string + type: array + runId: + type: string + status: + type: string + title: + type: string + required: + - runId + - status + - repo + - repositoryId + - baseBranch + - baseSha + - title + - body + - digest + - files + type: object + EndpointsCloudConnectorProposalFile: properties: - clientId: + action: + enum: + - create + - update type: string - createdAt: - format: date-time + before: type: string - tenantId: + content: type: string - updatedAt: - format: date-time + path: type: string required: - - clientId - - tenantId - - createdAt - - updatedAt + - path + - action + - before + - content type: object - EndpointsAdminBotInteraction: + EndpointsCloudReconAccountOverviewDTO: properties: - campaignId: - nullable: true - type: string - eventCreatedAt: - nullable: true + accountId: type: string - eventDescription: - nullable: true + discoveryCompleteness: type: string - eventId: - nullable: true + explorationStatus: type: string - eventStatus: - nullable: true + exposure: + $ref: '#/components/schemas/EndpointsCloudReconExposureSummaryDTO' + graphCoverage: + $ref: '#/components/schemas/EndpointsCloudReconGraphCoverageDTO' + graphGapsBlocking: + type: integer + hotspotCounts: + $ref: '#/components/schemas/EndpointsCloudReconSeverityCounts' + hotspotTotal: + type: integer + iamRedFlags: + $ref: '#/components/schemas/EndpointsCloudReconIamRedFlagsDTO' + infrastructureSummary: + $ref: '#/components/schemas/EndpointsCloudReconInfrastructureSummaryDTO' + metadata: + $ref: '#/components/schemas/EndpointsCloudReconSynthesisMetadataDTO' + provider: type: string - findingId: + scanId: type: string - findingTitle: + scanStatus: type: string - findingType: - $ref: '#/components/schemas/ModelsFindingType' - interactionType: + summary: type: string - prLink: + topHotspots: + items: + $ref: '#/components/schemas/EndpointsCloudReconHotspotSummaryDTO' nullable: true + type: array + type: object + EndpointsCloudReconAccountSummaryDTO: + properties: + accountId: type: string - prNumber: - nullable: true + boundaryCount: + type: integer + discoveryCompleteness: type: string - prStatus: - nullable: true + environment: type: string - repository: + explorationStatus: type: string - ticketKey: - nullable: true + hotspotCounts: + $ref: '#/components/schemas/EndpointsCloudReconSeverityCounts' + hotspotTotal: + type: integer + internetFacingCount: + type: integer + provider: type: string - ticketUrl: + trustedServiceCount: + type: integer + type: object + EndpointsCloudReconCapabilitiesDTO: + properties: + hasApiGateway: nullable: true - type: string - required: - - findingType - - findingId - - findingTitle - - repository - - interactionType + type: boolean + hasAuditLogging: + nullable: true + type: boolean + hasContainerServices: + nullable: true + type: boolean + hasCrossAccountDependencies: + nullable: true + type: boolean + hasDatabases: + nullable: true + type: boolean + hasFlowLogs: + nullable: true + type: boolean + hasKubernetes: + nullable: true + type: boolean + hasLoadBalancers: + nullable: true + type: boolean + hasMessageQueues: + nullable: true + type: boolean + hasObjectStorage: + nullable: true + type: boolean + hasServerlessFunctions: + nullable: true + type: boolean type: object - EndpointsAdminBotInteractionSummary: + EndpointsCloudReconComputeInventoryDTO: properties: - autofixPR: + containerServices: + nullable: true type: integer - internetSearch: + kubernetesWorkloads: + nullable: true type: integer other: + nullable: true type: integer - prComment: + serverlessFunctions: + nullable: true type: integer - ticketCreate: + totalComputeServices: + nullable: true type: integer - total: + virtualMachines: + nullable: true type: integer - required: - - autofixPR - - internetSearch - - ticketCreate - - prComment - - other - - total type: object - EndpointsAdminBotInteractionsOutput: + EndpointsCloudReconCrossAccountRelationshipDTO: properties: - interactions: - items: - $ref: '#/components/schemas/EndpointsAdminBotInteraction' + confidence: + type: string + description: + type: string + direction: + type: string + externalAccountId: + type: string + id: + type: string + isWideOpen: nullable: true - type: array - summary: - $ref: '#/components/schemas/EndpointsAdminBotInteractionSummary' - required: - - summary - - interactions - type: object - EndpointsAdminChecklistOutput: - properties: - items: + type: boolean + nodeIds: items: - $ref: '#/components/schemas/ModelsChecklistItem' - nullable: true + type: string type: array - required: - - items - type: object - EndpointsAdminDeleteAWSSettingsOutput: - properties: - message: + relationshipType: type: string - success: - type: boolean - type: object - EndpointsAdminDeleteAzureSettingsOutput: - properties: - message: + resourceId: type: string - success: - type: boolean type: object - EndpointsAdminDeleteGCPSettingsOutput: + EndpointsCloudReconDiscoveredNodeDTO: properties: - message: + cidr: type: string - success: - type: boolean - type: object - EndpointsAdminFileContentsOutput: - properties: - data: + nodeId: type: string - required: - - data - type: object - EndpointsAdminFileOwnersInput: - properties: - files: - items: - $ref: '#/components/schemas/EndpointsFileOwnersRequest' + objectType: + type: string + portFrom: nullable: true - type: array - required: - - files - type: object - EndpointsAdminFileOwnersOutput: - properties: - data: - items: - $ref: '#/components/schemas/ModelsFileOwners' + type: integer + portTo: nullable: true - type: array - required: - - data - type: object - EndpointsAdminFindingsDownloadInput: - properties: - query: - $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' - required: - - query - type: object - EndpointsAdminFindingsDownloadOutput: - properties: - csv: + type: integer + properties: + format: base64 + type: string + protocol: + type: string + publicFlag: + nullable: true + type: boolean + region: + type: string + source: + type: string + subType: + type: string + subnetId: + type: string + vpcId: type: string type: object - EndpointsAdminFixEffortMapInput: + EndpointsCloudReconExposureSummaryDTO: properties: - easy: + criticalNetworkExposureCount: type: integer - hard: + internetReachableFlowCount: type: integer - id: - type: string - medium: + internetReachableServiceCount: + type: integer + publicDataStoreCount: + type: integer + wideOpenCrossAccountCount: type: integer - required: - - id - - easy - - medium - - hard type: object - EndpointsAdminFixEffortMapOutput: + EndpointsCloudReconGraphCoverageDTO: properties: - createdAt: - type: string - easy: + discoveredCount: type: integer - hard: + edgeCount: type: integer - id: - type: string - medium: + hotspotCount: + type: integer + nodeCount: type: integer - updatedAt: - type: string - required: - - id - - easy - - medium - - hard type: object - EndpointsAdminGetAWSSettingsOutput: + EndpointsCloudReconGraphGapDTO: properties: - awsAccounts: - items: - $ref: '#/components/schemas/ModelsAWSAccountWithStatus' + blocksAnalysis: nullable: true - type: array - createdAt: + type: boolean + category: type: string - externalId: + confidence: type: string - iamRoleName: + description: type: string - lastValidatedAt: + id: type: string - lastValidationStatus: + missingObjectType: type: string - nullifyK8sCollectorRoleArn: + relatedArtifactIds: + items: + type: string + type: array + relatedNodeIds: + items: + type: string + type: array + severity: type: string - nullifyKMSKeyArn: + suggestedNextStep: type: string - nullifyRoleArn: + type: object + EndpointsCloudReconHotspotDTO: + properties: + category: type: string - nullifyS3Bucket: + confidence: type: string - overallStatus: + description: type: string - preferredDeployment: - $ref: '#/components/schemas/ModelsDeploymentType' - updatedAt: + hotspotId: + type: string + nodeIds: + items: + type: string + type: array + severity: + type: string + title: type: string type: object - EndpointsAdminGetAzureConfigOutput: + EndpointsCloudReconHotspotSummaryDTO: properties: - clientSecretUploaded: - type: boolean - configUploaded: + category: + type: string + confidence: + type: string + id: + type: string + internetFacing: + nullable: true type: boolean - configuration: - $ref: '#/components/schemas/EndpointsAdminAzureConfigOutput' - redactedClientSecret: + severity: type: string - version: + title: type: string - required: - - configUploaded - - clientSecretUploaded type: object - EndpointsAdminGetAzureSettingsOutput: + EndpointsCloudReconIamFindingDTO: properties: - clientId: - type: string - createdAt: + finding: type: string - displayName: + resourceId: type: string - lastValidatedAt: + resourceType: type: string - lastValidationStatus: + severity: type: string - overallStatus: + type: object + EndpointsCloudReconIamPostureDTO: + properties: + confidence: type: string - subscriptions: - items: - $ref: '#/components/schemas/ModelsAzureSubscriptionWithStatus' + crossAccountRoleCount: nullable: true + type: integer + findings: + items: + $ref: '#/components/schemas/EndpointsCloudReconIamFindingDTO' type: array - tenantId: + mfaAdoptionRate: type: string - updatedAt: - type: string - useManagedIdentity: + overlyPermissiveRoleCount: + nullable: true + type: integer + rootAccountSecured: + nullable: true type: boolean + serviceAccountCount: + nullable: true + type: integer + staleCredentialCount: + nullable: true + type: integer + totalRoles: + nullable: true + type: integer type: object - EndpointsAdminGetFindingOutput: - properties: - finding: - $ref: '#/components/schemas/ModelsUnifiedFindingPreview' - required: - - finding - type: object - EndpointsAdminGetFixEffortOutput: + EndpointsCloudReconIamRedFlagsDTO: properties: - fixEffort: - $ref: '#/components/schemas/EndpointsAdminFixEffortMapOutput' - version: + criticalFindingCount: + type: integer + crossAccountRoleCount: + nullable: true + type: integer + mfaAdoptionRate: type: string - required: - - fixEffort + overlyPermissiveRoleCount: + nullable: true + type: integer + rootAccountSecured: + nullable: true + type: boolean + staleCredentialCount: + nullable: true + type: integer + totalRoles: + nullable: true + type: integer type: object - EndpointsAdminGetGCPSettingsOutput: + EndpointsCloudReconInfrastructureSummaryDTO: properties: - createdAt: + capabilities: + $ref: '#/components/schemas/EndpointsCloudReconCapabilitiesDTO' + computeInventory: + $ref: '#/components/schemas/EndpointsCloudReconComputeInventoryDTO' + confidence: type: string - displayName: + criticalDataStoreCount: + nullable: true + type: integer + crossAccountDependencyCount: + nullable: true + type: integer + environment: type: string - gkeClusterOidcIssuerUrls: + graphGapCount: + nullable: true + type: integer + internetFacingHotspotCount: + nullable: true + type: integer + majorTrafficFlowCount: + nullable: true + type: integer + regions: items: type: string type: array - gkeServiceAccountUniqueId: + securityBoundaryCount: + nullable: true + type: integer + trustedServiceCount: + nullable: true + type: integer + type: object + EndpointsCloudReconNetworkExposureDTO: + properties: + cidr: type: string - lastValidatedAt: + cidrDirection: type: string - lastValidationStatus: + confidence: type: string - nullifyK8sCollectorRoleArn: + description: type: string - overallStatus: + exposureType: type: string - projects: + id: + type: string + nodeIds: items: - $ref: '#/components/schemas/ModelsGCPProjectWithStatus' - nullable: true + type: string type: array - updatedAt: + port: + nullable: true + type: integer + protocol: type: string - workloadIdentityProvider: + resourceId: type: string - workloadIdentityServiceAccountEmail: + resourceType: + type: string + severity: type: string type: object - EndpointsAdminGetGitHubAppSettingsOutput: + EndpointsCloudReconOrgSynthesisDTO: properties: - error: - type: string - events: - items: - type: string - nullable: true - type: array - incorrect_permissions: - additionalProperties: - $ref: '#/components/schemas/EndpointsIncorrectPermission' - nullable: true - type: object - installation_id: - format: int64 + accountCount: type: integer - missing_events: - items: - type: string - nullable: true - type: array - missing_permissions: - additionalProperties: - type: string - nullable: true - type: object - permissions: - additionalProperties: - type: string + aggregateMetadata: {} + combinedMermaidDiagram: + type: string + combinedSummary: + type: string + completedAt: + format: date-time nullable: true - type: object - required: - - events - - permissions - - installation_id - - missing_events - - missing_permissions - - incorrect_permissions - type: object - EndpointsAdminGetIntegrationTeamsOutput: - properties: - teams: + type: string + crossAccountCorrelations: {} + modelName: + type: string + organizationId: + type: string + perAccountSummaries: items: - $ref: '#/components/schemas/ModelsTeam' - nullable: true + $ref: '#/components/schemas/EndpointsCloudReconAccountSummaryDTO' type: array - version: + provider: type: string - required: - - teams - type: object - EndpointsAdminGetIntegrationUsersOutput: - properties: - users: + s3Bucket: + type: string + s3Key: + type: string + scanRunId: + type: string + schemaVersion: + type: string + sourceAccountIds: items: - $ref: '#/components/schemas/ModelsUser' + type: string nullable: true - type: array - version: - type: string - required: - - users - type: object - EndpointsAdminGetJiraConfigOutput: - properties: - configuration: - $ref: '#/components/schemas/ModelsJiraConfig' - enabled: - type: boolean - version: + type: array + startedAt: + format: date-time + type: string + status: type: string - required: - - enabled type: object - EndpointsAdminGetOrganizationOutput: + EndpointsCloudReconScanMetadataDTO: properties: - organization: - $ref: '#/components/schemas/ModelsOrganization' - version: + accountId: + type: string + completedAt: + format: date-time + nullable: true + type: string + discoveredCount: + type: integer + edgeCount: + type: integer + hotspotCount: + type: integer + inputGraphHash: + type: string + modelName: + type: string + nodeCount: + type: integer + provider: + type: string + s3Bucket: + type: string + s3Key: + type: string + scanId: + type: string + schemaVersion: + type: string + startedAt: + format: date-time + type: string + status: type: string type: object - EndpointsAdminGetRepositoriesOutput: + EndpointsCloudReconSecurityBoundaryDTO: properties: - nextToken: + confidence: type: string - numItems: - type: integer - repositories: + dataClassification: + type: string + description: + type: string + egressNodeIds: items: - $ref: '#/components/schemas/ModelsRepositoryPublic' - nullable: true + type: string type: array - version: + exposure: type: string - required: - - repositories - - numItems - - nextToken - type: object - EndpointsAdminGetUserInstallationsOutput: - properties: - installations: + id: + type: string + ingressNodeIds: items: - $ref: '#/components/schemas/EndpointsAdminInstallationOutput' - nullable: true + type: string type: array - version: + name: type: string - required: - - installations - type: object - EndpointsAdminGetUsersOutput: - properties: - users: + nodeIds: items: - $ref: '#/components/schemas/ModelsUser' + type: string type: array - version: + trustLevel: + type: string + type: type: string type: object - EndpointsAdminInstallationOutput: + EndpointsCloudReconSeverityCounts: properties: - avatarUrl: + critical: + type: integer + high: + type: integer + low: + type: integer + medium: + type: integer + type: object + EndpointsCloudReconSynthesisMetadataDTO: + properties: + completedAt: type: string - name: + durationSeconds: + format: double + type: number + generatorModel: type: string - nullifyBaseUrl: - nullable: true + generatorPromptVersion: + type: string + startedAt: type: string - provider: - $ref: '#/components/schemas/ModelsOwnerProvider' - queryParameters: - additionalProperties: - type: string - nullable: true - type: object - required: - - provider - - name - - avatarUrl - - queryParameters type: object - EndpointsAdminK8SConnectorWhitelistInput: + EndpointsCloudReconTenantTrustDTO: properties: - accountIds: - description: Optional list of AWS account IDs to whitelist. If empty, all accounts from stored AWS settings are used. + externalAccountId: + type: string + trustingAccountCount: + type: integer + trustingAccounts: items: type: string + nullable: true type: array type: object - EndpointsAdminK8SConnectorWhitelistOutput: + EndpointsCloudReconTopologyDTO: properties: - kmsError: + discoveryCompleteness: type: string - kmsPolicyUpdated: - type: boolean - message: + edgeCount: + type: integer + explorationStatus: type: string - s3Error: + mermaidDiagram: type: string - s3PolicyUpdated: - type: boolean + nodeCount: + type: integer type: object - EndpointsAdminListUnifiedEventsByTeamInput: + EndpointsCloudReconTrafficFlowDTO: properties: - afterId: - nullable: true + boundaryIds: + items: + type: string + type: array + confidence: type: string - afterTimeUnix: - nullable: true - type: integer - autofixId: - nullable: true + dataClassification: type: string - beforeTimeUnix: - nullable: true - type: integer - campaignId: - nullable: true + description: type: string - eventTypes: + id: + type: string + internetReachable: + nullable: true + type: boolean + pathEdgeTypes: items: type: string type: array - findingIds: + pathNodeIds: items: type: string type: array - limit: - nullable: true - type: integer - prCanonicalId: - nullable: true + protocol: type: string - runId: - nullable: true + sourceNodeId: type: string - services: + targetNodeId: + type: string + title: + type: string + trustedServiceIds: items: type: string type: array type: object - EndpointsAdminListUnifiedEventsInput: + EndpointsCloudReconTrustedServiceDTO: properties: - afterId: - nullable: true - type: string - afterTimeUnix: - nullable: true - type: integer - autofixId: - nullable: true - type: string - beforeTimeUnix: - nullable: true - type: integer - campaignId: - nullable: true - type: string - eventTypes: + accessedByNodeIds: items: type: string type: array - findingIds: + boundaryIds: items: type: string type: array - limit: - nullable: true - type: integer - prCanonicalId: + category: + type: string + confidence: + type: string + dataClassification: + type: string + description: + type: string + encryptionAtRest: nullable: true + type: boolean + id: type: string - runId: + internetReachable: nullable: true + type: boolean + name: type: string - services: + nodeIds: items: type: string type: array - type: object - EndpointsAdminListUnifiedEventsOutput: - properties: - events: - items: - $ref: '#/components/schemas/EndpointsUnifiedEventOutput' - nullable: true - type: array - hasMore: - type: boolean - nextCursorId: - nullable: true + publicAccess: type: string - nextCursorTime: - nullable: true - type: integer - version: + serviceType: type: string type: object - EndpointsAdminPostAzureCredentialsInput: + EndpointsClusterAssetDetailsView: properties: - clientId: - type: string - clientSecret: - type: string - tenantId: - type: string + awsEcsCluster: + $ref: '#/components/schemas/EndpointsAWSECSClusterDetailsView' + awsEksCluster: + $ref: '#/components/schemas/EndpointsAWSEKSClusterDetailsView' + azureAks: + $ref: '#/components/schemas/EndpointsAzureAKSDetailsView' + gcpGke: + $ref: '#/components/schemas/EndpointsGCPGKEDetailsView' + k8sCluster: + $ref: '#/components/schemas/EndpointsK8SClusterDetailsView' + subType: + $ref: '#/components/schemas/ModelsClusterSubType' required: - - clientId - - tenantId + - subType type: object - EndpointsAdminPostAzureCredentialsOutput: + EndpointsClusterAssetView: properties: - clientId: + accountId: type: string - clientSecret: + controlPlaneLogging: + type: boolean + deletedAtScanId: type: string - createdAt: - format: date-time + endpointVisibility: type: string - tenantId: + externalId: type: string - updatedAt: - format: date-time + firstFoundScanId: type: string - version: + firstSeenAt: type: string - required: - - clientId - - tenantId - - createdAt - - updatedAt - type: object - EndpointsAdminPostAzureInstallOutput: - properties: - version: + id: type: string - type: object - EndpointsAdminPutFixEffortInput: - properties: - fixEffort: - $ref: '#/components/schemas/EndpointsAdminFixEffortMapInput' - required: - - fixEffort - type: object - EndpointsAdminPutFixEffortOutput: - properties: - version: + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + kubernetesVersion: type: string - type: object - EndpointsAdminQueryFindingsInput: - properties: - query: - $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' - required: - - query - type: object - EndpointsAdminQueryFindingsMetricsInput: - properties: - query: - $ref: '#/components/schemas/ModelsLimitedUnifiedFindingsQuery' - required: - - query - type: object - EndpointsAdminQueryFindingsMetricsOutput: - properties: - findingsAnalysis: - $ref: '#/components/schemas/ModelsFindingsMetrics' - version: + lastSeenAt: type: string - required: - - findingsAnalysis - type: object - EndpointsAdminQueryFindingsOutput: - properties: - findings: - items: - $ref: '#/components/schemas/ModelsUnifiedFindingPreview' - nullable: true - type: array - hasMoreData: - type: boolean - page: - type: integer - scrollId: - nullable: true + name: type: string - total: + networkPlugin: + type: string + nodeCount: type: integer - version: + oidcProviderUrl: type: string - required: - - findings - - page - - hasMoreData - - total - type: object - EndpointsAdminUpsertAWSSettingsInput: - properties: - awsAccounts: - items: - $ref: '#/components/schemas/ModelsAWSAccount' - nullable: true - type: array - externalId: + podSecurityStandard: type: string - iamRoleName: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + rbacEnabled: + type: boolean + region: type: string - preferredDeployment: + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string + subType: + $ref: '#/components/schemas/ModelsClusterSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object required: - - iamRoleName - - awsAccounts - - preferredDeployment + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsCodeDeclaredHostDetailsView: + type: object + EndpointsComputeAssetDetailsView: + properties: + awsAutoscalingGroup: + $ref: '#/components/schemas/EndpointsAWSAutoscalingGroupDetailsView' + awsEc2: + $ref: '#/components/schemas/EndpointsAWSEC2DetailsView' + awsWorkspace: + $ref: '#/components/schemas/EndpointsAWSWorkspaceDetailsView' + azureVirtualDesktop: + $ref: '#/components/schemas/EndpointsAzureVirtualDesktopDetailsView' + azureVm: + $ref: '#/components/schemas/EndpointsAzureVMDetailsView' + azureVmss: + $ref: '#/components/schemas/EndpointsAzureVMSSDetailsView' + gcpGce: + $ref: '#/components/schemas/EndpointsGCPGCEDetailsView' + gcpMig: + $ref: '#/components/schemas/EndpointsGCPMIGDetailsView' + k8sNode: + $ref: '#/components/schemas/EndpointsK8SNodeDetailsView' + subType: + $ref: '#/components/schemas/ModelsComputeSubType' + required: + - subType type: object - EndpointsAdminUpsertAWSSettingsOutput: + EndpointsComputeAssetView: properties: - awsAccounts: - items: - $ref: '#/components/schemas/ModelsAWSAccountWithStatus' - nullable: true - type: array - externalId: + accountId: type: string - lastValidatedAt: + deletedAtScanId: type: string - lastValidationStatus: + externalId: type: string - message: + firstFoundScanId: type: string - nullifyKMSKeyArn: + firstSeenAt: type: string - nullifyRoleArn: + iamRoleArn: type: string - nullifyS3Bucket: + id: type: string - overallStatus: + imageId: type: string - type: object - EndpointsAdminUpsertAzureSettingsInput: - properties: - clientId: + instanceType: type: string - clientSecret: + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: type: string - displayName: + name: type: string - subscriptions: - items: - $ref: '#/components/schemas/ModelsAzureSubscriptionInput' - type: array - tenantId: + osPlatform: type: string - useManagedIdentity: - type: boolean - required: - - tenantId - type: object - EndpointsAdminUpsertAzureSettingsOutput: - properties: - clientId: + privateIp: type: string - displayName: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + publicIp: type: string - lastValidatedAt: + region: type: string - lastValidationStatus: + sourceScanId: type: string - message: + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string - overallStatus: + subType: + $ref: '#/components/schemas/ModelsComputeSubType' + subnetId: type: string - subscriptions: - items: - $ref: '#/components/schemas/ModelsAzureSubscriptionWithStatus' + tags: + additionalProperties: + type: string nullable: true - type: array - tenantId: + type: object + vpcId: type: string - useManagedIdentity: - type: boolean + workloadType: + $ref: '#/components/schemas/ModelsComputeWorkloadType' + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsConnectivityAssetDetailsView: + properties: + awsDirectConnect: + $ref: '#/components/schemas/EndpointsAWSDirectConnectDetailsView' + awsGlobalAccelerator: + $ref: '#/components/schemas/EndpointsAWSGlobalAcceleratorDetailsView' + awsNetworkFirewall: + $ref: '#/components/schemas/EndpointsAWSNetworkFirewallDetailsView' + awsPrivateLink: + $ref: '#/components/schemas/EndpointsAWSPrivateLinkDetailsView' + awsTgwAttachment: + $ref: '#/components/schemas/EndpointsAWSTGWAttachmentDetailsView' + awsVpnConnection: + $ref: '#/components/schemas/EndpointsAWSVPNConnectionDetailsView' + azureExpressRoute: + $ref: '#/components/schemas/EndpointsAzureExpressRouteDetailsView' + azureFirewall: + $ref: '#/components/schemas/EndpointsAzureFirewallDetailsView' + azureVpn: + $ref: '#/components/schemas/EndpointsAzureVPNDetailsView' + gcpCloudArmor: + $ref: '#/components/schemas/EndpointsGCPCloudArmorDetailsView' + gcpFirewallRule: + $ref: '#/components/schemas/EndpointsGCPFirewallRuleDetailsView' + gcpVpcServiceControls: + $ref: '#/components/schemas/EndpointsGCPVPCServiceControlsDetailsView' + gcpVpnTunnel: + $ref: '#/components/schemas/EndpointsGCPVPNTunnelDetailsView' + subType: + $ref: '#/components/schemas/ModelsConnectivitySubType' + required: + - subType type: object - EndpointsAdminUpsertGCPSettingsInput: + EndpointsConnectivityAssetView: properties: - displayName: + accountId: type: string - gkeClusterOidcIssuerUrls: - items: - type: string - type: array - gkeServiceAccountUniqueId: + allowedPrincipalsCount: + type: integer + bandwidthMbps: + type: integer + bgpAsn: + type: integer + connectionType: type: string - projects: - items: - $ref: '#/components/schemas/ModelsGCPProjectInput' - type: array - workloadIdentityProvider: + deletedAtScanId: type: string - workloadIdentityServiceAccountEmail: + encryptionAlgorithm: type: string - required: - - workloadIdentityProvider - - workloadIdentityServiceAccountEmail - type: object - EndpointsAdminUpsertGCPSettingsOutput: - properties: - displayName: + endpointDns: type: string - gkeClusterOidcIssuerUrls: - items: - type: string - type: array - gkeServiceAccountUniqueId: + externalId: type: string - lastValidatedAt: + firstFoundScanId: type: string - lastValidationStatus: + firstSeenAt: type: string - message: + id: type: string - nullifyK8sCollectorRoleArn: + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: type: string - overallStatus: + name: type: string - projects: - items: - $ref: '#/components/schemas/ModelsGCPProjectWithStatus' - nullable: true - type: array - workloadIdentityProvider: + peerCidrOrOrg: type: string - workloadIdentityServiceAccountEmail: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: type: string - type: object - EndpointsAdminUsageAggregateGroup: - properties: - agent: - nullable: true + sourceScanId: type: string - branchType: - nullable: true + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string - class: + subType: + $ref: '#/components/schemas/ModelsConnectivitySubType' + tags: + additionalProperties: + type: string nullable: true + type: object + tunnelStatus: type: string + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsContainerAssetDetailsView: + properties: + awsEcsService: + $ref: '#/components/schemas/EndpointsAWSECSServiceDetailsView' + awsEcsTask: + $ref: '#/components/schemas/EndpointsAWSECSTaskDetailsView' + awsEcsTaskDefinition: + $ref: '#/components/schemas/EndpointsAWSECSTaskDefinitionDetailsView' + azureAci: + $ref: '#/components/schemas/EndpointsAzureACIDetailsView' + azureAppService: + $ref: '#/components/schemas/EndpointsAzureAppServiceDetailsView' + gcpCloudRun: + $ref: '#/components/schemas/EndpointsGCPCloudRunDetailsView' + k8sDaemonSet: + $ref: '#/components/schemas/EndpointsK8SDaemonSetDetailsView' + k8sDeployment: + $ref: '#/components/schemas/EndpointsK8SDeploymentDetailsView' + k8sNamespace: + $ref: '#/components/schemas/EndpointsK8SNamespaceDetailsView' + k8sPod: + $ref: '#/components/schemas/EndpointsK8SPodDetailsView' + k8sStatefulSet: + $ref: '#/components/schemas/EndpointsK8SStatefulSetDetailsView' + subType: + $ref: '#/components/schemas/ModelsContainerSubType' + required: + - subType type: object - EndpointsAdminUsageLedgerEntry: + EndpointsContainerAssetView: properties: - agent: + accountId: type: string - at: + clusterId: type: string - branchType: + deletedAtScanId: type: string - budgetKeys: + deployedBy: + type: string + exposedPorts: items: type: string - nullable: true type: array - class: + externalId: type: string - commitSha: + firstFoundScanId: type: string - entryId: + firstSeenAt: type: string - environment: + id: type: string - findingId: + imageDigest: type: string - llm: - additionalProperties: {} - type: object - notes: + imageRef: type: string - prNumber: - nullable: true - type: integer - projectId: + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: type: string - repo: + name: type: string - runId: + namespace: type: string - status: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: type: string - trigger: + replicas: + type: integer + serviceAccount: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsContainerSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + workloadKind: type: string - usd: - format: double - type: number required: - - entryId - - at - - runId - - agent - - class - - branchType - - usd - - status - - trigger - - budgetKeys + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt type: object - EndpointsAdminUsageLedgerResponse: + EndpointsContextApproveCloudConnectorProposalInput: properties: - entries: - items: - $ref: '#/components/schemas/EndpointsAdminUsageLedgerEntry' - nullable: true - type: array - nextToken: - nullable: true + digest: + maxLength: 64 + minLength: 64 type: string required: - - entries + - digest type: object - EndpointsAdminUsageMetricsAggregateItem: + EndpointsContextApproveCloudConnectorProposalOutput: properties: - group: - $ref: '#/components/schemas/EndpointsAdminUsageAggregateGroup' - inputTokens: - format: int64 - type: integer - outputTokens: - format: int64 - type: integer - runCount: - format: int64 - type: integer - usd: - format: double - type: number + prUrl: + type: string required: - - group - - usd - - runCount - - inputTokens - - outputTokens + - prUrl type: object - EndpointsAdminUsageMetricsAggregateOutput: + EndpointsContextApproveWAFAllowlistProposalInput: properties: - asOf: - type: string - totals: - items: - $ref: '#/components/schemas/EndpointsAdminUsageMetricsAggregateItem' - nullable: true - type: array - window: + digest: + maxLength: 64 + minLength: 64 type: string required: - - window - - asOf - - totals + - digest type: object - EndpointsAdminUsageMetricsTimeseriesBucket: + EndpointsContextGetCloudConnectorPRRunOutput: properties: - agent: - type: string - class: + pr: + $ref: '#/components/schemas/EndpointsCloudConnectorPRRecord' + run: + $ref: '#/components/schemas/EndpointsRunStatus' + status: + enum: + - waiting + - retry_wait + - queued + - in_progress + - prepared + - creating + - completed + - failed + - no_iac_repo_found + - no_allowlist_found + - superseded type: string - inputTokens: - format: int64 - type: integer - outputTokens: - format: int64 - type: integer - timestamp: + version: type: string - usd: - format: double - type: number required: - - timestamp - - agent - - class - - usd - - inputTokens - - outputTokens + - run + - status type: object - EndpointsAdminUsageMetricsTimeseriesOutput: + EndpointsContextGetCloudConnectorPRStatusOutput: properties: - buckets: - items: - $ref: '#/components/schemas/EndpointsAdminUsageMetricsTimeseriesBucket' - nullable: true - type: array - from: - type: string - granularity: - type: string - to: - type: string + automation: + $ref: '#/components/schemas/EndpointsCloudConnectorAutomation' + pr: + $ref: '#/components/schemas/EndpointsCloudConnectorPRRecord' + preparationAvailable: + type: boolean + run: + $ref: '#/components/schemas/EndpointsCloudConnectorPRRunStatus' + type: object + EndpointsContextGetCloudConnectorProposalOutput: + properties: + proposal: + $ref: '#/components/schemas/EndpointsCloudConnectorProposal' required: - - granularity - - from - - to - - buckets + - proposal type: object - EndpointsAdminValidateAWSRoleInput: + EndpointsContextGetCloudScanStatusOutput: properties: - accountIds: + overallStatus: + type: string + providers: items: - type: string + $ref: '#/components/schemas/EndpointsProviderScanStatus' nullable: true type: array - onboarding: - type: boolean - roleNameToAssume: + scanId: type: string required: - - accountIds + - scanId + - overallStatus + - providers type: object - EndpointsAdminValidateAWSRoleOutput: + EndpointsContextRecoverCloudConnectorProposalInput: properties: - lastValidatedAt: - type: string - lastValidationStatus: - type: string - overallStatus: + confirmNoPullRequest: + type: boolean + digest: + maxLength: 64 + minLength: 64 type: string - results: - additionalProperties: - $ref: '#/components/schemas/EndpointsAccountValidationResult' - nullable: true - type: object + required: + - digest + - confirmNoPullRequest type: object - EndpointsAdminValidateGCPInput: + EndpointsContextRecoverCloudConnectorProposalOutput: properties: - projectIds: - items: - type: string - type: array + prUrl: + type: string + recovered: + type: boolean + required: + - recovered type: object - EndpointsAdminValidateGCPOutput: + EndpointsContextRecoverWAFAllowlistProposalInput: properties: - lastValidatedAt: + confirmNoPullRequest: + type: boolean + digest: + maxLength: 64 + minLength: 64 type: string - lastValidationStatus: - $ref: '#/components/schemas/EndpointsCloudValidationStatus' - overallStatus: - $ref: '#/components/schemas/EndpointsCloudValidationStatus' - results: - additionalProperties: - $ref: '#/components/schemas/EndpointsGCPProjectValidationResult' - nullable: true - type: object + required: + - digest + - confirmNoPullRequest type: object - EndpointsCloudValidationStatus: - enum: - - healthy - - unhealthy - type: string - EndpointsContextEnvironment: - enum: - - development - - staging - - production - - unknown - type: string - EndpointsContextIngestCreds: + EndpointsContextStartCloudConnectorPRRunInput: properties: - accessKeyId: - type: string - expiration: - type: string - secretAccessKey: + digest: type: string - sessionToken: + expectedRunId: type: string type: object - EndpointsContextIngestInput: + EndpointsContextStartCloudConnectorPRRunOutput: properties: - branch: - description: Git branch name (e.g. main, feat/add-vpc) - type: string - commitSha: - description: Git commit SHA - type: string - contextType: - description: Context data type (e.g. terraform, ci_logs) + executionArn: type: string - environment: - $ref: '#/components/schemas/EndpointsContextEnvironment' - fromPR: - description: PR number that originated this deployment (set on push-to-main after merge) - type: integer - name: - description: >- - Logical name for this context (e.g. networking, ecs-api, CI). Auto-detected by CLI from plan file path or - workflow name. + runId: type: string - prNumber: - description: Pull request number (for PR-scoped uploads) + statusCode: type: integer - repository: - description: Repository in org/repo format - type: string - required: - - contextType - - repository - - name type: object - EndpointsContextIngestOutput: + EndpointsContextStartCloudScanOutput: properties: - bucket: - type: string - credentials: - $ref: '#/components/schemas/EndpointsContextIngestCreds' - keyPrefix: + executionArn: type: string - kmsKeyArn: + runId: type: string - region: + scanId: type: string - type: object - EndpointsCount: - properties: - number: - type: integer - startTimeStamp: - format: int64 + statusCode: type: integer - required: - - startTimeStamp - - number type: object - EndpointsDeleteBuildkiteIntegrationOutput: + EndpointsContextStartRepoScopeScanInput: properties: - message: - type: string - version: - type: string - required: - - version - - message + includeArchived: + type: boolean type: object - EndpointsDeleteCircleCIIntegrationOutput: + EndpointsContextStartRepoScopeScanOutput: properties: - message: + executionArn: type: string - version: + scanId: type: string - required: - - version - - message + statusCode: + type: integer type: object - EndpointsDeleteJenkinsIntegrationOutput: + EndpointsContextStartWAFAllowlistPRRunInput: properties: - message: + digest: type: string - version: + expectedRunId: type: string - required: - - version - - message type: object - EndpointsDeleteRepositoryPropertyTeamKeyOutput: + EndpointsCratesDetailsView: + type: object + EndpointsCreateOrganizationInput: properties: - version: - type: string + organization: + $ref: '#/components/schemas/ModelsOrgContext' type: object - EndpointsDeleteServiceAccountOutput: + EndpointsCreateOrganizationOutput: properties: + organization: + $ref: '#/components/schemas/ModelsOrgContext' version: type: string type: object - EndpointsDeleteTeamOutput: + EndpointsCreateRepoScanInput: properties: - version: + branch: + type: string + commitSha: + type: string + projectsTouched: + items: + $ref: '#/components/schemas/EndpointsRepoScanProjectTouched' + type: array + repositoryId: + type: string + sbomsGenerated: + items: + $ref: '#/components/schemas/EndpointsRepoScanSBOMGenerated' + type: array + status: type: string + subagentsRun: + additionalProperties: + $ref: '#/components/schemas/EndpointsRepoScanSubagent' + type: object + required: + - repositoryId + - commitSha type: object - EndpointsDeleteUISavedViewOutput: + EndpointsCreateRepoScanOutput: properties: - id: + scan: + $ref: '#/components/schemas/EndpointsRepoScanSummary' + version: type: string required: - - id + - scan type: object - EndpointsDeleteUserErasureOutput: - properties: - report: - $ref: '#/components/schemas/EndpointsErasureReport' + EndpointsDataPipelineAssetDetailsView: + properties: + awsAthena: + $ref: '#/components/schemas/EndpointsAWSAthenaDetailsView' + awsEmr: + $ref: '#/components/schemas/EndpointsAWSEMRDetailsView' + awsGlue: + $ref: '#/components/schemas/EndpointsAWSGlueDetailsView' + azureBatch: + $ref: '#/components/schemas/EndpointsAzureBatchDetailsView' + azureDataFactory: + $ref: '#/components/schemas/EndpointsAzureDataFactoryDetailsView' + azureDatabricks: + $ref: '#/components/schemas/EndpointsAzureDatabricksDetailsView' + azureHdInsight: + $ref: '#/components/schemas/EndpointsAzureHDInsightDetailsView' + azureSynapse: + $ref: '#/components/schemas/EndpointsAzureSynapseDetailsView' + gcpCloudBatch: + $ref: '#/components/schemas/EndpointsGCPCloudBatchDetailsView' + gcpDataflow: + $ref: '#/components/schemas/EndpointsGCPDataflowDetailsView' + gcpDataproc: + $ref: '#/components/schemas/EndpointsGCPDataprocDetailsView' + gcpWorkflows: + $ref: '#/components/schemas/EndpointsGCPWorkflowsDetailsView' + subType: + $ref: '#/components/schemas/ModelsDataPipelineSubType' + required: + - subType type: object - EndpointsErasureReport: + EndpointsDataPipelineAssetView: properties: - adminUserDeleted: + accountId: + type: string + dataEncryptionEnabled: type: boolean - auditLogsAnonymized: - format: int64 - type: integer - erasedAt: + deletedAtScanId: type: string - privacyAcknowledgmentsDeleted: - format: int64 - type: integer - teamMembershipsDeleted: - format: int64 - type: integer - userId: + externalId: type: string - type: object - EndpointsFileOwnersRequest: - properties: - branchName: + firstFoundScanId: type: string - filePath: + firstSeenAt: + type: string + iamRoleArn: type: string id: type: string - repositoryName: + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastRunAt: type: string - required: - - id - - repositoryName - - branchName - - filePath - type: object - EndpointsFunnelData: - properties: - CRITICAL: - type: integer - HIGH: - type: integer - LOW: - type: integer - MEDIUM: - type: integer - funnelKey: + lastRunStatus: type: string - required: - - CRITICAL - - HIGH - - MEDIUM - - LOW - - funnelKey - type: object - EndpointsGCPProjectValidationResult: - properties: - displayName: + lastSeenAt: type: string - errorMessage: + name: type: string - isValid: - type: boolean - projectId: + pipelineKind: type: string - state: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: type: string - status: - $ref: '#/components/schemas/EndpointsGCPProjectValidationStatus' - type: object - EndpointsGCPProjectValidationStatus: - enum: - - valid - - invalid - type: string - EndpointsGetAdminNotificationConfigOutput: - properties: - notifications: - items: - $ref: '#/components/schemas/ModelsNotification' - nullable: true - type: array - version: + schedule: type: string - type: object - EndpointsGetBuildkiteIntegrationOutput: - properties: - configured: - type: boolean - orgSlug: + sinkCount: + type: integer + sourceCount: + type: integer + sourceScanId: type: string - version: + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string - required: - - version - - configured - type: object - EndpointsGetCircleCIIntegrationOutput: - properties: - configured: + subType: + $ref: '#/components/schemas/ModelsDataPipelineSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + vpcAttached: type: boolean - version: - type: string - required: - - version - - configured - type: object - EndpointsGetCurrentUserOutput: - properties: - userMapping: - $ref: '#/components/schemas/ModelsUserMapping' - username: - type: string required: - - userMapping - - username - type: object - EndpointsGetJenkinsIntegrationOutput: - properties: - configured: - type: boolean - version: - type: string + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsDatabaseAssetDetailsView: + properties: + awsDynamoDb: + $ref: '#/components/schemas/EndpointsAWSDynamoDBDetailsView' + awsElastiCache: + $ref: '#/components/schemas/EndpointsAWSElastiCacheDetailsView' + awsMemoryDb: + $ref: '#/components/schemas/EndpointsAWSMemoryDBDetailsView' + awsNeptune: + $ref: '#/components/schemas/EndpointsAWSNeptuneDetailsView' + awsOpenSearch: + $ref: '#/components/schemas/EndpointsAWSOpenSearchDetailsView' + awsRds: + $ref: '#/components/schemas/EndpointsAWSRDSDetailsView' + awsRedshift: + $ref: '#/components/schemas/EndpointsAWSRedshiftDetailsView' + azureCosmos: + $ref: '#/components/schemas/EndpointsAzureCosmosDetailsView' + azureMysql: + $ref: '#/components/schemas/EndpointsAzureMySQLDetailsView' + azurePostgres: + $ref: '#/components/schemas/EndpointsAzurePostgresDetailsView' + azureRedis: + $ref: '#/components/schemas/EndpointsAzureRedisDetailsView' + azureSql: + $ref: '#/components/schemas/EndpointsAzureSQLDetailsView' + gcpAlloyDb: + $ref: '#/components/schemas/EndpointsGCPAlloyDBDetailsView' + gcpBigQuery: + $ref: '#/components/schemas/EndpointsGCPBigQueryDetailsView' + gcpCloudSql: + $ref: '#/components/schemas/EndpointsGCPCloudSQLDetailsView' + gcpFirestore: + $ref: '#/components/schemas/EndpointsGCPFirestoreDetailsView' + gcpMemorystore: + $ref: '#/components/schemas/EndpointsGCPMemorystoreDetailsView' + gcpSpanner: + $ref: '#/components/schemas/EndpointsGCPSpannerDetailsView' + subType: + $ref: '#/components/schemas/ModelsDatabaseSubType' required: - - version - - configured + - subType type: object - EndpointsGetLinearInstallOutput: + EndpointsDatabaseAssetView: properties: - authorizeUrl: - description: Linear OAuth authorize URL the UI should navigate to + accountId: type: string - required: - - authorizeUrl - type: object - EndpointsGetLinearOAuthStatusOutput: - properties: - installed: - description: True if the tenant has completed the Linear OAuth install + backupRetentionDays: + type: integer + deletedAtScanId: + type: string + encryptionAtRest: type: boolean - installedAt: - description: When the install was last completed - format: date-time - nullable: true + endpoint: type: string - required: - - installed - type: object - EndpointsGetPrivacyAcknowledgmentOutput: - properties: - acknowledged: - description: Whether the user has acknowledged this policy version + engine: + type: string + engineVersion: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + id: + type: string + instanceClassOrCapacity: + type: string + isActive: type: boolean - acknowledgedAt: - description: Timestamp when the user acknowledged (RFC3339) - nullable: true + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: type: string - policyVersion: - description: The policy version that was checked + multiAzOrReplicaCount: + type: integer + name: type: string - type: object - EndpointsGetProviderUsersOutput: - properties: - numItems: + port: type: integer - users: - items: - $ref: '#/components/schemas/ModelsUser' - nullable: true - type: array - version: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + publiclyAccessible: + type: boolean + region: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string + storageBytes: + format: int64 + type: integer + subType: + $ref: '#/components/schemas/ModelsDatabaseSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object required: - - users - type: object - EndpointsGetPullRequestStateOutput: - properties: - pullRequestState: - $ref: '#/components/schemas/ModelsPullRequestStateWithDiffs' + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt type: object - EndpointsGetRepositoryPropertyTeamKeysOutput: + EndpointsDecideSetupPentestAssessmentRecommendationOutput: properties: - keys: - items: - $ref: '#/components/schemas/EndpointsRepositoryPropertyTeamKey' - nullable: true - type: array - version: - type: string + recommendation: + $ref: '#/components/schemas/EndpointsSetupPentestAssessmentRecommendation' required: - - keys + - recommendation type: object - EndpointsGetSLAsOutput: + EndpointsDecideSetupPentestTargetRecommendationOutput: properties: - slas: - items: - $ref: '#/components/schemas/ModelsSLA' - nullable: true - type: array + recommendation: + $ref: '#/components/schemas/EndpointsSetupPentestTargetRecommendation' required: - - slas + - recommendation type: object - EndpointsGetScanCoverageFindingsOutput: + EndpointsDeleteArtifactOutput: properties: - findings: - items: - $ref: '#/components/schemas/EndpointsScanCoverageFinding' - nullable: true - type: array - source: + message: type: string - totalCount: - type: integer - type: object - EndpointsGetScanCoverageOutput: - properties: - repositories: - items: - $ref: '#/components/schemas/EndpointsScanCoverageRepo' - nullable: true - type: array - totalCount: - type: integer + success: + type: boolean + required: + - success + - message type: object - EndpointsGetServiceAccountsOutput: + EndpointsDeleteAssetOutput: properties: - serviceAccounts: - items: - $ref: '#/components/schemas/EndpointsServiceAccount' - nullable: true - type: array + success: + type: boolean version: type: string required: - - serviceAccounts + - success + - version type: object - EndpointsGetSlackConfigOutput: + EndpointsDeleteContextApplicationOutput: properties: - enabled: - type: boolean message: type: string required: - - enabled + - message type: object - EndpointsGetSlackDistributedInstallOutput: + EndpointsDeleteDepsOutput: properties: - authorizeUrl: - description: Slack OAuth v2 authorize URL the UI should navigate to + deletedCount: + type: integer + scope: type: string - required: - - authorizeUrl - type: object - EndpointsGetSuggestedUserMappingsOutput: - properties: - suggestions: - items: - $ref: '#/components/schemas/EndpointsUserMappingSuggestion' - nullable: true - type: array version: type: string required: - - suggestions + - version type: object - EndpointsGetTeamFindingsOutput: + EndpointsDeleteEntrypointOutput: properties: - findings: - items: - $ref: '#/components/schemas/ModelsTeamFinding' - nullable: true - type: array - team: - $ref: '#/components/schemas/ModelsTeam' - version: + message: type: string + success: + type: boolean + required: + - success + - message type: object - EndpointsGetTeamOutput: - properties: - team: - $ref: '#/components/schemas/ModelsTeam' - type: object - EndpointsGetTeamSourcePreferencesOutput: + EndpointsDeleteMemoryOutput: properties: - preferences: - $ref: '#/components/schemas/EndpointsTeamSourcePreferences' + message: + type: string + success: + type: boolean version: type: string required: - - preferences + - success + - message type: object - EndpointsGetTeamSyncRunsOutput: + EndpointsDeletePipelineOutput: properties: - runs: - items: - $ref: '#/components/schemas/EndpointsTeamSyncRun' - nullable: true - type: array - version: + message: type: string + success: + type: boolean required: - - runs + - success + - message type: object - EndpointsGetTeamsAppZipOutput: + EndpointsDeleteProjectOutput: properties: - presignedUrl: + message: type: string + success: + type: boolean required: - - presignedUrl + - success + - message type: object - EndpointsGetTeamsOutput: + EndpointsDeleteRepositoryOutput: properties: - nextToken: + message: + type: string + success: + type: boolean + version: type: string - numItems: - type: integer - teams: - items: - $ref: '#/components/schemas/ModelsTeam' - nullable: true - type: array required: - - teams - - nextToken - - numItems + - success + - message type: object - EndpointsGetUISavedViewsOutput: + EndpointsDeleteSBOMOutput: properties: - savedViews: + deletedKeys: items: - $ref: '#/components/schemas/ModelsUISavedView' - nullable: true + type: string type: array - required: - - savedViews - type: object - EndpointsGetUserDataExportOutput: - properties: - export: - $ref: '#/components/schemas/EndpointsUserDataExport' - type: object - EndpointsGetUserMappingOutput: - properties: - user: - $ref: '#/components/schemas/ModelsUserMapping' - required: - - user - type: object - EndpointsGetUserMappingsOutput: - properties: - users: + repositories: items: - $ref: '#/components/schemas/ModelsUserMapping' + $ref: '#/components/schemas/ModelsSBOMRepository' nullable: true type: array - required: - - users - type: object - EndpointsGetUserOutput: - properties: - user: - $ref: '#/components/schemas/ModelsUser' - version: + tenantId: type: string - type: object - EndpointsIncorrectPermission: - properties: - actual: + tenantName: type: string - expected: + version: type: string required: - - expected - - actual + - tenantId + - repositories type: object - EndpointsListTeamFindingsOutput: - properties: - teamFindings: - items: - $ref: '#/components/schemas/ModelsTeamFindings' - nullable: true - type: array - version: - type: string + EndpointsDockerHubDetailsView: type: object - EndpointsMappedCanonicalIDs: + EndpointsDockerImageDetailsView: + type: object + EndpointsEndpointsAssetView: properties: - jira: + awsService: type: string - slack: + bodyType: type: string - teams: + createdAt: type: string - required: - - slack - - jira - - teams - type: object - EndpointsMetricData: - properties: - lastMonth: - format: float - type: number - thisMonth: - format: float - type: number - required: - - thisMonth - - lastMonth - type: object - EndpointsMetricWithValue: - properties: - important: - type: integer - lastMonth: - type: integer - negligible: - type: integer - thisMonth: - type: integer - urgent: - type: integer - value: + deletedAtScanId: type: string - required: - - value - - thisMonth - - lastMonth - - urgent - - important - - negligible - type: object - EndpointsOverviewType: - properties: - api: - $ref: '#/components/schemas/EndpointsMetricWithValue' - code: - $ref: '#/components/schemas/EndpointsMetricWithValue' - container: - $ref: '#/components/schemas/EndpointsMetricWithValue' - dependency: - $ref: '#/components/schemas/EndpointsMetricWithValue' - secret: - $ref: '#/components/schemas/EndpointsMetricWithValue' - required: - - code - - secret - - dependency - - container - - api - type: object - EndpointsPatchSLAInput: - properties: - allowExtensions: - nullable: true + firstFoundScanId: + type: string + hostCategory: + $ref: '#/components/schemas/ModelsAssetInventoryCategory' + hostId: + type: string + id: + type: string + isActive: type: boolean - maxDaysToFix: - nullable: true - type: integer - priority: - $ref: '#/components/schemas/ModelsPriorityLabel' - nullable: true - severity: - $ref: '#/components/schemas/ModelsSeverity' - nullable: true - type: object - EndpointsPatchSLAOutput: - properties: - sla: - $ref: '#/components/schemas/ModelsSLA' + isAutoGenerated: + type: boolean + isConfirmedAtRuntime: + type: boolean + isConfirmedByUser: + type: boolean + method: + type: string + path: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + updatedAt: + type: string required: - - sla + - id + - hostId + - hostCategory + - method + - path + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - createdAt + - updatedAt type: object - EndpointsPatchTeamInput: + EndpointsEntrypointSummary: properties: - codeOwnerships: + applicationTypes: items: - $ref: '#/components/schemas/ModelsTeamCodeOwnership' + type: string type: array - github: - $ref: '#/components/schemas/ModelsTeamProviderGitHub' - gitlab: - $ref: '#/components/schemas/ModelsTeamProviderGitLab' - groundRules: + artifactIds: items: - $ref: '#/components/schemas/ModelsGroundRule' + type: string type: array - jira: - $ref: '#/components/schemas/ModelsTeamProviderJira' - leadId: + createdAt: + format: date-time + type: string + deletedAt: + format: date-time nullable: true type: string - memberIds: + description: + type: string + frameworkName: + type: string + id: + type: string + isDeleted: + type: boolean + kind: + type: string + lineNumber: + type: integer + name: + type: string + path: + type: string + ports: items: - type: string + type: integer type: array - messageChannelProvider: - $ref: '#/components/schemas/ModelsMessageChannelProvider' - name: - nullable: true + projectId: type: string - privacy: - $ref: '#/components/schemas/ModelsTeamPrivacy' - nullable: true - slug: - nullable: true + repositoryId: + type: string + updatedAt: + format: date-time type: string - ticketProjectProvider: - $ref: '#/components/schemas/ModelsTicketProjectProvider' type: object - EndpointsPatchTeamOutput: - properties: - team: - $ref: '#/components/schemas/ModelsTeam' - required: - - team + EndpointsExecutableDetailsView: type: object - EndpointsPatchUISavedViewInput: - properties: - savedView: - $ref: '#/components/schemas/ModelsUISavedViewAPIInput' - required: - - savedView + EndpointsGCPAPIGatewayDetailsView: type: object - EndpointsPatchUISavedViewOutput: - properties: - savedView: - $ref: '#/components/schemas/ModelsUISavedView' - required: - - savedView + EndpointsGCPAlloyDBDetailsView: type: object - EndpointsPostBuildkiteTokenInput: - properties: - apiToken: - type: string - orgSlug: - type: string - required: - - apiToken - - orgSlug + EndpointsGCPAppEngineDetailsView: type: object - EndpointsPostBuildkiteTokenOutput: - properties: - message: - type: string - version: - type: string - required: - - version - - message + EndpointsGCPArtifactRegistryDetailsView: + type: object + EndpointsGCPBigQueryDetailsView: + type: object + EndpointsGCPCloudArmorDetailsView: + type: object + EndpointsGCPCloudBatchDetailsView: + type: object + EndpointsGCPCloudBuildDetailsView: + type: object + EndpointsGCPCloudCDNDetailsView: + type: object + EndpointsGCPCloudDNSRecordDetailsView: + type: object + EndpointsGCPCloudDNSZoneDetailsView: + type: object + EndpointsGCPCloudFunctionDetailsView: + type: object + EndpointsGCPCloudNATDetailsView: + type: object + EndpointsGCPCloudRunDetailsView: + type: object + EndpointsGCPCloudSQLDetailsView: type: object - EndpointsPostBulkGetUserMappingsInput: + EndpointsGCPDataflowDetailsView: + type: object + EndpointsGCPDataprocDetailsView: + type: object + EndpointsGCPFilestoreDetailsView: + type: object + EndpointsGCPFirestoreDetailsView: + type: object + EndpointsGCPFirewallRuleDetailsView: + type: object + EndpointsGCPGCEDetailsView: properties: - gitCanonicalUserIds: + diskNames: items: type: string type: array - githubCanonicalUserIds: + labels: + additionalProperties: + type: string + type: object + machineType: + type: string + networkTags: items: type: string type: array - type: object - EndpointsPostBulkGetUserMappingsOutput: - properties: - users: - additionalProperties: - $ref: '#/components/schemas/EndpointsMappedCanonicalIDs' - type: object - version: + preemptible: + type: boolean + serviceAccount: type: string - type: object - EndpointsPostCircleCITokenInput: - properties: - apiToken: + zone: type: string - required: - - apiToken type: object - EndpointsPostCircleCITokenOutput: - properties: - message: - type: string - version: - type: string - required: - - version - - message + EndpointsGCPGCSBucketDetailsView: type: object - EndpointsPostCompassTeamInput: + EndpointsGCPGKEDetailsView: + type: object + EndpointsGCPKMSDetailsView: + type: object + EndpointsGCPLBDetailsView: + type: object + EndpointsGCPLoggingDetailsView: + type: object + EndpointsGCPMIGDetailsView: properties: - displayName: - description: Team display name + autoHealing: + type: boolean + instanceTemplate: type: string - lead: - description: Atlassian accountId of the team lead + region: type: string - members: - description: List of Atlassian accountIds for team members - items: - type: string - nullable: true - type: array - providerId: - $ref: '#/components/schemas/ModelsProviderID' - repositories: - description: List of repo URLs (owner/repo) + targetSize: + type: integer + zones: items: type: string - nullable: true type: array - teamKey: - description: Compass/Atlassian team key (unique identifier) - type: string - required: - - displayName - - lead - - members - - repositories type: object - EndpointsPostCompassTeamOutput: - properties: - team: - $ref: '#/components/schemas/ModelsTeam' - required: - - team + EndpointsGCPMemorystoreDetailsView: type: object - EndpointsPostInitializeRepositoriesInput: - properties: - repositories: - items: - $ref: '#/components/schemas/ModelsGitRepositoryProvider' - nullable: true - type: array - required: - - repositories + EndpointsGCPOrgPolicyDetailsView: + type: object + EndpointsGCPPDDetailsView: + type: object + EndpointsGCPPolicyAnalyzerDetailsView: + type: object + EndpointsGCPPubSubDetailsView: + type: object + EndpointsGCPRoleDetailsView: + type: object + EndpointsGCPSecretManagerDetailsView: + type: object + EndpointsGCPSecurityCommandCtrDetailsView: + type: object + EndpointsGCPServiceAccountDetailsView: + type: object + EndpointsGCPSpannerDetailsView: + type: object + EndpointsGCPStackdriverDetailsView: + type: object + EndpointsGCPVPCDetailsView: + type: object + EndpointsGCPVPCServiceControlsDetailsView: + type: object + EndpointsGCPVPNTunnelDetailsView: + type: object + EndpointsGCPVertexEndpointDetailsView: + type: object + EndpointsGCPWorkflowsDetailsView: type: object - EndpointsPostInitializeRepositoriesOutput: + EndpointsGHCRDetailsView: + type: object + EndpointsGetActiveDepsOutput: properties: - repositories: + dependencies: items: - $ref: '#/components/schemas/EndpointsRepositotryInitializationStatus' + $ref: '#/components/schemas/ModelsDependencyOccurrence' nullable: true type: array + nextCursor: + type: string + numItems: + type: integer + version: + type: string required: - - repositories + - version + - nextCursor + - numItems + - dependencies type: object - EndpointsPostJenkinsTokenInput: + EndpointsGetActiveDepsSummaryOutput: properties: - apiToken: - type: string - url: - type: string - username: + directCount: + format: int64 + type: integer + oldest: + $ref: '#/components/schemas/EndpointsActiveDepsSummaryOldest' + totalCount: + format: int64 + type: integer + transitiveCount: + format: int64 + type: integer + version: type: string required: - - url - - username - - apiToken + - version + - totalCount + - directCount + - transitiveCount type: object - EndpointsPostJenkinsTokenOutput: + EndpointsGetAiMlAssetOutput: properties: - message: - type: string + asset: + $ref: '#/components/schemas/EndpointsAiMlAssetView' + details: + $ref: '#/components/schemas/EndpointsAiMlAssetDetailsView' version: type: string required: + - asset + - details - version - - message type: object - EndpointsPostPrivacyAcknowledgmentInput: + EndpointsGetApplicationExecutionRecipeOutput: properties: - policyVersion: - description: The version of the privacy policy being acknowledged - type: string + resolution: + $ref: '#/components/schemas/ModelsExecutionRecipeResolution' required: - - policyVersion + - resolution type: object - EndpointsPostPrivacyAcknowledgmentOutput: + EndpointsGetApplicationRebuildOutput: properties: - acknowledgedAt: - description: Timestamp when the acknowledgment was recorded (RFC3339) + applicationCount: + type: integer + applications: + items: + $ref: '#/components/schemas/ModelsApplication' + nullable: true + type: array + run: + $ref: '#/components/schemas/EndpointsRunStatus' + version: type: string - success: - description: Whether the acknowledgment was recorded successfully - type: boolean + required: + - run + - applications type: object - EndpointsPostRepositoryPropertyTeamKeyInput: + EndpointsGetApplicationSchemaOutput: properties: - propertyKey: + format: + $ref: '#/components/schemas/ModelsSchemaFormat' + schema: + type: string + type: + $ref: '#/components/schemas/ModelsSchemaType' + version: type: string - providerId: - $ref: '#/components/schemas/ModelsProviderID' required: - - providerId - - propertyKey + - type + - format + - schema type: object - EndpointsPostRepositoryPropertyTeamKeyOutput: + EndpointsGetArtifactDeploymentOutput: properties: - key: - $ref: '#/components/schemas/EndpointsRepositoryPropertyTeamKey' + deployment: + $ref: '#/components/schemas/EndpointsArtifactDeploymentSummary' version: type: string required: - - key + - deployment type: object - EndpointsPostSLAInput: + EndpointsGetArtifactOutput: properties: - allowExtensions: - type: boolean - maxDaysToFix: - type: integer - priority: - $ref: '#/components/schemas/ModelsPriorityLabel' - severity: - $ref: '#/components/schemas/ModelsSeverity' + artifact: + $ref: '#/components/schemas/EndpointsArtifactSummary' + version: + type: string required: - - severity - - priority - - maxDaysToFix - - allowExtensions + - artifact type: object - EndpointsPostSLAOutput: + EndpointsGetArtifactRepositoriesAssetOutput: properties: - sla: - $ref: '#/components/schemas/ModelsSLA' + asset: + $ref: '#/components/schemas/EndpointsArtifactRepositoriesAssetView' + details: + $ref: '#/components/schemas/EndpointsArtifactRepositoriesAssetDetailsView' + version: + type: string required: - - sla + - asset + - details + - version type: object - EndpointsPostServiceAccountInput: + EndpointsGetArtifactsAssetOutput: properties: - name: + asset: + $ref: '#/components/schemas/EndpointsArtifactsAssetView' + details: + $ref: '#/components/schemas/EndpointsArtifactsAssetDetailsView' + version: type: string - platform: - $ref: '#/components/schemas/ModelsProviderID' required: - - platform - - name + - asset + - details + - version type: object - EndpointsPostServiceAccountOutput: + EndpointsGetAssetGraphAttackPathsOutput: properties: - serviceAccount: - $ref: '#/components/schemas/EndpointsServiceAccount' + attackPaths: + items: + $ref: '#/components/schemas/EndpointsAttackPathDTO' + nullable: true + type: array + truncated: + type: boolean version: type: string required: - - serviceAccount + - attackPaths type: object - EndpointsPostSlackAPIKeyInput: + EndpointsGetAssetGraphLandingOutput: properties: - apiKey: + applications: + items: + $ref: '#/components/schemas/EndpointsAssetGraphNodeSummary' + nullable: true + type: array + cloudAccounts: + items: + $ref: '#/components/schemas/EndpointsAssetGraphNodeSummary' + nullable: true + type: array + counts: + additionalProperties: + format: int64 + type: integer + nullable: true + type: object + internetNodeId: + type: string + k8sClusters: + items: + $ref: '#/components/schemas/EndpointsAssetGraphNodeSummary' + nullable: true + type: array + repositories: + items: + $ref: '#/components/schemas/EndpointsAssetGraphNodeSummary' + nullable: true + type: array + syncCoverage: + $ref: '#/components/schemas/EndpointsAssetGraphSyncCoverage' + totalEdgeCount: + format: int64 + type: integer + totalNodeCount: + format: int64 + type: integer + version: type: string required: - - apiKey + - counts + - cloudAccounts + - k8sClusters + - applications + - repositories type: object - EndpointsPostSlackAPIKeyOutput: + EndpointsGetAssetGraphNodeOutput: properties: - message: - type: string + node: + $ref: '#/components/schemas/EndpointsAssetGraphNodeSummary' + nodeData: {} version: type: string required: - - version - - message + - node type: object - EndpointsPostTeamFindingsInput: + EndpointsGetAssetGraphNodesOutput: properties: - mappings: - description: List of finding-to-team mappings (max 1000) + nodes: items: - $ref: '#/components/schemas/EndpointsPostTeamFindingsMapping' + $ref: '#/components/schemas/EndpointsAssetGraphNodeSummary' nullable: true type: array + total: + type: integer + version: + type: string required: - - mappings + - nodes + - total type: object - EndpointsPostTeamFindingsMapping: + EndpointsGetAssetGraphReachabilityOutput: properties: - findingId: - description: The finding ID to assign + isInternetFacing: + type: boolean + path: + items: + $ref: '#/components/schemas/EndpointsReachabilityPathDTO' + nullable: true + type: array + targetNodeFound: + type: boolean + targetNodeId: type: string - findingType: - $ref: '#/components/schemas/ModelsFindingType' - teamId: - description: The team ID to assign the finding to + targetNodeKind: + type: string + truncated: + type: boolean + version: type: string required: - - findingId - - teamId - - findingType + - targetNodeId + - targetNodeFound + - isInternetFacing + - path type: object - EndpointsPostTeamFindingsOutput: + EndpointsGetAssetGraphRetrieveOutput: properties: - upserted: - description: Number of mappings upserted + results: + items: + $ref: '#/components/schemas/EndpointsAssetGraphRetrievedNode' + nullable: true + type: array + total: type: integer version: type: string required: - - version + - results + - total type: object - EndpointsPostTeamFindingsSyncInput: + EndpointsGetAssetGraphSearchOutput: properties: - async: - type: boolean - findingIds: + results: items: - type: string + $ref: '#/components/schemas/EndpointsAssetGraphSearchResultEntry' + nullable: true type: array - findingTypes: + total: + type: integer + version: + type: string + required: + - results + - total + type: object + EndpointsGetAssetGraphSubgraphOutput: + properties: + hierarchyEdges: items: - type: string + $ref: '#/components/schemas/GraphEdge' + nullable: true type: array - repositoryIds: + lateralEdges: items: - type: string + $ref: '#/components/schemas/GraphEdge' + nullable: true type: array - repositoryNames: - items: - type: string + nodes: + items: {} + nullable: true type: array - type: object - EndpointsPostTeamFindingsSyncOutput: - properties: - async: - type: boolean - matched: - type: integer - message: + rootNodeId: type: string - unmatched: + totalChildren: type: integer + totalChildrenByType: + additionalProperties: + type: integer + type: object + truncated: + type: boolean version: type: string required: - - version + - nodes + - hierarchyEdges + - lateralEdges + - rootNodeId + - totalChildren + - truncated type: object - EndpointsPostTeamInput: + EndpointsGetAssetGraphSummaryOutput: properties: - codeOwnerships: + accountCount: + type: integer + combinedGraphExpiresAt: + format: date-time + type: string + combinedGraphUrl: + type: string + failedAccounts: items: - $ref: '#/components/schemas/ModelsTeamCodeOwnership' + type: string type: array - github: - $ref: '#/components/schemas/ModelsTeamProviderGitHub' - gitlab: - $ref: '#/components/schemas/ModelsTeamProviderGitLab' - groundRules: + findingNodeCount: + type: integer + graphInfo: + $ref: '#/components/schemas/EndpointsInfrastructureGraphInfo' + infrastructureGraphs: items: - $ref: '#/components/schemas/ModelsGroundRule' + $ref: '#/components/schemas/EndpointsAssetGraphComponent' + nullable: true type: array - jira: - $ref: '#/components/schemas/ModelsTeamProviderJira' - leadId: + internetFacingNodeCount: + type: integer + lastUpdated: + format: date-time type: string - memberIds: - items: - type: string - type: array - messageChannelProvider: - $ref: '#/components/schemas/ModelsMessageChannelProvider' - name: + mergedGraphEdgeCount: + type: integer + mergedGraphExpiresAt: + format: date-time type: string - privacy: - $ref: '#/components/schemas/ModelsTeamPrivacy' - slug: + mergedGraphNodeCount: + type: integer + mergedGraphUrl: type: string - ticketProjectProvider: - $ref: '#/components/schemas/ModelsTicketProjectProvider' - required: - - name - - slug - - privacy - - messageChannelProvider - - ticketProjectProvider - type: object - EndpointsPostTeamMergeInput: - properties: - sources: + repoContextGraphs: items: - $ref: '#/components/schemas/EndpointsTeamMergeSource' + $ref: '#/components/schemas/EndpointsAssetGraphComponent' nullable: true type: array - targetTeamId: + totalInfraEdges: + type: integer + totalInfraNodes: + type: integer + totalRepoGraphs: + type: integer + version: type: string required: - - sources + - infrastructureGraphs + - repoContextGraphs + - totalInfraNodes + - totalInfraEdges + - totalRepoGraphs + - accountCount + - lastUpdated type: object - EndpointsPostTeamMergeOutput: + EndpointsGetCDNAndDNSAssetOutput: properties: - team: - $ref: '#/components/schemas/ModelsTeam' + asset: + $ref: '#/components/schemas/EndpointsCDNAndDNSAssetView' + details: + $ref: '#/components/schemas/EndpointsCDNAndDNSAssetDetailsView' + version: + type: string required: - - team + - asset + - details + - version type: object - EndpointsPostTeamOutput: + EndpointsGetCiCdAssetOutput: properties: - team: - $ref: '#/components/schemas/ModelsTeam' + asset: + $ref: '#/components/schemas/EndpointsCiCdAssetView' + details: + $ref: '#/components/schemas/EndpointsCiCdAssetDetailsView' + version: + type: string required: - - team + - asset + - details + - version type: object - EndpointsPostTeamSyncRunInput: + EndpointsGetCloudReconAccountOverviewOutput: + properties: + overview: + $ref: '#/components/schemas/EndpointsCloudReconAccountOverviewDTO' + type: object + EndpointsGetCloudReconAccountSynthesisOutput: + properties: + expiresAt: + description: Latest time the presigned URL can be used; it can stop working earlier if the signing session ends + format: date-time + nullable: true + type: string + presignedUrl: + description: S3 presigned URL for an artifact too large to return inline + type: string + sizeBytes: + description: Size of the stored artifact in bytes + format: int64 + type: integer + synthesis: {} + type: object + EndpointsGetCloudReconCrossAccountRelationshipsOutput: + properties: + crossAccountRelationships: + items: + $ref: '#/components/schemas/EndpointsCloudReconCrossAccountRelationshipDTO' + nullable: true + type: array + type: object + EndpointsGetCloudReconDiscoveredNodesOutput: + properties: + nodes: + items: + $ref: '#/components/schemas/EndpointsCloudReconDiscoveredNodeDTO' + nullable: true + type: array + type: object + EndpointsGetCloudReconGraphGapsOutput: properties: - source: - type: string + graphGaps: + items: + $ref: '#/components/schemas/EndpointsCloudReconGraphGapDTO' + nullable: true + type: array type: object - EndpointsPostTeamSyncRunOutput: + EndpointsGetCloudReconHotspotsOutput: properties: - runs: + hotspots: items: - $ref: '#/components/schemas/EndpointsTeamSyncRun' + $ref: '#/components/schemas/EndpointsCloudReconHotspotDTO' nullable: true type: array - version: - type: string - required: - - runs type: object - EndpointsPostUISavedViewInput: + EndpointsGetCloudReconIamPostureOutput: properties: - savedView: - $ref: '#/components/schemas/ModelsUISavedViewAPIInput' - required: - - savedView + iamPosture: + $ref: '#/components/schemas/EndpointsCloudReconIamPostureDTO' type: object - EndpointsPostUISavedViewOutput: + EndpointsGetCloudReconNetworkExposuresOutput: properties: - savedView: - $ref: '#/components/schemas/ModelsUISavedView' - required: - - savedView + networkExposures: + items: + $ref: '#/components/schemas/EndpointsCloudReconNetworkExposureDTO' + nullable: true + type: array type: object - EndpointsPostUninitializeRepositoriesInput: + EndpointsGetCloudReconOrgSynthesisOutput: properties: - repositories: + synthesis: + $ref: '#/components/schemas/EndpointsCloudReconOrgSynthesisDTO' + type: object + EndpointsGetCloudReconSecurityBoundariesOutput: + properties: + securityBoundaries: items: - $ref: '#/components/schemas/ModelsGitRepositoryProvider' + $ref: '#/components/schemas/EndpointsCloudReconSecurityBoundaryDTO' nullable: true type: array - required: - - repositories type: object - EndpointsPostUninitializeRepositoriesOutput: + EndpointsGetCloudReconTenantTrustsOutput: properties: - repositories: + trusts: items: - $ref: '#/components/schemas/EndpointsRepositotryInitializationStatus' + $ref: '#/components/schemas/EndpointsCloudReconTenantTrustDTO' nullable: true type: array - required: - - repositories type: object - EndpointsPostUserInput: + EndpointsGetCloudReconTopologyOutput: properties: - user: - $ref: '#/components/schemas/EndpointsUserInput' - required: - - user + topology: + $ref: '#/components/schemas/EndpointsCloudReconTopologyDTO' type: object - EndpointsPostUserMappingInput: + EndpointsGetCloudReconTrafficFlowsOutput: properties: - useSuggestions: - type: boolean - userMappings: + trafficFlows: items: - $ref: '#/components/schemas/EndpointsUserMappingInput' + $ref: '#/components/schemas/EndpointsCloudReconTrafficFlowDTO' nullable: true type: array - required: - - userMappings - - useSuggestions type: object - EndpointsPostUserMappingOutput: + EndpointsGetCloudReconTrustedServicesOutput: properties: - userMappings: + trustedServices: items: - $ref: '#/components/schemas/ModelsUserMapping' + $ref: '#/components/schemas/EndpointsCloudReconTrustedServiceDTO' nullable: true type: array + type: object + EndpointsGetClusterAssetOutput: + properties: + asset: + $ref: '#/components/schemas/EndpointsClusterAssetView' + details: + $ref: '#/components/schemas/EndpointsClusterAssetDetailsView' + version: + type: string required: - - userMappings + - asset + - details + - version type: object - EndpointsPostUserOutput: + EndpointsGetComputeAssetOutput: properties: - user: - $ref: '#/components/schemas/ModelsUser' + asset: + $ref: '#/components/schemas/EndpointsComputeAssetView' + details: + $ref: '#/components/schemas/EndpointsComputeAssetDetailsView' version: type: string required: - - user + - asset + - details + - version type: object - EndpointsPrivacyAcknowledgmentExport: + EndpointsGetConnectivityAssetOutput: properties: - acknowledgedAt: + asset: + $ref: '#/components/schemas/EndpointsConnectivityAssetView' + details: + $ref: '#/components/schemas/EndpointsConnectivityAssetDetailsView' + version: type: string - policyVersion: + required: + - asset + - details + - version + type: object + EndpointsGetContainerAssetOutput: + properties: + asset: + $ref: '#/components/schemas/EndpointsContainerAssetView' + details: + $ref: '#/components/schemas/EndpointsContainerAssetDetailsView' + version: type: string - tenantId: + required: + - asset + - details + - version + type: object + EndpointsGetContextApplicationOutput: + properties: + application: + $ref: '#/components/schemas/ModelsApplication' + version: type: string type: object - EndpointsPutAdminNotificationConfigInput: + EndpointsGetContextApplicationsOutput: properties: - notifications: + applications: items: - $ref: '#/components/schemas/ModelsNotification' + $ref: '#/components/schemas/ModelsApplication' nullable: true type: array + snapshot: + type: string + totalCount: + type: integer + version: + type: string required: - - notifications + - applications + - totalCount type: object - EndpointsPutAdminNotificationConfigOutput: + EndpointsGetDataPipelineAssetOutput: properties: + asset: + $ref: '#/components/schemas/EndpointsDataPipelineAssetView' + details: + $ref: '#/components/schemas/EndpointsDataPipelineAssetDetailsView' version: type: string + required: + - asset + - details + - version type: object - EndpointsPutBulkSLAInput: + EndpointsGetDatabaseAssetOutput: properties: - slas: - items: - $ref: '#/components/schemas/ModelsSLA' - nullable: true - type: array + asset: + $ref: '#/components/schemas/EndpointsDatabaseAssetView' + details: + $ref: '#/components/schemas/EndpointsDatabaseAssetDetailsView' + version: + type: string required: - - slas + - asset + - details + - version type: object - EndpointsPutBulkSLAOutput: + EndpointsGetDepsAtCommitOutput: properties: - slaIds: + commitTimestamp: + format: date-time + type: string + dependencies: items: - type: string + $ref: '#/components/schemas/ModelsDependencyOccurrence' nullable: true type: array + numItems: + type: integer + version: + type: string required: - - slaIds - type: object - EndpointsPutEditUserMappingInput: - properties: - azure: - $ref: '#/components/schemas/ModelsAzureUserProvider' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketUserProvider' - github: - $ref: '#/components/schemas/ModelsGitHubUserProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabUserProvider' - jira: - $ref: '#/components/schemas/ModelsJiraUserProvider' - linear: - $ref: '#/components/schemas/ModelsLinearUserProvider' - slack: - $ref: '#/components/schemas/ModelsSlackUserProvider' - teams: - $ref: '#/components/schemas/ModelsTeamsUserProvider' + - version + - commitTimestamp + - numItems + - dependencies type: object - EndpointsPutTeamSourcePreferencesInput: + EndpointsGetDepsByBomRefOutput: properties: - githubTeamsEnabled: - type: boolean - repositoryPropertyEnabled: - type: boolean + dependencies: + items: + $ref: '#/components/schemas/ModelsDependencyOccurrence' + nullable: true + type: array + nextCursor: + type: string + numItems: + type: integer + version: + type: string required: - - githubTeamsEnabled - - repositoryPropertyEnabled + - version + - nextCursor + - numItems + - dependencies type: object - EndpointsPutTeamSourcePreferencesOutput: + EndpointsGetDepsDependentsOutput: properties: - preferences: - $ref: '#/components/schemas/EndpointsTeamSourcePreferences' - syncQueued: - type: boolean + dependencies: + items: + $ref: '#/components/schemas/ModelsDependencyOccurrence' + nullable: true + type: array + nextCursor: + type: string + numItems: + type: integer version: type: string required: - - preferences - - syncQueued + - version + - nextCursor + - numItems + - dependencies type: object - EndpointsQueryMetricsOverTimeInput: + EndpointsGetDepsDiffOutput: properties: - query: - $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + diff: + $ref: '#/components/schemas/ModelsDependencyDiff' + numItems: + type: integer + version: + type: string required: - - query + - version + - numItems type: object - EndpointsQueryMetricsOverTimeOutput: + EndpointsGetDepsHistoryOut: properties: - fixed: + numItems: + type: integer + version: + type: string + windows: items: - $ref: '#/components/schemas/EndpointsCount' + $ref: '#/components/schemas/ModelsDependencyWindow' nullable: true type: array - introduced: + required: + - version + - numItems + - windows + type: object + EndpointsGetDepsOutput: + properties: + dependencies: items: - $ref: '#/components/schemas/EndpointsCount' + $ref: '#/components/schemas/ModelsDependencyOccurrence' nullable: true type: array + nextCursor: + type: string + numItems: + type: integer version: type: string required: - - introduced - - fixed + - version + - nextCursor + - numItems + - dependencies type: object - EndpointsQueryMetricsRawInput: + EndpointsGetDepsWithoutLockfileOutput: properties: - query: - $ref: '#/components/schemas/ModelsUnifiedFindingsMetricsQuery' - required: - - query + projects: + items: + $ref: '#/components/schemas/EndpointsProjectWithoutLockfile' + type: array + repositories: + items: + $ref: '#/components/schemas/EndpointsRepositoryWithoutLockfile' + type: array + version: + type: string type: object - EndpointsQueryMetricsRawOutput: + EndpointsGetEndpointsAssetOutput: properties: - metrics: - additionalProperties: - $ref: '#/components/schemas/ModelsUnifiedFindingsRawMetricsQueryResultItem' - nullable: true - type: object + endpoint: + $ref: '#/components/schemas/EndpointsEndpointsAssetView' version: type: string required: - - metrics + - endpoint + - version type: object - EndpointsQueryOverviewInput: + EndpointsGetEntrypointOutput: properties: - query: - $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + entrypoint: + $ref: '#/components/schemas/EndpointsEntrypointSummary' + version: + type: string required: - - query + - entrypoint type: object - EndpointsQueryOverviewOutput: + EndpointsGetExposureOutput: properties: - appName: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - appType: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - autofixMerged: - $ref: '#/components/schemas/EndpointsMetricData' - botInteractions: - $ref: '#/components/schemas/EndpointsMetricData' - branch: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - cleanPrsMerged: - $ref: '#/components/schemas/EndpointsMetricData' - cve: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - cwe: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - falsePositives: - $ref: '#/components/schemas/EndpointsMetricData' - findingsResolved: - $ref: '#/components/schemas/EndpointsMetricData' - funnelData: - items: - $ref: '#/components/schemas/EndpointsFunnelData' - nullable: true - type: array - host: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - hoursSaved: - $ref: '#/components/schemas/EndpointsMetricData' - imageName: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - inSLAFindings: - $ref: '#/components/schemas/EndpointsMetricData' - investigateData: - $ref: '#/components/schemas/EndpointsMetricData' - issuesFoundInPR: - $ref: '#/components/schemas/EndpointsMetricData' - language: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - meanTriageDurationMs: - $ref: '#/components/schemas/EndpointsMetricData' - mergeReadyRate: - $ref: '#/components/schemas/EndpointsMetricData' - overviewCWE: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - overviewLanguage: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - overviewRepos: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - overviewType: - $ref: '#/components/schemas/EndpointsOverviewType' - owners: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - package: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - repos: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - ruleId: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - secretType: - items: - $ref: '#/components/schemas/EndpointsMetricWithValue' - nullable: true - type: array - teams: + numItems: + type: integer + version: + type: string + windows: items: - $ref: '#/components/schemas/EndpointsMetricWithValue' + $ref: '#/components/schemas/ModelsDependencyWindow' nullable: true type: array - totalPrsMerged: - $ref: '#/components/schemas/EndpointsMetricData' - type: - additionalProperties: - $ref: '#/components/schemas/EndpointsMetricData' - nullable: true - type: object + required: + - version + - numItems + - windows + type: object + EndpointsGetIdentityAssetOutput: + properties: + asset: + $ref: '#/components/schemas/EndpointsIdentityAssetView' + details: + $ref: '#/components/schemas/EndpointsIdentityAssetDetailsView' version: type: string required: - - funnelData - - type - - investigateData - - findingsResolved - - autofixMerged - - hoursSaved - - issuesFoundInPR - - botInteractions - - cleanPrsMerged - - totalPrsMerged - - falsePositives - - inSLAFindings - - mergeReadyRate - - meanTriageDurationMs - - overviewRepos - - overviewLanguage - - overviewCWE - - overviewType - - repos - - branch - - owners - - teams - - language - - cwe - - cve - - ruleId - - package - - imageName - - secretType - - appName - - appType - - host + - asset + - details + - version type: object - EndpointsRepositoryInitializationTaskStatus: + EndpointsGetInfrastructureGraphDownloadOutput: properties: - error: + accountId: type: string - status: + downloadUrl: + type: string + expiresAt: + format: date-time + type: string + graphVersion: + description: Resolved graph snapshot version, or latest type: string - taskName: + version: type: string required: - - taskName - - status - - error + - downloadUrl + - expiresAt + - accountId type: object - EndpointsRepositoryPropertyTeamKey: + EndpointsGetInfrastructureGraphOutput: properties: - createdAt: + graph: + $ref: '#/components/schemas/GraphGraph' + version: + type: string + type: object + EndpointsGetInfrastructureGraphSummaryOutput: + properties: + accountCount: + type: integer + combinedGraphExpiresAt: format: date-time type: string - id: + combinedGraphUrl: type: string - propertyKey: + failedAccounts: + items: + type: string + type: array + graphInfo: + $ref: '#/components/schemas/EndpointsInfrastructureGraphInfo' + graphs: + items: + $ref: '#/components/schemas/EndpointsInfrastructureGraphDownloadInfo' + nullable: true + type: array + integrationStatus: + $ref: '#/components/schemas/EndpointsIntegrationStatus' + lastUpdated: + format: date-time type: string - providerId: - $ref: '#/components/schemas/ModelsProviderID' - tenantId: + totalEdgeCount: + type: integer + totalNodeCount: + type: integer + version: type: string - updatedAt: - format: date-time + required: + - integrationStatus + - graphs + - combinedGraphExpiresAt + - totalNodeCount + - totalEdgeCount + - accountCount + - lastUpdated + type: object + EndpointsGetInfrastructureGraphVersionOutput: + properties: + graph: + $ref: '#/components/schemas/GraphGraph' + version: type: string - required: - - id - - tenantId - - providerId - - propertyKey - - createdAt - - updatedAt type: object - EndpointsRepositotryInitializationStatus: + EndpointsGetLatestCloudReconScanOutput: properties: - isInitialized: - type: boolean - repository: - $ref: '#/components/schemas/ModelsGitRepositoryProvider' - taskStatuses: + scan: + $ref: '#/components/schemas/EndpointsCloudReconScanMetadataDTO' + type: object + EndpointsGetLatestSBOMsOutput: + properties: + sboms: items: - $ref: '#/components/schemas/EndpointsRepositoryInitializationTaskStatus' + $ref: '#/components/schemas/ModelsCDXGenAtCommit' nullable: true type: array - required: - - repository - - isInitialized - - taskStatuses + version: + type: string type: object - EndpointsScanCoverageCVECounts: + EndpointsGetLoadBalancerAssetOutput: properties: - critical: - type: integer - high: - type: integer - low: - type: integer - medium: - type: integer + asset: + $ref: '#/components/schemas/EndpointsLoadBalancerAssetView' + details: + $ref: '#/components/schemas/EndpointsLoadBalancerAssetDetailsView' + version: + type: string + required: + - asset + - details + - version type: object - EndpointsScanCoverageFinding: + EndpointsGetMemoriesByDocumentAndTypeOutput: properties: - allowlistType: + count: + format: int32 + type: integer + memories: + items: + $ref: '#/components/schemas/ModelsMemory' nullable: true - type: string - author: + type: array + paginationToken: nullable: true type: string - category: - type: string - createdAt: + version: type: string - cveCounts: - $ref: '#/components/schemas/EndpointsScanCoverageCVECounts' - cwe: + required: + - memories + - count + type: object + EndpointsGetMemoriesByDocumentOutput: + properties: + count: + format: int32 type: integer - filePath: - type: string - id: - type: string - imageName: + memories: + items: + $ref: '#/components/schemas/ModelsMemory' nullable: true - type: string - imageTag: + type: array + paginationToken: nullable: true type: string - isAllowlisted: - type: boolean - isDirect: - nullable: true - type: boolean - language: + version: type: string - package: + required: + - memories + - count + type: object + EndpointsGetMemoriesByTypeOutput: + properties: + count: + format: int32 + type: integer + memories: + items: + $ref: '#/components/schemas/ModelsMemory' nullable: true - type: string - priorityLabel: - type: string - ruleId: - type: string - secretType: + type: array + paginationToken: nullable: true type: string - severityLabel: - type: string - startLine: + totalCount: + format: int32 type: integer - status: - type: string - title: - type: string - updatedAt: - type: string - verified: - nullable: true - type: boolean version: - nullable: true type: string + required: + - memories + - count + - totalCount type: object - EndpointsScanCoverageRepo: + EndpointsGetMemoriesOutput: properties: - criticalCount: - type: integer - highCount: + count: type: integer - lastCommitAt: + memories: + items: + $ref: '#/components/schemas/ModelsMemory' nullable: true - type: string - lastCommitHash: + type: array + nextToken: nullable: true type: string - lastScanAt: - nullable: true + totalCount: + type: integer + version: type: string - lastScanCommitHash: + required: + - memories + - count + - totalCount + type: object + EndpointsGetMemoryFindingsOutput: + properties: + findings: + items: + $ref: '#/components/schemas/EndpointsMemoryFinding' nullable: true - type: string - lowCount: - type: integer - mediumCount: + type: array + totalCount: type: integer - owner: + version: type: string - platform: + required: + - findings + - totalCount + type: object + EndpointsGetMemoryOutput: + properties: + memory: + $ref: '#/components/schemas/ModelsMemory' + version: type: string - repository: + type: object + EndpointsGetMemoryVersionsOutput: + properties: + count: + format: int32 + type: integer + version: type: string - repositoryId: + versions: + items: + $ref: '#/components/schemas/EndpointsMemoryVersion' + nullable: true + type: array + required: + - versions + - count + type: object + EndpointsGetMessagingAssetOutput: + properties: + asset: + $ref: '#/components/schemas/EndpointsMessagingAssetView' + details: + $ref: '#/components/schemas/EndpointsMessagingAssetDetailsView' + version: type: string - totalCount: - type: integer + required: + - asset + - details + - version type: object - EndpointsScanCoverageType: - enum: - - sast - - sca_dependencies - - sca_containers - - secrets - type: string - EndpointsServiceAccount: + EndpointsGetNetworkAssetOutput: properties: - createdAt: - format: date-time + asset: + $ref: '#/components/schemas/EndpointsNetworkAssetView' + details: + $ref: '#/components/schemas/EndpointsNetworkAssetDetailsView' + version: type: string - name: + required: + - asset + - details + - version + type: object + EndpointsGetObservabilityAssetOutput: + properties: + asset: + $ref: '#/components/schemas/EndpointsObservabilityAssetView' + details: + $ref: '#/components/schemas/EndpointsObservabilityAssetDetailsView' + version: type: string - platform: - $ref: '#/components/schemas/ModelsProviderID' - serviceAccountId: + required: + - asset + - details + - version + type: object + EndpointsGetOrgContextRunOutput: + properties: + message: type: string - tenantId: + organization: + $ref: '#/components/schemas/ModelsOrgContext' + runId: type: string - token: + state: + $ref: '#/components/schemas/EndpointsRunState' + version: type: string required: - - serviceAccountId - - tenantId - - platform - - name - - createdAt + - runId + - state type: object - EndpointsTeamMembershipExport: + EndpointsGetOrganizationOutput: properties: - role: - type: string - teamId: - type: string - teamName: + assessmentContext: + $ref: '#/components/schemas/EndpointsAssessmentContextReadiness' + organization: + $ref: '#/components/schemas/ModelsOrgContext' + version: type: string type: object - EndpointsTeamMergeSource: + EndpointsGetPipelineOutput: properties: - providerId: - $ref: '#/components/schemas/ModelsProviderID' - teamId: + pipeline: + $ref: '#/components/schemas/EndpointsPipelineSummary' + version: type: string required: - - providerId - - teamId + - pipeline type: object - EndpointsTeamSourcePreferences: + EndpointsGetPipelinesAssetOutput: properties: - githubTeamsEnabled: - type: boolean - repositoryPropertyEnabled: - type: boolean - tenantId: - type: string - updatedAt: - format: date-time + asset: + $ref: '#/components/schemas/EndpointsPipelinesAssetView' + details: + $ref: '#/components/schemas/EndpointsPipelinesAssetDetailsView' + version: type: string required: - - tenantId - - githubTeamsEnabled - - repositoryPropertyEnabled + - asset + - details + - version type: object - EndpointsTeamSyncRun: + EndpointsGetProjectActiveDepsOutput: properties: - completedAt: - format: date-time + dependencies: + items: + $ref: '#/components/schemas/ModelsDependencyOccurrence' nullable: true - type: string - errorMessage: - type: string - id: - type: string - source: - $ref: '#/components/schemas/ModelsTeamSource' - startedAt: - format: date-time - type: string - status: - type: string - tenantId: - type: string - triggeredBy: + type: array + numItems: + type: integer + version: type: string required: - - id - - tenantId - - source - - status - - startedAt - - triggeredBy + - version + - numItems + - dependencies type: object - EndpointsUnifiedEventOutput: + EndpointsGetProjectExecutionRecipeOutput: properties: - autofixId: - nullable: true + resolution: + $ref: '#/components/schemas/ModelsExecutionRecipeResolution' + required: + - resolution + type: object + EndpointsGetProjectExposureOutput: + properties: + numItems: + type: integer + version: type: string - campaignId: + windows: + items: + $ref: '#/components/schemas/ModelsDependencyWindow' nullable: true + type: array + required: + - version + - numItems + - windows + type: object + EndpointsGetProjectOutput: + properties: + project: + $ref: '#/components/schemas/ModelsContextProject' + version: type: string - createdAt: - nullable: true + type: object + EndpointsGetProjectSchemaMetadataOutput: + properties: + downloadUrl: type: string - data: {} - findingId: - nullable: true + format: + $ref: '#/components/schemas/ModelsSchemaFormat' + numEndpoints: + type: integer + provenance: + $ref: '#/components/schemas/EndpointsSchemaProvenance' + size: + type: integer + type: + $ref: '#/components/schemas/ModelsSchemaType' + version: type: string - id: + required: + - type + - format + - size + - numEndpoints + - downloadUrl + type: object + EndpointsGetProjectSchemaOutput: + properties: + format: + $ref: '#/components/schemas/ModelsSchemaFormat' + schema: type: string - prCanonicalId: - nullable: true + type: + $ref: '#/components/schemas/ModelsSchemaType' + version: type: string - repositoryId: - nullable: true + required: + - type + - format + - schema + type: object + EndpointsGetProjectSchemaRawOutput: + properties: + contentType: + description: MIME type of the file, e.g. application/json, application/yaml, text/plain type: string - runId: - nullable: true + downloadUrl: + description: Presigned URL for the raw spec file (OpenAPI JSON/YAML, Proto, GraphQL SDL) type: string - service: - $ref: '#/components/schemas/EventbusService' - tenantId: + fileName: + description: Suggested filename, e.g. schema.openapi.json, schema.proto type: string - timestampUnix: - format: int64 - type: integer - type: - $ref: '#/components/schemas/EventsEventType' type: object - EndpointsUpdateJiraConfigInput: + EndpointsGetProjectsAssetOutput: properties: - autoCreate: - type: boolean - issueType: - type: string - projectKey: - type: string - severityThreshold: + asset: + $ref: '#/components/schemas/EndpointsProjectsAssetView' + details: + $ref: '#/components/schemas/EndpointsProjectsAssetDetailsView' + version: type: string required: - - projectKey - - severityThreshold - - issueType - - autoCreate + - asset + - details + - version type: object - EndpointsUpdateJiraConfigOutput: + EndpointsGetRepoScanOutput: properties: - configuration: - $ref: '#/components/schemas/ModelsJiraConfig' + run: + $ref: '#/components/schemas/EndpointsRunStatus' + scan: + $ref: '#/components/schemas/EndpointsRepoScanSummary' + version: + type: string + required: + - scan type: object - EndpointsUserDataExport: + EndpointsGetRepoScopeScanOutput: properties: - auditLogEntryCount: - format: int64 - type: integer - exportVersion: + generatedAt: type: string - exportedAt: + recommendedCount: + type: integer + run: + $ref: '#/components/schemas/EndpointsRunStatus' + supersededBy: type: string - privacyAcknowledgments: + uncovered: items: - $ref: '#/components/schemas/EndpointsPrivacyAcknowledgmentExport' - nullable: true - type: array - teamMemberships: - items: - $ref: '#/components/schemas/EndpointsTeamMembershipExport' - nullable: true + type: string type: array - user: - $ref: '#/components/schemas/EndpointsUserExport' - type: object - EndpointsUserExport: - properties: - email: - type: string - id: - type: string - isBot: - type: boolean - name: - type: string - providerId: - type: string - username: + version: type: string + required: + - run type: object - EndpointsUserInput: + EndpointsGetReportStatusOutput: properties: - email: - description: The user's email address + error: type: string - isBot: - description: Whether the user is a bot - type: boolean - name: - description: The user's name + status: type: string - provider: - $ref: '#/components/schemas/ModelsUserProvider' - slug: - description: The user's slug + url: type: string - username: - description: The user's username + version: type: string - required: - - provider - - name - - slug - - username - - isBot type: object - EndpointsUserMappingInput: + EndpointsGetReposAssetOutput: properties: - azure: - $ref: '#/components/schemas/ModelsAzureUserProvider' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketUserProvider' - github: - $ref: '#/components/schemas/ModelsGitHubUserProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabUserProvider' - jira: - $ref: '#/components/schemas/ModelsJiraUserProvider' - linear: - $ref: '#/components/schemas/ModelsLinearUserProvider' - slack: - $ref: '#/components/schemas/ModelsSlackUserProvider' - teams: - $ref: '#/components/schemas/ModelsTeamsUserProvider' + asset: + $ref: '#/components/schemas/EndpointsReposAssetView' + details: + $ref: '#/components/schemas/EndpointsReposAssetDetailsView' + version: + type: string + required: + - asset + - details + - version type: object - EndpointsUserMappingSuggestion: + EndpointsGetRepositoriesOutput: properties: - github: - $ref: '#/components/schemas/ModelsUser' - jira: - items: - $ref: '#/components/schemas/ModelsUser' - nullable: true - type: array - linear: - items: - $ref: '#/components/schemas/ModelsUser' - type: array - slack: + nextToken: + type: string + numItems: + type: integer + repositories: items: - $ref: '#/components/schemas/ModelsUser' + $ref: '#/components/schemas/RepocontextRepoContext' nullable: true type: array - teams: + repositoryIds: + additionalProperties: + type: string + type: object + version: + type: string + required: + - repositories + - numItems + - nextToken + type: object + EndpointsGetRepositoryOutput: + properties: + repository: + $ref: '#/components/schemas/RepocontextRepoContext' + url: + type: string + version: + type: string + required: + - repository + type: object + EndpointsGetSBOMSOutput: + properties: + sboms: items: - $ref: '#/components/schemas/ModelsUser' + $ref: '#/components/schemas/ModelsCDXGenAtCommit' nullable: true type: array + version: + type: string required: - - github - - slack - - jira - - teams + - sboms type: object - EventbusService: - enum: - - sast - - sca - - secrets - - dast - - scpm - - cspm - - orchestrator - - context - - manager - - webhooks - - auth - - notifications - - billing - type: string - EventsEventType: - enum: - - org_context_agent_started - - org_context_agent_finished - - org_context_agent_failed - - repo_context_agent_started - - repo_context_agent_finished - - repo_context_agent_failed - - triage_agent_started - - triage_agent_finished - - triage_agent_failed - - triage_agent_skipped - - triage_agent_quality_degraded - - auto_fix_agent_started - - auto_fix_agent_finished - - auto_fix_agent_failed - - schema_reversing_agent_started - - schema_reversing_agent_finished - - schema_reversing_agent_failed - - auth-user-logged-in - - auth-user-role-changed - - auth-api-key-created - - auth-api-key-revoked - - auth-tenant-created - - auth-tenant-deleted - - auth-integration-enabled - - auth-integration-disabled - - billing-budget-exhausted - - billing-budget-warning - - billing-lease-started - - billing-lease-ended - - billing-lease-extended - - billing-usage-recorded - - account-scan-completed - - cloud-integration-scan-completed - - cspm-new-finding - - cspm-new-findings - - cspm-finding-triaged - - cspm-findings-triaged - - cspm-new-allowlisted-finding - - cspm-ticket-created - - cspm-ticket-updated - - cspm-ticket-assigned - - cspm-ticket-closed - - cspm-ticket-reopened - - account-scan-started - - account-scan-failed - - cloud-integration-scan-started - - cloud-integration-scan-failed - - cspm-scan-started - - cspm-scan-completed - - cspm-scan-failed - - dast-new-findings - - dast-new-fixes - - dast-update-endpoints - - dast-bughunt-new-finding - - dast-bughunt-finding-fixed - - dast-bughunt-finding-unfixed - - dast-bughunt-finding-allowlisted - - dast-bughunt-finding-unallowlisted - - dast-bughunt-triage-completed - - dast-bughunt-scan-failed - - dast-bughunt-scan-failsafe-invoked - - dast-pentest-new-finding - - dast-pentest-finding-fixed - - dast-pentest-finding-unfixed - - dast-pentest-finding-allowlisted - - dast-pentest-finding-unallowlisted - - dast-pentest-triage-completed - - dast-preflight-started - - dast-preflight-check-started - - dast-preflight-check-completed - - dast-preflight-estimate - - dast-preflight-completed - - dast-preflight-failed - - dast-preflight-failsafe-invoked - - dast-pentest-scan-aborted-config-error - - dast-pentest-scan-human-fallback - - dast-pentest-scan-failsafe-invoked - - dast-bughunt-scan-started - - dast-bughunt-scan-completed - - dast-pentest-scan-started - - dast-pentest-scan-completed - - dast-pentest-scan-failed - - bot-interaction - - bot-interaction-issue-dashboard-reply - - bot-interaction-pull-request-comment-reply - - bot-interaction-pull-request-discussion-reply - - bot-interaction-pull-request-review-diff-thread-reply - - bot-interaction-pull-request-review-discussion-reply - - bot-interaction-pull-request-review - - auto-fix-pull-request-created - - auto-fix-pull-request-accepted - - auto-fix-pull-request-closed - - auto-fix-suggestion-created - - auto-fix-suggestion-accepted - - scpm-new-branch-summary - - scpm-new-finding - - scpm-new-allowlisted-finding - - scpm-new-unallowlisted-finding - - scpm-new-vulnerability-merged - - scpm-new-fix - - scpm-new-pull-request-finding - - scpm-new-pull-request-fix - - scpm-ticket-created - - scpm-ticket-updated - - scpm-ticket-assigned - - scpm-ticket-closed - - scpm-ticket-reopened - - scpm-scan-started - - scpm-scan-completed - - scpm-scan-failed - - scpm-finding-retriaged - - scpm-archived-finding - - manager-campaign-created - - manager-campaign-updated - - manager-campaign-deleted - - manager-scheduled-plan-completed - - manager-plan-created - - manager-action-allowlist - - manager-action-escalate - - manager-action-ticket-create - - manager-action-ticket-comment - - manager-action-ticket-close - - manager-action-ticket-reassign - - manager-action-pr-create - - manager-action-pr-comment - - manager-action-pr-close - - manager-action-pr-reassign - - manager-action-message-user - - manager-action-message-channel - - manager-action-assign-user-task - - manager-action-campaign-create - - notification-sent - - notification-failed - - notification-retried - - notification-dlqed - - orchestrator-pipeline-run-started - - orchestrator-pipeline-run-completed - - orchestrator-pipeline-run-failed - - orchestrator-batch-autofix-started - - orchestrator-batch-autofix-completed - - orchestrator-batch-autofix-failed - - orchestrator-onboarding-started - - orchestrator-onboarding-phase-advanced - - orchestrator-onboarding-completed - - orchestrator-onboarding-failed - - orchestrator-retriage-requested - - orchestrator-retriage-queued - - pipeline-triggered - - pipeline-finished - - pipeline-failed - - sast-new-branch-summary - - sast-new-finding - - sast-new-findings - - sast-new-fix - - sast-new-fixes - - sast-new-allowlisted-finding - - sast-new-allowlisted-findings - - sast-new-unallowlisted-finding - - sast-new-unallowlisted-findings - - sast-new-pull-request-finding - - sast-new-pull-request-findings - - sast-new-pull-request-fix - - sast-new-pull-request-fixes - - sast-new-pull-request-allowlisted-finding - - sast-new-pull-request-unallowlisted-finding - - sast-new-vulnerability-merged - - sast-reintroduced-finding - - sast-reintroduced-pull-request-finding - - sast-finding-retriaged - - sast-archived-finding - - sast-ticket-created - - sast-ticket-updated - - sast-ticket-assigned - - sast-ticket-closed - - sast-ticket-reopened - - sast-autofix-iteration-started - - sast-autofix-iteration-completed - - sast-scan-started - - sast-scan-completed - - sast-scan-failed - - sca-new-branch-summary - - sca-new-finding - - sca-new-findings - - sca-new-fix - - sca-new-fixes - - sca-new-allowlisted-finding - - sca-new-allowlisted-findings - - sca-new-unallowlisted-finding - - sca-new-pull-request-finding - - sca-new-pull-request-findings - - sca-new-pull-request-fix - - sca-new-pull-request-fixes - - sca-dependency-reintroduced-finding - - sca-container-reintroduced-finding - - sca-dependency-archived-finding - - sca-container-archived-finding - - sca-finding-retriaged - - sca-ticket-created - - sca-ticket-updated - - sca-ticket-assigned - - sca-ticket-closed - - sca-ticket-reopened - - sca-autofix-iteration-started - - sca-autofix-iteration-completed - - sca-scan-started - - sca-scan-completed - - sca-scan-failed - - secrets-new-finding - - secrets-new-findings - - secrets-new-allowlisted-finding - - secrets-new-allowlisted-findings - - secrets-new-unallowlisted-finding - - secrets-archived-finding - - secrets-credential-triage-completed - - secrets-sensitivedata-triage-completed - - secrets-finding-retriaged - - secrets-ticket-created - - secrets-ticket-updated - - secrets-ticket-assigned - - secrets-ticket-closed - - secrets-ticket-reopened - - sensitivedata-new-finding - - sensitivedata-new-findings - - sensitivedata-allowlisted - - sensitivedata-unallowlisted - - sensitivedata-ticket-created - - sensitivedata-ticket-updated - - sensitivedata-ticket-assigned - - sensitivedata-ticket-closed - - sensitivedata-ticket-reopened - - sensitivedata-archived-finding - - secrets-scan-started - - secrets-scan-completed - - secrets-scan-failed - - threat-investigation-created - - threat-investigation-completed - - webhook-repo-onboarded - - webhook-repo-removed - - webhook-integration-installed - - webhook-integration-uninstalled - - webhook-default-branch-changed - - webhook-pr-opened - - webhook-pr-merged - - webhook-pr-closed - - webhook-push-received - type: string - ModelsAWSAccount: + EndpointsGetSBOMTreeOutput: properties: - accountId: + repositories: + items: + $ref: '#/components/schemas/ModelsSBOMRepository' + nullable: true + type: array + tenantId: type: string - accountName: + tenantName: type: string - accountType: + version: type: string - isDefault: - type: boolean - lastVerifiedAt: + required: + - tenantId + - repositories + type: object + EndpointsGetSecurityAssetOutput: + properties: + asset: + $ref: '#/components/schemas/EndpointsSecurityAssetView' + details: + $ref: '#/components/schemas/EndpointsSecurityAssetDetailsView' + version: type: string - lastVerifiedStatus: + required: + - asset + - details + - version + type: object + EndpointsGetServerlessAssetOutput: + properties: + asset: + $ref: '#/components/schemas/EndpointsServerlessAssetView' + details: + $ref: '#/components/schemas/EndpointsServerlessAssetDetailsView' + version: type: string required: - - accountId - - accountName - - isDefault + - asset + - details + - version type: object - ModelsAWSAccountWithStatus: + EndpointsGetStorageAndBackupAssetOutput: properties: - accountId: + asset: + $ref: '#/components/schemas/EndpointsStorageAndBackupAssetView' + details: + $ref: '#/components/schemas/EndpointsStorageAndBackupAssetDetailsView' + version: type: string - accountName: + required: + - asset + - details + - version + type: object + EndpointsGetVaultDocumentTextOutput: + properties: + description: type: string - accountType: + docType: type: string - assumedRole: + documentId: type: string - errorMessage: + endPage: + type: integer + fileName: type: string - isDefault: - type: boolean - lastVerifiedAt: + nextToken: + nullable: true type: string - lastVerifiedStatus: + startPage: + type: integer + text: type: string - status: + totalChars: + type: integer + totalChunks: + type: integer + truncated: + type: boolean + version: type: string required: - - accountId - - accountName - - isDefault + - documentId + - fileName + - text + - totalChunks + - totalChars + - truncated type: object - ModelsAllowlistState: - enum: - - none - - in_progress_requested - - pending_review - - failed_pr_generation - - failed_pr_creation - - pr_merged - type: string - ModelsAllowlistType: - enum: - - AI - - UserFixed - - UserAssumeRisk - - UserFalsePositive - - UserOther - type: string - ModelsAssignee: + EndpointsGetVaultFileOutput: properties: - id: + createdAt: + format: date-time type: string - name: + documentId: type: string - type: object - ModelsAutoFixState: - enum: - - none - - cancelled - - in_progress_requested - - in_progress_agent - - cached - - in_progress_preview_available - - in_progress_creating_pr - - in_progress_draft - - pending_review - - failed_retry - - failed_abort - - pr_merged - - pr_closed - - failed_pr_creation - type: string - ModelsAzureEntraOwnerProvider: - properties: - clientId: - description: The Azure Entra client ID + fileId: type: string - clientSecret: - description: The Azure Entra client secret + fileName: type: string - tenantId: - description: The Azure Entra tenant ID + filePresignedUrl: + type: string + uploaderId: + type: string + uploaderUsername: + type: string + version: type: string required: - - tenantId - - clientId - - clientSecret + - filePresignedUrl + - fileId + - fileName + - uploaderId + - uploaderUsername + - createdAt type: object - ModelsAzureEntraUserProvider: + EndpointsGetVaultFilesListOutput: properties: - id: + files: + items: + $ref: '#/components/schemas/EndpointsVaultFileSimple' + nullable: true + type: array + version: type: string required: - - id + - files type: object - ModelsAzureGitPullRequest: + EndpointsGetVaultFilesOutput: properties: - pullRequestId: - description: The Azure pull request ID + files: + items: + $ref: '#/components/schemas/EndpointsVaultFile' + nullable: true + type: array + totalCount: type: integer + version: + type: string required: - - pullRequestId + - files + - totalCount type: object - ModelsAzureGitRepositoryProvider: + EndpointsGitHubActionsDetailsView: + type: object + EndpointsGitHubRepoDetailsView: + type: object + EndpointsGitLabCIDetailsView: + type: object + EndpointsGitLabRepoDetailsView: + type: object + EndpointsGrepMemoriesInput: properties: - projectId: - description: The ID of the Azure project - type: string - projectName: - description: The name of the Azure project - type: string - repositoryId: - description: The ID of the Azure repository + limit: + nullable: true + type: integer + memoryClass: + $ref: '#/components/schemas/ModelsMemoryMemoryClass' + nullable: true + memoryTypes: + items: + $ref: '#/components/schemas/ModelsMemoryMemoryType' + type: array + minTrustTier: + nullable: true + type: integer + pattern: type: string - repositoryName: - description: The name of the Azure repository + resourceType: + $ref: '#/components/schemas/ModelsMemoryResourceType' + nullable: true + scope: + $ref: '#/components/schemas/ModelsMemoryScope' + nullable: true + required: + - pattern + type: object + EndpointsGrepMemoriesOutput: + properties: + count: + type: integer + memories: + items: + $ref: '#/components/schemas/ModelsMemory' + nullable: true + type: array + version: type: string required: - - projectId - - projectName - - repositoryId - - repositoryName + - memories + - count + type: object + EndpointsIdentityAssetDetailsView: + properties: + awsCognitoUserPool: + $ref: '#/components/schemas/EndpointsAWSCognitoUserPoolDetailsView' + awsIamGroup: + $ref: '#/components/schemas/EndpointsAWSIAMGroupDetailsView' + awsIamPolicy: + $ref: '#/components/schemas/EndpointsAWSIAMPolicyDetailsView' + awsIamRole: + $ref: '#/components/schemas/EndpointsAWSIAMRoleDetailsView' + awsIamUser: + $ref: '#/components/schemas/EndpointsAWSIAMUserDetailsView' + azureAdGroup: + $ref: '#/components/schemas/EndpointsAzureADGroupDetailsView' + azureAdUser: + $ref: '#/components/schemas/EndpointsAzureADUserDetailsView' + azureApplication: + $ref: '#/components/schemas/EndpointsAzureApplicationDetailsView' + azureEntraId: + $ref: '#/components/schemas/EndpointsAzureEntraIDDetailsView' + azureManagedIdentity: + $ref: '#/components/schemas/EndpointsAzureManagedIdentityDetailsView' + azureRoleAssignment: + $ref: '#/components/schemas/EndpointsAzureRoleAssignmentDetailsView' + azureServicePrincipal: + $ref: '#/components/schemas/EndpointsAzureServicePrincipalDetailsView' + gcpRole: + $ref: '#/components/schemas/EndpointsGCPRoleDetailsView' + gcpServiceAccount: + $ref: '#/components/schemas/EndpointsGCPServiceAccountDetailsView' + k8sRole: + $ref: '#/components/schemas/EndpointsK8SRoleDetailsView' + k8sRoleBinding: + $ref: '#/components/schemas/EndpointsK8SRoleBindingDetailsView' + k8sServiceAccount: + $ref: '#/components/schemas/EndpointsK8SServiceAccountDetailsView' + subType: + $ref: '#/components/schemas/ModelsIdentitySubType' + required: + - subType type: object - ModelsAzureOwnerProvider: + EndpointsIdentityAssetView: properties: - baseUrl: - description: The base URL for the Azure instance + accountId: type: string - organizationId: - description: The Azure organization ID + attachedPolicyCount: + type: integer + consoleAccess: + type: boolean + deletedAtScanId: type: string - organizationName: - description: The Azure organization name + externalId: type: string - tenantId: - description: The Azure tenant ID + federated: + type: boolean + firstFoundScanId: type: string - required: - - tenantId - - organizationId - - organizationName - - baseUrl - type: object - ModelsAzureSubscriptionInput: - properties: - displayName: + firstSeenAt: type: string - isDefault: + hasAdmin: type: boolean - subscriptionId: + id: type: string - type: + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: type: string - required: - - subscriptionId - type: object - ModelsAzureSubscriptionWithStatus: - properties: - accountType: + lastUsedAt: type: string - isDefault: - type: boolean - isEnabled: + mfaEnabled: type: boolean - lastVerifiedAt: + name: type: string - lastVerifiedStatus: + principalType: type: string - state: + privilegeScore: + type: integer + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: type: string - subscriptionId: + sourceScanId: type: string - subscriptionName: + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string + subType: + $ref: '#/components/schemas/ModelsIdentitySubType' + tags: + additionalProperties: + type: string + nullable: true + type: object required: - - subscriptionId - - isDefault - - isEnabled + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt type: object - ModelsAzureTicketProject: + EndpointsInfrastructureAccountInfo: properties: - projectName: - description: The Azure DevOps project name + accountId: type: string - required: - - projectName - type: object - ModelsAzureTicketProvider: - properties: - url: - description: The Azure DevOps work item URL + accountName: type: string - workItemId: - description: The Azure DevOps work item ID + accountType: + type: string + cloudProvider: + type: string + edgeCount: + type: integer + graphFilePath: + type: string + hasApiGateway: + type: boolean + hasCloudFrontCdn: + type: boolean + hasCloudFunctions: + type: boolean + hasCloudRunServices: + type: boolean + hasCrossAccountRefs: + type: boolean + hasDatabases: + type: boolean + hasEcsServices: + type: boolean + hasEksClusters: + type: boolean + hasGceInstances: + type: boolean + hasGkeClusters: + type: boolean + hasK8sClusters: + type: boolean + hasLambdaFunctions: + type: boolean + hasPublicAlb: + type: boolean + hasPublicNlb: + type: boolean + hasRoute53Dns: + type: boolean + hasTransitGateway: + type: boolean + internalServiceCount: + type: integer + nodeCount: type: integer + publicEndpointCount: + type: integer + regions: + items: + type: string + nullable: true + type: array + services: + items: + type: string + nullable: true + type: array required: - - workItemId - - url + - accountId + - accountType + - nodeCount + - edgeCount + - regions + - services + - hasPublicAlb + - hasPublicNlb + - hasEcsServices + - hasEksClusters + - hasLambdaFunctions + - hasTransitGateway + - hasCrossAccountRefs + - hasCloudFrontCdn + - hasRoute53Dns + - hasApiGateway + - hasDatabases + - publicEndpointCount + - internalServiceCount type: object - ModelsAzureUserProvider: + EndpointsInfrastructureCrossAccountConnection: properties: - id: + connectionCount: + type: integer + connectionType: + type: string + sourceAccountId: + type: string + sourceAccountType: + type: string + targetAccountId: + type: string + targetAccountType: type: string required: - - id + - sourceAccountId + - targetAccountId + - connectionType + - connectionCount type: object - ModelsBitbucketGitPullRequest: + EndpointsInfrastructureCrossAccountStatistics: properties: - pullRequestId: - description: The GitHub pull request ID - format: int64 + crossAccountConnections: + items: + $ref: '#/components/schemas/EndpointsInfrastructureCrossAccountConnection' + type: array + crossAccountEdgesCreated: + type: integer + hasCrossAccountReferences: + type: boolean + orphanedReferences: + type: integer + referencesByType: + additionalProperties: + type: integer + nullable: true + type: object + totalReferences: + type: integer + validatedReferences: type: integer required: - - pullRequestId + - hasCrossAccountReferences + - totalReferences + - validatedReferences + - orphanedReferences + - referencesByType + - crossAccountEdgesCreated type: object - ModelsBitbucketGitRepositoryProvider: + EndpointsInfrastructureEdgeStatistics: properties: - projectKey: - description: The key of a Bitbucket project - type: string - projectName: - description: The name of the Bitbucket project - type: string - repositoryId: - description: The ID of the Bitbucket repository - type: string - repositoryName: - description: The name of the Bitbucket repository - type: string + bidirectionalEdges: + type: integer + edgesByType: + additionalProperties: + type: integer + nullable: true + type: object + totalEdges: + type: integer + unidirectionalEdges: + type: integer required: - - repositoryId - - repositoryName - - projectKey - - projectName + - totalEdges + - edgesByType + - bidirectionalEdges + - unidirectionalEdges type: object - ModelsBitbucketOwnerProvider: + EndpointsInfrastructureGraphDownloadInfo: properties: - appKey: - description: The Bitbucket app key - type: string - baseUrl: - description: The Bitbucket base URL - type: string - clientKey: - description: The Bitbucket client key + accountId: type: string - ownerId: - description: The Bitbucket owner ID + downloadUrl: type: string - ownerName: - description: The Bitbucket owner name + edgeCount: + type: integer + expiresAt: + format: date-time type: string - sharedSecret: - description: The Bitbucket shared secret + generatedAt: + format: date-time type: string - required: - - appKey - - baseUrl - - ownerId - - ownerName - - clientKey - - sharedSecret - type: object - ModelsBitbucketTicketProject: - type: object - ModelsBitbucketUserProvider: - properties: - id: + graphId: type: string - required: - - id - type: object - ModelsChecklistItem: - properties: - currentValue: + graphType: type: string - desiredValue: + nodeCount: + type: integer + region: type: string - name: + version: type: string required: - - name - - currentValue - - desiredValue + - accountId + - downloadUrl + - expiresAt + - nodeCount + - edgeCount + - generatedAt type: object - ModelsCode: + EndpointsInfrastructureGraphInfo: properties: - enableFailBuilds: - nullable: true - type: boolean - ignore: + accountsInfo: items: - $ref: '#/components/schemas/ModelsCodeIgnore' + $ref: '#/components/schemas/EndpointsInfrastructureAccountInfo' + nullable: true type: array + crossAccountStatistics: + $ref: '#/components/schemas/EndpointsInfrastructureCrossAccountStatistics' + edgeStatistics: + $ref: '#/components/schemas/EndpointsInfrastructureEdgeStatistics' + metadata: + $ref: '#/components/schemas/EndpointsInfrastructureGraphInfoMetadata' + nodeStatistics: + $ref: '#/components/schemas/EndpointsInfrastructureNodeStatistics' + validationResults: + $ref: '#/components/schemas/EndpointsInfrastructureValidationResults' + required: + - metadata + - nodeStatistics + - edgeStatistics + - accountsInfo + - crossAccountStatistics + - validationResults type: object - ModelsCodeIgnore: + EndpointsInfrastructureGraphInfoMetadata: properties: - cwes: - items: - type: integer - type: array - dirs: - items: - type: string - type: array - expiry: + destinationBucket: type: string - paths: - items: - type: string - type: array - reason: + generatedAt: + format: date-time type: string - repositories: - items: - type: string - type: array - ruleIds: - items: - type: string - type: array - type: object - ModelsCollection: - properties: - collectionId: - description: Unique identifier for the collection + generatedBy: type: string - collections: - description: List of sub-collections - items: - $ref: '#/components/schemas/ModelsSubCollection' - nullable: true - type: array - isSensitive: - description: Whether the collection contains sensitive data + graphType: + type: string + id: + type: string + isCombinedGraph: type: boolean - name: - description: Name of the collection + processingDuration: + type: string + sourceBucket: + type: string + version: type: string required: - - collectionId - - name - - isSensitive - - collections + - id + - version + - generatedAt + - generatedBy + - processingDuration + - sourceBucket + - isCombinedGraph + - graphType type: object - ModelsConfiguration: + EndpointsInfrastructureGraphSummary: properties: - code: - $ref: '#/components/schemas/ModelsCode' - dependencies: - $ref: '#/components/schemas/ModelsDependencies' - enableFailBuilds: - nullable: true - type: boolean - enableIssueDashboards: - nullable: true - type: boolean - enablePullRequestReviews: - nullable: true - type: boolean - ignoreDirs: - items: - type: string - type: array - ignorePaths: - items: - type: string - type: array - integrations: - $ref: '#/components/schemas/ModelsIntegrations' - priorityThreshold: + accountId: type: string - secrets: - $ref: '#/components/schemas/ModelsSecrets' - secretsWhitelist: - items: - type: string - type: array - severityThreshold: + edgeCount: + type: integer + generatedAt: + format: date-time type: string - type: object - ModelsContainerImageMetadata: - properties: - digest: + generatedBy: type: string - distro: - properties: - name: - type: string - version: - type: string - type: object - fullReference: + graphId: type: string - registryDomain: + graphType: type: string - registryPath: + lastModified: + format: date-time type: string - shortName: + nodeCount: + type: integer + region: type: string - tag: + s3Key: type: string + tags: + additionalProperties: + type: string + type: object + version: + type: string + required: + - accountId + - graphId + - version + - nodeCount + - edgeCount + - graphType + - generatedAt + - generatedBy + - lastModified type: object - ModelsDataMap: - additionalProperties: - type: string - type: object - ModelsDependencies: + EndpointsInfrastructureNodeStatistics: properties: - enableFailBuilds: + nodesByAccount: + additionalProperties: + type: integer + nullable: true + type: object + nodesByObjectType: + additionalProperties: + type: integer + nullable: true + type: object + nodesByRegion: + additionalProperties: + type: integer + nullable: true + type: object + nodesBySubType: + additionalProperties: + type: integer + nullable: true + type: object + nodesByType: + additionalProperties: + type: integer nullable: true + type: object + totalNodes: + type: integer + required: + - totalNodes + - nodesByObjectType + - nodesByType + - nodesBySubType + - nodesByRegion + - nodesByAccount + type: object + EndpointsInfrastructureValidationCheck: + properties: + details: + type: string + name: + type: string + passed: type: boolean - ignore: - items: - $ref: '#/components/schemas/ModelsDependenciesIgnore' - type: array + required: + - name + - passed type: object - ModelsDependenciesIgnore: + EndpointsInfrastructureValidationResults: properties: - cves: - items: - type: string - type: array - dirs: + checks: items: - type: string + $ref: '#/components/schemas/EndpointsInfrastructureValidationCheck' + nullable: true type: array - expiry: - type: string - paths: + errorCount: + type: integer + errors: items: type: string type: array - reason: - type: string - repositories: + isValid: + type: boolean + warningCount: + type: integer + warnings: items: type: string type: array + required: + - isValid + - errorCount + - warningCount + - checks type: object - ModelsDeploymentType: + EndpointsIntegrationStatus: enum: - - helm - - terraform - - cloudformation - - cloud_connector + - pending + - ready type: string - ModelsDiffFile: + EndpointsJARDetailsView: + type: object + EndpointsJenkinsDetailsView: + type: object + EndpointsK8SClusterDetailsView: + type: object + EndpointsK8SCollectorClusterView: properties: - header: + clusterName: type: string - hunks: - items: - $ref: '#/components/schemas/ModelsDiffHunk' - nullable: true - type: array - mode: - type: integer - newName: + lastCompletedAt: type: string - origName: + lastScanId: type: string - required: - - header - - mode - - origName - - newName - - hunks - type: object - ModelsDiffHunk: - properties: - header: + recordCounts: + additionalProperties: + type: integer + type: object + scanIdentity: type: string - wholeRange: - $ref: '#/components/schemas/ModelsDiffRange' required: - - header - - wholeRange + - scanIdentity + - lastScanId + - lastCompletedAt type: object - ModelsDiffLine: - properties: - content: - type: string - mode: - $ref: '#/components/schemas/ModelsDiffLineMode' - number: - type: integer - required: - - mode - - number - - content + EndpointsK8SDaemonSetDetailsView: type: object - ModelsDiffLineMode: - format: int32 - type: integer - ModelsDiffRange: + EndpointsK8SDeploymentDetailsView: properties: - length: + availableReplicas: type: integer - lines: + clusterId: + type: string + images: items: - $ref: '#/components/schemas/ModelsDiffLine' - nullable: true + type: string type: array - start: + namespace: + type: string + readyReplicas: type: integer - required: - - start - - length - - lines + selector: + additionalProperties: + type: string + type: object type: object - ModelsExternalOwnerProvider: + EndpointsK8SIngressDetailsView: properties: - installationId: - description: The external installation ID + backendServices: + items: + type: string + type: array + clusterId: type: string - required: - - installationId - type: object - ModelsFileOwner: - properties: - name: - description: The name of the owner + hosts: + items: + type: string + type: array + ingressClass: type: string - type: - $ref: '#/components/schemas/ModelsOwnerType' - required: - - name - - type - type: object - ModelsFileOwners: - properties: - id: - description: A unique identifier for the file owners + namespace: type: string - owners: - description: A list of owners associated with the file + tlsHosts: items: - $ref: '#/components/schemas/ModelsFileOwner' - nullable: true + type: string type: array - required: - - id - - owners - type: object - ModelsFindingType: - enum: - - Unknown - - Code - - Dependencies - - Containers - - SecretsCredentials - - SecretsSensitiveData - - Pentest - - BugHunt - - Cloud - - Platform - type: string - ModelsFindingsMetrics: - properties: - autofixTimeTotal: - minimum: 0 - type: integer - detectionTimeTotal: - minimum: 0 - type: integer - estimatedBacklogStoryPoints: - minimum: 0 - type: integer - findingsAllowlistedCount: - minimum: 0 - type: integer - findingsCount: - minimum: 0 - type: integer - findingsInBacklogCount: - minimum: 0 - type: integer - findingsInProgressCount: - minimum: 0 - type: integer - findingsResolvedCount: - minimum: 0 - type: integer - findingsWithOpenAutoFixPRCount: - minimum: 0 - type: integer - findingsWithOpenTicketCount: - minimum: 0 - type: integer - meanTimeToDetectAndTriage: - minimum: 0 - type: integer - meanTimeToMerge: - minimum: 0 - type: integer - meanTimeToPullRequestCreation: - minimum: 0 - type: integer - meanTimeToResolve: - minimum: 0 - type: integer - meanTimeToReview: - minimum: 0 - type: integer - medianTimeToDetectAndTriage: - minimum: 0 - type: integer - medianTimeToMerge: - minimum: 0 - type: integer - medianTimeToPullRequestCreation: - minimum: 0 - type: integer - medianTimeToResolve: - minimum: 0 - type: integer - medianTimeToReview: - minimum: 0 - type: integer - timeSaved: - minimum: 0 - type: integer - triageTimeTotal: - minimum: 0 - type: integer - required: - - findingsCount - - findingsInBacklogCount - - findingsWithOpenAutoFixPRCount - - findingsWithOpenTicketCount - - findingsResolvedCount type: object - ModelsGCPProjectInput: + EndpointsK8SNamespaceDetailsView: properties: - displayName: - type: string - isDefault: - type: boolean - projectId: + clusterId: type: string - type: + finalizers: + items: + type: string + type: array + phase: type: string - required: - - projectId type: object - ModelsGCPProjectWithStatus: + EndpointsK8SNodeDetailsView: properties: - accountType: - type: string - isDefault: - type: boolean - isEnabled: - type: boolean - lastVerifiedAt: + allocatable: + additionalProperties: + type: string + type: object + capacity: + additionalProperties: + type: string + type: object + clusterName: type: string - lastVerifiedStatus: + containerRuntime: type: string - projectId: + kernelVersion: type: string - projectName: + kubeletVersion: type: string - state: + labels: + additionalProperties: + type: string + type: object + nodeName: type: string - required: - - projectId - - isDefault - - isEnabled + taints: + items: + type: string + type: array type: object - ModelsGitBuildStatus: - enum: - - IN_PROGRESS - - SUCCESS - - SKIPPED - - FAILURE - type: string - ModelsGitHubGitPullRequest: - properties: - pullRequestNodeId: - description: The GraphQL node ID for the GitHub pull request - type: string - pullRequestNumber: - description: The GitHub pull request number - format: int64 - type: integer - required: - - pullRequestNumber - - pullRequestNodeId + EndpointsK8SPodDetailsView: type: object - ModelsGitHubGitRepositoryProvider: + EndpointsK8SRoleBindingDetailsView: + type: object + EndpointsK8SRoleDetailsView: + type: object + EndpointsK8SServiceAccountDetailsView: + type: object + EndpointsK8SServiceDetailsView: properties: - hasIssue: - description: Whether the repository has GitHub Issues - type: boolean - nodeId: - description: The GitHub Node ID of the repository + clusterId: type: string - owner: - description: The owner of the repository + clusterIps: + items: + type: string + type: array + externalIps: + items: + type: string + type: array + externalName: type: string - ownerId: - description: The GitHub ID of the repository owner - format: int64 - type: integer - repositoryId: - description: The GitHub ID of the repository - format: int64 - type: integer - repositoryName: - description: The name of the GitHub repository + namespace: type: string - required: - - owner - - ownerId - - repositoryName - - repositoryId - - hasIssue + ports: + items: + $ref: '#/components/schemas/EndpointsK8SServicePortDetailsView' + type: array + selector: + additionalProperties: + type: string + type: object type: object - ModelsGitHubOwnerProvider: + EndpointsK8SServicePortDetailsView: properties: - baseUrl: - description: The GitHub base URL - type: string - installationId: - description: The GitHub installation ID - format: int64 - type: integer - owner: - description: The GitHub owner name + name: type: string - ownerId: - description: The GitHub owner ID - format: int64 + nodePort: type: integer - ownerType: - description: The GitHub owner type - type: string - required: - - installationId - - ownerId - - owner - - ownerType - - baseUrl - type: object - ModelsGitHubTicketProject: - properties: - repositoryId: - description: The GitHub repository ID - format: int64 + port: type: integer - repositoryName: - description: The GitHub repository name + protocol: type: string - repositoryNodeId: - description: The GraphQL node ID for the GitHub repository + targetPort: type: string - required: - - repositoryId - - repositoryNodeId - - repositoryName type: object - ModelsGitHubTicketProvider: + EndpointsK8SStatefulSetDetailsView: + type: object + EndpointsListAiMlAssetsOutput: properties: - issueId: - description: The GitHub issue ID - format: int64 - type: integer - nodeId: - description: The GitHub issue GraphQL node ID + assets: + items: + $ref: '#/components/schemas/EndpointsAiMlAssetView' + nullable: true + type: array + nextToken: type: string - number: - description: The GitHub issue number - format: int64 + total: type: integer - repositoryName: - description: The GitHub issue repository name - type: string - url: - description: The GitHub issue URL + version: type: string required: - - number - - issueId - - nodeId - - repositoryName - - url + - assets + - total + - version type: object - ModelsGitHubUserProvider: + EndpointsListArtifactDeploymentsOutput: properties: - id: - format: int64 - type: integer - nodeId: + deployments: + items: + $ref: '#/components/schemas/EndpointsArtifactDeploymentSummary' + nullable: true + type: array + nextToken: + nullable: true + type: string + version: type: string required: - - id - - nodeId + - deployments type: object - ModelsGitLabGitPullRequest: + EndpointsListArtifactRepositoriesAssetsOutput: properties: - mergeRequestNumber: - description: The GitLab merge request ID - format: int64 + assets: + items: + $ref: '#/components/schemas/EndpointsArtifactRepositoriesAssetView' + nullable: true + type: array + nextToken: + type: string + total: type: integer + version: + type: string required: - - mergeRequestNumber + - assets + - total + - version type: object - ModelsGitLabGitRepositoryProvider: + EndpointsListArtifactsAssetsOutput: properties: - projectId: - description: The ID of the GitLab project - format: int64 + assets: + items: + $ref: '#/components/schemas/EndpointsArtifactsAssetView' + nullable: true + type: array + nextToken: + type: string + total: type: integer - projectName: - description: The name of the GitLab project + version: type: string required: - - projectId - - projectName + - assets + - total + - version type: object - ModelsGitLabOwnerProvider: + EndpointsListArtifactsOutput: properties: - baseUrl: - description: The GitLab base URL + artifacts: + items: + $ref: '#/components/schemas/EndpointsArtifactSummary' + nullable: true + type: array + nextToken: + nullable: true type: string - groupId: - description: The GitLab group ID + totalCount: format: int64 type: integer - groupName: - description: The GitLab group name + version: type: string required: - - groupId - - groupName - - baseUrl - type: object - ModelsGitLabTicketProject: - type: object - ModelsGitLabTicketProvider: - type: object - ModelsGitLabUserProvider: - properties: - id: - type: integer - required: - - id - type: object - ModelsGitPullRequestProvider: - properties: - azure: - $ref: '#/components/schemas/ModelsAzureGitPullRequest' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketGitPullRequest' - github: - $ref: '#/components/schemas/ModelsGitHubGitPullRequest' - gitlab: - $ref: '#/components/schemas/ModelsGitLabGitPullRequest' - id: - $ref: '#/components/schemas/ModelsProviderID' - type: object - ModelsGitRepositoryProvider: - properties: - azure: - $ref: '#/components/schemas/ModelsAzureGitRepositoryProvider' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketGitRepositoryProvider' - github: - $ref: '#/components/schemas/ModelsGitHubGitRepositoryProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabGitRepositoryProvider' - id: - $ref: '#/components/schemas/ModelsProviderID' + - artifacts + - totalCount type: object - ModelsGoogleWorkspaceOwnerProvider: + EndpointsListAssetInventoryOutput: properties: - domain: - description: The Google Workspace domain + assets: + items: + $ref: '#/components/schemas/EndpointsUnifiedAssetView' + nullable: true + type: array + nextToken: type: string - serviceAccountJson: - description: The service account JSON key + total: + type: integer + version: type: string required: - - domain - - serviceAccountJson + - assets + - total + - version type: object - ModelsGoogleWorkspaceUserProvider: + EndpointsListCDNAndDNSAssetsOutput: properties: - id: + assets: + items: + $ref: '#/components/schemas/EndpointsCDNAndDNSAssetView' + nullable: true + type: array + nextToken: + type: string + total: + type: integer + version: type: string required: - - id + - assets + - total + - version type: object - ModelsGroundRule: + EndpointsListCiCdAssetsOutput: properties: - description: - type: string - id: + assets: + items: + $ref: '#/components/schemas/EndpointsCiCdAssetView' + nullable: true + type: array + nextToken: type: string - title: + total: + type: integer + version: type: string required: - - id - - title - - description - type: object - ModelsIntegrations: - properties: - jira: - $ref: '#/components/schemas/ModelsJira' + - assets + - total + - version type: object - ModelsJira: + EndpointsListClusterAssetsOutput: properties: - assignee: - $ref: '#/components/schemas/ModelsAssignee' - commentOnClose: + assets: + items: + $ref: '#/components/schemas/EndpointsClusterAssetView' nullable: true - type: boolean - descriptionTemplate: + type: array + nextToken: type: string - disabled: - type: boolean - enabled: - nullable: true - type: boolean - issueType: + total: + type: integer + version: type: string - labels: + required: + - assets + - total + - version + type: object + EndpointsListComputeAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsComputeAssetView' + nullable: true type: array - onFixTransition: - type: string - priorities: - $ref: '#/components/schemas/ModelsPriorities' - priorityThreshold: - type: string - projectKey: - type: string - severityThreshold: + nextToken: type: string - titleTemplate: + total: + type: integer + version: type: string + required: + - assets + - total + - version type: object - ModelsJiraConfig: + EndpointsListConnectivityAssetsOutput: properties: - autoCreate: - type: boolean - createdAt: - type: string - issueType: - type: string - projectKey: - type: string - severityThreshold: + assets: + items: + $ref: '#/components/schemas/EndpointsConnectivityAssetView' + nullable: true + type: array + nextToken: type: string - updatedAt: + total: + type: integer + version: type: string required: - - severityThreshold - - projectKey - - issueType - - createdAt - - updatedAt - - autoCreate + - assets + - total + - version type: object - ModelsJiraOwnerProvider: + EndpointsListContainerAssetsOutput: properties: - appKeyId: - description: The Jira app key ID - type: string - baseUrl: - description: The Jira base URL - type: string - installationId: - description: The Jira installation ID - type: string - ownerId: - description: The Jira owner ID + assets: + items: + $ref: '#/components/schemas/EndpointsContainerAssetView' + nullable: true + type: array + nextToken: type: string - sharedSecret: - description: The Jira shared secret + total: + type: integer + version: type: string required: - - installationId - - ownerId - - appKeyId - - sharedSecret - - baseUrl + - assets + - total + - version type: object - ModelsJiraTicketProject: + EndpointsListDataPipelineAssetsOutput: properties: - id: - description: The Jira project ID + assets: + items: + $ref: '#/components/schemas/EndpointsDataPipelineAssetView' + nullable: true + type: array + nextToken: type: string - projectKey: - description: The Jira project key + total: + type: integer + version: type: string required: - - id - - projectKey + - assets + - total + - version type: object - ModelsJiraTicketProvider: + EndpointsListDatabaseAssetsOutput: properties: - issueId: - description: The Jira issue ID - type: string - issueKey: - description: The Jira issue key + assets: + items: + $ref: '#/components/schemas/EndpointsDatabaseAssetView' + nullable: true + type: array + nextToken: type: string - url: - description: The Jira issue URL + total: + type: integer + version: type: string required: - - issueId - - issueKey - - url + - assets + - total + - version type: object - ModelsJiraUserProvider: + EndpointsListEndpointsAssetsOutput: properties: - id: + endpoints: + items: + $ref: '#/components/schemas/EndpointsEndpointsAssetView' + nullable: true + type: array + nextToken: type: string - name: + total: + type: integer + version: type: string required: - - id + - endpoints + - total + - version type: object - ModelsLanguageName: - enum: - - Apex - - Bash - - Bicep - - CloudFormation - - Containerfile - - Custom Rules - - C - - Cairo - - Clojure - - C/C++ - - C++ - - C# - - Dart - - Elixir - - Generic - - Go - - HCL - - HTML - - Java - - JavaScript - - JSON - - Jsonnet - - Julia - - Kotlin - - Kubernetes - - Lisp - - Lua - - OCaml - - OpenAPI - - PHP - - Python - - R - - Renovate - - Ruby - - Rust - - Scala - - Scheme - - Serverless - - Shell - - Solidity - - Swift - - Terraform - - TypeScript - - YAML - - XML - type: string - ModelsLimitedUnifiedFindingsQuery: + EndpointsListEntrypointsOutput: properties: - appName: + entrypoints: items: - type: string + $ref: '#/components/schemas/EndpointsEntrypointSummary' nullable: true type: array - appType: - items: - type: string + nextToken: nullable: true - type: array - autoFixState: + type: string + version: + type: string + required: + - entrypoints + type: object + EndpointsListIdentityAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsIdentityAssetView' nullable: true type: array - branch: + nextToken: + type: string + total: + type: integer + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListInfrastructureGraphVersionsOutput: + properties: + accountId: + type: string + count: + type: integer + version: + type: string + versions: items: type: string nullable: true type: array - cve: + required: + - accountId + - versions + - count + type: object + EndpointsListInfrastructureGraphsOutput: + properties: + count: + type: integer + graphs: items: - type: string + $ref: '#/components/schemas/EndpointsInfrastructureGraphSummary' nullable: true type: array - cwe: + version: + type: string + required: + - graphs + - count + type: object + EndpointsListK8SCollectorClustersOutput: + properties: + clusters: items: - type: string + $ref: '#/components/schemas/EndpointsK8SCollectorClusterView' nullable: true type: array - exploitValidated: - nullable: true - type: boolean - fileOwner: + version: + type: string + required: + - clusters + - version + type: object + EndpointsListLoadBalancerAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsLoadBalancerAssetView' nullable: true type: array - findingId: + nextToken: + type: string + total: + type: integer + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListMessagingAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsMessagingAssetView' nullable: true type: array - fromDate: - nullable: true + nextToken: type: string - fromPriorityScore: - nullable: true + total: type: integer - hasAutoFix: - nullable: true - type: boolean - hasTicket: - nullable: true - type: boolean - hasTicketOrPR: - nullable: true - type: boolean - host: + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListNetworkAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsNetworkAssetView' nullable: true type: array - imageName: + nextToken: + type: string + total: + type: integer + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListObservabilityAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsObservabilityAssetView' nullable: true type: array - importantMaxDays: - nullable: true + nextToken: + type: string + total: type: integer - includeEmpty: - nullable: true - type: boolean - informationalMaxDays: + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListPipelinesAssetsOutput: + properties: + assets: + items: + $ref: '#/components/schemas/EndpointsPipelinesAssetView' nullable: true + type: array + nextToken: + type: string + total: type: integer - isAllowlisted: - nullable: true - type: boolean - isArchived: - nullable: true - type: boolean - isAutofixed: - nullable: true - type: boolean - isDirect: - nullable: true - type: boolean - isFalsePositive: - nullable: true - type: boolean - isFixed: - nullable: true - type: boolean - isInternetReachable: - nullable: true - type: boolean - isPushWorkflow: - nullable: true - type: boolean - isResolved: + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListPipelinesOutput: + properties: + nextToken: nullable: true - type: boolean - language: + type: string + pipelines: items: - type: string + $ref: '#/components/schemas/EndpointsPipelineSummary' nullable: true type: array - notfindingId: + version: + type: string + required: + - pipelines + type: object + EndpointsListProjectExecutionRecipeValidationsOutput: + properties: + limit: + type: integer + offset: + type: integer + validations: items: - type: string + $ref: '#/components/schemas/ModelsExecutionRecipeValidation' nullable: true type: array - package: + required: + - limit + - offset + type: object + EndpointsListProjectExecutionRecipeVersionsOutput: + properties: + limit: + type: integer + offset: + type: integer + versions: items: - type: string + $ref: '#/components/schemas/ModelsExecutionRecipe' nullable: true type: array - platform: + required: + - limit + - offset + type: object + EndpointsListProjectsAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsProjectsAssetView' nullable: true type: array - priorityLabel: + nextToken: + type: string + total: + type: integer + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListRepoScansOutput: + properties: + page: + type: integer + pageSize: + type: integer + scans: items: - type: string + $ref: '#/components/schemas/EndpointsRepoScanSummary' nullable: true type: array - repository: + total: + type: integer + version: + type: string + required: + - scans + - total + - page + - pageSize + type: object + EndpointsListReposAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsReposAssetView' nullable: true type: array - repositoryId: - items: - type: string + nextToken: + type: string + total: + type: integer + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListRepositoryProjectsOutput: + properties: + nextToken: nullable: true - type: array - ruleId: + type: string + projects: items: - type: string + $ref: '#/components/schemas/ModelsProjectSummary' nullable: true type: array - search: - nullable: true + version: type: string - secretType: + required: + - projects + type: object + EndpointsListSchemasOutput: + properties: + schemas: items: - type: string + $ref: '#/components/schemas/EndpointsSchemaSummary' nullable: true type: array - severity: + version: + type: string + required: + - schemas + type: object + EndpointsListSecurityAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsSecurityAssetView' nullable: true type: array - sort: + nextToken: + type: string + total: + type: integer + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListServerlessAssetsOutput: + properties: + assets: items: - additionalProperties: - additionalProperties: {} - type: object - type: object + $ref: '#/components/schemas/EndpointsServerlessAssetView' nullable: true type: array - sortPreset: - $ref: '#/components/schemas/ModelsUnifiedFindingsSortPreset' - nullable: true - teamIDs: + nextToken: + type: string + total: + type: integer + version: + type: string + required: + - assets + - total + - version + type: object + EndpointsListStorageAndBackupAssetsOutput: + properties: + assets: items: - type: string + $ref: '#/components/schemas/EndpointsStorageAndBackupAssetView' nullable: true type: array - tenantId: - nullable: true + nextToken: type: string - toDate: - nullable: true + total: + type: integer + version: type: string - toPriorityScore: - nullable: true + required: + - assets + - total + - version + type: object + EndpointsLoadBalancerAssetDetailsView: + properties: + awsAlb: + $ref: '#/components/schemas/EndpointsAWSALBDetailsView' + awsClb: + $ref: '#/components/schemas/EndpointsAWSCLBDetailsView' + awsNlb: + $ref: '#/components/schemas/EndpointsAWSNLBDetailsView' + awsTargetGroup: + $ref: '#/components/schemas/EndpointsAWSTargetGroupDetailsView' + azureAppGateway: + $ref: '#/components/schemas/EndpointsAzureAppGatewayDetailsView' + gcpLb: + $ref: '#/components/schemas/EndpointsGCPLBDetailsView' + k8sIngress: + $ref: '#/components/schemas/EndpointsK8SIngressDetailsView' + k8sService: + $ref: '#/components/schemas/EndpointsK8SServiceDetailsView' + subType: + $ref: '#/components/schemas/ModelsLoadBalancerSubType' + required: + - subType + type: object + EndpointsLoadBalancerAssetView: + properties: + accountId: + type: string + deletedAtScanId: + type: string + dnsName: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + healthyTargetCount: type: integer - type: - items: + id: + type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: + type: string + lbType: + type: string + listenerCount: + type: integer + name: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + scheme: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsLoadBalancerSubType' + tags: + additionalProperties: type: string nullable: true - type: array - urgentMaxDays: - nullable: true + type: object + targetCount: type: integer + tlsPolicy: + type: string + wafAttached: + type: boolean + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt type: object - ModelsLinearOwnerProvider: + EndpointsMavenDetailsView: + type: object + EndpointsMemoryFinding: properties: - accessToken: - description: The Linear access token + cited: + type: boolean + findingType: type: string - clientId: - description: The Linear client ID + id: type: string - clientSecret: - description: The Linear client secret + repository: type: string - urlKey: - description: The Linear domain key + severity: type: string - workspaceId: - description: The Linear workspace ID + status: + enum: + - open + - resolved + - allowlisted + - closed type: string - workspaceName: - description: The Linear workspace name + title: type: string required: - - clientId - - clientSecret - - workspaceName - - workspaceId - - urlKey + - id + - findingType + - title + - severity + - status + - cited type: object - ModelsLinearTicketProject: + EndpointsMemoryVersion: properties: - projectId: - description: The Linear project ID + changeReason: type: string - teamId: - description: The Linear team ID + changedBy: + nullable: true type: string - teamKey: - description: The Linear team key + createdAt: + format: date-time type: string + memory: + $ref: '#/components/schemas/ModelsMemory' + status: + $ref: '#/components/schemas/ModelsMemoryStatus' + version: + type: integer required: - - teamKey - - teamId + - version + - status + - changeReason + - createdAt + - memory + type: object + EndpointsMessagingAssetDetailsView: + properties: + awsEventBridge: + $ref: '#/components/schemas/EndpointsAWSEventBridgeDetailsView' + awsKinesis: + $ref: '#/components/schemas/EndpointsAWSKinesisDetailsView' + awsMq: + $ref: '#/components/schemas/EndpointsAWSMQDetailsView' + awsMsk: + $ref: '#/components/schemas/EndpointsAWSMSKDetailsView' + awsSes: + $ref: '#/components/schemas/EndpointsAWSSESDetailsView' + awsSns: + $ref: '#/components/schemas/EndpointsAWSSNSDetailsView' + awsSqs: + $ref: '#/components/schemas/EndpointsAWSSQSDetailsView' + azureEventGrid: + $ref: '#/components/schemas/EndpointsAzureEventGridDetailsView' + azureEventHub: + $ref: '#/components/schemas/EndpointsAzureEventHubDetailsView' + azureIotHub: + $ref: '#/components/schemas/EndpointsAzureIotHubDetailsView' + azureServiceBus: + $ref: '#/components/schemas/EndpointsAzureServiceBusDetailsView' + gcpPubSub: + $ref: '#/components/schemas/EndpointsGCPPubSubDetailsView' + subType: + $ref: '#/components/schemas/ModelsMessagingSubType' + required: + - subType type: object - ModelsLinearTicketProvider: + EndpointsMessagingAssetView: properties: - issueId: - description: The Linear issue ID + accountId: type: string - teamId: - description: The Linear team ID + deletedAtScanId: type: string - url: - description: The Linear issue URL + dlqConfigured: + type: boolean + encryptionKmsKeyId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + id: + type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + kind: + type: string + lastSeenAt: + type: string + messageRetentionS: + type: integer + name: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + publiclyAccessible: + type: boolean + region: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string + subType: + $ref: '#/components/schemas/ModelsMessagingSubType' + subscriberCount: + type: integer + tags: + additionalProperties: + type: string + nullable: true + type: object + throughputOrShardCount: + type: integer required: - - issueId - - url - - teamId + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsNPMPackageDetailsView: + type: object + EndpointsNPMRegistryDetailsView: + type: object + EndpointsNetworkAssetDetailsView: + properties: + awsEip: + $ref: '#/components/schemas/EndpointsAWSEIPDetailsView' + awsInternetGateway: + $ref: '#/components/schemas/EndpointsAWSInternetGatewayDetailsView' + awsNatGateway: + $ref: '#/components/schemas/EndpointsAWSNATGatewayDetailsView' + awsRouteTable: + $ref: '#/components/schemas/EndpointsAWSRouteTableDetailsView' + awsSubnet: + $ref: '#/components/schemas/EndpointsAWSSubnetDetailsView' + awsVpc: + $ref: '#/components/schemas/EndpointsAWSVPCDetailsView' + awsVpcEndpoint: + $ref: '#/components/schemas/EndpointsAWSVPCEndpointDetailsView' + azureSubnet: + $ref: '#/components/schemas/EndpointsAzureSubnetDetailsView' + azureVnet: + $ref: '#/components/schemas/EndpointsAzureVNetDetailsView' + gcpCloudNat: + $ref: '#/components/schemas/EndpointsGCPCloudNATDetailsView' + gcpVpc: + $ref: '#/components/schemas/EndpointsGCPVPCDetailsView' + subType: + $ref: '#/components/schemas/ModelsNetworkSubType' + required: + - subType type: object - ModelsLinearUserProvider: + EndpointsNetworkAssetView: properties: + accountId: + type: string + attachedGatewayIds: + items: + type: string + type: array + cidrBlock: + type: string + deletedAtScanId: + type: string + dnsHostnamesEnabled: + type: boolean + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + flowLogsEnabled: + type: boolean id: type: string + isActive: + type: boolean + isDefault: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + isPublicSubnet: + type: boolean + lastSeenAt: + type: string + name: + type: string + peeringCount: + type: integer + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + routeTableId: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsNetworkSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object required: - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsNuGetDetailsView: + type: object + EndpointsObservabilityAssetDetailsView: + properties: + awsCloudWatchAlarm: + $ref: '#/components/schemas/EndpointsAWSCloudWatchAlarmDetailsView' + awsCloudWatchDashboard: + $ref: '#/components/schemas/EndpointsAWSCloudWatchDashboardDetailsView' + awsCloudWatchLogGroup: + $ref: '#/components/schemas/EndpointsAWSCloudWatchLogGroupDetailsView' + awsXRay: + $ref: '#/components/schemas/EndpointsAWSXRayDetailsView' + azureAutomation: + $ref: '#/components/schemas/EndpointsAzureAutomationDetailsView' + azureMonitor: + $ref: '#/components/schemas/EndpointsAzureMonitorDetailsView' + gcpLogging: + $ref: '#/components/schemas/EndpointsGCPLoggingDetailsView' + gcpStackdriver: + $ref: '#/components/schemas/EndpointsGCPStackdriverDetailsView' + subType: + $ref: '#/components/schemas/ModelsObservabilitySubType' + required: + - subType type: object - ModelsMessageChannel: + EndpointsObservabilityAssetView: properties: - channelProvider: - $ref: '#/components/schemas/ModelsMessageChannelProvider' - description: + accountId: + type: string + alarmState: + type: string + deletedAtScanId: + type: string + destination: + type: string + encryptionKmsKeyId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + id: + type: string + ingestionBytes30d: + format: int64 + type: integer + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + kind: + type: string + lastSeenAt: type: string name: type: string - ownerProvider: - $ref: '#/components/schemas/ModelsOwnerProvider' + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + retentionDays: + type: integer + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsObservabilitySubType' + tags: + additionalProperties: + type: string + nullable: true + type: object required: - - ownerProvider - - channelProvider + - id - name - - description + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt type: object - ModelsMessageChannelProvider: + EndpointsOtherArtifactDetailsView: + type: object + EndpointsOtherRegistryDetailsView: + type: object + EndpointsPackageFilter: properties: - id: - $ref: '#/components/schemas/ModelsProviderID' - slack: - $ref: '#/components/schemas/ModelsSlackMessageChannelProvider' - teams: - $ref: '#/components/schemas/ModelsTeamsMessageChannelProvider' + ecosystem: + type: string + package: + type: string + version: + type: string required: - - id + - ecosystem + - package + - version type: object - ModelsMetricsResolution: - enum: - - hour - - day - - week - type: string - ModelsNotification: + EndpointsPatchAssetFlagsInput: properties: - events: - $ref: '#/components/schemas/ModelsNotificationEvents' - repositories: - items: + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + required: + - isPublicFacing + - isInternetReachable + type: object + EndpointsPatchAssetFlagsOutput: + properties: + success: + type: boolean + version: + type: string + required: + - success + - version + type: object + EndpointsPatchAssetTagsInput: + properties: + tags: + additionalProperties: type: string - type: array - targets: - $ref: '#/components/schemas/ModelsNotificationTargets' + nullable: true + type: object type: object - ModelsNotificationEventAll: + EndpointsPatchAssetTagsOutput: properties: - cves: + success: + type: boolean + version: + type: string + required: + - success + - version + type: object + EndpointsPatchContextApplicationInput: + properties: + application: + $ref: '#/components/schemas/ModelsAgentAppContextSeed' + required: + - application + type: object + EndpointsPatchContextApplicationOutput: + properties: + application: + $ref: '#/components/schemas/ModelsApplication' + message: + type: string + version: + type: string + required: + - message + type: object + EndpointsPatchMemoryInput: + properties: + citations: items: - type: string + $ref: '#/components/schemas/ModelsMemoryCitationsElem' type: array - cwes: + confidence: + nullable: true + type: number + content: + nullable: true + type: string + crossReferences: items: - type: integer + $ref: '#/components/schemas/ModelsMemoryCrossReferencesElem' type: array - minimumPriority: - type: integer - minimumSeverity: - $ref: '#/components/schemas/ModelsSeverity' - secretTypes: + metadata: + $ref: '#/components/schemas/ModelsMemoryMetadata' + parentNoteId: + nullable: true + type: string + priority: + $ref: '#/components/schemas/ModelsMemoryPriority' + nullable: true + supersedesMemoryId: + nullable: true + type: string + tags: items: type: string type: array + title: + nullable: true + type: string type: object - ModelsNotificationEventNewAPIFindings: + EndpointsPatchMemoryOutput: properties: - cwes: + memory: + $ref: '#/components/schemas/ModelsMemory' + version: + type: string + type: object + EndpointsPatchRepoScanInput: + properties: + completedAt: + format: date-time + nullable: true + type: string + errorMessage: + type: string + projectsTouched: items: - type: integer + $ref: '#/components/schemas/EndpointsRepoScanProjectTouched' type: array - minimumPriority: - type: integer - minimumSeverity: - $ref: '#/components/schemas/ModelsSeverity' + sbomsGenerated: + items: + $ref: '#/components/schemas/EndpointsRepoScanSBOMGenerated' + type: array + status: + type: string + subagentsRun: + additionalProperties: + $ref: '#/components/schemas/EndpointsRepoScanSubagent' + type: object + type: object + EndpointsPatchRepoScanOutput: + properties: + scan: + $ref: '#/components/schemas/EndpointsRepoScanSummary' + version: + type: string + required: + - scan + type: object + EndpointsPatchVaultFileInput: + properties: + documentId: + type: string + metadata: + additionalProperties: {} + type: object + processedAt: + type: string type: object - ModelsNotificationEventNewCodeFindings: + EndpointsPatchVaultFileOutput: properties: - cwes: - items: - type: integer - type: array - minimumPriority: - type: integer - minimumSeverity: - $ref: '#/components/schemas/ModelsSeverity' + message: + type: string + success: + type: boolean + version: + type: string + required: + - success + - message type: object - ModelsNotificationEventNewDependencyFindings: + EndpointsPipelineJobSummary: properties: - cves: - items: - type: string - type: array - cwes: + name: + type: string + runsOn: + type: string + steps: items: - type: integer + $ref: '#/components/schemas/EndpointsPipelineStepSummary' + nullable: true type: array - minimumPriority: - type: integer - minimumSeverity: - $ref: '#/components/schemas/ModelsSeverity' type: object - ModelsNotificationEventNewSecretFindings: + EndpointsPipelineStepSummary: properties: - types: - items: - type: string - type: array + command: + type: string + description: + type: string + name: + type: string + uses: + type: string type: object - ModelsNotificationEventThreatIntel: + EndpointsPipelineSummary: properties: - cves: + artifactIds: items: type: string type: array - ecosystems: + createdAt: + format: date-time + type: string + deletedAt: + format: date-time + nullable: true + type: string + filePath: + type: string + id: + type: string + isDeleted: + type: boolean + jobs: items: - type: string + $ref: '#/components/schemas/EndpointsPipelineJobSummary' type: array - minimumSeverity: - $ref: '#/components/schemas/ModelsSeverity' - type: object - ModelsNotificationEvents: - properties: - all: - $ref: '#/components/schemas/ModelsNotificationEventAll' - newApiFindings: - $ref: '#/components/schemas/ModelsNotificationEventNewAPIFindings' - newCodeFindings: - $ref: '#/components/schemas/ModelsNotificationEventNewCodeFindings' - newDependencyFindings: - $ref: '#/components/schemas/ModelsNotificationEventNewDependencyFindings' - newSecretFindings: - $ref: '#/components/schemas/ModelsNotificationEventNewSecretFindings' - threatIntel: - $ref: '#/components/schemas/ModelsNotificationEventThreatIntel' - type: object - ModelsNotificationTargetEmail: - properties: - address: + metadata: + additionalProperties: {} + type: object + name: type: string - addresses: + platform: + type: string + projectId: + type: string + repositoryId: + type: string + runsOnPr: + type: boolean + triggers: items: - type: string + $ref: '#/components/schemas/EndpointsPipelineTriggerSummary' type: array + updatedAt: + format: date-time + type: string type: object - ModelsNotificationTargetSlack: + EndpointsPipelineTriggerSummary: properties: - channel: - type: string - channels: + branches: items: type: string type: array - type: object - ModelsNotificationTargetWebhook: - properties: - url: + cron: type: string - urls: + paths: items: type: string type: array + type: + type: string type: object - ModelsNotificationTargets: - properties: - email: - $ref: '#/components/schemas/ModelsNotificationTargetEmail' - slack: - $ref: '#/components/schemas/ModelsNotificationTargetSlack' - webhook: - $ref: '#/components/schemas/ModelsNotificationTargetWebhook' + EndpointsPipelinesAssetDetailsView: + properties: + azurePipelines: + $ref: '#/components/schemas/EndpointsAzurePipelinesDetailsView' + buildkite: + $ref: '#/components/schemas/EndpointsBuildkiteDetailsView' + circleci: + $ref: '#/components/schemas/EndpointsCircleCIDetailsView' + githubActions: + $ref: '#/components/schemas/EndpointsGitHubActionsDetailsView' + gitlabCi: + $ref: '#/components/schemas/EndpointsGitLabCIDetailsView' + jenkins: + $ref: '#/components/schemas/EndpointsJenkinsDetailsView' + subType: + $ref: '#/components/schemas/ModelsPipelinesSubType' + required: + - subType type: object - ModelsOccurrence: + EndpointsPipelinesAssetView: properties: - columnNumber: - description: Column number in file - type: integer - excerpt: - description: Code excerpt + accountId: type: string - fileName: - description: Name of the file + deletedAtScanId: type: string - lineNumber: - description: Line number in file - type: integer - sample: - description: Sample code snippet + externalId: type: string - required: - - sample - - lineNumber - - columnNumber - - fileName - - excerpt - type: object - ModelsOktaOwnerProvider: - properties: - apiToken: - description: The Okta API token + filePath: type: string - domain: - description: The Okta domain (e.g. dev-12345.okta.com) + firstFoundScanId: + type: string + firstSeenAt: type: string - required: - - domain - - apiToken - type: object - ModelsOktaUserProvider: - properties: id: type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: + type: string + name: + type: string + platform: + type: string + projectId: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + repoId: + type: string + runsOnPr: + type: boolean + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsPipelinesSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object required: - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt type: object - ModelsOrganization: + EndpointsPostCloudReconScanInput: properties: - id: + accountId: type: string - members: - items: - $ref: '#/components/schemas/ModelsUser' - nullable: true - type: array - name: + completedAt: + format: date-time + type: string + modelName: + type: string + payload: + format: base64 type: string provider: - $ref: '#/components/schemas/ModelsOwnerProvider' - slug: type: string - teams: - items: - $ref: '#/components/schemas/ModelsTeam' - nullable: true - type: array + scanId: + type: string + schemaVersion: + type: string + startedAt: + format: date-time + type: string required: + - accountId - provider - - id - - name - - slug - - teams - - members + - startedAt + - schemaVersion + - payload type: object - ModelsOwnerProvider: + EndpointsPostCloudReconScanOutput: properties: - azure: - $ref: '#/components/schemas/ModelsAzureOwnerProvider' - azureEntra: - $ref: '#/components/schemas/ModelsAzureEntraOwnerProvider' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketOwnerProvider' - external: - $ref: '#/components/schemas/ModelsExternalOwnerProvider' - github: - $ref: '#/components/schemas/ModelsGitHubOwnerProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabOwnerProvider' - googleWorkspace: - $ref: '#/components/schemas/ModelsGoogleWorkspaceOwnerProvider' - id: - $ref: '#/components/schemas/ModelsProviderID' - jira: - $ref: '#/components/schemas/ModelsJiraOwnerProvider' - linear: - $ref: '#/components/schemas/ModelsLinearOwnerProvider' - okta: - $ref: '#/components/schemas/ModelsOktaOwnerProvider' - slack: - $ref: '#/components/schemas/ModelsSlackOwnerProvider' - teams: - $ref: '#/components/schemas/ModelsTeamsOwnerProvider' + hotspotCount: + type: integer + nodeCount: + type: integer + s3Bucket: + type: string + s3Key: + type: string + scanId: + type: string + type: object + EndpointsPostContextApplicationInput: + properties: + application: + $ref: '#/components/schemas/ModelsAgentAppContextSeed' required: - - id + - application type: object - ModelsOwnerType: - enum: - - email - - team - - username - type: string - ModelsPII: + EndpointsPostContextApplicationOutput: properties: - collections: - description: List of data collections - items: - $ref: '#/components/schemas/ModelsCollection' - nullable: true - type: array - language: - description: The programming language + application: + $ref: '#/components/schemas/ModelsApplication' + message: type: string - probableSinks: - description: List of probable data sinks + version: + type: string + required: + - message + type: object + EndpointsPostMemoryInput: + properties: + anchors: items: type: string - nullable: true type: array - processing: - description: List of processing activities + citations: items: - $ref: '#/components/schemas/ModelsProcessing' - nullable: true + $ref: '#/components/schemas/ModelsMemoryCitationsElem' type: array - sinkProcessing: - description: List of sink processing activities + commentIds: items: - $ref: '#/components/schemas/ModelsSinkProcessing' - nullable: true + type: string type: array - sources: - description: List of data sources - items: - $ref: '#/components/schemas/ModelsSource' + confidence: nullable: true - type: array - required: - - language - - processing - - sources - - probableSinks - - sinkProcessing - - collections - type: object - ModelsPriorities: - properties: - critical: - type: string - high: - type: string - important: + type: number + content: type: string - low: + createdBy: + nullable: true type: string - medium: + crossReferences: + items: + $ref: '#/components/schemas/ModelsMemoryCrossReferencesElem' + type: array + eventTime: + format: date-time + nullable: true type: string - negligible: + isUserCreated: + nullable: true + type: boolean + memoryClass: + $ref: '#/components/schemas/ModelsMemoryMemoryClass' + nullable: true + memoryId: + nullable: true type: string - urgent: + memoryType: + $ref: '#/components/schemas/ModelsMemoryMemoryType' + metadata: + $ref: '#/components/schemas/ModelsMemoryMetadata' + parentNoteId: + nullable: true type: string - type: object - ModelsPriorityLabel: - enum: - - URGENT - - IMPORTANT - - MEDIUM - - INFORMATIONAL - - LOW - - NEGLIGIBLE - - FALSE_POSITIVE - - UNKNOWN - type: string - ModelsProcessing: - properties: - occurrences: - description: List of occurrences - items: - $ref: '#/components/schemas/ModelsOccurrence' + priority: + $ref: '#/components/schemas/ModelsMemoryPriority' + nullable: true + promptVersion: nullable: true - type: array - sourceId: - description: ID of the source type: string - required: - - sourceId - - occurrences - type: object - ModelsProviderID: - enum: - - Nullify - - GitHub - - Bitbucket - - Azure - - GitLab - - Okta - - GoogleWorkspace - - AzureEntra - - GitHubNullify - - Jira - - Linear - - Slack - - Teams - - AWS - - Azure - - GCP - - Alibaba - - Oracle - - IBM - - DigitalOcean - - Heroku - - Datadog - - Grafana - - NewRelic - - Splunk - - Elastic - - Confluence - - Notion - - GoogleDrive - - SharePoint - - Buildkite - - Jenkins - - CircleCI - - CodeBuild - - Drone - - Semaphore - - TeamCity - - AzurePipelines - - External - - RepositoryProperty - type: string - ModelsPullRequestInfo: - properties: - createdAt: - format: date-time + resourceId: type: string - explanation: + resourceType: + $ref: '#/components/schemas/ModelsMemoryResourceType' + scope: + $ref: '#/components/schemas/ModelsMemoryScope' + nullable: true + sourceEvent: + nullable: true type: string - firstReviewedAt: - format: date-time + supersedesMemoryId: nullable: true type: string - hasCustomerCommit: + tags: + items: + type: string + type: array + title: nullable: true - type: boolean - hasCustomerFeedback: + type: string + trustTier: nullable: true - type: boolean - id: type: integer - lastReviewedAt: - format: date-time - nullable: true + required: + - memoryType + - content + type: object + EndpointsPostMemoryOutput: + properties: + memory: + $ref: '#/components/schemas/ModelsMemory' + version: type: string - link: + type: object + EndpointsPostProjectSchemaInput: + properties: + content: type: string - mergedAt: - format: date-time - nullable: true + format: + $ref: '#/components/schemas/ModelsSchemaFormat' + type: + $ref: '#/components/schemas/ModelsSchemaType' + required: + - type + - format + - content + type: object + EndpointsPostProjectSchemaOutput: + properties: + message: type: string - pullRequestProvider: - $ref: '#/components/schemas/ModelsGitPullRequestProvider' - status: - $ref: '#/components/schemas/ModelsPullRequestState' - title: + version: type: string - updatedAt: - format: date-time - nullable: true + required: + - message + type: object + EndpointsPostRAGResyncInput: + properties: + confluenceOnly: + type: boolean + type: object + EndpointsPostRAGResyncOutput: + properties: + message: type: string + success: + type: boolean required: - - pullRequestProvider - - id - - link - - status - - explanation - - createdAt + - success + - message type: object - ModelsPullRequestReviewState: - enum: - - APPROVED - - CHANGES_REQUESTED - - DISMISSED - - COMMENTED - type: string - ModelsPullRequestState: - enum: - - open - - closed - - merged - - unknown - type: string - ModelsPullRequestStateWithDiffs: + EndpointsPostReportInput: properties: - diffs: + packages: + description: List of packages to filter (ecosystem, package, version) items: - $ref: '#/components/schemas/ModelsDiffFile' + $ref: '#/components/schemas/EndpointsPackageFilter' nullable: true type: array - id: - type: string - state: + repositories: + description: Optional list of repository IDs to filter. If empty, searches all repositories. + items: + type: string + type: array + required: + - packages + type: object + EndpointsPostReportOutput: + properties: + jobId: type: string - url: + version: type: string required: - - id - - url - - state - - diffs + - jobId type: object - ModelsRepository: + EndpointsPostSBOMGenerateInput: properties: - cloneURL: - description: URL used to clone the repository + cloneUrl: type: string - createdAt: + commitSha: type: string defaultBranch: - description: Name of the default branch type: string - description: + repositoryId: type: string - forksCount: - type: integer - fullName: - description: The full name of the repository + required: + - repositoryId + type: object + EndpointsPostSBOMGenerateOutput: + properties: + commitSha: type: string - hasIssues: - description: Whether issues are enabled for this repository - type: boolean - head: - description: Current HEAD commit SHA + executionArn: type: string - htmlURL: + repositoryId: type: string - id: - description: The ID for the repository + status: type: string - isArchived: - description: Whether this repository is archived - type: boolean - isFork: - type: boolean - isGlobalConfig: - description: Whether this is a global config repository - type: boolean - isInitialized: - description: Whether this repository has been initialized - type: boolean - isPublic: - description: Whether this is a public repository + version: + type: string + type: object + EndpointsPostSBOMResolveInput: + properties: + baselineOnly: type: boolean - language: + branch: type: string - license: + cdxgenMajor: + type: integer + cloneURL: type: string - name: - description: Name of the repository + commitSHA: type: string - openIssues: - type: integer + isDefaultBranchPush: + type: boolean + lockfileSetHash: + type: string + manifestOnly: + type: boolean ownerProvider: $ref: '#/components/schemas/ModelsOwnerProvider' - provider: + repositoryID: + type: string + repositoryProvider: $ref: '#/components/schemas/ModelsGitRepositoryProvider' - pushedAt: + scannerVersion: type: string - repoSizeGiB: - description: Size of the repository in GiB - format: int32 - type: integer - starCount: + tenantID: + type: string + timestamp: + type: string + type: object + EndpointsPostSBOMResolveOutput: + properties: + components: type: integer - topics: + coverageRegression: + type: boolean + exclusions: + items: + $ref: '#/components/schemas/ModelsSBOMScope' + type: array + failedEcosystems: items: type: string type: array - updatedAt: + failureClass: + enum: + - oom + - disk_full + - timeout + - cdxgen_error + - no_components + - input_too_large + - guest_error + - unstable + - unsupported + - registry_auth + - other type: string - visibility: + failureReason: + type: string + incomplete: + type: boolean + incompleteScopes: + items: + $ref: '#/components/schemas/ModelsSBOMScope' + type: array + packageAuth: + items: + $ref: '#/components/schemas/ModelsSBOMPackageAuth' + type: array + sbomS3Key: + type: string + sbomSha256: + type: string + sbomSizeBytes: + format: int64 + type: integer + sbomUrl: + type: string + scanScope: + $ref: '#/components/schemas/ModelsPathScope' + source: + type: string + type: object + EndpointsPostSBOMRunInput: + properties: + branch: + maxLength: 255 + type: string + commitSha: + pattern: ^[0-9a-fA-F]{40}$ + type: string + repositoryId: + maxLength: 20 + minLength: 1 + pattern: ^[1-9][0-9]*$ type: string required: - - provider - - ownerProvider - - id - - name - - fullName - - isGlobalConfig - - hasIssues - - isPublic - - isInitialized - - isArchived - - cloneURL - - repoSizeGiB - - defaultBranch - - head + - repositoryId type: object - ModelsRepositoryPublic: + EndpointsPostSBOMRunOutput: properties: - countsBySeverity: - additionalProperties: - type: integer - description: Count of findings by severity level - nullable: true - type: object - countsByType: - additionalProperties: - type: integer - description: Count of findings by type - nullable: true - type: object - defaultBranch: - description: Default branch name + branch: type: string - defaultBranchCommittedAt: - description: Timestamp of the default branch HEAD commit - format: date-time - nullable: true + commitSha: type: string - defaultBranchSha: - description: HEAD commit SHA of the default branch + executionArn: type: string - id: - description: Unique identifier for the repository + repositoryId: type: string - isArchived: - description: Whether the repository is archived on its source platform - type: boolean - isDefaultBranch: - description: Whether this is the default branch - type: boolean - nullifyConfigFile: - $ref: '#/components/schemas/ModelsConfiguration' - owner: - description: Repository owner name + runId: type: string - ownerType: - description: Type of repository owner (user/organization) + version: type: string - pii: - $ref: '#/components/schemas/ModelsPII' - platform: - description: Git platform name + required: + - runId + - executionArn + - repositoryId + - commitSha + type: object + EndpointsPostSBOMScanInput: + properties: + commitSha: type: string - repository: - description: Repository name + forceRegenerate: + type: boolean + projectId: type: string repositoryId: - description: Repository identifier type: string + required: + - repositoryId + - projectId + - commitSha + type: object + EndpointsPostSBOMScanOutput: + properties: + cached: + type: boolean sbom: - description: Software Bill of Materials + $ref: '#/components/schemas/ModelsCDXGenAtCommit' + status: type: string - tenantId: - description: Tenant identifier + version: type: string - timestamp: - description: Timestamp of last scan + type: object + EndpointsPostVaultFileInput: + properties: + description: + nullable: true type: string - timestampUnix: - description: Unix timestamp of last scan + fileName: + type: string + size: format: int64 type: integer required: - - id - - countsBySeverity - - sbom - - countsByType - - timestamp - - timestampUnix - - owner - - ownerType - - tenantId - - repository - - repositoryId - - isDefaultBranch - - platform - - isArchived + - fileName type: object - ModelsSLA: + EndpointsPostVaultFileOutput: properties: - allowExtensions: - type: boolean - id: + description: + nullable: true + type: string + documentID: + type: string + fileID: + type: string + fileName: + type: string + presignedUploadURL: + type: string + version: type: string - maxDaysToFix: - type: integer - priority: - $ref: '#/components/schemas/ModelsPriorityLabel' - severity: - $ref: '#/components/schemas/ModelsSeverity' required: - - severity - - priority - - maxDaysToFix - - allowExtensions + - presignedUploadURL + - documentID + - fileID + - fileName type: object - ModelsSecrets: + EndpointsPostVaultIndexInput: properties: - customPatterns: - additionalProperties: - $ref: '#/components/schemas/ModelsSecretsCustomPattern' - type: object - customPatternsOverrideGlobal: - type: boolean - enableFailBuilds: - nullable: true - type: boolean - ignore: + fileIDs: + description: List of vault file IDs to index into pgvector items: - $ref: '#/components/schemas/ModelsSecretsIgnore' + type: string + nullable: true type: array + required: + - fileIDs type: object - ModelsSecretsCustomPattern: + EndpointsPostVaultIndexOutput: properties: - description: - nullable: true + message: type: string - entropy: - nullable: true - type: number - keywords: + success: + type: boolean + required: + - success + - message + type: object + EndpointsPostVaultOnboardInput: + properties: + fileIDs: + description: List of vault file IDs to process items: type: string - type: array - pathRegex: nullable: true + type: array + runId: + description: Optional ULID receipt; reuse with the same fileIDs to retry ambiguous delivery + type: string + required: + - fileIDs + type: object + EndpointsPostVaultOnboardOutput: + properties: + message: type: string - secretRegex: + runId: type: string - secretRegexGroup: - nullable: true - type: integer + success: + type: boolean + required: + - success + - message type: object - ModelsSecretsIgnore: + EndpointsProjectWithoutLockfile: properties: - expiry: + ecosystem: type: string - paths: + projectId: + type: string + projectName: + type: string + repositoryId: + type: string + repositoryName: + type: string + type: object + EndpointsProjectsAssetDetailsView: + properties: + repoContextProject: + $ref: '#/components/schemas/EndpointsRepoContextProjectDetailsView' + subType: + $ref: '#/components/schemas/ModelsProjectsSubType' + required: + - subType + type: object + EndpointsProjectsAssetView: + properties: + accountId: + type: string + deletedAtScanId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + framework: + type: string + id: + type: string + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + languages: items: type: string type: array - pattern: + lastSeenAt: type: string - reason: + name: type: string - repositories: - items: + ownerTeam: + type: string + pathPrefix: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + repoId: + type: string + securityImportance: + $ref: '#/components/schemas/RepocontextProjectContextSecurityImportance' + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsProjectsSubType' + tags: + additionalProperties: type: string - type: array - sha256: + nullable: true + type: object + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsProviderScanStatus: + properties: + completedAt: type: string - value: + errorMessage: + type: string + provider: + type: string + startedAt: type: string + status: + type: string + required: + - provider + - status type: object - ModelsSensitivity: - enum: - - LOW - - MEDIUM - - HIGH - type: string - ModelsSeverity: + EndpointsPublicAssetPolicy: enum: - - CRITICAL - - HIGH - - MEDIUM - - LOW - - NONE - - INFORMATIONAL - - UNKNOWN + - intentional + - reachable + - either type: string - ModelsSinkProcessing: + EndpointsPyPIDetailsView: + type: object + EndpointsReachabilityPathDTO: properties: - occurrences: - description: List of occurrences + depth: + format: int32 + type: integer + nodeIds: items: - $ref: '#/components/schemas/ModelsOccurrence' + type: string nullable: true type: array - sinkId: - description: ID of the sink + required: + - nodeIds + - depth + type: object + EndpointsRebuildApplicationsInput: + properties: + force: + type: boolean + providerOwnerId: type: string required: - - sinkId - - occurrences + - providerOwnerId + - force type: object - ModelsSlackMessageChannelProvider: + EndpointsRebuildApplicationsOutput: properties: - id: - description: The Slack message channel ID + runId: type: string - thread_ts: - description: The Slack message thread timestamp + status: + type: string + version: type: string required: - - id + - status type: object - ModelsSlackOwnerProvider: + EndpointsRepoContextProjectDetailsView: + type: object + EndpointsRepoScanProjectTouched: properties: - teamId: - description: The Slack team ID + path: + type: string + projectId: type: string required: - - teamId + - projectId + - path type: object - ModelsSlackUserProvider: + EndpointsRepoScanSBOMGenerated: properties: - id: + ecosystem: type: string - name: + projectId: + type: string + s3Key: type: string required: - - id + - projectId + - ecosystem + - s3Key type: object - ModelsSource: + EndpointsRepoScanSubagent: properties: - category: - description: Category of the source + completedAt: + format: date-time + nullable: true type: string - id: - description: Unique identifier + durationMs: + nullable: true + type: integer + error: type: string - isSensitive: - description: Whether the source contains sensitive data + ran: type: boolean - name: - description: Name of the source + reused: + type: boolean + skipReason: type: string - sensitivity: - $ref: '#/components/schemas/ModelsSensitivity' - sourceType: - description: Type of the source + startedAt: + format: date-time + nullable: true + type: string + status: type: string - tags: - $ref: '#/components/schemas/ModelsDataMap' - required: - - sourceType - - id - - name - - category - - sensitivity - - isSensitive - - tags type: object - ModelsSubCollection: + EndpointsRepoScanSummary: properties: - occurrences: - description: List of occurrences - items: - $ref: '#/components/schemas/ModelsOccurrence' + baseContextVersion: + type: string + branch: + type: string + commitSha: + type: string + completedAt: + format: date-time nullable: true - type: array - sourceId: - description: ID of the source type: string - required: - - occurrences - - sourceId - type: object - ModelsTeam: - properties: - codeOwnerships: - items: - $ref: '#/components/schemas/ModelsTeamCodeOwnership' - type: array - github: - $ref: '#/components/schemas/ModelsTeamProviderGitHub' - gitlab: - $ref: '#/components/schemas/ModelsTeamProviderGitLab' - groundRules: - items: - $ref: '#/components/schemas/ModelsGroundRule' - type: array - id: + contextVersion: type: string - jira: - $ref: '#/components/schemas/ModelsTeamProviderJira' - lead: - $ref: '#/components/schemas/ModelsUser' - leadId: + errorMessage: type: string - linear: - $ref: '#/components/schemas/ModelsTeamProviderLinear' - memberIds: + executionArn: + type: string + id: + type: string + projectsTouched: items: - type: string + $ref: '#/components/schemas/EndpointsRepoScanProjectTouched' type: array - members: + publishedAsLatest: + nullable: true + type: boolean + repositoryId: + type: string + sbomsGenerated: items: - $ref: '#/components/schemas/ModelsUser' + $ref: '#/components/schemas/EndpointsRepoScanSBOMGenerated' type: array - messageChannelProvider: - $ref: '#/components/schemas/ModelsMessageChannelProvider' - messageChannels: + scopePathPrefixes: items: - $ref: '#/components/schemas/ModelsMessageChannel' + type: string type: array - msteams: - $ref: '#/components/schemas/ModelsTeamProviderMSTeams' - name: + source: type: string - numMembers: - type: integer - okta: - $ref: '#/components/schemas/ModelsTeamProviderOkta' - privacy: + startedAt: + format: date-time type: string - provider: - $ref: '#/components/schemas/ModelsProviderID' - repositories: - items: - $ref: '#/components/schemas/ModelsRepository' - type: array - repositoryIds: + status: + type: string + subagentAllowlist: items: type: string type: array - slack: - $ref: '#/components/schemas/ModelsTeamProviderSlack' - slug: - type: string - source: - $ref: '#/components/schemas/ModelsTeamSource' - sourceRepositoryPropertyName: - type: string - sourceRepositoryPropertyValue: + subagentsRun: + additionalProperties: + $ref: '#/components/schemas/EndpointsRepoScanSubagent' + type: object + updatedAt: + format: date-time type: string - ticketProjectProvider: - $ref: '#/components/schemas/ModelsTicketProjectProvider' required: - id - - provider - - source - - name - - slug - - privacy - - messageChannelProvider - - ticketProjectProvider + - repositoryId + - commitSha + - status + - startedAt + - updatedAt type: object - ModelsTeamCodeOwnership: + EndpointsReposAssetDetailsView: properties: - dataSource: - $ref: '#/components/schemas/ModelsTeamCodeOwnershipDataSource' - globPatterns: - items: - type: string - nullable: true - type: array - repository: - $ref: '#/components/schemas/ModelsGitRepositoryProvider' + azureRepo: + $ref: '#/components/schemas/EndpointsAzureRepoDetailsView' + bitbucketRepo: + $ref: '#/components/schemas/EndpointsBitbucketRepoDetailsView' + githubRepo: + $ref: '#/components/schemas/EndpointsGitHubRepoDetailsView' + gitlabRepo: + $ref: '#/components/schemas/EndpointsGitLabRepoDetailsView' + subType: + $ref: '#/components/schemas/ModelsReposSubType' required: - - dataSource - - globPatterns + - subType type: object - ModelsTeamCodeOwnershipDataSource: - enum: - - github_teams - - atlassian_compass - - manual - - repository_property - type: string - ModelsTeamFinding: + EndpointsReposAssetView: properties: - findingType: - $ref: '#/components/schemas/ModelsFindingType' - id: + accountId: type: string - matchSource: - $ref: '#/components/schemas/ModelsTeamFindingMatchSource' - matchSourceUserID: + deletedAtScanId: type: string - resolved: + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + headSha: + type: string + id: + type: string + isActive: type: boolean - slaBreached: + isInternetReachable: type: boolean - teamID: + isPublic: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: + type: string + name: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string + subType: + $ref: '#/components/schemas/ModelsReposSubType' + tags: + additionalProperties: + type: string + nullable: true + type: object + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt type: object - ModelsTeamFindingMatchSource: + EndpointsRepositorySortBy: enum: - - codeowners_team - - codeowners_user - - github_teams - - atlassian_compass - - manual - - git_blame - - git_blame_directory - - repository_contributor - - repository_property + - '' + - alphabetical type: string - ModelsTeamFindings: + EndpointsRepositoryWithoutLockfile: properties: - findings: + depCount: + format: int64 + type: integer + ecosystems: items: - $ref: '#/components/schemas/ModelsTeamFinding' + type: string nullable: true type: array - team: - $ref: '#/components/schemas/ModelsTeam' - type: object - ModelsTeamPrivacy: - enum: - - private - - public - - visible - - secret - type: string - ModelsTeamProviderGitHub: - properties: - orgLogin: - type: string - teamId: + projectCount: format: int64 type: integer - teamSlug: + repositoryId: + type: string + repositoryName: type: string type: object - ModelsTeamProviderGitLab: + EndpointsRetractMemoryInput: properties: - groupId: - type: integer + reason: + description: Why the memory is being retracted + type: string + retractedBy: + description: Who retracted it, when the caller knows + nullable: true + type: string + required: + - reason type: object - ModelsTeamProviderJira: + EndpointsRetractMemoryOutput: properties: - teamId: + memory: + $ref: '#/components/schemas/ModelsMemory' + version: type: string type: object - ModelsTeamProviderLinear: + EndpointsRubyGemsDetailsView: + type: object + EndpointsRunState: + enum: + - PENDING + - RUNNING + - SUCCEEDED + - FAILED + - SKIPPED + - TIMED_OUT + - ABORTED + type: string + EndpointsRunStatus: properties: - teamId: + completedAt: + type: string + error: + type: string + runId: + type: string + startedAt: type: string + state: + $ref: '#/components/schemas/EndpointsRunState' + terminal: + type: boolean + required: + - runId + - state type: object - ModelsTeamProviderMSTeams: + EndpointsSBOMIngestReplayInput: properties: - channelId: + globalReplay: + type: boolean + projectID: type: string - teamId: + repositoryID: type: string type: object - ModelsTeamProviderOkta: + EndpointsSBOMIngestReplayOutput: properties: - groupId: + message: + type: string + version: type: string type: object - ModelsTeamProviderSlack: + EndpointsSchemaProvenance: properties: - groupId: + executionMode: type: string + methodUnknownOperations: + type: integer + partial: + type: boolean + unconfirmed: + type: boolean + unverifiedOperations: + type: integer + verifiedAgainstCode: + nullable: true + type: boolean type: object - ModelsTeamSource: - enum: - - github_teams - - repository_property - - manual - - atlassian_compass - - identity_provider - type: string - ModelsTeamsMessageChannelProvider: + EndpointsSchemaSummary: properties: - channel: - description: The Teams channel name + downloadUrl: type: string - id: - description: The Teams message channel ID + projectId: type: string - teamId: - description: The Teams team ID that owns the channel + projectName: type: string - required: - - id - - channel - - teamId - type: object - ModelsTeamsOwnerProvider: - properties: - teamId: - description: The Teams team ID + provenance: + $ref: '#/components/schemas/EndpointsSchemaProvenance' + repositoryId: type: string - required: - - teamId + schemaFormat: + $ref: '#/components/schemas/ModelsSchemaFormat' + schemaType: + $ref: '#/components/schemas/ModelsSchemaType' + size: + type: integer type: object - ModelsTeamsUserProvider: + EndpointsSearchMemoriesInput: properties: - id: - type: string - teamIDs: + anchors: items: type: string + type: array + includeOrgWide: + type: boolean + limit: + nullable: true + type: integer + memoryClass: + $ref: '#/components/schemas/ModelsMemoryMemoryClass' nullable: true + memoryTypes: + items: + $ref: '#/components/schemas/ModelsMemoryMemoryType' type: array + minTrustTier: + nullable: true + type: integer + query: + type: string + resourceType: + $ref: '#/components/schemas/ModelsMemoryResourceType' + nullable: true + scope: + $ref: '#/components/schemas/ModelsMemoryScope' + nullable: true required: - - id - - teamIDs + - query type: object - ModelsTicketProjectProvider: + EndpointsSearchMemoriesOutput: properties: - azure: - $ref: '#/components/schemas/ModelsAzureTicketProject' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketTicketProject' - github: - $ref: '#/components/schemas/ModelsGitHubTicketProject' - gitlab: - $ref: '#/components/schemas/ModelsGitLabTicketProject' - id: - $ref: '#/components/schemas/ModelsProviderID' - jira: - $ref: '#/components/schemas/ModelsJiraTicketProject' - linear: - $ref: '#/components/schemas/ModelsLinearTicketProject' + count: + type: integer + results: + items: + $ref: '#/components/schemas/EndpointsSearchMemoryResult' + nullable: true + type: array + version: + type: string + required: + - results + - count type: object - ModelsTicketProvider: + EndpointsSearchMemoryResult: properties: - azure: - $ref: '#/components/schemas/ModelsAzureTicketProvider' - github: - $ref: '#/components/schemas/ModelsGitHubTicketProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabTicketProvider' - jira: - $ref: '#/components/schemas/ModelsJiraTicketProvider' - linear: - $ref: '#/components/schemas/ModelsLinearTicketProvider' - providerId: - $ref: '#/components/schemas/ModelsProviderID' + memory: + $ref: '#/components/schemas/ModelsMemory' + score: + format: double + type: number required: - - providerId + - memory + - score type: object - ModelsUISavedView: + EndpointsSearchVaultInput: properties: - createdAt: - type: string - createdBy: - type: string - data: - type: string - id: - type: string - lastUpdatedBy: - type: string - name: - type: string - updatedAt: - type: string - viewOwnerId: + docTypes: + items: + type: string + type: array + documentIds: + items: + type: string + type: array + limit: + nullable: true + type: integer + query: type: string - viewOwnerType: - $ref: '#/components/schemas/ModelsUISavedViewOwnerType' - viewPageType: - $ref: '#/components/schemas/ModelsUISavedViewPageType' required: - - id - - viewPageType - - viewOwnerType - - viewOwnerId - - name - - data - - createdAt - - createdBy - - updatedAt - - lastUpdatedBy + - query type: object - ModelsUISavedViewAPIInput: + EndpointsSearchVaultOutput: properties: - data: - type: string - name: - type: string - viewOwnerId: + count: + type: integer + results: + items: + $ref: '#/components/schemas/EndpointsVaultSearchResult' + nullable: true + type: array + version: type: string - viewOwnerType: - $ref: '#/components/schemas/ModelsUISavedViewOwnerType' - viewPageType: - $ref: '#/components/schemas/ModelsUISavedViewPageType' required: - - viewPageType - - viewOwnerType - - viewOwnerId - - name - - data + - results + - count + type: object + EndpointsSecurityAssetDetailsView: + properties: + awsAcm: + $ref: '#/components/schemas/EndpointsAWSACMDetailsView' + awsCloudTrail: + $ref: '#/components/schemas/EndpointsAWSCloudTrailDetailsView' + awsConfig: + $ref: '#/components/schemas/EndpointsAWSConfigDetailsView' + awsGuardDuty: + $ref: '#/components/schemas/EndpointsAWSGuardDutyDetailsView' + awsKms: + $ref: '#/components/schemas/EndpointsAWSKMSDetailsView' + awsNacl: + $ref: '#/components/schemas/EndpointsAWSNACLDetailsView' + awsSecretsManager: + $ref: '#/components/schemas/EndpointsAWSSecretsManagerDetailsView' + awsSecurityGroup: + $ref: '#/components/schemas/EndpointsAWSSecurityGroupDetailsView' + awsSsm: + $ref: '#/components/schemas/EndpointsAWSSSMDetailsView' + awsWaf: + $ref: '#/components/schemas/EndpointsAWSWAFDetailsView' + azureDefender: + $ref: '#/components/schemas/EndpointsAzureDefenderDetailsView' + azureKeyVault: + $ref: '#/components/schemas/EndpointsAzureKeyVaultDetailsView' + azureNsg: + $ref: '#/components/schemas/EndpointsAzureNSGDetailsView' + azurePolicy: + $ref: '#/components/schemas/EndpointsAzurePolicyDetailsView' + gcpKms: + $ref: '#/components/schemas/EndpointsGCPKMSDetailsView' + gcpOrgPolicy: + $ref: '#/components/schemas/EndpointsGCPOrgPolicyDetailsView' + gcpPolicyAnalyzer: + $ref: '#/components/schemas/EndpointsGCPPolicyAnalyzerDetailsView' + gcpSecretManager: + $ref: '#/components/schemas/EndpointsGCPSecretManagerDetailsView' + gcpSecurityCommandCtr: + $ref: '#/components/schemas/EndpointsGCPSecurityCommandCtrDetailsView' + subType: + $ref: '#/components/schemas/ModelsSecuritySubType' + required: + - subType type: object - ModelsUISavedViewOwnerType: - enum: - - ORGANIZATION - - USER - type: string - ModelsUISavedViewPageType: - enum: - - OVERVIEW - - TRIAGE - type: string - ModelsUnifiedFindingPreview: + EndpointsSecurityAssetView: properties: - aiDevTitle: - type: string - aiTitle: - type: string - allowlistReason: + accountId: type: string - allowlistState: - $ref: '#/components/schemas/ModelsAllowlistState' - allowlistType: - $ref: '#/components/schemas/ModelsAllowlistType' - nullable: true - appName: + allowsWorldIngress: + type: boolean + controlKind: type: string - appType: + deletedAtScanId: type: string - assessmentFactors: - additionalProperties: - type: string - nullable: true - type: object - autoFixEndTime: - format: date-time - nullable: true + expiresAt: type: string - autoFixStartTime: - format: date-time - nullable: true + externalId: type: string - autoFixState: - $ref: '#/components/schemas/ModelsAutoFixState' - branch: + findingsCountOpen: + type: integer + firstFoundScanId: type: string - category: + firstSeenAt: type: string - commit: + id: type: string - commitHash: + isActive: + type: boolean + isInternetReachable: + type: boolean + isPublicFacing: + type: boolean + lastSeenAt: type: string - createdAt: + name: type: string - cwe: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: type: string - endLine: + rotationEnabled: + type: boolean + ruleCount: type: integer - endpointMethod: - type: string - endpointPath: - type: string - entropy: - format: double - type: number - entrypoint: + scopeRef: type: string - errorDescription: + sourceScanId: type: string - errorType: + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string - exploitValidated: - nullable: true - type: boolean - failedTriage: + subType: + $ref: '#/components/schemas/ModelsSecuritySubType' + tags: + additionalProperties: + type: string nullable: true + type: object + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsServerlessAssetDetailsView: + properties: + awsAppRunner: + $ref: '#/components/schemas/EndpointsAWSAppRunnerDetailsView' + awsLambda: + $ref: '#/components/schemas/EndpointsAWSLambdaDetailsView' + awsStepFunction: + $ref: '#/components/schemas/EndpointsAWSStepFunctionDetailsView' + azureFunction: + $ref: '#/components/schemas/EndpointsAzureFunctionDetailsView' + azureLogicApps: + $ref: '#/components/schemas/EndpointsAzureLogicAppsDetailsView' + gcpAppEngine: + $ref: '#/components/schemas/EndpointsGCPAppEngineDetailsView' + gcpCloudFunction: + $ref: '#/components/schemas/EndpointsGCPCloudFunctionDetailsView' + gcpCloudRun: + $ref: '#/components/schemas/EndpointsGCPCloudRunDetailsView' + subType: + $ref: '#/components/schemas/ModelsServerlessSubType' + required: + - subType + type: object + EndpointsServerlessAssetView: + properties: + accountId: + type: string + codeSigningEnabled: type: boolean - fileOwners: - items: - $ref: '#/components/schemas/ModelsFileOwner' - nullable: true - type: array - filePath: + deletedAtScanId: type: string - firstSeenCommit: + externalId: type: string - graphExists: - nullable: true - type: boolean - hasReachableCVEs: - type: boolean - host: + firstFoundScanId: type: string - httpVersion: + firstSeenAt: type: string - hypothesis: + handler: type: string - id: + iamRoleArn: type: string - imageMetadata: - $ref: '#/components/schemas/ModelsContainerImageMetadata' - installationId: + id: type: string - isAllowlisted: - nullable: true - type: boolean - isArchived: - nullable: true - type: boolean - isAutoFixable: - nullable: true - type: boolean - isCloudTriaged: - nullable: true - type: boolean - isDefaultBranch: - nullable: true - type: boolean - isDirect: - nullable: true - type: boolean - isFalsePositive: + isActive: type: boolean isInternetReachable: - nullable: true - type: boolean - isLatest: - nullable: true type: boolean - isResolved: - nullable: true + isPublicFacing: type: boolean - language: - $ref: '#/components/schemas/ModelsLanguageName' - lastEvent: - type: string - line: - type: integer - match: + lastInvocationAt: type: string - message: - type: string - method: + lastSeenAt: type: string - numCritical: - type: integer - numHigh: - type: integer - numLow: - type: integer - numMedium: - type: integer - numUnknown: + memoryMb: type: integer - package: - type: string - packageFilePath: - type: string - path: + name: type: string - previousResponse: + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: type: string - priorityLabel: - $ref: '#/components/schemas/ModelsPriorityLabel' - priorityOverride: - $ref: '#/components/schemas/ModelsPriorityLabel' - priorityScore: - type: integer - projectId: + runtime: type: string - projectName: + sourceScanId: type: string - projectPathPrefix: + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: type: string - pullRequestsAllowlist: - items: - $ref: '#/components/schemas/ModelsPullRequestInfo' - nullable: true - type: array - pullRequestsAutofix: - items: - $ref: '#/components/schemas/ModelsPullRequestInfo' - nullable: true - type: array - queryParameters: + subType: + $ref: '#/components/schemas/ModelsServerlessSubType' + tags: additionalProperties: type: string nullable: true type: object - redactedSecret: + timeoutS: + type: integer + triggerSources: + items: + type: string + type: array + urlEnabled: + type: boolean + vpcAttached: + type: boolean + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsSetupAssessmentBlocker: + properties: + code: + enum: + - target_needed + - repository_needed type: string - repository: + message: type: string - repositoryId: + required: + - code + - message + type: object + EndpointsSetupAssessmentTarget: + properties: + appliedTargetId: + description: DAST target already created for the host type: string - repositoryName: + confidence: + enum: + - high + - medium type: string - requestBody: + environment: + enum: + - staging + - development type: string - requestHeader: - additionalProperties: - type: string - nullable: true - type: object - resolvedAt: - format: date-time + evidence: + items: + $ref: '#/components/schemas/EndpointsSetupRecommendationEvidence' nullable: true + type: array + hostname: type: string - responseBody: + recommendationId: + description: The pentest target recommendation for this host type: string - responseHeader: - additionalProperties: + repositoryIds: + description: The application's repositories whose code declares the host + items: type: string nullable: true - type: object - roleDescription: - type: string - roleName: - type: string - ruleId: + type: array + status: + description: Status of the pentest target recommendation + enum: + - proposed + - accepted type: string - ruleUrl: + required: + - recommendationId + - hostname + - environment + - status + - confidence + - repositoryIds + - evidence + type: object + EndpointsSetupAssessmentWebService: + properties: + componentName: type: string - scanConfigId: + componentType: + description: frontend, backend or service, as discovered type: string - scanId: + projectId: type: string - scanType: + repoPath: type: string - scopes: - items: - type: string - nullable: true - type: array - secretHash: + repositoryId: type: string - secretType: + repositoryName: type: string - severity: - $ref: '#/components/schemas/ModelsSeverity' - solution: + required: + - repositoryId + - repositoryName + - componentName + type: object + EndpointsSetupPentestAssessmentRecommendation: + properties: + applicationName: type: string - source: + appliedApplicationId: + description: DAST application created when the proposal was accepted type: string - startLine: - type: integer - suggestedImage: + blockers: items: - $ref: '#/components/schemas/ModelsContainerImageMetadata' + $ref: '#/components/schemas/EndpointsSetupAssessmentBlocker' nullable: true type: array - suggestedVersion: - type: string - summary: - type: string - tags: - type: string - targetUrl: - type: string - tenantId: + confidence: + description: high when the application's code declares a candidate target + enum: + - high + - medium type: string - ticket: - $ref: '#/components/schemas/ModelsTicketProvider' - timeSaved: - $ref: '#/components/schemas/TimeDuration' - title: + contextApplicationId: type: string - triageEnd: + createdAt: format: date-time - nullable: true type: string - triageStart: + decidedAt: format: date-time nullable: true type: string - triageVersion: - type: string - type: - $ref: '#/components/schemas/ModelsFindingType' - updatedAt: - type: string - uri: + decidedBy: type: string - userName: + id: type: string - version: + status: + enum: + - proposed + - accepted + - dismissed + - superseded type: string - vulnerabilitiesCVEIds: + targets: items: - type: string + $ref: '#/components/schemas/EndpointsSetupAssessmentTarget' nullable: true type: array - vulnerabilitiesCWEIds: + updatedAt: + format: date-time + type: string + webServices: items: - type: string + $ref: '#/components/schemas/EndpointsSetupAssessmentWebService' nullable: true type: array - vulnerabilitiesMaxPriority: - $ref: '#/components/schemas/ModelsPriorityLabel' - vulnerabilitiesMaxSeverity: - $ref: '#/components/schemas/ModelsSeverity' - vulnerableParameterName: - type: string - vulnerableParameterValue: - type: string required: - - type + - id + - contextApplicationId + - applicationName + - status + - confidence - createdAt - updatedAt - - tenantId - - repositoryId - - projectId - - projectName - - repository - - branch - - commitHash - - firstSeenCommit - - id - - title - - category - - severity - - language - - message - - filePath - - cwe - - ruleId - - ruleUrl - - entrypoint - - startLine - - endLine - - autoFixState - - allowlistState - - priorityOverride - - priorityScore - - priorityLabel - - isFalsePositive - - pullRequestsAllowlist - - pullRequestsAutofix - - fileOwners - - lastEvent - - triageVersion - - assessmentFactors - - aiTitle - - aiDevTitle - - line - - numCritical - - numHigh - - numMedium - - numLow - - numUnknown - - vulnerabilitiesCVEIds - - vulnerabilitiesMaxSeverity - - hasReachableCVEs - - installationId - - package - - packageFilePath - - suggestedVersion - - version - - vulnerabilitiesMaxPriority - - vulnerabilitiesCWEIds - - entropy - - secretHash - - redactedSecret - - scopes - - match - - secretType - - appName - - host - - commit - - imageMetadata - - suggestedImage - - scanId - - scanConfigId - - scanType - - appType - - targetUrl - - repositoryName - - projectPathPrefix - - summary - - source - - endpointMethod - - endpointPath - - solution - - httpVersion - - method - - path - - queryParameters - - vulnerableParameterName - - vulnerableParameterValue - - errorType - - errorDescription - - previousResponse - - uri - - requestHeader - - requestBody - - responseHeader - - responseBody - - tags - - hypothesis - - userName - - roleName - - roleDescription - - timeSaved - type: object - ModelsUnifiedFindingsMetricsQuery: - additionalProperties: - $ref: '#/components/schemas/ModelsUnifiedFindingsQuery' + - webServices + - targets + - blockers type: object - ModelsUnifiedFindingsQuery: + EndpointsSetupPentestAssessmentRecommendationsOutput: properties: - appName: - items: - type: string - nullable: true - type: array - appType: + recommendations: items: - type: string + $ref: '#/components/schemas/EndpointsSetupPentestAssessmentRecommendation' nullable: true type: array - autoFixState: - items: - type: string + required: + - recommendations + type: object + EndpointsSetupPentestTargetRecommendation: + properties: + appliedTargetId: + description: DAST target created when the recommendation was accepted + type: string + confidence: + enum: + - high + - medium + type: string + createdAt: + format: date-time + type: string + decidedAt: + format: date-time nullable: true - type: array - branch: + type: string + decidedBy: + type: string + environment: + enum: + - staging + - development + type: string + evidence: items: - type: string + $ref: '#/components/schemas/EndpointsSetupRecommendationEvidence' nullable: true type: array - cve: + hostname: + type: string + id: + type: string + status: + enum: + - proposed + - accepted + - dismissed + - superseded + type: string + updatedAt: + format: date-time + type: string + required: + - id + - hostname + - environment + - status + - confidence + - createdAt + - updatedAt + - evidence + type: object + EndpointsSetupPentestTargetRecommendationsOutput: + properties: + recommendations: items: - type: string + $ref: '#/components/schemas/EndpointsSetupPentestTargetRecommendation' nullable: true type: array - cwe: + required: + - recommendations + type: object + EndpointsSetupRecommendationEvidence: + properties: + accountId: + description: Cloud account holding the asset; empty when unknown or for repository code + type: string + detail: + description: Human-readable statement of the fact; the cited line for repository code + type: string + reference: + description: Inventory asset id, or :: for repository code + type: string + signal: + description: What about the asset or code indicated the environment + enum: + - hostname + - tag + - code_reference + type: string + source: + description: Inventory or repository code the fact came from + enum: + - route53_record + - load_balancer + - repository_code + type: string + required: + - source + - signal + - reference + - accountId + - detail + type: object + EndpointsStartRepositoryExecutionRecipeDiscoveryInput: + properties: + branch: + description: The branch whose head commit the run proves, defaulting to the repository's default branch + type: string + projectIds: + description: The projects to prove, defaulting to every project of the repository items: type: string - nullable: true type: array - exploitValidated: - nullable: true + type: object + EndpointsStartRepositoryExecutionRecipeDiscoveryOutput: + properties: + alreadyStarted: type: boolean - fileOwner: + branch: + type: string + commitSha: + type: string + executionArn: + type: string + executionName: + type: string + mode: + enum: + - discover + - replay + type: string + queued: items: - type: string + $ref: '#/components/schemas/ModelsExecutionRecipeValidation' nullable: true type: array - findingId: + refused: items: - type: string - nullable: true + $ref: '#/components/schemas/ModelsExecutionRecipeDiscoveryRefusal' type: array - fromDate: - nullable: true + runId: type: string - fromPriorityScore: - nullable: true - type: integer - hasAutoFix: - nullable: true + required: + - runId + - commitSha + - mode + type: object + EndpointsStorageAndBackupAssetDetailsView: + properties: + awsBackupVault: + $ref: '#/components/schemas/EndpointsAWSBackupVaultDetailsView' + awsEbsVolume: + $ref: '#/components/schemas/EndpointsAWSEBSVolumeDetailsView' + awsEfs: + $ref: '#/components/schemas/EndpointsAWSEFSDetailsView' + awsS3Bucket: + $ref: '#/components/schemas/EndpointsAWSS3BucketDetailsView' + awsStorageGateway: + $ref: '#/components/schemas/EndpointsAWSStorageGatewayDetailsView' + azureBlob: + $ref: '#/components/schemas/EndpointsAzureBlobDetailsView' + azureDisk: + $ref: '#/components/schemas/EndpointsAzureDiskDetailsView' + azureFiles: + $ref: '#/components/schemas/EndpointsAzureFilesDetailsView' + azureStorageAccount: + $ref: '#/components/schemas/EndpointsAzureStorageAccountDetailsView' + gcpFilestore: + $ref: '#/components/schemas/EndpointsGCPFilestoreDetailsView' + gcpGcsBucket: + $ref: '#/components/schemas/EndpointsGCPGCSBucketDetailsView' + gcpPd: + $ref: '#/components/schemas/EndpointsGCPPDDetailsView' + subType: + $ref: '#/components/schemas/ModelsStorageAndBackupSubType' + required: + - subType + type: object + EndpointsStorageAndBackupAssetView: + properties: + accountId: + type: string + deletedAtScanId: + type: string + encryptionKmsKeyId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + id: + type: string + isActive: type: boolean - hasTicket: - nullable: true + isInternetReachable: type: boolean - hasTicketOrPR: + isPublicFacing: + type: boolean + lastSeenAt: + type: string + lifecyclePolicyPresent: + type: boolean + name: + type: string + objectLockEnabled: + type: boolean + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + publicAccessBlockState: + type: string + region: + type: string + replicationEnabled: + type: boolean + retentionDays: + type: integer + role: + type: string + sizeBytes: + format: int64 + type: integer + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + $ref: '#/components/schemas/ModelsStorageAndBackupSubType' + tags: + additionalProperties: + type: string nullable: true + type: object + versioningEnabled: type: boolean - host: + required: + - id + - name + - subType + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsTriggerProjectSchemaInput: + properties: + branch: + type: string + type: object + EndpointsTriggerProjectSchemaOutput: + properties: + branch: + type: string + commitSha: + type: string + executionArn: + type: string + projectId: + type: string + repositoryId: + type: string + runId: + type: string + version: + type: string + required: + - runId + - repositoryId + - projectId + - commitSha + type: object + EndpointsTriggerRepoContextInput: + properties: + branch: + type: string + force: + type: boolean + pathPrefixes: items: type: string - nullable: true type: array - imageName: + subagents: items: type: string - nullable: true type: array - importantMaxDays: - nullable: true - type: integer - includeEmpty: - nullable: true - type: boolean - informationalMaxDays: - nullable: true - type: integer - isAllowlisted: - nullable: true + type: object + EndpointsTriggerRepoContextOutput: + properties: + branch: + type: string + commitSha: + type: string + executionArn: + type: string + repositoryId: + type: string + runId: + type: string + version: + type: string + required: + - runId + - repositoryId + - commitSha + type: object + EndpointsUnifiedAssetView: + properties: + _links: + $ref: '#/components/schemas/EndpointsAssetLinks' + accountId: + type: string + category: + $ref: '#/components/schemas/ModelsAssetInventoryCategory' + deletedAtScanId: + type: string + externalId: + type: string + firstFoundScanId: + type: string + firstSeenAt: + type: string + id: + type: string + isActive: type: boolean - isArchived: - nullable: true + isInternetReachable: type: boolean - isAutofixed: - nullable: true + isPublicFacing: type: boolean - isDirect: + lastSeenAt: + type: string + name: + type: string + provider: + $ref: '#/components/schemas/ModelsCloudProvider' + region: + type: string + sourceScanId: + type: string + sourceType: + $ref: '#/components/schemas/ModelsEndpointSourceType' + state: + type: string + subType: + type: string + tags: + additionalProperties: + type: string nullable: true - type: boolean - isFalsePositive: + type: object + required: + - category + - id + - subType + - name + - provider + - sourceType + - firstFoundScanId + - sourceScanId + - isActive + - isPublicFacing + - isInternetReachable + - firstSeenAt + - lastSeenAt + type: object + EndpointsUpdateOrganizationInput: + properties: + name: nullable: true - type: boolean - isFixed: + type: string + notes: nullable: true - type: boolean - isInternetReachable: + type: string + type: object + EndpointsUpdateProjectInput: + properties: + deletedAt: + format: date-time nullable: true - type: boolean - isPushWorkflow: + type: string + description: nullable: true - type: boolean - isResolved: + type: string + isDeleted: nullable: true type: boolean - language: + metadata: + additionalProperties: {} + type: object + tags: items: type: string - nullable: true type: array - notfindingId: - items: - type: string + type: object + EndpointsUpdateProjectOutput: + properties: + success: + type: boolean + version: + type: string + required: + - success + type: object + EndpointsUpdateRepositoryInput: + properties: + name: nullable: true - type: array - package: - items: - type: string + type: string + type: object + EndpointsVaultFile: + properties: + contentType: + type: string + createdAt: + format: date-time + type: string + documentId: + type: string + fileId: + type: string + fileName: + type: string + filePresignedUrl: + type: string + indexed: + description: Whether the document has chunks in the vault index; omitted when the index could not be read nullable: true - type: array - page: + type: boolean + uploaderId: + type: string + uploaderUsername: + type: string + required: + - filePresignedUrl + - fileId + - fileName + - uploaderId + - uploaderUsername + - createdAt + type: object + EndpointsVaultFileSimple: + properties: + description: nullable: true - type: integer - pageSize: + type: string + documentId: nullable: true + type: string + fileName: + type: string + required: + - fileName + type: object + EndpointsVaultSearchResult: + properties: + description: + type: string + docType: + type: string + documentId: + type: string + endLine: type: integer - platform: - items: - type: string - nullable: true - type: array - priorityLabel: - items: - type: string - nullable: true - type: array - repository: - items: - type: string - nullable: true - type: array - repositoryId: - items: - type: string - nullable: true - type: array - ruleId: - items: - type: string + endPage: + type: integer + fileName: + type: string + nodeId: + type: string + score: + format: double + type: number + startLine: + type: integer + startPage: + type: integer + text: + type: string + required: + - nodeId + - documentId + - fileName + - text + - score + type: object + EndpointsWheelDetailsView: + type: object + GraphBuildArtifactRepositoryType: + enum: + - ARTIFACTORY + - GITHUB_RELEASES + - IMAGE_REGISTRY + - OTHER + - PACKAGE_REGISTRY + - S3_BUCKET + type: string + GraphBuildArtifactType: + enum: + - ARCHIVE + - BYTECODE_OBJECT_FILE + - CODE_DIRECTORY + - CONTAINER_IMAGE + - CRATE_PACKAGE + - EXECUTABLE_BINARY + - GEM_PACKAGE + - HELM_CHART + - JAR + - MAVEN_PACKAGE + - NPM_PACKAGE + - NUGET_PACKAGE + - OCI_IMAGE + - OS_PACKAGE + - OTHER + - PYPI_PACKAGE + - SPA_BUNDLE + - STATIC_WEBSITE + - VIRTUAL_MACHINE_IMAGE + - WASM_MODULES + - WEB_COMPONENTS + type: string + GraphCodeArtifactType: + enum: + - BROWSER_CLIENT + - BROWSER_EXTENSION + - CLI + - CLOUD_FUNCTION + - DESKTOP + - GRAPHQL_API + - IOT_FIRMWARE + - MOBILE_APP + - MVC + - OTHER + - PIPELINE_NODE + - PLUGIN + - PRIVATE_LIBRARY + - PUBLIC_LIBRARY + - REST_API + - SMART_CONTRACT + - SPA_BROWSER_APP + - TEST_SUITE + - WEB_SERVER + type: string + GraphEdge: + properties: + confidence: nullable: true - type: array - scrollId: + type: number + explanation: nullable: true type: string - search: - nullable: true + properties: + additionalProperties: {} + type: object + sourceId: type: string - secretType: - items: - type: string - nullable: true - type: array - severity: + targetId: + type: string + type: + $ref: '#/components/schemas/GraphEdgeType' + type: object + GraphEdgeType: + enum: + - ABOUT + - ACCESSED_BY + - ALLOWED_BY + - ALLOWS_EGRESS_TO + - ALLOWS_INGRESS_FROM + - APPLIES_TO + - ASSUMES + - ASSUMES_ROLE + - ATTACHED_TO + - AUTHENTICATES + - BASED_ON_CONTAINERFILE + - BELONGS_TO + - BUILDS + - BUILT_FROM + - CALLS + - CAN_REACH + - CLAIMS + - CONTAINS + - CONTRIBUTES_TO + - CONTRIBUTES_TO_PROJECT + - CONTROLS + - DATA_FLOWS_TO + - DEPLOYED_BY + - DEPLOYED_IN + - DEPLOYED_TO + - DERIVED_FROM + - ENCRYPTS + - ENFORCED_BY + - ENFORCES + - ENTRY_POINTS + - EXECUTES + - EXISTS + - EXISTS_IN + - EXPOSED_AT + - EXPOSED_BY + - EXPOSED_ON + - EXPOSES + - FILTERED_BY + - FORWARDS_TO + - GRANTS_ACCESS + - HAS_AUTH + - HAS_CONTRIBUTOR + - HAS_ENDPOINT + - HAS_ENTRYPOINT + - HAS_FINDING + - HAS_HOST + - HAS_MEMBER + - HAS_NOTE + - HAS_ROLE + - HAS_RULE + - HAS_SECURITY_GROUP + - HOSTS + - IN_PROJECT + - IN_REPOSITORY + - IN_SUBNET + - INVOKES_CALLBACK + - IN_VPC + - ISSUED_TO + - MEMBER_OF + - MONITORS + - MOUNTED_BY + - OPEN_ON + - ORIGIN + - PEERED_WITH + - PRODUCED_BY + - PROTECTED_BY + - PROVIDED_BY + - PROVIDES + - PUBLISHES_TO + - QUERIED_BY + - QUERIES + - REFERENCES + - REGISTERS_CALLBACK + - REMEDIATES + - RESOLVES_TO + - ROUTED_BY + - ROUTES_TO + - RUNS_IMAGE + - SCALES + - SECURED_BY + - SERVES + - SOURCED_FROM + - STORED_IN + - SUBSCRIBES_TO + - SUPERSEDES + - TARGETS + - TARGET_WORKLOAD + - TRACKS + - TRIGGERED_BY + - TRIGGERS + - UPLOADED_TO + - USED_BY + - USES + - USES_CONTAINER + - USES_POD + - USES_SECURITY_GROUP + - USES_TASK_DEFINITION + type: string + GraphGraph: + properties: + edges: items: - type: string + $ref: '#/components/schemas/GraphEdge' nullable: true type: array - sort: - items: - additionalProperties: - additionalProperties: {} - type: object - type: object + nodes: + items: {} nullable: true type: array - sortPreset: - nullable: true + pathAssessment: + $ref: '#/components/schemas/GraphPathAssessment' + type: object + GraphPathAssessment: + properties: + explanation: type: string - teamIDs: + findingId: + type: string + sourceIds: items: type: string nullable: true type: array - tenantId: - nullable: true - type: string - toDate: - nullable: true - type: string - toPriorityScore: - nullable: true - type: integer - type: + status: + $ref: '#/components/schemas/GraphPathAssessmentStatus' + unknowns: items: type: string nullable: true type: array - urgentMaxDays: - nullable: true - type: integer - type: object - ModelsUnifiedFindingsRawMetricsQueryResultItem: - properties: - doc_count: - type: integer type: object - ModelsUnifiedFindingsSortPreset: + GraphPathAssessmentStatus: enum: - - created_at_desc - - created_at_asc - - priority_desc - - severity_desc + - BLOCKED + - CONFIRMED + - UNRESOLVED type: string - ModelsUser: + LanguageCodeLanguage: + enum: + - Apex + - Bicep + - C + - CPlusPlus + - CSharp + - CloudFormation + - Containerfile + - Dockerfile + - Elixir + - Erlang + - FSharp + - Go + - HCL + - Haskell + - JSON + - Java + - JavaScript + - Julia + - Kotlin + - Kubernetes + - Objective-C + - OpenAPI + - PHP + - Python + - Renovate + - Ruby + - Rust + - Scala + - Serverless + - Shell + - Solidity + - Swift + - Terraform + - TypeScript + - Unknown + - YAML + type: string + ModelsAPISpecMetadata: properties: - azure: - $ref: '#/components/schemas/ModelsAzureUserProvider' - azureEntra: - $ref: '#/components/schemas/ModelsAzureEntraUserProvider' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketUserProvider' - createdAt: - type: string - createdBy: - type: string - email: - description: The user's email address - type: string - github: - $ref: '#/components/schemas/ModelsGitHubUserProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabUserProvider' - googleWorkspace: - $ref: '#/components/schemas/ModelsGoogleWorkspaceUserProvider' - id: - description: The user's ID - type: string - isBot: - description: Whether the user is a bot - type: boolean - jira: - $ref: '#/components/schemas/ModelsJiraUserProvider' - lastUpdatedBy: - type: string - linear: - $ref: '#/components/schemas/ModelsLinearUserProvider' - name: - description: The user's name - type: string - okta: - $ref: '#/components/schemas/ModelsOktaUserProvider' - provider: - $ref: '#/components/schemas/ModelsUserProvider' - slack: - $ref: '#/components/schemas/ModelsSlackUserProvider' - slug: - description: The user's slug - type: string - teams: - $ref: '#/components/schemas/ModelsTeamsUserProvider' - updatedAt: + basePath: type: string - username: - description: The user's username + numEndpoints: + type: integer + servers: + items: + type: string + type: array + version: type: string required: - - provider - - id - - name - - slug - - username - - isBot + - numEndpoints type: object - ModelsUserMapping: + ModelsAPISpecRef: properties: - azure: - $ref: '#/components/schemas/ModelsAzureUserProvider' - azureEntra: - $ref: '#/components/schemas/ModelsAzureEntraUserProvider' - bitbucket: - $ref: '#/components/schemas/ModelsBitbucketUserProvider' - createdAt: - type: string - createdBy: + contentRef: + $ref: '#/components/schemas/ModelsContentReference' + format: type: string - github: - $ref: '#/components/schemas/ModelsGitHubUserProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabUserProvider' - googleWorkspace: - $ref: '#/components/schemas/ModelsGoogleWorkspaceUserProvider' id: type: string - jira: - $ref: '#/components/schemas/ModelsJiraUserProvider' - lastUpdatedBy: + metadata: + $ref: '#/components/schemas/ModelsAPISpecMetadata' + name: type: string - linear: - $ref: '#/components/schemas/ModelsLinearUserProvider' - okta: - $ref: '#/components/schemas/ModelsOktaUserProvider' - slack: - $ref: '#/components/schemas/ModelsSlackUserProvider' - teams: - $ref: '#/components/schemas/ModelsTeamsUserProvider' - updatedAt: + source: + type: string + type: type: string required: - id - - createdAt - - createdBy - - updatedAt - - lastUpdatedBy - type: object - ModelsUserProvider: - properties: - azure: - $ref: '#/components/schemas/ModelsAzureUserProvider' - azureEntra: - $ref: '#/components/schemas/ModelsAzureEntraUserProvider' - bitBucket: - $ref: '#/components/schemas/ModelsBitbucketUserProvider' - gitHub: - $ref: '#/components/schemas/ModelsGitHubUserProvider' - gitlab: - $ref: '#/components/schemas/ModelsGitLabUserProvider' - googleWorkspace: - $ref: '#/components/schemas/ModelsGoogleWorkspaceUserProvider' - id: - $ref: '#/components/schemas/ModelsProviderID' - jira: - $ref: '#/components/schemas/ModelsJiraUserProvider' - linear: - $ref: '#/components/schemas/ModelsLinearUserProvider' - okta: - $ref: '#/components/schemas/ModelsOktaUserProvider' - slack: - $ref: '#/components/schemas/ModelsSlackUserProvider' - teams: - $ref: '#/components/schemas/ModelsTeamsUserProvider' - required: - - id + - name + - contentRef + - metadata type: object - RestErrResponse: + ModelsAPISurface: properties: - code: - description: Application-specific error code. + authenticatedEndpoints: + nullable: true + type: integer + coverage: + nullable: true + type: number + publicEndpoints: + nullable: true + type: integer + totalEndpoints: + nullable: true type: integer - context: - additionalProperties: {} - description: Application context. - type: object - error: - description: Error message. - type: string - status: - description: Status text. - type: string type: object - TimeDuration: - format: int64 - type: integer - AssetgraphSearchIndexEntry: + ModelsAgentAppContextSeed: properties: - accountId: - type: string - name: + componentTypes: + items: + type: string + type: array + description: type: string - nodeId: + id: + nullable: true type: string - objectType: + name: type: string - region: + productType: + nullable: true type: string - subTitle: + productUrl: + nullable: true type: string + tags: + items: + type: string + type: array type: object - EndpointsActiveDepsSummaryOldest: + ModelsAiMlSubType: + enum: + - AWS_SAGEMAKER_ENDPOINT + - AWS_BEDROCK_MODEL + - GCP_VERTEX_ENDPOINT + - AZURE_OPENAI_DEPLOYMENT + - AZURE_ML_WORKSPACE + - AZURE_MACHINE_LEARNING + type: string + ModelsApplication: properties: - ecosystem: - type: string - introducedAt: + components: + items: + $ref: '#/components/schemas/ModelsApplicationComponent' + nullable: true + type: array + createdAt: format: date-time type: string - name: - type: string - required: - - name - - ecosystem - - introducedAt - type: object - EndpointsArtifactDeploymentSummary: - properties: - accountId: + description: type: string - artifactId: + discovery: + $ref: '#/components/schemas/ModelsApplicationDiscovery' + generationId: type: string - cloudProvider: + id: type: string - cloudResourceId: + metadata: + $ref: '#/components/schemas/ModelsApplicationMetadata' + name: type: string - computeType: + origin: + $ref: '#/components/schemas/ModelsApplicationOrigin' + tags: + items: + type: string + type: array + tenantId: type: string - createdAt: + updatedAt: format: date-time type: string - deletedAt: - format: date-time + userDescription: nullable: true type: string - id: - type: string - isDeleted: - type: boolean - isInternetFacing: - type: boolean - matchConfidence: - type: string - matchDetail: - type: string - matchMethod: - type: string - metadata: - additionalProperties: {} - type: object - projectId: - type: string - region: + userName: + nullable: true type: string - repositoryId: + userTags: + items: + type: string + type: array + version: type: string - serviceName: + required: + - id + - tenantId + - name + - description + - components + - discovery + - metadata + - createdAt + - updatedAt + type: object + ModelsApplicationAuthModel: + properties: + notes: type: string - updatedAt: - format: date-time + source: type: string + required: + - source type: object - EndpointsArtifactRegistrySummary: + ModelsApplicationComponent: properties: - baseUrl: - type: string + discovery: + $ref: '#/components/schemas/ModelsComponentDiscovery' id: type: string name: type: string - path: - type: string + relationships: + items: + $ref: '#/components/schemas/ModelsComponentRelationship' + type: array + source: + $ref: '#/components/schemas/ModelsComponentSource' type: type: string + required: + - id + - name + - source + - discovery type: object - EndpointsArtifactSummary: + ModelsApplicationDiscovery: properties: - artifactName: + apiSpecs: + items: + $ref: '#/components/schemas/ModelsAPISpecRef' + nullable: true + type: array + apiSurface: + $ref: '#/components/schemas/ModelsAPISurface' + authModel: + $ref: '#/components/schemas/ModelsApplicationAuthModel' + securityProfile: + $ref: '#/components/schemas/ModelsSecurityProfile' + sharedInfrastructure: + items: + $ref: '#/components/schemas/ModelsSharedInfrastructureRef' + type: array + technologies: + items: + type: string + nullable: true + type: array + required: + - apiSpecs + - apiSurface + - technologies + - securityProfile + type: object + ModelsApplicationMetadata: + properties: + agentExecutionId: type: string - createdAt: - format: date-time + cacheKey: type: string - deletedAt: + cliAppContext: {} + cliAppContextUpdatedAt: format: date-time nullable: true type: string - entrypointId: + cliAppContextVersion: type: string - id: + customFields: + additionalProperties: + type: string + type: object + generatedByAgentVersion: type: string - isDeleted: - type: boolean - name: + lastAttemptTime: + format: date-time type: string - nonProduction: - type: boolean - projectId: + lastRebuildTime: + format: date-time type: string - registries: + sourceRepositories: items: - $ref: '#/components/schemas/EndpointsArtifactRegistrySummary' + type: string type: array - repositoryId: - type: string - subArtifactPath: - type: string - subArtifactType: - type: string - type: - type: string - updatedAt: - format: date-time + sourceRepositoryCount: + type: integer + status: type: string + required: + - lastRebuildTime type: object - EndpointsAssetGraphComponent: + ModelsApplicationOrigin: + enum: + - ai + - user + type: string + ModelsArtifactRepositoriesSubType: + enum: + - AWS_ECR + - AWS_CODEARTIFACT + - AZURE_ACR + - GCP_ARTIFACT_REGISTRY + - DOCKERHUB + - GHCR + - NPM + - PYPI + - MAVEN + - NUGET + - RUBYGEMS + - CRATES + - OTHER + type: string + ModelsArtifactsSubType: + enum: + - DOCKER_IMAGE + - JAR + - WHEEL + - NPM_PACKAGE + - EXECUTABLE + - OTHER + type: string + ModelsAssetInventoryCategory: + enum: + - compute + - container + - cluster + - serverless + - network + - connectivity + - load_balancer + - cdn_and_dns + - storage_and_backup + - database + - messaging + - data_pipeline + - identity + - security + - observability + - ci_cd + - ai_ml + - repos + - projects + - artifacts + - pipelines + - artifact_repositories + type: string + ModelsCDNAndDNSSubType: + enum: + - AWS_CLOUDFRONT + - AWS_ROUTE53_HOSTED_ZONE + - AWS_API_GATEWAY + - AWS_APPSYNC + - GCP_CLOUD_CDN + - GCP_CLOUD_DNS_ZONE + - GCP_CLOUD_DNS_RECORD + - AZURE_CDN_PROFILE + - AZURE_DNS_ZONE + - AZURE_FRONT_DOOR + - AZURE_API_MANAGEMENT + - GCP_API_GATEWAY + - CODE_DECLARED_HOST + type: string + ModelsCDXAuthors: properties: - accountType: - type: string - componentType: - type: string - downloadUrl: - type: string - edgeCount: - type: integer - expiresAt: - format: date-time - type: string - id: - type: string - lastUpdated: - format: date-time + email: type: string name: type: string - nodeCount: - type: integer - ownerId: - type: string - platform: - type: string - services: - items: - type: string - type: array required: - - componentType - - id - - downloadUrl - - expiresAt - - nodeCount - - edgeCount + - name + - email type: object - EndpointsCloudReconDiscoveredNodeDTO: + ModelsCDXComponents: properties: - cidr: + author: type: string - nodeId: + bom-ref: + type: string + description: type: string - objectType: + externalReferences: + items: + $ref: '#/components/schemas/ModelsCDXReferences' + nullable: true + type: array + group: type: string - portFrom: + hashes: + items: + $ref: '#/components/schemas/ModelsCDXHashes' nullable: true - type: integer - portTo: + type: array + licenses: + items: + $ref: '#/components/schemas/ModelsCDXLicenseEntry' nullable: true - type: integer - properties: - format: base64 - type: string - protocol: + type: array + name: type: string - publicFlag: + properties: + items: + $ref: '#/components/schemas/ModelsCDXProperties' nullable: true - type: boolean - region: + type: array + publisher: type: string - source: + purl: type: string - subType: + scope: type: string - subnetId: + type: type: string - vpcId: + version: type: string + required: + - author + - publisher + - group + - name + - version + - description + - hashes + - licenses + - purl + - type + - bom-ref + - properties + - externalReferences + - scope type: object - EndpointsCloudReconHotspotDTO: + ModelsCDXDeps: properties: - category: - type: string - confidence: - type: string - description: - type: string - hotspotId: - type: string - nodeIds: + dependsOn: items: type: string + nullable: true type: array - severity: - type: string - title: + ref: type: string + required: + - ref + - dependsOn type: object - EndpointsCloudReconScanMetadataDTO: + ModelsCDXGen: properties: - accountId: + bomFormat: type: string - completedAt: - format: date-time + components: + items: + $ref: '#/components/schemas/ModelsCDXComponents' + nullable: true + type: array + dependencies: + items: + $ref: '#/components/schemas/ModelsCDXDeps' nullable: true + type: array + metadata: + $ref: '#/components/schemas/ModelsCDXMetaData' + serialNumber: type: string - discoveredCount: - type: integer - edgeCount: + services: + items: + $ref: '#/components/schemas/ModelsCDXService' + nullable: true + type: array + specVersion: + type: string + version: type: integer - hotspotCount: + required: + - bomFormat + - specVersion + - serialNumber + - version + - metadata + - components + - services + - dependencies + type: object + ModelsCDXGenAtCommit: + properties: + authoritative: + type: boolean + authorityRevision: + format: int64 type: integer - modelName: - type: string - nodeCount: + carryCount: type: integer - provider: - type: string - s3Bucket: + cdxGen: + $ref: '#/components/schemas/ModelsCDXGen' + commitSha: type: string - s3Key: + commitTimestamp: + format: date-time type: string - scanId: + completenessRecorded: + type: boolean + detectedEcosystems: + items: + type: string + nullable: true + type: array + detectedLockfiles: + items: + type: string + nullable: true + type: array + detectedManifests: + items: + type: string + nullable: true + type: array + empty: + type: boolean + exclusions: + items: + $ref: '#/components/schemas/ModelsSBOMScope' + type: array + failedEcosystems: + items: + type: string + type: array + failureClass: + enum: + - oom + - disk_full + - timeout + - cdxgen_error + - no_components + - input_too_large + - guest_error + - unstable + - unsupported + - registry_auth + - other type: string - schemaVersion: + failureReason: type: string - startedAt: + generatedAt: format: date-time type: string - status: - type: string - type: object - EndpointsCloudReconTenantTrustDTO: - properties: - externalAccountId: - type: string - trustingAccountCount: - type: integer - trustingAccounts: + incomplete: + type: boolean + incompleteScopes: items: - type: string - nullable: true + $ref: '#/components/schemas/ModelsSBOMScope' type: array - type: object - EndpointsContextGetCloudScanStatusOutput: - properties: - overallStatus: + lockfileClassification: type: string - providers: + lockfileSetHash: + type: string + manifestRangeSources: + additionalProperties: + $ref: '#/components/schemas/ModelsManifestRangeSource' + type: object + manifestRanges: + additionalProperties: + type: string + type: object + packageAuth: items: - $ref: '#/components/schemas/EndpointsProviderScanStatus' - nullable: true + $ref: '#/components/schemas/ModelsSBOMPackageAuth' type: array - scanId: + provenance: + $ref: '#/components/schemas/ModelsSBOMProvenance' + repoContextCommitSha: + type: string + repoContextStaleReason: + type: string + repoContextVersion: + type: string + scanScope: + $ref: '#/components/schemas/ModelsPathScope' + scannerVersion: type: string required: - - scanId - - overallStatus - - providers + - commitSha + - commitTimestamp type: object - EndpointsContextStartCloudScanOutput: + ModelsCDXHashes: properties: - executionArn: + alg: type: string - scanId: + content: type: string - statusCode: - type: integer - type: object - EndpointsCreateOrganizationInput: - properties: - organization: - $ref: '#/components/schemas/ModelsOrgContext' + required: + - alg + - content type: object - EndpointsCreateOrganizationOutput: + ModelsCDXLicenseEntry: properties: - organization: - $ref: '#/components/schemas/ModelsOrgContext' - version: + expression: type: string + license: + $ref: '#/components/schemas/ModelsCDXLicenseInfo' type: object - EndpointsCreateRepoScanInput: + ModelsCDXLicenseInfo: properties: - branch: - type: string - commitSha: + id: type: string - projectsTouched: - items: - $ref: '#/components/schemas/EndpointsRepoScanProjectTouched' - type: array - repositoryId: + url: type: string - sbomsGenerated: + type: object + ModelsCDXMetaData: + properties: + authors: items: - $ref: '#/components/schemas/EndpointsRepoScanSBOMGenerated' + $ref: '#/components/schemas/ModelsCDXAuthors' + nullable: true type: array - status: + component: + $ref: '#/components/schemas/ModelsCDXComponents' + timestamp: + format: date-time type: string - subagentsRun: + tools: additionalProperties: - $ref: '#/components/schemas/EndpointsRepoScanSubagent' + items: + $ref: '#/components/schemas/ModelsCDXTool' + type: array + nullable: true type: object required: - - repositoryId - - commitSha + - timestamp + - tools + - authors + - component type: object - EndpointsCreateRepoScanOutput: + ModelsCDXProperties: properties: - scan: - $ref: '#/components/schemas/EndpointsRepoScanSummary' - version: + name: + type: string + value: type: string required: - - scan + - name + - value type: object - EndpointsDeleteArtifactOutput: + ModelsCDXReferences: properties: - message: + type: + type: string + url: type: string - success: - type: boolean required: - - success - - message + - type + - url type: object - EndpointsDeleteContextApplicationOutput: + ModelsCDXService: properties: - message: + bom-ref: + type: string + endpoints: + items: + type: string + type: array + group: + type: string + name: + type: string + provider: + type: string + version: type: string - required: - - message type: object - EndpointsDeleteDepsOutput: + ModelsCDXTool: properties: - deletedCount: - type: integer - scope: + group: + type: string + name: type: string version: type: string required: + - group + - name - version type: object - EndpointsDeleteEntrypointOutput: + ModelsCSPMCoverageManifestStatus: + enum: + - available + - missing + - unavailable + - invalid + - unknown_version + type: string + ModelsCiCdSubType: + enum: + - AWS_CODEBUILD + - AWS_CODEPIPELINE + - AWS_CODECOMMIT + - AWS_CODEDEPLOY + - GCP_CLOUD_BUILD + - AZURE_DEVOPS_PIPELINES + type: string + ModelsCloudProvider: + enum: + - AWS + - AZURE + - GCP + - K8S + - OTHER + type: string + ModelsClusterSubType: + enum: + - AWS_EKS_CLUSTER + - AWS_ECS_CLUSTER + - GCP_GKE + - AZURE_AKS + - K8S_CLUSTER + type: string + ModelsComponentDiscovery: properties: - message: - type: string - success: - type: boolean - required: - - success - - message + apiSpecs: + items: + $ref: '#/components/schemas/ModelsAPISpecRef' + type: array + endpoints: + items: + type: string + type: array + frontendAssets: + $ref: '#/components/schemas/ModelsFrontendAssets' + technologies: + items: + type: string + type: array type: object - EndpointsDeleteMemoryOutput: + ModelsComponentRelationship: properties: - message: + confidence: + nullable: true + type: number + evidence: type: string - success: - type: boolean - version: + targetComponentId: + type: string + type: type: string required: - - success - - message + - targetComponentId + - type type: object - EndpointsDeletePipelineOutput: + ModelsComponentSource: properties: - message: + path: + type: string + projectId: + type: string + repositoryId: + type: string + type: type: string - success: - type: boolean - required: - - success - - message type: object - EndpointsDeleteProjectOutput: + ModelsComputeSubType: + enum: + - AWS_EC2 + - AWS_AUTOSCALING_GROUP + - AWS_WORKSPACE + - GCP_GCE + - GCP_MIG + - AZURE_VM + - AZURE_VMSS + - AZURE_VIRTUAL_DESKTOP + - K8S_NODE + type: string + ModelsComputeWorkloadType: + enum: + - server + - desktop + - streaming + - edge + type: string + ModelsConnectivitySubType: + enum: + - AWS_VPN_CONNECTION + - AWS_DIRECT_CONNECT + - AWS_PRIVATE_LINK + - AWS_TGW_ATTACHMENT + - AWS_GLOBAL_ACCELERATOR + - AWS_NETWORK_FIREWALL + - AZURE_EXPRESS_ROUTE + - AZURE_VPN + - AZURE_FIREWALL + - GCP_VPN_TUNNEL + - GCP_CLOUD_ARMOR + - GCP_VPC_SERVICE_CONTROLS + - GCP_FIREWALL_RULE + type: string + ModelsContainerSubType: + enum: + - AWS_ECS_SERVICE + - AWS_ECS_TASK + - AWS_ECS_TASK_DEFINITION + - K8S_DEPLOYMENT + - K8S_NAMESPACE + - K8S_POD + - K8S_STATEFULSET + - K8S_DAEMONSET + - GCP_CLOUD_RUN + - AZURE_ACI + - AZURE_APP_SERVICE + type: string + ModelsContentReference: properties: - message: + hash: + type: string + location: + type: string + size: + format: int64 + type: integer + type: type: string - success: - type: boolean required: - - success - - message + - size + - hash type: object - EndpointsDeleteRepositoryOutput: + ModelsContextProject: properties: - message: + createdAt: + format: date-time type: string - success: + deletedAt: + format: date-time + nullable: true + type: string + description: + type: string + id: + type: string + isDeleted: type: boolean - version: + metadata: + additionalProperties: {} + type: object + name: + type: string + path: + type: string + repositoryId: + type: string + tags: + items: + type: string + type: array + updatedAt: + format: date-time type: string required: - - success - - message + - id + - repositoryId + - name + - description + - path + - isDeleted + - createdAt + - updatedAt type: object - EndpointsDeleteSBOMOutput: + ModelsDataPipelineSubType: + enum: + - AWS_GLUE + - AWS_EMR + - AWS_ATHENA + - GCP_DATAFLOW + - GCP_DATAPROC + - AZURE_DATA_FACTORY + - AZURE_DATABRICKS + - AZURE_SYNAPSE + - AZURE_HDINSIGHT + - AZURE_BATCH + - GCP_CLOUD_BATCH + - GCP_WORKFLOWS + type: string + ModelsDatabaseSubType: + enum: + - AWS_RDS + - AWS_DYNAMODB + - AWS_REDSHIFT + - AWS_NEPTUNE + - AWS_ELASTICACHE + - AWS_MEMORYDB + - AWS_OPENSEARCH + - GCP_SPANNER + - GCP_BIGQUERY + - GCP_FIRESTORE + - GCP_ALLOYDB + - GCP_CLOUD_SQL + - GCP_MEMORYSTORE + - AZURE_SQL + - AZURE_COSMOS + - AZURE_MYSQL + - AZURE_POSTGRES + - AZURE_REDIS + type: string + ModelsDependencyDiff: properties: - deletedKeys: + added: items: - type: string + $ref: '#/components/schemas/ModelsDependencyOccurrence' + nullable: true type: array - repositories: + downgraded: items: - $ref: '#/components/schemas/ModelsSBOMRepository' + $ref: '#/components/schemas/ModelsDependencyUpgrade' nullable: true type: array - tenantId: - type: string - tenantName: - type: string - version: - type: string - required: - - tenantId - - repositories - type: object - EndpointsEntrypointSummary: - properties: - applicationTypes: + removed: items: - type: string + $ref: '#/components/schemas/ModelsDependencyOccurrence' + nullable: true type: array - artifactIds: + upgraded: items: - type: string + $ref: '#/components/schemas/ModelsDependencyUpgrade' + nullable: true type: array - createdAt: - format: date-time - type: string - deletedAt: - format: date-time + required: + - added + - removed + - upgraded + - downgraded + type: object + ModelsDependencyOccurrence: + properties: + bomRef: nullable: true type: string - description: - type: string - frameworkName: + depth: + nullable: true + type: integer + direct: + nullable: true + type: boolean + ecosystem: type: string - id: + introducedAt: + format: date-time + nullable: true type: string - isDeleted: - type: boolean - kind: + introducedByCommit: + nullable: true type: string - lineNumber: - type: integer name: type: string - path: - type: string - ports: + parents: items: - type: integer + type: string type: array projectId: type: string - repositoryId: + projectName: type: string - updatedAt: + purl: + type: string + rangeUnverified: + type: boolean + removedAt: format: date-time + nullable: true type: string - type: object - EndpointsGetActiveDepsOutput: - properties: - dependencies: - items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' + removedByCommit: nullable: true - type: array - nextCursor: type: string - numItems: - type: integer - version: + repoId: + type: string + repositoryName: + type: string + requestedRange: + nullable: true + type: string + requestedRangeSource: + nullable: true type: string - required: - - version - - nextCursor - - numItems - - dependencies - type: object - EndpointsGetActiveDepsSummaryOutput: - properties: - directCount: - format: int64 - type: integer - oldest: - $ref: '#/components/schemas/EndpointsActiveDepsSummaryOldest' - totalCount: - format: int64 - type: integer - transitiveCount: - format: int64 - type: integer version: type: string required: + - repoId + - projectId + - ecosystem + - name - version - - totalCount - - directCount - - transitiveCount type: object - EndpointsGetApplicationSchemaOutput: + ModelsDependencyUpgrade: properties: - format: - $ref: '#/components/schemas/ModelsSchemaFormat' - schema: + ecosystem: type: string - type: - $ref: '#/components/schemas/ModelsSchemaType' - version: + from: type: string - required: - - type - - format - - schema - type: object - EndpointsGetArtifactDeploymentOutput: - properties: - deployment: - $ref: '#/components/schemas/EndpointsArtifactDeploymentSummary' - version: + fromCommit: + nullable: true type: string - required: - - deployment - type: object - EndpointsGetArtifactOutput: - properties: - artifact: - $ref: '#/components/schemas/EndpointsArtifactSummary' - version: + name: + type: string + projectId: + type: string + projectName: + type: string + repoId: + type: string + repositoryName: + type: string + to: type: string required: - - artifact + - repoId + - projectId + - ecosystem + - name + - from + - to type: object - EndpointsGetAssetGraphReachabilityOutput: + ModelsDependencyWindow: properties: - isInternetFacing: + ecosystem: + type: string + fromCommit: + type: string + fromTime: + format: date-time + type: string + isArchived: + description: Whether the repository is archived on its source platform type: boolean - paths: - items: - $ref: '#/components/schemas/EndpointsNetworkPathDTO' + lastScannedAt: + description: Last SBOM scan timestamp for the project + format: date-time nullable: true - type: array - summary: type: string - targetNodeId: + name: type: string - targetNodeType: + projectId: type: string - version: + projectName: type: string - required: - - targetNodeId - - isInternetFacing - - paths - type: object - EndpointsGetAssetGraphSearchOutput: - properties: - results: - items: - $ref: '#/components/schemas/AssetgraphSearchIndexEntry' - nullable: true - type: array - total: - type: integer - version: + repoId: type: string - required: - - results - - total - type: object - EndpointsGetAssetGraphSubgraphOutput: - properties: - hierarchyEdges: - items: - $ref: '#/components/schemas/GraphEdge' - nullable: true - type: array - lateralEdges: - items: - $ref: '#/components/schemas/GraphEdge' + repositoryName: + type: string + resolvedWithoutLockfile: + description: Whether this dependency was resolved without a committed lockfile + type: boolean + toCommit: nullable: true - type: array - nodes: - items: {} + type: string + toTime: + format: date-time nullable: true - type: array - rootNodeId: type: string - totalChildren: - type: integer - truncated: - type: boolean version: type: string required: - - nodes - - hierarchyEdges - - lateralEdges - - rootNodeId - - totalChildren - - truncated + - repoId + - projectId + - ecosystem + - name + - version + - fromTime type: object - EndpointsGetAssetGraphSummaryOutput: + ModelsEndpointSourceType: + enum: + - UserUpload + - CodeScan + - AWSIntegration + - BugHunt + - Manual + - Pentest + - Dast + type: string + ModelsEscalationPolicy: properties: - accountCount: - type: integer - combinedGraphExpiresAt: - format: date-time - type: string - combinedGraphUrl: + citations: + items: + $ref: '#/components/schemas/ModelsEscalationPolicyCitationsElem' + type: array + description: + nullable: true type: string - findingNodeCount: - type: integer - graphInfo: - $ref: '#/components/schemas/EndpointsInfrastructureGraphInfo' - infrastructureGraphs: + escalationChain: items: - $ref: '#/components/schemas/EndpointsAssetGraphComponent' + $ref: '#/components/schemas/ModelsEscalationPolicyEscalationChainElem' nullable: true type: array - internetFacingNodeCount: - type: integer - lastUpdated: - format: date-time - type: string - mergedGraphEdgeCount: - type: integer - mergedGraphExpiresAt: - format: date-time + id: type: string - mergedGraphNodeCount: - type: integer - mergedGraphUrl: + name: type: string - repoContextGraphs: + scope: + $ref: '#/components/schemas/ModelsEscalationPolicyScope' + severitySLAs: items: - $ref: '#/components/schemas/EndpointsAssetGraphComponent' - nullable: true + $ref: '#/components/schemas/ModelsEscalationPolicySeveritySLAsElem' type: array - totalInfraEdges: - type: integer - totalInfraNodes: - type: integer - totalRepoGraphs: - type: integer - version: - type: string - required: - - infrastructureGraphs - - repoContextGraphs - - totalInfraNodes - - totalInfraEdges - - totalRepoGraphs - - accountCount - - lastUpdated type: object - EndpointsGetAssetInventoryCloudResourcesOutput: + ModelsEscalationPolicyCitationsElem: properties: - nextToken: + documentId: + nullable: true type: string - resources: - items: - $ref: '#/components/schemas/ModelsAssetInventoryResource' + documentName: + nullable: true + type: string + page: nullable: true - type: array - total: - type: integer - version: type: string - required: - - resources - - total - - version type: object - EndpointsGetAssetInventoryResourcesOutput: + ModelsEscalationPolicyEscalationChainElem: properties: - nextToken: - type: string - resources: - items: - $ref: '#/components/schemas/ModelsAssetInventoryHost' + contact: + $ref: '#/components/schemas/ModelsEscalationPolicyEscalationChainElemContact' + escalateAfterHours: nullable: true - type: array - total: + type: number + level: type: integer - version: - type: string - required: - - resources - - total - - version type: object - EndpointsGetCloudAccountRecordsOutput: + ModelsEscalationPolicyEscalationChainElemContact: properties: - cloudAccounts: - items: - $ref: '#/components/schemas/ModelsAssetInventoryCloudAccountRecord' + channel: nullable: true - type: array - nextToken: type: string - total: - type: integer - version: + name: + nullable: true type: string - required: - - cloudAccounts - - total - - version type: object - EndpointsGetCloudReconDiscoveredNodesOutput: + ModelsEscalationPolicyScope: properties: - nodes: + services: items: - $ref: '#/components/schemas/EndpointsCloudReconDiscoveredNodeDTO' - nullable: true + type: string type: array - type: object - EndpointsGetCloudReconHotspotsOutput: - properties: - hotspots: + teams: items: - $ref: '#/components/schemas/EndpointsCloudReconHotspotDTO' - nullable: true + type: string type: array type: object - EndpointsGetCloudReconTenantTrustsOutput: + ModelsEscalationPolicySeveritySLAsElem: properties: - trusts: - items: - $ref: '#/components/schemas/EndpointsCloudReconTenantTrustDTO' + resolutionTimeHours: nullable: true - type: array + type: number + responseTimeHours: + nullable: true + type: number + severity: + $ref: '#/components/schemas/ModelsEscalationPolicySeveritySLAsElemSeverity' type: object - EndpointsGetContextApplicationOutput: + ModelsEscalationPolicySeveritySLAsElemSeverity: + enum: + - CRITICAL + - HIGH + - LOW + - MEDIUM + type: string + ModelsExecutionRecipe: properties: - application: - $ref: '#/components/schemas/ModelsApplication' - version: + applicationId: type: string - type: object - EndpointsGetContextApplicationsOutput: - properties: - applications: + capabilities: + additionalProperties: + $ref: '#/components/schemas/ModelsExecutionRecipeCapability' + type: object + components: items: - $ref: '#/components/schemas/ModelsApplication' - nullable: true + $ref: '#/components/schemas/ModelsExecutionRecipeComponent' type: array - version: + composePath: type: string - required: - - applications - type: object - EndpointsGetDepsAtCommitOutput: - properties: - commitTimestamp: + confidence: + format: double + type: number + cpuMillicores: + type: integer + discoveredAt: format: date-time type: string - dependencies: - items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' - nullable: true - type: array - numItems: + diskMib: type: integer - version: + dotnetSetup: + $ref: '#/components/schemas/DotnetsetupSelection' + ecosystem: type: string - required: - - version - - commitTimestamp - - numItems - - dependencies - type: object - EndpointsGetDepsByBomRefOutput: - properties: - dependencies: + edits: items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' - nullable: true + $ref: '#/components/schemas/ModelsExecutionRecipeFileEdit' type: array - nextCursor: + envNames: + items: + type: string + type: array + failureCode: type: string - numItems: + id: + type: string + inputHash: + type: string + kind: + enum: + - project + - application + type: string + memoryMib: type: integer - version: + packageManager: type: string - required: - - version - - nextCursor - - numItems - - dependencies - type: object - EndpointsGetDepsDependentsOutput: - properties: - dependencies: + projectId: + type: string + projectPath: + type: string + proof: + enum: + - replayed + - unproven_failed + type: string + readiness: + $ref: '#/components/schemas/ModelsExecutionRecipeReadiness' + repositoryId: + type: string + requirements: items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' - nullable: true + type: string type: array - nextCursor: + runOutcome: + enum: + - started + - not_ready + - failed + - none + - unsupported + - not_attempted type: string - numItems: - type: integer - version: + sandboxImage: type: string - required: - - version - - nextCursor - - numItems - - dependencies - type: object - EndpointsGetDepsDiffOutput: - properties: - diff: - $ref: '#/components/schemas/ModelsDependencyDiff' - numItems: - type: integer - version: + sandboxImageVersion: type: string - required: - - version - - numItems - type: object - EndpointsGetDepsHistoryOut: - properties: - numItems: - type: integer - version: + sourceCommit: type: string - windows: - items: - $ref: '#/components/schemas/ModelsDependencyWindow' + staleAt: + format: date-time nullable: true - type: array - required: - - version - - numItems - - windows - type: object - EndpointsGetDepsOutput: - properties: - dependencies: + type: string + staleReason: + type: string + status: + enum: + - valid + - stale + - superseded + type: string + steps: items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' - nullable: true + $ref: '#/components/schemas/ModelsExecutionRecipeStep' type: array - nextCursor: + testOutcome: + enum: + - passed + - failed + - no_tests + - unsupported + - timed_out type: string - numItems: - type: integer - version: + toolchainImageDigest: + type: string + validatedAt: + format: date-time type: string + validationId: + type: string + version: + type: integer required: + - id - version - - nextCursor - - numItems - - dependencies + - status + - proof + - validationId + - kind + - repositoryId + - sourceCommit + - inputHash + - discoveredAt + - validatedAt type: object - EndpointsGetDepsWithoutLockfileOutput: + ModelsExecutionRecipeCapability: properties: - projects: - items: - $ref: '#/components/schemas/EndpointsProjectWithoutLockfile' - type: array - repositories: - items: - $ref: '#/components/schemas/EndpointsRepositoryWithoutLockfile' - type: array - version: + reason: type: string + status: + enum: + - supported + - unsupported + - not_attempted + type: string + testOutcome: + enum: + - passed + - failed + - no_tests + - unsupported + - timed_out + type: string + required: + - status type: object - EndpointsGetEntrypointOutput: + ModelsExecutionRecipeComponent: properties: - entrypoint: - $ref: '#/components/schemas/EndpointsEntrypointSummary' - version: + componentRecipeId: + type: string + projectId: + type: string + proof: + type: string + repositoryId: + type: string + serviceName: type: string - required: - - entrypoint - type: object - EndpointsGetExposureOutput: - properties: - numItems: - type: integer - version: + status: type: string - windows: - items: - $ref: '#/components/schemas/ModelsDependencyWindow' - nullable: true - type: array + version: + type: integer required: + - serviceName + - componentRecipeId - version - - numItems - - windows type: object - EndpointsGetInfrastructureGraphDownloadOutput: + ModelsExecutionRecipeDiscoveryRefusal: properties: - accountId: + applicationId: type: string - downloadUrl: + kind: + enum: + - project + - application type: string - expiresAt: - format: date-time + projectId: type: string - version: + reason: + type: string + repositoryId: type: string required: - - downloadUrl - - expiresAt - - accountId + - kind + - repositoryId + - reason type: object - EndpointsGetInfrastructureGraphOutput: + ModelsExecutionRecipeFileEdit: properties: - graph: - $ref: '#/components/schemas/GraphGraph' - version: + content: type: string - type: object - EndpointsGetInfrastructureGraphSummaryOutput: - properties: - accountCount: + operation: + enum: + - write + - delete + type: string + ordinal: type: integer - combinedGraphExpiresAt: - format: date-time + originalSha256: type: string - combinedGraphUrl: + path: type: string - graphInfo: - $ref: '#/components/schemas/EndpointsInfrastructureGraphInfo' - graphs: - items: - $ref: '#/components/schemas/EndpointsInfrastructureGraphDownloadInfo' - nullable: true - type: array - integrationStatus: - $ref: '#/components/schemas/EndpointsIntegrationStatus' - lastUpdated: - format: date-time + phase: type: string - totalEdgeCount: - type: integer - totalNodeCount: - type: integer - version: + reviewReason: + type: string + reviewVerdict: + enum: + - setup + - alters_behaviour + - unclear type: string required: - - integrationStatus - - graphs - - combinedGraphExpiresAt - - totalNodeCount - - totalEdgeCount - - accountCount - - lastUpdated + - phase + - ordinal + - path + - operation + - reviewVerdict type: object - EndpointsGetInfrastructureGraphVersionOutput: + ModelsExecutionRecipeReadiness: properties: - graph: - $ref: '#/components/schemas/GraphGraph' - version: + path: type: string + port: + type: integer + timeoutSeconds: + type: integer + required: + - port + - timeoutSeconds type: object - EndpointsGetLatestCloudReconScanOutput: - properties: - scan: - $ref: '#/components/schemas/EndpointsCloudReconScanMetadataDTO' - type: object - EndpointsGetLatestSBOMsOutput: + ModelsExecutionRecipeResolution: properties: - sboms: + commitSha: + type: string + compatibility: + enum: + - exact_commit + - input_hash + - unmatched + type: string + observedInputHash: + type: string + reason: + type: string + recipe: + $ref: '#/components/schemas/ModelsExecutionRecipe' + status: + enum: + - valid + - stale_with_last_known_good + - incompatible + - unavailable + type: string + trust: + enum: + - sandbox_only + type: string + unmetRequirements: items: - $ref: '#/components/schemas/ModelsCDXGenAtCommit' - nullable: true + type: string type: array - version: - type: string + required: + - status + - compatibility + - trust type: object - EndpointsGetMemoriesByTypeOutput: + ModelsExecutionRecipeStep: properties: - count: - format: int32 - type: integer - memories: + background: + type: boolean + command: + type: string + envNames: items: - $ref: '#/components/schemas/ModelsMemory' - nullable: true + type: string type: array - paginationToken: - nullable: true + expectedExitCode: + type: integer + id: type: string - version: + ordinal: + type: integer + phase: + enum: + - bootstrap + - build + - lint + - migrate + - test + - unit_test + - integration_test + - run + - readiness + - smoke + - shutdown + type: string + readinessProven: + type: boolean + requirements: + items: + type: string + type: array + timeoutSeconds: + type: integer + workingDir: type: string required: - - memories - - count + - phase + - ordinal + - command + - timeoutSeconds type: object - EndpointsGetMemoriesOutput: + ModelsExecutionRecipeValidation: properties: - count: + applicationId: + type: string + attemptCount: type: integer - memories: - items: - $ref: '#/components/schemas/ModelsMemory' + authorityRevision: + format: int64 + type: integer + completedAt: + format: date-time nullable: true - type: array - nextToken: + type: string + createdAt: + format: date-time + type: string + dueAt: + format: date-time + type: string + durationMs: + format: int64 + type: integer + executionArn: + type: string + failureCode: + type: string + id: + type: string + inputHash: + type: string + kind: + enum: + - project + - application + type: string + lastError: + type: string + projectId: + type: string + repositoryId: + type: string + sourceCommit: + type: string + startedAt: + format: date-time nullable: true type: string - version: + status: + enum: + - pending + - running + - succeeded + - failed type: string - required: - - memories - - count - type: object - EndpointsGetMemoryOutput: - properties: - memory: - $ref: '#/components/schemas/ModelsMemory' - version: + trigger: + enum: + - discovery + - manual type: string + required: + - id + - kind + - repositoryId + - trigger + - status + - dueAt + - attemptCount + - createdAt type: object - EndpointsGetMemoryVersionsOutput: + ModelsFrontendAssets: properties: - count: - format: int32 + apiEndpoints: + items: + type: string + type: array + exposedValues: type: integer - version: - type: string - versions: + routes: items: - $ref: '#/components/schemas/ModelsMemory' - nullable: true + type: string type: array - required: - - versions - - count type: object - EndpointsGetOrganizationOutput: + ModelsIdentitySubType: + enum: + - AWS_IAM_USER + - AWS_IAM_ROLE + - AWS_IAM_GROUP + - AWS_IAM_POLICY + - AWS_COGNITO_USER_POOL + - K8S_SERVICE_ACCOUNT + - K8S_ROLE + - K8S_ROLE_BINDING + - AZURE_ENTRA_ID + - AZURE_ROLE_ASSIGNMENT + - AZURE_MANAGED_IDENTITY + - AZURE_SERVICE_PRINCIPAL + - AZURE_APPLICATION + - AZURE_AD_USER + - AZURE_AD_GROUP + - GCP_SERVICE_ACCOUNT + - GCP_ROLE + type: string + ModelsLoadBalancerSubType: + enum: + - AWS_ALB + - AWS_NLB + - AWS_CLB + - AWS_TARGET_GROUP + - K8S_SERVICE + - K8S_INGRESS + - AZURE_APP_GATEWAY + - GCP_LB + type: string + ModelsManifestRangeSource: properties: - organization: - $ref: '#/components/schemas/ModelsOrgContext' - version: + filePath: type: string - type: object - EndpointsGetPipelineOutput: - properties: - pipeline: - $ref: '#/components/schemas/EndpointsPipelineSummary' - version: + range: type: string required: - - pipeline + - range type: object - EndpointsGetProjectActiveDepsOutput: + ModelsMemory: properties: - dependencies: + anchors: items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' - nullable: true + type: string type: array - numItems: - type: integer - version: + citations: + items: + $ref: '#/components/schemas/ModelsMemoryCitationsElem' + type: array + classification: + $ref: '#/components/schemas/ModelsMemoryClassification' + commentIds: + items: + type: string + type: array + confidence: + nullable: true + type: number + content: type: string - required: - - version - - numItems - - dependencies - type: object - EndpointsGetProjectExposureOutput: - properties: - numItems: - type: integer - version: + createdAt: + format: date-time type: string - windows: - items: - $ref: '#/components/schemas/ModelsDependencyWindow' + createdBy: nullable: true + type: string + crossReferences: + items: + $ref: '#/components/schemas/ModelsMemoryCrossReferencesElem' type: array - required: - - version - - numItems - - windows - type: object - EndpointsGetProjectOutput: - properties: - project: - $ref: '#/components/schemas/ModelsContextProject' - version: + eventTime: + format: date-time + nullable: true type: string - type: object - EndpointsGetProjectSchemaMetadataOutput: - properties: - downloadUrl: + id: type: string - format: - $ref: '#/components/schemas/ModelsSchemaFormat' - numEndpoints: + invalidateWhen: + $ref: '#/components/schemas/ModelsMemoryInvalidateWhen' + isUserCreated: + type: boolean + memoryClass: + $ref: '#/components/schemas/ModelsMemoryMemoryClass' + nullable: true + memoryLineage: + $ref: '#/components/schemas/ModelsMemoryMemoryLineage' + memoryType: + $ref: '#/components/schemas/ModelsMemoryMemoryType' + metadata: + $ref: '#/components/schemas/ModelsMemoryMetadata' + priority: + $ref: '#/components/schemas/ModelsMemoryPriority' + promptVersion: + nullable: true + type: string + questionId: + nullable: true + type: string + resourceId: + type: string + resourceType: + $ref: '#/components/schemas/ModelsMemoryResourceType' + retractedAt: + format: date-time + nullable: true + type: string + retractionReason: + nullable: true + type: string + scope: + $ref: '#/components/schemas/ModelsMemoryScope' + nullable: true + scopeResourceId: + nullable: true + type: string + searchability: + $ref: '#/components/schemas/ModelsMemorySearchability' + nullable: true + sourceEvent: + nullable: true + type: string + status: + $ref: '#/components/schemas/ModelsMemoryStatus' + nullable: true + support: + nullable: true type: integer - size: + tags: + items: + type: string + type: array + title: + nullable: true + type: string + trustTier: + nullable: true type: integer - type: - $ref: '#/components/schemas/ModelsSchemaType' - version: + updatedAt: + format: date-time + nullable: true type: string - required: - - type - - format - - size - - numEndpoints - - downloadUrl + version: + nullable: true + type: integer type: object - EndpointsGetProjectSchemaOutput: + ModelsMemoryCitationsElem: properties: - format: - $ref: '#/components/schemas/ModelsSchemaFormat' - schema: + citation_id: type: string - type: - $ref: '#/components/schemas/ModelsSchemaType' - version: + document_id: type: string - required: - - type - - format - - schema - type: object - EndpointsGetProjectSchemaRawOutput: - properties: - contentType: - description: MIME type of the file, e.g. application/json, application/yaml, text/plain + document_name: type: string - downloadUrl: - description: Presigned URL for the raw spec file (OpenAPI JSON/YAML, Proto, GraphQL SDL) + page: type: string - fileName: - description: Suggested filename, e.g. schema.openapi.json, schema.proto + title: + nullable: true type: string type: object - EndpointsGetPublicFacingAssetsOutput: + ModelsMemoryClassification: properties: - assets: + businessImpact: + $ref: '#/components/schemas/ModelsMemoryClassificationBusinessImpact' + nullable: true + computePlatforms: + items: + $ref: '#/components/schemas/ModelsMemoryClassificationComputePlatformsElem' + type: array + containsSensitiveData: + nullable: true + type: boolean + criticality: + $ref: '#/components/schemas/ModelsMemoryClassificationCriticality' + nullable: true + dataClassification: + $ref: '#/components/schemas/ModelsMemoryClassificationDataClassification' + nullable: true + environments: + items: + $ref: '#/components/schemas/ModelsMemoryClassificationEnvironmentsElem' + type: array + networkExposure: + $ref: '#/components/schemas/ModelsMemoryClassificationNetworkExposure' + nullable: true + organizationalEntityType: + $ref: '#/components/schemas/ModelsMemoryClassificationOrganizationalEntityType' + nullable: true + riskLevel: + $ref: '#/components/schemas/ModelsMemoryClassificationRiskLevel' + nullable: true + securityDomains: + items: + $ref: '#/components/schemas/ModelsMemoryClassificationSecurityDomainsElem' + type: array + systemTypes: items: - $ref: '#/components/schemas/EndpointsPublicAsset' + $ref: '#/components/schemas/ModelsMemoryClassificationSystemTypesElem' + type: array + type: object + ModelsMemoryClassificationBusinessImpact: + enum: + - CUSTOMER_FACING + - INTERNAL_OPERATIONS + - REVENUE_CRITICAL + - SUPPORT_FUNCTION + type: string + ModelsMemoryClassificationComputePlatformsElem: + enum: + - BARE_METAL + - CLOUD_FUNCTION + - CONTAINER + - DOCKER + - KUBERNETES + - SERVERLESS + - VIRTUAL_MACHINE + type: string + ModelsMemoryClassificationCriticality: + enum: + - CRITICAL + - HIGH + - LOW + - MEDIUM + type: string + ModelsMemoryClassificationDataClassification: + enum: + - CONFIDENTIAL + - INTERNAL + - PUBLIC + - RESTRICTED + type: string + ModelsMemoryClassificationEnvironmentsElem: + enum: + - DEVELOPMENT + - OTHER + - PREPRODUCTION + - PRODUCTION + - STAGING + - TEST + type: string + ModelsMemoryClassificationNetworkExposure: + enum: + - AIR_GAPPED + - INTERNAL_NETWORK + - ISOLATED + - PUBLIC_INTERNET + - VPN_ONLY + type: string + ModelsMemoryClassificationOrganizationalEntityType: + enum: + - BUSINESS_UNIT + - CONTRACTOR + - DEPARTMENT + - DIVISION + - EXTERNAL_PARTNER + - GROUP + - ROLE + - SERVICE_ACCOUNT + - TEAM + - USER + - VENDOR + type: string + ModelsMemoryClassificationRiskLevel: + enum: + - CRITICAL + - HIGH + - LOW + - MEDIUM + - MINIMAL + type: string + ModelsMemoryClassificationSecurityDomainsElem: + enum: + - APPLICATION_SECURITY + - CLOUD_SECURITY + - COMPLIANCE + - DATA_PROTECTION + - INCIDENT_RESPONSE + - INFRASTRUCTURE_SECURITY + - SECURITY_ARCHITECTURE + - SUPPLY_CHAIN_SECURITY + - THREAT_INTELLIGENCE + type: string + ModelsMemoryClassificationSystemTypesElem: + enum: + - API + - APPLICATION + - DATABASE + - ENDPOINT + - INFRASTRUCTURE + - SERVICE + type: string + ModelsMemoryCrossReferencesElem: + properties: + description: nullable: true - type: array - nextToken: type: string - required: - - assets + id: + type: string type: object - EndpointsGetRepoScanOutput: + ModelsMemoryInvalidateWhen: properties: - scan: - $ref: '#/components/schemas/EndpointsRepoScanSummary' - version: + anchor: + nullable: true type: string - required: - - scan + kind: + $ref: '#/components/schemas/ModelsMemoryInvalidateWhenKind' type: object - EndpointsGetReportStatusOutput: + ModelsMemoryInvalidateWhenKind: + enum: + - anchor_changed + type: string + ModelsMemoryMemoryClass: + enum: + - episodic + - procedural + - prospective + - retrieval + - semantic + type: string + ModelsMemoryMemoryLineage: properties: - error: - type: string - status: + agentVersion: + nullable: true type: string - url: + generationReason: + $ref: '#/components/schemas/ModelsMemoryMemoryLineageGenerationReason' + nullable: true + isLatest: + nullable: true + type: boolean + parentMemoryId: + nullable: true type: string - version: + parentSessionId: + nullable: true type: string - type: object - EndpointsGetRepositoriesOutput: - properties: - nextToken: + sessionId: type: string - numItems: - type: integer - repositories: - items: - $ref: '#/components/schemas/RepocontextRepoContext' + supersededBy: nullable: true - type: array - version: type: string - required: - - repositories - - numItems - - nextToken - type: object - EndpointsGetRepositoryOutput: - properties: - repository: - $ref: '#/components/schemas/RepocontextRepoContext' - version: + timestamp: + format: date-time type: string - required: - - repository type: object - EndpointsGetSBOMSOutput: + ModelsMemoryMemoryLineageGenerationReason: + enum: + - AGENT_UPGRADED + - DOCUMENT_UPDATED + - OTHER + - USER_TRIGGERED + type: string + ModelsMemoryMemoryType: + enum: + - ANALYSIS + - AUTOFIX + - BRANCH_NAMING_CONVENTION + - DISCOVERY + - ESCALATION + - FOLLOW_UP + - HISTORICAL + - KNOWLEDGE + - OTHER + - REMEDIATION + - TRIAGE + - VALIDATION + type: string + ModelsMemoryMetadata: properties: - sboms: - items: - $ref: '#/components/schemas/ModelsCDXGenAtCommit' + documentMetadata: + $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadata' + findingId: nullable: true - type: array - version: type: string - required: - - sboms type: object - EndpointsGetSBOMTreeOutput: + ModelsMemoryMetadataDocumentMetadata: properties: - repositories: - items: - $ref: '#/components/schemas/ModelsSBOMRepository' + documentDescription: nullable: true - type: array - tenantId: - type: string - tenantName: - type: string - version: - type: string - required: - - tenantId - - repositories - type: object - EndpointsGetVaultFileOutput: - properties: - createdAt: - format: date-time type: string documentId: + nullable: true type: string - fileId: - type: string - fileName: - type: string - filePresignedUrl: - type: string - uploaderId: + documentName: + nullable: true type: string - uploaderUsername: + documentType: + $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadataDocumentType' + nullable: true + documentVersion: + nullable: true type: string - version: + source: + nullable: true type: string - required: - - filePresignedUrl - - fileId - - fileName - - uploaderId - - uploaderUsername - - createdAt + structuralInfo: + $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadataStructuralInfo' type: object - EndpointsGetVaultFilesListOutput: + ModelsMemoryMetadataDocumentMetadataDocumentType: + enum: + - API_SPEC + - ARCHITECTURE + - AUDIT_REPORT + - COMPLIANCE_REPORT + - DOCUMENTATION + - OTHER + - POLICY + - SECURITY_REPORT + - TEST_RESULT + - VULNERABILITY_REPORT + type: string + ModelsMemoryMetadataDocumentMetadataStructuralInfo: properties: - files: - items: - $ref: '#/components/schemas/EndpointsVaultFileSimple' + encoding: nullable: true - type: array - version: type: string - required: - - files + sections: + items: + $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadataStructuralInfoSectionsElem' + type: array + totalCharacters: + nullable: true + type: integer + totalLines: + nullable: true + type: integer type: object - EndpointsGetVaultFilesOutput: + ModelsMemoryMetadataDocumentMetadataStructuralInfoSectionsElem: properties: - files: - items: - $ref: '#/components/schemas/EndpointsVaultFile' + endLine: + nullable: true + type: integer + name: + nullable: true + type: string + startLine: + nullable: true + type: integer + type: nullable: true - type: array - version: type: string - required: - - files type: object - EndpointsInfrastructureAccountInfo: + ModelsMemoryPriority: + enum: + - CRITICAL + - HIGH + - INFO + - LOW + - MEDIUM + type: string + ModelsMemoryResourceType: + enum: + - AGENT_REASONING + - APP_CONTEXT + - BUGHUNT_SCAN + - BUGHUNT_TRIAGE + - CHAT_SESSION + - CLOUD_CONTEXT + - CODE_AUTOFIX + - CODE_TRIAGE + - COMPLIANCE_FRAMEWORK + - CONTAINERS_TRIAGE + - DEPENDENCIES_AUTOFIX + - DEPENDENCIES_TRIAGE + - MANAGER_CAMPAIGN + - NETWORK_REACHABILITY + - ORGANIZATION + - ORG_CONTEXT + - OTHER + - PENTEST_AUTH_MATRIX + - PENTEST_EXPLOIT_ANALYSIS + - PENTEST_TOOLS + - PROJECT + - QUESTION_ANSWER + - REPO_CONTEXT + - SCHEMA_REVERSING + - SECRETS_TRIAGE + - SELF_HOSTED_INTEGRATION + - STANDOUT_ASSESSMENT + - TEAM + - USER + - VAULT + - VULNERABILITY_FINDING + type: string + ModelsMemoryScope: + enum: + - CLOUD + - ORGANIZATION + - REPOSITORY + type: string + ModelsMemorySearchability: + enum: + - EMBEDDING_FAILED + - LEXICAL_ONLY + - SEARCHABLE + type: string + ModelsMemoryStatus: + enum: + - active + - cancelled + - candidate + - completed + - quarantined + type: string + ModelsMessagingSubType: + enum: + - AWS_SQS + - AWS_SNS + - AWS_KINESIS + - AWS_EVENTBRIDGE + - AWS_SES + - AWS_MSK + - AWS_MQ + - GCP_PUBSUB + - AZURE_SERVICE_BUS + - AZURE_EVENT_HUB + - AZURE_EVENT_GRID + - AZURE_IOT_HUB + type: string + ModelsNetworkSubType: + enum: + - AWS_VPC + - AWS_SUBNET + - AWS_NAT_GATEWAY + - AWS_INTERNET_GATEWAY + - AWS_VPC_ENDPOINT + - AWS_ROUTE_TABLE + - AWS_EIP + - GCP_VPC + - GCP_CLOUD_NAT + - AZURE_VNET + - AZURE_SUBNET + type: string + ModelsObservabilitySubType: + enum: + - AWS_CLOUDWATCH_LOG_GROUP + - AWS_CLOUDWATCH_ALARM + - AWS_CLOUDWATCH_DASHBOARD + - AWS_X_RAY + - GCP_STACKDRIVER + - GCP_LOGGING + - AZURE_MONITOR + - AZURE_AUTOMATION + type: string + ModelsOrgContext: properties: - accountId: - type: string - accountName: + bugBountyProgram: + $ref: '#/components/schemas/ModelsOrgContextBugBountyProgram' + cacheKey: + nullable: true type: string - accountType: + complianceRequirements: + items: + type: string + type: array + description: type: string - cloudProvider: + detailedOverview: + nullable: true type: string - edgeCount: - type: integer - graphFilePath: + documentCitations: + items: + $ref: '#/components/schemas/ModelsOrgContextDocumentCitationsElem' + type: array + escalationPolicies: + items: + $ref: '#/components/schemas/ModelsEscalationPolicy' + type: array + industries: + items: + $ref: '#/components/schemas/ModelsOrgContextIndustriesElem' + nullable: true + type: array + name: type: string - hasApiGateway: - type: boolean - hasCloudFrontCdn: - type: boolean - hasCloudFunctions: - type: boolean - hasCloudRunServices: - type: boolean - hasCrossAccountRefs: - type: boolean - hasDatabases: - type: boolean - hasEcsServices: - type: boolean - hasEksClusters: - type: boolean - hasGceInstances: - type: boolean - hasGkeClusters: - type: boolean - hasK8sClusters: - type: boolean - hasLambdaFunctions: - type: boolean - hasPublicAlb: - type: boolean - hasPublicNlb: - type: boolean - hasRoute53Dns: - type: boolean - hasTransitGateway: + notes: + items: + $ref: '#/components/schemas/ModelsMemory' + type: array + onboarded: + nullable: true type: boolean - internalServiceCount: - type: integer - nodeCount: - type: integer - publicEndpointCount: - type: integer - regions: + otherIndustries: items: type: string - nullable: true type: array - services: + products: items: - type: string + $ref: '#/components/schemas/ModelsOrgContextProductsElem' + type: array + questionnaire: + $ref: '#/components/schemas/ModelsSecurityOnboardingAnswers' + timeZone: nullable: true + type: string + vaultFiles: + items: + $ref: '#/components/schemas/ModelsOrgContextVaultFilesElem' type: array - required: - - accountId - - accountType - - nodeCount - - edgeCount - - regions - - services - - hasPublicAlb - - hasPublicNlb - - hasEcsServices - - hasEksClusters - - hasLambdaFunctions - - hasTransitGateway - - hasCrossAccountRefs - - hasCloudFrontCdn - - hasRoute53Dns - - hasApiGateway - - hasDatabases - - publicEndpointCount - - internalServiceCount type: object - EndpointsInfrastructureCrossAccountConnection: + ModelsOrgContextBugBountyProgram: properties: - connectionCount: - type: integer - connectionType: + type: + $ref: '#/components/schemas/ModelsOrgContextBugBountyProgramType' + url: + nullable: true type: string - sourceAccountId: + type: object + ModelsOrgContextBugBountyProgramType: + enum: + - bugcrowd + - document + - hackerone + - none + - website + type: string + ModelsOrgContextDocumentCitationsElem: + properties: + citation_id: type: string - sourceAccountType: + document_id: + nullable: true type: string - targetAccountId: + document_name: + nullable: true type: string - targetAccountType: + page: + nullable: true + type: string + source_type: + $ref: '#/components/schemas/ModelsOrgContextDocumentCitationsElemSourceType' + title: + nullable: true type: string - required: - - sourceAccountId - - targetAccountId - - connectionType - - connectionCount type: object - EndpointsInfrastructureCrossAccountStatistics: + ModelsOrgContextDocumentCitationsElemSourceType: + enum: + - document + - questionnaire + type: string + ModelsOrgContextIndustriesElem: + enum: + - AGRICULTURE + - CONSTRUCTION + - EDUCATION + - ENERGY + - ENTERTAINMENT + - FINANCIAL_SERVICES + - GOVERNMENT + - HEALTHCARE + - INFORMATION_TECHNOLOGY + - INSURANCE_SERVICES + - LOGISTICS + - MANUFACTURING + - MINING + - OTHER + - PROFESSIONAL_SERVICES + - REAL_ESTATE + - RETAIL + - TECHNOLOGY + type: string + ModelsOrgContextProductsElem: properties: - crossAccountConnections: - items: - $ref: '#/components/schemas/EndpointsInfrastructureCrossAccountConnection' - type: array - crossAccountEdgesCreated: - type: integer - hasCrossAccountReferences: - type: boolean - orphanedReferences: - type: integer - referencesByType: - additionalProperties: - type: integer - nullable: true - type: object - totalReferences: - type: integer - validatedReferences: - type: integer - required: - - hasCrossAccountReferences - - totalReferences - - validatedReferences - - orphanedReferences - - referencesByType - - crossAccountEdgesCreated + description: + type: string + name: + type: string + productType: + $ref: '#/components/schemas/ModelsOrgContextProductsElemProductType' + url: + type: string type: object - EndpointsInfrastructureEdgeStatistics: + ModelsOrgContextProductsElemProductType: + enum: + - B2B_ON_PREMISE + - B2B_SAAS + - B2B_SAAS_OSS + - B2C_SAAS + - DESKTOP_APPLICATION + - E_COMMERCE + - MARKETPLACE + - MEDIA_STREAMING + - SOCIAL + type: string + ModelsOrgContextVaultFilesElem: properties: - bidirectionalEdges: - type: integer - edgesByType: - additionalProperties: - type: integer - nullable: true - type: object - totalEdges: - type: integer - unidirectionalEdges: - type: integer + content: + type: string + description: + type: string + documentId: + type: string + fileName: + type: string + type: object + ModelsPipelinesSubType: + enum: + - GITHUB_ACTIONS + - GITLAB_CI + - JENKINS + - CIRCLECI + - BUILDKITE + - AZURE_PIPELINES + type: string + ModelsProjectSummary: + properties: + description: + type: string + id: + type: string + isDeleted: + type: boolean + name: + type: string + path: + type: string + pathPrefix: + type: string + repositoryId: + type: string required: - - totalEdges - - edgesByType - - bidirectionalEdges - - unidirectionalEdges + - id + - name + - repositoryId + - path + - pathPrefix + - description + - isDeleted type: object - EndpointsInfrastructureGraphDownloadInfo: + ModelsProjectsSubType: + enum: + - REPO_CONTEXT_PROJECT + type: string + ModelsReposSubType: + enum: + - GITHUB_REPO + - GITLAB_REPO + - BITBUCKET_REPO + - AZURE_REPO + type: string + ModelsSBOMPackageAuth: properties: - accountId: - type: string - downloadUrl: + credential: + enum: + - rejected + - absent + - unknown type: string - edgeCount: - type: integer - expiresAt: - format: date-time + dir: type: string - generatedAt: - format: date-time + ecosystem: type: string - graphId: + evidence: type: string - graphType: + registry: type: string - nodeCount: - type: integer - region: + tool: type: string version: - type: string - required: - - accountId - - downloadUrl - - expiresAt - - nodeCount - - edgeCount - - generatedAt + type: integer type: object - EndpointsInfrastructureGraphInfo: + ModelsSBOMProject: properties: - accountsInfo: + commits: items: - $ref: '#/components/schemas/EndpointsInfrastructureAccountInfo' + type: string nullable: true type: array - crossAccountStatistics: - $ref: '#/components/schemas/EndpointsInfrastructureCrossAccountStatistics' - edgeStatistics: - $ref: '#/components/schemas/EndpointsInfrastructureEdgeStatistics' - metadata: - $ref: '#/components/schemas/EndpointsInfrastructureGraphInfoMetadata' - nodeStatistics: - $ref: '#/components/schemas/EndpointsInfrastructureNodeStatistics' - validationResults: - $ref: '#/components/schemas/EndpointsInfrastructureValidationResults' + projectId: + type: string + projectName: + type: string required: - - metadata - - nodeStatistics - - edgeStatistics - - accountsInfo - - crossAccountStatistics - - validationResults + - projectId + - commits type: object - EndpointsInfrastructureGraphInfoMetadata: + ModelsSBOMProvenance: properties: - destinationBucket: - type: string - generatedAt: - format: date-time + backend: type: string - generatedBy: - type: string - graphType: + cdxgenVersion: type: string - id: + imageDigest: type: string - isCombinedGraph: - type: boolean - processingDuration: + sandboxJobId: type: string - sourceBucket: + type: object + ModelsSBOMRepository: + properties: + projects: + items: + $ref: '#/components/schemas/ModelsSBOMProject' + nullable: true + type: array + repositoryId: type: string - version: + repositoryName: type: string required: - - id - - version - - generatedAt - - generatedBy - - processingDuration - - sourceBucket - - isCombinedGraph - - graphType + - repositoryId + - projects type: object - EndpointsInfrastructureGraphSummary: + ModelsSBOMScope: properties: - accountId: + dir: type: string - edgeCount: - type: integer - generatedAt: - format: date-time + ecosystems: + items: + type: string + type: array + path: type: string - generatedBy: + reason: type: string - graphId: + type: object + ModelsSchemaFormat: + enum: + - JSON + - PROTO + - SDL + - TEXT + - WSDL + - YAML + type: string + ModelsSchemaType: + enum: + - GRAPHQL + - GRPC + - OPENAPI + - SOAP + type: string + ModelsSecurityOnboardingAnswers: + properties: + additionalNotes: + nullable: true type: string - graphType: + companyName: type: string - lastModified: - format: date-time + complianceStandards: + items: + type: string + type: array + coreProductsServices: type: string - nodeCount: - type: integer - region: + dataTypes: + items: + type: string + type: array + files: + items: + $ref: '#/components/schemas/ModelsSecurityOnboardingAnswersFilesElem' + type: array + impactConcerns: + items: + type: string + type: array + perceivedThreatActors: + items: + type: string + type: array + type: object + ModelsSecurityOnboardingAnswersFilesElem: + properties: + content: type: string - s3Key: + description: type: string - tags: - additionalProperties: - type: string - type: object - version: + fileName: type: string - required: - - accountId - - graphId - - version - - nodeCount - - edgeCount - - graphType - - generatedAt - - generatedBy - - lastModified type: object - EndpointsInfrastructureNodeStatistics: + ModelsSecurityProfile: properties: - nodesByAccount: - additionalProperties: - type: integer - nullable: true - type: object - nodesByObjectType: - additionalProperties: - type: integer - nullable: true - type: object - nodesByRegion: - additionalProperties: - type: integer - nullable: true - type: object - nodesBySubType: - additionalProperties: - type: integer + exposedSecrets: nullable: true - type: object - nodesByType: - additionalProperties: - type: integer + type: integer + recommendations: + items: + type: string + type: array + riskScore: nullable: true - type: object - totalNodes: type: integer - required: - - totalNodes - - nodesByObjectType - - nodesByType - - nodesBySubType - - nodesByRegion - - nodesByAccount type: object - EndpointsInfrastructureValidationCheck: + ModelsSecuritySubType: + enum: + - AWS_SECURITY_GROUP + - AWS_NACL + - AWS_WAF + - AWS_KMS + - AWS_SECRETS_MANAGER + - AWS_ACM + - AWS_GUARD_DUTY + - AWS_CONFIG + - AWS_CLOUDTRAIL + - AWS_SSM + - AZURE_KEY_VAULT + - AZURE_DEFENDER + - AZURE_NSG + - AZURE_POLICY + - GCP_KMS + - GCP_SECRET_MANAGER + - GCP_SCC + - GCP_ORG_POLICY + - GCP_POLICY_ANALYZER + type: string + ModelsServerlessSubType: + enum: + - AWS_LAMBDA + - AWS_STEP_FUNCTION + - AWS_APP_RUNNER + - GCP_CLOUD_FUNCTION + - GCP_CLOUD_RUN + - AZURE_FUNCTION + - AZURE_LOGIC_APPS + - GCP_APP_ENGINE + type: string + ModelsSharedInfrastructureRef: properties: - details: + componentId: type: string name: type: string - passed: - type: boolean + repositoryId: + type: string + type: + type: string required: + - componentId - name - - passed + - type type: object - EndpointsInfrastructureValidationResults: + ModelsStorageAndBackupSubType: + enum: + - AWS_S3_BUCKET + - AWS_EBS_VOLUME + - AWS_EFS + - AWS_BACKUP_VAULT + - AWS_STORAGE_GATEWAY + - GCP_GCS_BUCKET + - GCP_PD + - GCP_FILESTORE + - AZURE_BLOB + - AZURE_DISK + - AZURE_FILES + - AZURE_STORAGE_ACCOUNT + type: string + RepocontextAPISchema: properties: - checks: - items: - $ref: '#/components/schemas/EndpointsInfrastructureValidationCheck' + content: nullable: true - type: array - errorCount: - type: integer - errors: + type: string + format: + $ref: '#/components/schemas/RepocontextAPISchemaFormat' + name: + type: string + origin: + $ref: '#/components/schemas/RepocontextAPISchemaOrigin' + nullable: true + path: + nullable: true + type: string + type: + $ref: '#/components/schemas/RepocontextAPISchemaType' + version: + nullable: true + type: string + type: object + RepocontextAPISchemaFormat: + enum: + - JSON + - PROTO + - SDL + - TEXT + - XML + - YAML + type: string + RepocontextAPISchemaOrigin: + enum: + - discovered + - generated + type: string + RepocontextAPISchemaType: + enum: + - ASYNCAPI + - GRAPHQL + - GRPC + - INSOMNIA + - OPENAPI + - POSTMAN + - RAML + - SWAGGER + - WADL + type: string + RepocontextAccountInfrastructureSummary: + properties: + accountId: + type: string + accountType: + $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryAccountType' + capabilities: + $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryCapabilities' + computeServices: items: - type: string + $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryComputeServicesElem' type: array - isValid: - type: boolean - warningCount: + internetFacingServiceCount: + nullable: true type: integer - warnings: + narrative: + nullable: true + type: string + regions: items: type: string type: array - required: - - isValid - - errorCount - - warningCount - - checks + totalComputeServices: + nullable: true + type: integer type: object - EndpointsIntegrationStatus: + RepocontextAccountInfrastructureSummaryAccountType: enum: - - pending - - ready + - development + - network_services + - production + - staging type: string - EndpointsListArtifactDeploymentsOutput: + RepocontextAccountInfrastructureSummaryCapabilities: properties: - deployments: - items: - $ref: '#/components/schemas/EndpointsArtifactDeploymentSummary' + hasApiGateway: nullable: true - type: array - nextToken: + type: boolean + hasCdn: nullable: true - type: string - version: - type: string - required: - - deployments + type: boolean + hasContainerServices: + nullable: true + type: boolean + hasCrossAccountReferences: + nullable: true + type: boolean + hasDatabases: + nullable: true + type: boolean + hasDns: + nullable: true + type: boolean + hasKubernetes: + nullable: true + type: boolean + hasLoadBalancers: + nullable: true + type: boolean + hasServerlessFunctions: + nullable: true + type: boolean + hasTransitGateway: + nullable: true + type: boolean type: object - EndpointsListArtifactsOutput: + RepocontextAccountInfrastructureSummaryComputeServicesElem: properties: - artifacts: - items: - $ref: '#/components/schemas/EndpointsArtifactSummary' - nullable: true - type: array - nextToken: + computeType: + $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryComputeServicesElemComputeType' + internetFacing: + type: boolean + name: + type: string + region: nullable: true type: string - version: + trafficFlow: + nullable: true type: string - required: - - artifacts type: object - EndpointsListEntrypointsOutput: + RepocontextAccountInfrastructureSummaryComputeServicesElemComputeType: + enum: + - container_service + - kubernetes_workload + - other + - serverless_function + - virtual_machine + type: string + RepocontextArtifactLink: properties: - entrypoints: - items: - $ref: '#/components/schemas/EndpointsEntrypointSummary' + artifactId: + type: string + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + description: + type: string + entrypointId: nullable: true + type: string + evidencePaths: + items: + type: string type: array - nextToken: + matchMethod: + $ref: '#/components/schemas/RepocontextArtifactLinkMatchMethod' + projectId: nullable: true type: string - version: + reasoning: + nullable: true type: string - required: - - entrypoints - type: object - EndpointsListInfrastructureGraphVersionsOutput: - properties: - accountId: + targetKind: + $ref: '#/components/schemas/RepocontextArtifactLinkTargetKind' + targetNodeId: + nullable: true type: string - count: - type: integer - version: + targetRef: type: string - versions: - items: - type: string + workloadFamily: nullable: true - type: array - required: - - accountId - - versions - - count + type: string type: object - EndpointsListInfrastructureGraphsOutput: + RepocontextArtifactLinkCoverage: properties: - count: - type: integer - graphs: + projects: items: - $ref: '#/components/schemas/EndpointsInfrastructureGraphSummary' + $ref: '#/components/schemas/RepocontextProjectArtifactLinkCoverage' nullable: true type: array - version: - type: string - required: - - graphs - - count + unreadInputs: + items: + type: string + type: array type: object - EndpointsListPipelinesOutput: + RepocontextArtifactLinkMatchMethod: + enum: + - affinity_hint + - build_config + - ci_pipeline + - container_image_name + - container_image_uri + - manual_label + - other + - registry_reference + - service_name_match + type: string + RepocontextArtifactLinkTargetKind: + enum: + - graph_node + - infrastructure_resource + - registry + - workload + type: string + RepocontextAuthenticationGrounding: properties: - nextToken: - nullable: true - type: string - pipelines: + coverage: + $ref: '#/components/schemas/RepocontextAuthenticationGroundingCoverage' + heldMethods: items: - $ref: '#/components/schemas/EndpointsPipelineSummary' - nullable: true + type: string type: array - version: - type: string - required: - - pipelines + scope: + $ref: '#/components/schemas/RepocontextAuthenticationGroundingScope' type: object - EndpointsListRepoScansOutput: + RepocontextAuthenticationGroundingCoverage: + enum: + - partial + - unavailable + - unknown + type: string + RepocontextAuthenticationGroundingScope: + enum: + - declared-source + type: string + RepocontextBuildAssessment: properties: - page: - type: integer - pageSize: - type: integer - scans: + completion: + $ref: '#/components/schemas/RepocontextBuildAssessmentCompletion' + gaps: items: - $ref: '#/components/schemas/EndpointsRepoScanSummary' + $ref: '#/components/schemas/RepocontextBuildCoverageGap' nullable: true type: array - total: - type: integer - version: - type: string - required: - - scans - - total - - page - - pageSize type: object - EndpointsListRepositoryProjectsOutput: + RepocontextBuildAssessmentCompletion: + enum: + - complete + - incomplete + - unknown + type: string + RepocontextBuildCoverage: properties: - nextToken: - nullable: true - type: string + formatVersion: + type: integer projects: items: - $ref: '#/components/schemas/ModelsProjectSummary' + $ref: '#/components/schemas/RepocontextProjectBuildCoverage' nullable: true type: array - version: + repository: + $ref: '#/components/schemas/RepocontextBuildAssessment' + sourceCommit: type: string - required: - - projects type: object - EndpointsListSchemasOutput: + RepocontextBuildCoverageGap: properties: - schemas: - items: - $ref: '#/components/schemas/EndpointsSchemaSummary' - nullable: true - type: array - version: + path: type: string - required: - - schemas + reason: + $ref: '#/components/schemas/RepocontextBuildCoverageGapReason' type: object - EndpointsNetworkPathDTO: + RepocontextBuildCoverageGapReason: + enum: + - ambiguous_owner + - identity_changed + - invalid_source + - limit_exceeded + - missing_publish + - unknown_predicate + - unreadable_source + - unresolved_input + - unsupported_route + type: string + RepocontextBuildOwnership: properties: - description: + baseImages: + $ref: '#/components/schemas/RepocontextContainerBaseImages' + buildContext: type: string - edges: + dockerfile: + type: string + evidencePaths: items: - $ref: '#/components/schemas/GraphEdge' + type: string nullable: true type: array - nodeIds: + image: + type: string + sourcePaths: items: type: string nullable: true type: array - pathId: + sourceRepository: type: string - reachesInternet: - type: boolean - startNodeId: + supportingContexts: + items: + type: string + nullable: true + type: array + target: type: string - startNodeType: + variant: type: string - required: - - pathId - - edges - - nodeIds - - startNodeId - - startNodeType - - reachesInternet type: object - EndpointsPackageFilter: + RepocontextBusinessFunction: properties: - ecosystem: + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + description: type: string - package: + id: type: string - version: + name: + type: string + ownedPaths: + items: + type: string + type: array + reasoning: + nullable: true type: string - required: - - ecosystem - - package - - version - type: object - EndpointsPatchContextApplicationInput: - properties: - application: - $ref: '#/components/schemas/ModelsAppContextSeed' - required: - - application type: object - EndpointsPatchContextApplicationOutput: + RepocontextCallEdge: properties: - application: - $ref: '#/components/schemas/ModelsApplication' - message: + callSiteFilePath: type: string - version: + callSiteLine: + type: integer + calleeQualifiedName: type: string - required: - - message - type: object - EndpointsPatchMemoryInput: - properties: - citations: - items: - $ref: '#/components/schemas/ModelsMemoryCitationsElem' - type: array - confidence: + calleeSymbolId: nullable: true - type: number - content: + type: string + callerQualifiedName: + type: string + callerSymbolId: + nullable: true + type: string + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + detector: nullable: true type: string - createNewVersion: + id: + type: string + isExternal: nullable: true type: boolean - crossReferences: - items: - $ref: '#/components/schemas/ModelsMemoryCrossReferencesElem' - type: array - metadata: - $ref: '#/components/schemas/ModelsMemoryMetadata' - parentNoteId: + kind: + $ref: '#/components/schemas/RepocontextCallEdgeKind' + language: + $ref: '#/components/schemas/LanguageCodeLanguage' nullable: true - type: string - priority: - $ref: '#/components/schemas/ModelsMemoryPriority' + projectId: nullable: true - tags: + type: string + type: object + RepocontextCallEdgeKind: + enum: + - callback + - direct + - dynamic + - framework + - interface + - method + - virtual + type: string + RepocontextCodeConvention: + properties: + category: + $ref: '#/components/schemas/RepocontextCodeConventionCategory' + description: + type: string + evidencePaths: items: type: string type: array - title: + scope: nullable: true type: string type: object - EndpointsPatchMemoryOutput: - properties: - memory: - $ref: '#/components/schemas/ModelsMemory' - version: - type: string - type: object - EndpointsPatchRepoScanInput: + RepocontextCodeConventionCategory: + enum: + - API_DESIGN + - ARCHITECTURE + - CODE_STYLE + - DATA_ACCESS + - DEPENDENCY_MANAGEMENT + - ERROR_HANDLING + - NAMING + - OBSERVABILITY + - OTHER + - RELEASE_PROCESS + - SECURITY + - TESTING + type: string + RepocontextCodeSymbol: properties: - completedAt: - format: date-time + endLine: nullable: true + type: integer + filePath: type: string - errorMessage: - type: string - projectsTouched: - items: - $ref: '#/components/schemas/EndpointsRepoScanProjectTouched' - type: array - sbomsGenerated: - items: - $ref: '#/components/schemas/EndpointsRepoScanSBOMGenerated' - type: array - status: + id: type: string - subagentsRun: - additionalProperties: - $ref: '#/components/schemas/EndpointsRepoScanSubagent' - type: object - type: object - EndpointsPatchRepoScanOutput: - properties: - scan: - $ref: '#/components/schemas/EndpointsRepoScanSummary' - version: + kind: + $ref: '#/components/schemas/RepocontextCodeSymbolKind' + language: + $ref: '#/components/schemas/LanguageCodeLanguage' + nullable: true + name: type: string - required: - - scan - type: object - EndpointsPatchVaultFileInput: - properties: - documentId: + parentSymbolId: + nullable: true type: string - metadata: - additionalProperties: {} - type: object - processedAt: + qualifiedName: + nullable: true type: string - type: object - EndpointsPatchVaultFileOutput: - properties: - message: + signature: + nullable: true type: string - success: - type: boolean - version: + startLine: + type: integer + summary: + nullable: true type: string - required: - - success - - message + visibility: + $ref: '#/components/schemas/RepocontextCodeSymbolVisibility' + nullable: true type: object - EndpointsPipelineJobSummary: + RepocontextCodeSymbolKind: + enum: + - class + - constant + - enum + - function + - interface + - macro + - method + - module + - type + - variable + type: string + RepocontextCodeSymbolVisibility: + enum: + - internal + - private + - protected + - public + type: string + RepocontextComplianceFramework: + enum: + - APRA-CPS-234 + - CCPA + - CIS + - FEDRAMP + - GDPR + - GLBA + - HIPAA + - HITRUST + - ISO27001 + - ISO27017 + - ISO27018 + - LGPD + - NIST + - NIST-800-53 + - NIST-CSF + - OTHER + - PCI-DSS + - PIPEDA + - SOC2 + - SOX + type: string + RepocontextConfidence: + enum: + - confirmed + - high + - low + - medium + - speculative + type: string + RepocontextContainerBaseImages: properties: - name: - type: string - runsOn: + dockerfileSha256: type: string - steps: + images: items: - $ref: '#/components/schemas/EndpointsPipelineStepSummary' + type: string nullable: true type: array type: object - EndpointsPipelineStepSummary: - properties: - command: - type: string - description: - type: string - name: - type: string - uses: - type: string - type: object - EndpointsPipelineSummary: + RepocontextCoverageGap: properties: - artifactIds: + accountIds: items: type: string + nullable: true type: array - createdAt: - format: date-time - type: string - deletedAt: - format: date-time + action: nullable: true type: string - filePath: + effect: + $ref: '#/components/schemas/RepocontextCoverageGapEffect' + nullable: true + image: + nullable: true type: string - id: + kind: + $ref: '#/components/schemas/RepocontextCoverageGapKind' + missing: + nullable: true type: string - isDeleted: - type: boolean - jobs: + pathNodeIds: items: - $ref: '#/components/schemas/EndpointsPipelineJobSummary' + type: string + nullable: true type: array - metadata: - additionalProperties: {} - type: object - name: - type: string - platform: + reason: type: string - projectId: + region: + nullable: true type: string - repositoryId: + resourceId: type: string - runsOnPr: - type: boolean - triggers: - items: - $ref: '#/components/schemas/EndpointsPipelineTriggerSummary' - type: array - updatedAt: - format: date-time + resourceType: + nullable: true type: string type: object - EndpointsPipelineTriggerSummary: + RepocontextCoverageGapEffect: + enum: + - informational + - lowers_confidence + type: string + RepocontextCoverageGapKind: + enum: + - transit_gateway + - uncollected_resource + - unscanned_account + - unverified_proxy + - vpc_peering + - vpn_or_direct_connect + type: string + RepocontextDataClassification: + enum: + - confidential + - highly_confidential + - internal + - public + - restricted + type: string + RepocontextDataDomain: properties: - branches: + availabilityRequirement: + $ref: '#/components/schemas/RepocontextImpactLevel' + nullable: true + complianceFrameworks: items: - type: string + $ref: '#/components/schemas/RepocontextComplianceFramework' type: array - cron: + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + description: type: string - paths: + evidence: + items: + $ref: '#/components/schemas/RepocontextRepoContextEvidence' + type: array + examplePaths: items: type: string type: array - type: - type: string - type: object - EndpointsPostCloudReconScanInput: - properties: - accountId: - type: string - completedAt: - format: date-time - type: string - modelName: - type: string - payload: - format: base64 - type: string - provider: - type: string - scanId: - type: string - schemaVersion: - type: string - startedAt: - format: date-time - type: string - required: - - accountId - - provider - - startedAt - - schemaVersion - - payload - type: object - EndpointsPostCloudReconScanOutput: - properties: - hotspotCount: - type: integer - nodeCount: - type: integer - s3Bucket: + id: type: string - s3Key: + integrityRequirement: + $ref: '#/components/schemas/RepocontextImpactLevel' + nullable: true + name: type: string - scanId: + piiCategories: + items: + $ref: '#/components/schemas/RepocontextDataDomainPiiCategoriesElem' + type: array + reasoning: + nullable: true type: string + sensitivity: + $ref: '#/components/schemas/RepocontextDataDomainSensitivity' type: object - EndpointsPostContextApplicationInput: - properties: - application: - $ref: '#/components/schemas/ModelsAgentAppContextSeed' - required: - - application - type: object - EndpointsPostContextApplicationOutput: + RepocontextDataDomainPiiCategoriesElem: + enum: + - CREDENTIALS + - EMAIL + - FINANCIAL + - HEALTH + - NAME + - OTHER + - SSN + type: string + RepocontextDataDomainSensitivity: + enum: + - CRITICAL + - HIGH + - LOW + - MODERATE + type: string + RepocontextDataFlow: properties: - application: - $ref: '#/components/schemas/ModelsApplication' - message: - type: string - version: + accessPattern: + $ref: '#/components/schemas/RepocontextDataFlowAccessPattern' + nullable: true + cloudReconDataFlowId: + nullable: true type: string - required: - - message - type: object - EndpointsPostMemoryInput: - properties: - citations: + codeHops: items: - $ref: '#/components/schemas/ModelsMemoryCitationsElem' + $ref: '#/components/schemas/RepocontextDataflowHop' type: array confidence: - nullable: true - type: number - content: - type: string - createdBy: - nullable: true - type: string - crossReferences: + $ref: '#/components/schemas/RepocontextConfidence' + crossedBoundaryIds: items: - $ref: '#/components/schemas/ModelsMemoryCrossReferencesElem' + type: string type: array - isUserCreated: - nullable: true - type: boolean - memoryType: - $ref: '#/components/schemas/ModelsMemoryMemoryType' - metadata: - $ref: '#/components/schemas/ModelsMemoryMetadata' - parentNoteId: + dataClassification: + $ref: '#/components/schemas/RepocontextDataClassification' + nullable: true + dataDomainIds: + items: + type: string + type: array + description: nullable: true type: string - priority: - $ref: '#/components/schemas/ModelsMemoryPriority' + entrypointId: nullable: true - resourceId: type: string - resourceType: - $ref: '#/components/schemas/ModelsMemoryResourceType' - tags: + evidencePaths: items: type: string type: array - title: + exposure: + $ref: '#/components/schemas/RepocontextExposureLevel' nullable: true + id: type: string - required: - - memoryType - - content - type: object - EndpointsPostMemoryOutput: - properties: - memory: - $ref: '#/components/schemas/ModelsMemory' - version: - type: string - type: object - EndpointsPostProjectSchemaInput: - properties: - content: - type: string - format: - $ref: '#/components/schemas/ModelsSchemaFormat' - type: - $ref: '#/components/schemas/ModelsSchemaType' - required: - - type - - format - - content - type: object - EndpointsPostProjectSchemaOutput: - properties: - message: - type: string - version: - type: string - required: - - message - type: object - EndpointsPostRAGResyncOutput: - properties: - message: + infraConnections: + $ref: '#/components/schemas/RepocontextDataFlowInfraConnections' + name: type: string - success: - type: boolean - required: - - success - - message - type: object - EndpointsPostReportInput: - properties: - packages: - description: List of packages to filter (ecosystem, package, version) + pathEdgeTypes: items: - $ref: '#/components/schemas/EndpointsPackageFilter' - nullable: true + $ref: '#/components/schemas/GraphEdgeType' type: array - repositories: - description: Optional list of repository IDs to filter. If empty, searches all repositories. + pathNodeIds: items: type: string type: array - required: - - packages - type: object - EndpointsPostReportOutput: - properties: - jobId: - type: string - version: - type: string - required: - - jobId - type: object - EndpointsPostSBOMGenerateInput: - properties: - cloneUrl: - type: string - commitSha: - type: string - defaultBranch: - type: string - repositoryId: + projectId: + nullable: true type: string - required: - - repositoryId + protections: + items: + $ref: '#/components/schemas/RepocontextDataFlowProtectionsElem' + type: array + sink: + $ref: '#/components/schemas/RepocontextDataFlowSink' + source: + $ref: '#/components/schemas/RepocontextDataFlowSource' + sourceSinkIds: + items: + type: string + type: array + validationApplied: + $ref: '#/components/schemas/RepocontextDataFlowValidationApplied' + nullable: true type: object - EndpointsPostSBOMGenerateOutput: + RepocontextDataFlowAccessPattern: + enum: + - DELETE + - OTHER + - PUBLISH + - READ + - READ_WRITE + - SUBSCRIBE + - WRITE + type: string + RepocontextDataFlowInfraConnections: properties: - repositoryId: - type: string - status: - type: string - version: + fullPath: + nullable: true type: string + internalPath: + $ref: '#/components/schemas/RepocontextInfraPath' + internetPath: + $ref: '#/components/schemas/RepocontextInfraPath' + sinkPath: + $ref: '#/components/schemas/RepocontextInfraPath' type: object - EndpointsPostSBOMResolveInput: + RepocontextDataFlowProtectionsElem: + enum: + - ACCESS_CONTROLLED + - ANONYMIZED + - ENCRYPTED_AT_REST + - ENCRYPTED_IN_TRANSIT + - HASHED + - NONE_OBSERVED + - REDACTED + - SIGNED + - TOKENIZED + type: string + RepocontextDataFlowSink: properties: - branch: - type: string - cdxgenMajor: - type: integer - cloneURL: + description: + nullable: true type: string - commitSHA: + identifier: + nullable: true type: string - isDefaultBranchPush: + isExternal: + nullable: true type: boolean - lockfileSetHash: - type: string - ownerProvider: - $ref: '#/components/schemas/ModelsOwnerProvider' - repositoryID: - type: string - repositoryProvider: - $ref: '#/components/schemas/ModelsGitRepositoryProvider' - scannerVersion: - type: string - tenantID: - type: string - timestamp: - type: string - type: object - EndpointsPostSBOMResolveOutput: - properties: - components: - type: integer - sbomS3Key: + kind: + $ref: '#/components/schemas/RepocontextDataFlowSinkKind' + nodeId: + nullable: true type: string - source: + trustedServiceId: + nullable: true type: string type: object - EndpointsPostSBOMScanInput: + RepocontextDataFlowSinkKind: + enum: + - cache + - database + - external_api + - file_system + - llm_input + - logs + - notification + - object_storage + - other + - queue + - response + type: string + RepocontextDataFlowSource: properties: - commitSha: + description: + nullable: true type: string - forceRegenerate: - type: boolean - projectId: + entrypointId: + nullable: true type: string - repositoryId: + identifier: + nullable: true type: string - required: - - repositoryId - - projectId - - commitSha - type: object - EndpointsPostSBOMScanOutput: - properties: - cached: + isExternal: + nullable: true type: boolean - sbom: - $ref: '#/components/schemas/ModelsCDXGenAtCommit' - status: + kind: + $ref: '#/components/schemas/RepocontextDataFlowSourceKind' + nodeId: + nullable: true type: string - version: + trustedServiceId: + nullable: true type: string type: object - EndpointsPostVaultFileInput: + RepocontextDataFlowSourceKind: + enum: + - cache_read + - database_read + - event + - external_api + - file_upload + - internal_config + - internal_service + - llm_output + - other + - scheduled + - user_input + - web_scraping + - webhook + type: string + RepocontextDataFlowValidationApplied: + enum: + - full + - none_observed + - partial + - unknown + type: string + RepocontextDataflowHop: properties: - description: + boundaryId: nullable: true type: string - fileName: + boundaryName: + nullable: true type: string - required: - - fileName - type: object - EndpointsPostVaultFileOutput: - properties: - description: + callEdgeId: nullable: true type: string - documentID: + filePath: type: string - fileID: + index: + type: integer + line: + type: integer + notes: + nullable: true type: string - fileName: + qualifiedName: type: string - presignedUploadURL: + role: + $ref: '#/components/schemas/RepocontextDataflowHopRole' + symbol: + nullable: true type: string - version: + symbolId: + nullable: true type: string - required: - - presignedUploadURL - - documentID - - fileID - - fileName type: object - EndpointsPostVaultOnboardInput: + RepocontextDataflowHopRole: + enum: + - dispatcher + - sanitizer + - sink + - source + - transform + type: string + RepocontextDeploymentTargetDetail: properties: - fileIDs: - description: List of vault file IDs to process + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + evidence: items: - type: string - nullable: true + $ref: '#/components/schemas/RepocontextRepoContextEvidence' type: array - required: - - fileIDs - type: object - EndpointsPostVaultOnboardOutput: - properties: - message: - type: string - success: - type: boolean - required: - - success - - message - type: object - EndpointsProjectWithoutLockfile: - properties: - ecosystem: - type: string - projectId: - type: string - projectName: - type: string - repositoryId: - type: string - repositoryName: - type: string - type: object - EndpointsProviderScanStatus: - properties: - completedAt: - type: string - errorMessage: - type: string - provider: - type: string - startedAt: + reasoning: type: string - status: + source: + $ref: '#/components/schemas/RepocontextDeploymentTargetDetailSource' + target: type: string - required: - - provider - - status type: object - EndpointsPublicAsset: + RepocontextDeploymentTargetDetailSource: + enum: + - ci + - cloud_graph + - iac_resource + - manifest + type: string + RepocontextEntrypointRoute: properties: - accountId: - type: string - assetId: - type: string - cloudProvider: - type: string - dnsNames: + authMethods: + items: + $ref: '#/components/schemas/RepocontextEntrypointRouteAuthMethodsElem' + type: array + authStatus: + $ref: '#/components/schemas/RepocontextEntrypointRouteAuthStatus' + nullable: true + dataDomainIds: items: type: string type: array - isPublicFacing: - type: boolean - lastSeenAt: - type: string - publicIps: + dataFlowIds: items: type: string type: array - region: + filePath: + nullable: true type: string - resourceId: + frameworkName: + nullable: true type: string - resourceType: + handler: + nullable: true type: string - tags: - additionalProperties: - type: string - type: object - tenantId: + handlerSymbolId: + nullable: true type: string - required: - - assetId - - tenantId - - cloudProvider - - accountId - - resourceType - - resourceId - - isPublicFacing - type: object - EndpointsRebuildApplicationsInput: - properties: - force: + isAuthenticated: + nullable: true type: boolean - providerOwnerId: - type: string - required: - - providerOwnerId - - force - type: object - EndpointsRebuildApplicationsOutput: - properties: - status: + isInternal: + nullable: true + type: boolean + language: + nullable: true type: string - version: + lineNumber: + nullable: true + type: integer + method: + $ref: '#/components/schemas/RepocontextEntrypointRouteMethod' + nullable: true + operationId: + nullable: true type: string - required: - - status - type: object - EndpointsRepoScanProjectTouched: - properties: + parameters: + items: + $ref: '#/components/schemas/RepocontextRouteParameter' + type: array path: type: string - projectId: - type: string - required: - - projectId - - path - type: object - EndpointsRepoScanSBOMGenerated: - properties: - ecosystem: + pathUnresolved: + nullable: true + type: boolean + projectPathPrefix: + nullable: true type: string - projectId: + rateLimit: + nullable: true + type: boolean + registrationCondition: + nullable: true type: string - s3Key: + requestBodyFields: + items: + type: string + type: array + requiresPrivilegedAccess: + nullable: true + type: boolean + responseStatuses: + items: + type: integer + type: array + summary: + nullable: true type: string - required: - - projectId - - ecosystem - - s3Key + validationApplied: + $ref: '#/components/schemas/RepocontextEntrypointRouteValidationApplied' + nullable: true type: object - EndpointsRepoScanSubagent: + RepocontextEntrypointRouteAuthMethodsElem: + enum: + - API_KEY + - BASIC_AUTH + - IAM + - JWT + - LDAP + - MFA + - MTLS + - NONE + - OAUTH2 + - OPENID + - PASSWORD + - SAML + - SESSION_COOKIE + type: string + RepocontextEntrypointRouteAuthStatus: + enum: + - authenticated + - unauthenticated + - unknown + type: string + RepocontextEntrypointRouteMethod: + enum: + - CONSUME + - DELETE + - EVENT + - GET + - HEAD + - MUTATION + - OPTIONS + - PATCH + - POST + - PUT + - QUERY + - RPC + - SCHEDULE + - SUBSCRIPTION + type: string + RepocontextEntrypointRouteValidationApplied: + enum: + - full + - none_observed + - partial + - unknown + type: string + RepocontextExposureLevel: + enum: + - internal + - internet_reachable + - mixed + - private + - public + - unknown + type: string + RepocontextFileSummary: properties: - completedAt: - format: date-time + id: nullable: true type: string - durationMs: + isGenerated: nullable: true - type: integer - error: - type: string - ran: type: boolean - startedAt: - format: date-time + isTest: + nullable: true + type: boolean + language: + $ref: '#/components/schemas/LanguageCodeLanguage' nullable: true + path: type: string - status: + projectId: + nullable: true + type: string + summary: type: string type: object - EndpointsRepoScanSummary: + RepocontextIaCCloudLink: properties: - branch: + accountId: + nullable: true type: string - commitSha: + address: type: string - completedAt: - format: date-time + candidateCount: + nullable: true + type: integer + cloudNodeId: nullable: true type: string - errorMessage: - type: string - id: + cloudSubType: + nullable: true type: string - projectsTouched: - items: - $ref: '#/components/schemas/EndpointsRepoScanProjectTouched' - type: array - repositoryId: + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + declarationId: + nullable: true type: string - sbomsGenerated: + evidence: items: - $ref: '#/components/schemas/EndpointsRepoScanSBOMGenerated' + $ref: '#/components/schemas/RepocontextRepoContextEvidence' type: array - startedAt: - format: date-time - type: string - status: - type: string - subagentsRun: - additionalProperties: - $ref: '#/components/schemas/EndpointsRepoScanSubagent' - type: object - updatedAt: - format: date-time + file: type: string - required: - - id - - repositoryId - - commitSha - - status - - startedAt - - updatedAt - type: object - EndpointsRepositorySortBy: - enum: - - '' - - alphabetical - type: string - EndpointsRepositoryWithoutLockfile: - properties: - depCount: - format: int64 + line: type: integer - ecosystems: - items: - type: string + matchMethod: + $ref: '#/components/schemas/RepocontextIaCCloudLinkMatchMethod' nullable: true - type: array - projectCount: - format: int64 - type: integer - repositoryId: - type: string - repositoryName: - type: string - type: object - EndpointsSBOMIngestReplayInput: - properties: - globalReplay: - type: boolean - projectID: - type: string - repositoryID: - type: string - type: object - EndpointsSBOMIngestReplayOutput: - properties: - message: - type: string - version: - type: string - type: object - EndpointsSchemaSummary: - properties: - downloadUrl: - type: string - projectId: + moduleDir: type: string - projectName: + reasoning: type: string - repositoryId: + region: + nullable: true type: string - schemaFormat: + resourceType: type: string - schemaType: + rootDir: + nullable: true type: string - size: - type: integer + source: + $ref: '#/components/schemas/RepocontextIaCCloudLinkSource' + status: + $ref: '#/components/schemas/RepocontextIaCCloudLinkStatus' type: object - EndpointsUpdateOrganizationInput: + RepocontextIaCCloudLinkMatchMethod: + enum: + - iac_identifier_exact + - iac_name_across_accounts + - iac_name_global + - iac_name_in_account + type: string + RepocontextIaCCloudLinkSource: + enum: + - cloudformation + - terraform + type: string + RepocontextIaCCloudLinkStatus: + enum: + - ambiguous + - candidate + - matched + - not_found + - not_in_inventory + - unresolved + - unscanned_account + type: string + RepocontextImpactLevel: + enum: + - CRITICAL + - HIGH + - LOW + - MODERATE + type: string + RepocontextInfraNode: properties: name: nullable: true type: string - notes: + nodeId: nullable: true type: string - type: object - EndpointsUpdateProjectInput: - properties: - deletedAt: - format: date-time + type: nullable: true type: string + type: object + RepocontextInfraPath: + properties: description: nullable: true type: string - isDeleted: + exposure: + $ref: '#/components/schemas/RepocontextExposureLevel' nullable: true - type: boolean - metadata: - additionalProperties: {} - type: object - tags: + nodes: items: - type: string + $ref: '#/components/schemas/RepocontextInfraNode' type: array type: object - EndpointsUpdateProjectOutput: + RepocontextInfrastructureMatch: properties: - success: - type: boolean - version: + accountId: type: string - required: - - success - type: object - EndpointsUpdateRepositoryInput: - properties: - name: + accountType: + $ref: '#/components/schemas/RepocontextInfrastructureMatchAccountType' + nullable: true + artifactName: nullable: true type: string - type: object - EndpointsVaultFile: - properties: - contentType: - type: string - createdAt: - format: date-time - type: string - documentId: - type: string - fileId: - type: string - fileName: - type: string - filePresignedUrl: - type: string - uploaderId: + computeType: + $ref: '#/components/schemas/RepocontextInfrastructureMatchComputeType' + evidence: + items: + $ref: '#/components/schemas/RepocontextRepoContextEvidence' + type: array + isInternetFacing: + nullable: true + type: boolean + matchConfidence: + $ref: '#/components/schemas/RepocontextConfidence' + matchDetail: + nullable: true type: string - uploaderUsername: + matchMethod: + $ref: '#/components/schemas/RepocontextInfrastructureMatchMatchMethod' + nodeId: type: string - required: - - filePresignedUrl - - fileId - - fileName - - uploaderId - - uploaderUsername - - createdAt - type: object - EndpointsVaultFileSimple: - properties: - description: + reasoning: nullable: true type: string - documentId: + region: nullable: true type: string - fileName: + serviceName: type: string - required: - - fileName type: object - GraphBuildArtifactRepositoryType: + RepocontextInfrastructureMatchAccountType: enum: - - ARTIFACTORY - - GITHUB_RELEASES - - IMAGE_REGISTRY - - OTHER - - PACKAGE_REGISTRY - - S3_BUCKET + - development + - network_services + - production + - staging type: string - GraphBuildArtifactType: + RepocontextInfrastructureMatchComputeType: enum: - - ARCHIVE - - BYTECODE_OBJECT_FILE - - CODE_DIRECTORY - - CONTAINER_IMAGE - - CRATE_PACKAGE - - EXECUTABLE_BINARY - - GEM_PACKAGE - - HELM_CHART - - JAR - - MAVEN_PACKAGE - - NPM_PACKAGE - - NUGET_PACKAGE - - OCI_IMAGE - - OS_PACKAGE - - OTHER - - PYPI_PACKAGE - - SPA_BUNDLE - - STATIC_WEBSITE - - VIRTUAL_MACHINE_IMAGE - - WASM_MODULES - - WEB_COMPONENTS + - container_service + - kubernetes_workload + - other + - serverless_function + - virtual_machine type: string - GraphCodeArtifactType: + RepocontextInfrastructureMatchMatchMethod: enum: - - BROWSER_CLIENT - - BROWSER_EXTENSION - - CLI - - CLOUD_FUNCTION - - DESKTOP - - GRAPHQL_API - - IOT_FIRMWARE - - MOBILE_APP - - OTHER - - PIPELINE_NODE - - PLUGIN - - PRIVATE_LIBRARY - - PUBLIC_LIBRARY - - REST_API - - SMART_CONTRACT - - SPA_BROWSER_APP - - TEST_SUITE - - WEB_SERVER + - affinity_hint + - aws_tag + - build_config + - ci_pipeline + - container_image_name + - container_image_uri + - k8s_label + - manual_label + - registry_reference + - service_name_match type: string - GraphEdge: + RepocontextMetadata: properties: - explanation: + authenticationGrounding: + $ref: '#/components/schemas/RepocontextAuthenticationGrounding' + generatedAt: + format: date-time nullable: true type: string - sourceId: + generatorModel: + nullable: true type: string - targetId: + generatorPromptVersion: + nullable: true type: string - type: - $ref: '#/components/schemas/GraphEdgeType' + warnings: + items: + type: string + type: array type: object - GraphEdgeType: - enum: - - ACCESSED_BY - - ALLOWED_BY - - ALLOWS_EGRESS_TO - - ALLOWS_INGRESS_FROM - - APPLIES_TO - - ASSUMES - - ASSUMES_ROLE - - ATTACHED_TO - - AUTHENTICATES - - BASED_ON_CONTAINERFILE - - BELONGS_TO - - BUILDS - - BUILT_FROM - - CALLS - - CAN_REACH - - CLAIMS - - CONTAINS - - CONTRIBUTES_TO - - CONTRIBUTES_TO_PROJECT - - CONTROLS - - DEPLOYED_BY - - DEPLOYED_IN - - DEPLOYED_TO - - ENCRYPTS - - ENFORCED_BY - - ENFORCES - - ENTRY_POINTS - - EXECUTES - - EXISTS - - EXISTS_IN - - EXPOSED_AT - - EXPOSED_BY - - EXPOSED_ON - - EXPOSES - - FILTERED_BY - - FORWARDS_TO - - GRANTS_ACCESS - - HAS_AUTH - - HAS_CONTRIBUTOR - - HAS_ENDPOINT - - HAS_ENTRYPOINT - - HAS_FINDING - - HAS_HOST - - HAS_MEMBER - - HAS_NOTE - - HAS_ROLE - - HAS_RULE - - HAS_SECURITY_GROUP - - HOSTS - - IN_PROJECT - - IN_REPOSITORY - - IN_SUBNET - - IN_VPC - - ISSUED_TO - - MEMBER_OF - - MONITORS - - MOUNTED_BY - - OPEN_ON - - ORIGIN - - PEERED_WITH - - PRODUCED_BY - - PROTECTED_BY - - PROVIDED_BY - - PROVIDES - - PUBLISHES_TO - - QUERIED_BY - - QUERIES - - REFERENCES - - RESOLVES_TO - - ROUTED_BY - - ROUTES_TO - - RUNS_IMAGE - - SCALES - - SECURED_BY - - SERVES - - SOURCED_FROM - - STORED_IN - - SUBSCRIBES_TO - - TARGETS - - TARGET_WORKLOAD - - TRIGGERED_BY - - TRIGGERS - - UPLOADED_TO - - USED_BY - - USES - - USES_CONTAINER - - USES_POD - - USES_SECURITY_GROUP - - USES_TASK_DEFINITION - type: string - GraphGraph: + RepocontextProjectArtifact: properties: - edges: + artifactName: + type: string + buildEvidencePaths: items: - $ref: '#/components/schemas/GraphEdge' - nullable: true + type: string type: array - nodes: - items: {} + deploymentContext: + $ref: '#/components/schemas/RepocontextProjectArtifactDeploymentContext' + description: + type: string + id: + type: string + name: + type: string + nonProduction: + type: boolean + otherArtifactType: + nullable: true + type: string + registries: + items: + $ref: '#/components/schemas/RepocontextProjectArtifactRegistriesElem' nullable: true type: array + story: + items: + $ref: '#/components/schemas/RepocontextProjectArtifactStoryElem' + type: array + subArtifactPath: + nullable: true + type: string + subArtifactType: + $ref: '#/components/schemas/GraphBuildArtifactType' + nullable: true + type: + $ref: '#/components/schemas/GraphBuildArtifactType' + nullable: true type: object - LanguageCodeLanguage: - enum: - - Apex - - Bicep - - C - - CPlusPlus - - CSharp - - CloudFormation - - Containerfile - - Dockerfile - - FSharp - - Go - - HCL - - JSON - - Java - - JavaScript - - Kotlin - - Kubernetes - - Objective-C - - OpenAPI - - PHP - - Python - - Renovate - - Ruby - - Rust - - Scala - - Serverless - - Shell - - Solidity - - Swift - - Terraform - - TypeScript - - Unknown - - YAML - type: string - ModelsAPISpecMetadata: + RepocontextProjectArtifactDeploymentContext: properties: - basePath: - type: string - numEndpoints: + isDeployed: + nullable: true + type: boolean + type: object + RepocontextProjectArtifactLinkCoverage: + properties: + failedProvider: type: integer - servers: - items: - type: string - type: array - version: + projectId: type: string - required: - - numEndpoints + skippedBudget: + type: integer + skippedTimeout: + type: integer + undecided: + type: integer type: object - ModelsAPISpecRef: + RepocontextProjectArtifactRegistriesElem: properties: - contentRef: - $ref: '#/components/schemas/ModelsContentReference' - format: + baseUrl: type: string id: type: string - metadata: - $ref: '#/components/schemas/ModelsAPISpecMetadata' name: + nullable: true type: string - source: + otherType: + nullable: true type: string - type: + path: type: string - required: - - id - - name - - contentRef - - metadata + type: + $ref: '#/components/schemas/GraphBuildArtifactRepositoryType' type: object - ModelsAPISurface: + RepocontextProjectArtifactStoryElem: properties: - authenticatedEndpoints: - type: integer - coverage: - format: double - type: number - publicEndpoints: - type: integer - totalEndpoints: - type: integer - required: - - totalEndpoints - - publicEndpoints - - authenticatedEndpoints - - coverage + command: + nullable: true + type: string + description: + nullable: true + type: string + otherTool: + nullable: true + type: string + relatedFiles: + items: + type: string + type: array + tool: + $ref: '#/components/schemas/RepocontextProjectArtifactStoryElemTool' + nullable: true + type: + $ref: '#/components/schemas/RepocontextProjectArtifactStoryElemType' + nullable: true type: object - ModelsAWSAccountType: + RepocontextProjectArtifactStoryElemTool: enum: - - Production - - Development - - Staging - - Sandbox - - PreProd - - Other + - bazel + - docker + - docker-compose + - go + - gradle + - make + - maven + - npm + - other + - pip + - yarn + type: string + RepocontextProjectArtifactStoryElemType: + enum: + - COPY_OR_MOVE_FILE + - DOCKER_BUILD_COMMAND + - DOCKER_COPY + - DOCKER_TAG_COMMAND + - EXECUTE_CI_STEP + - PACKAGE_MANAGER_BUILD + - RUN_SCRIPT type: string - ModelsAWSIntegrationAssetInventoryHost: + RepocontextProjectBuildCoverage: properties: - accountId: - type: string - accountName: - type: string - accountType: - $ref: '#/components/schemas/ModelsAWSAccountType' - aliases: + assessment: + $ref: '#/components/schemas/RepocontextBuildAssessment' + ownership: items: - type: string + $ref: '#/components/schemas/RepocontextBuildOwnership' nullable: true type: array - protocol: - type: string - region: - type: string - resourceId: + pathPrefix: type: string - service: + projectId: type: string - required: - - accountId - - accountName - - accountType - - region - - service - - aliases - - resourceId - - protocol type: object - ModelsAgentAppContextSeed: + RepocontextProjectContext: properties: - componentTypes: + artifacts: + items: + $ref: '#/components/schemas/RepocontextProjectContextArtifactsElem' + type: array + boundaryIds: items: type: string type: array - description: - type: string - id: - nullable: true - type: string - name: - type: string - productType: + buildArtifacts: + items: + additionalProperties: {} + type: object + type: array + businessFunctionIds: + items: + $ref: '#/components/schemas/RepocontextProjectContextBusinessFunctionIdsElem' + type: array + cacheKey: nullable: true type: string - productUrl: + classificationConfidence: + $ref: '#/components/schemas/RepocontextConfidence' + classificationReasoning: nullable: true type: string - tags: + codeSymbols: + items: + $ref: '#/components/schemas/RepocontextCodeSymbol' + type: array + dataDomainIds: items: type: string type: array - type: object - ModelsAppContextSeed: - properties: - description: - type: string - name: - type: string - type: object - ModelsApplication: - properties: - components: + dataHandled: items: - $ref: '#/components/schemas/ModelsApplicationComponent' - nullable: true + $ref: '#/components/schemas/RepocontextProjectContextDataHandledElem' type: array - createdAt: - format: date-time - type: string + dependencyManifests: + items: + type: string + type: array + deploymentGraph: + $ref: '#/components/schemas/GraphGraph' + deploymentSummary: + additionalProperties: {} + type: object description: type: string - discovery: - $ref: '#/components/schemas/ModelsApplicationDiscovery' + directorySummaries: + items: + $ref: '#/components/schemas/RepocontextRepoContextDirectorySummary' + type: array + entrypoints: + items: + $ref: '#/components/schemas/RepocontextProjectEntrypoint' + type: array + fileSummaries: + items: + $ref: '#/components/schemas/RepocontextFileSummary' + type: array + frameworks: + items: + $ref: '#/components/schemas/RepocontextProjectContextFrameworksElem' + type: array + iac: + $ref: '#/components/schemas/RepocontextProjectContextIac' + iacPrograms: + items: + $ref: '#/components/schemas/RepocontextProjectContextIacProgramsElem' + type: array id: type: string - metadata: - $ref: '#/components/schemas/ModelsApplicationMetadata' + importanceReasoning: + nullable: true + type: string + internalDependencyIds: + items: + type: string + type: array + isTruncatedAnalysis: + type: boolean + languages: + items: + $ref: '#/components/schemas/LanguageCodeLanguage' + nullable: true + type: array name: type: string - tags: + orgImportance: + $ref: '#/components/schemas/RepocontextRepoContextProjectImportance' + nullable: true + orgRole: + $ref: '#/components/schemas/RepocontextRepoContextProjectRole' + nullable: true + otherDataHandled: items: type: string type: array - tenantId: + owners: + items: + $ref: '#/components/schemas/RepocontextProjectContextOwnersElem' + type: array + pathPrefix: type: string - updatedAt: - format: date-time + projectFiles: + items: + type: string + nullable: true + type: array + repositoryReferences: + items: + $ref: '#/components/schemas/RepocontextProjectContextRepositoryReferencesElem' + type: array + role: + $ref: '#/components/schemas/RepocontextProjectContextRole' + nullable: true + securityImportance: + $ref: '#/components/schemas/RepocontextProjectContextSecurityImportance' + nullable: true + shippedArtifact: + $ref: '#/components/schemas/RepocontextProjectContextShippedArtifact' + testCoverage: + $ref: '#/components/schemas/RepocontextProjectContextTestCoverage' + trustedServiceIds: + items: + type: string + type: array + type: object + RepocontextProjectContextArtifactsElem: + properties: + artifactType: + $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemArtifactType' + availabilityImportance: + $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemAvailabilityImportance' + dataConfidentialityImportance: + $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemDataConfidentialityImportance' + entrypointPath: type: string - version: + nonProduction: + type: boolean + otherType: + nullable: true type: string - required: - - id - - tenantId - - name - - description - - components - - discovery - - metadata - - createdAt - - updatedAt + systemIntegrityImportance: + $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemSystemIntegrityImportance' type: object - ModelsApplicationComponent: + RepocontextProjectContextArtifactsElemArtifactType: + enum: + - BROWSER_CLIENT + - BROWSER_EXTENSION + - CLI + - DESKTOP + - ETL_PIPELINE + - GRAPHQL_API + - IOT_FIRMWARE + - MOBILE_APP + - OTHER + - PLUGIN + - PRIVATE_LIBRARY + - PUBLIC_LIBRARY + - REST_API + - SPA_BROWSER_APP + - TEST_SUITE + - WEB_SERVER + type: string + RepocontextProjectContextArtifactsElemAvailabilityImportance: + enum: + - HIGH + - LOW + - MEDIUM + type: string + RepocontextProjectContextArtifactsElemDataConfidentialityImportance: + enum: + - HIGH + - LOW + - MEDIUM + type: string + RepocontextProjectContextArtifactsElemSystemIntegrityImportance: + enum: + - HIGH + - LOW + - MEDIUM + type: string + RepocontextProjectContextBusinessFunctionIdsElem: properties: - discovery: - $ref: '#/components/schemas/ModelsComponentDiscovery' + description: + nullable: true + type: string id: type: string + implementation: + $ref: '#/components/schemas/RepocontextProjectContextBusinessFunctionIdsElemImplementation' + nullable: true + type: object + RepocontextProjectContextBusinessFunctionIdsElemImplementation: + enum: + - full + - partial + - supporting + type: string + RepocontextProjectContextDataHandledElem: + enum: + - ADDRESS + - BIRTHDATE + - CREDIT_CARD + - EMAIL + - NAME + - OTHER + - PASSWORD + - PERSONAL_MEDICAL + - PHONE + - PROPRIETARY_FINANCIAL + - SOCIAL_SECURITY + - TRADE_SECRET + type: string + RepocontextProjectContextFrameworksElem: + properties: name: type: string - source: - $ref: '#/components/schemas/ModelsComponentSource' - type: + version: + nullable: true type: string - required: - - id - - name - - source - - discovery type: object - ModelsApplicationDiscovery: + RepocontextProjectContextIac: properties: - apiSpecs: - items: - $ref: '#/components/schemas/ModelsAPISpecRef' + backend: nullable: true + type: string + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + consumedBy: + items: + type: string type: array - apiSurface: - $ref: '#/components/schemas/ModelsAPISurface' - securityProfile: - $ref: '#/components/schemas/ModelsSecurityProfile' - technologies: + kind: + $ref: '#/components/schemas/RepocontextProjectContextIacKind' + modules: items: type: string - nullable: true type: array - required: - - apiSpecs - - apiSurface - - technologies - - securityProfile - type: object - ModelsApplicationMetadata: - properties: - agentExecutionId: - type: string - cacheKey: + reasoning: type: string - customFields: - additionalProperties: + roots: + items: type: string - type: object - generatedByAgentVersion: - type: string - lastRebuildTime: - format: date-time - type: string - sourceRepositories: + type: array + units: + items: + type: string + type: array + uses: items: type: string type: array - sourceRepositoryCount: - type: integer - status: - type: string - required: - - lastRebuildTime type: object - ModelsAssetInventoryCloudAccountRecord: + RepocontextProjectContextIacKind: + enum: + - embedded + - module + - root + - stack + type: string + RepocontextProjectContextIacProgramsElem: properties: - accountId: - type: string - accountName: - type: string - active: - type: boolean - cloudProvider: + path: type: string - createdAt: + shippedArtifact: + $ref: '#/components/schemas/RepocontextProjectContextShippedArtifact' + type: object + RepocontextProjectContextOwnersElem: + properties: + name: type: string - deletedAt: + source: + nullable: true type: string - id: + type: + $ref: '#/components/schemas/RepocontextProjectContextOwnersElemType' + nullable: true + type: object + RepocontextProjectContextOwnersElemType: + enum: + - individual + - team + type: string + RepocontextProjectContextRepositoryReferencesElem: + properties: + description: + nullable: true type: string - lastScanAt: + name: type: string - lastScanId: + repositoryReferenceType: + $ref: '#/components/schemas/RepocontextProjectContextRepositoryReferencesElemRepositoryReferenceType' + url: type: string - updatedAt: + version: + nullable: true type: string - required: - - id - - accountId - - accountName - - cloudProvider - - active - - createdAt - - updatedAt type: object - ModelsAssetInventoryHost: + RepocontextProjectContextRepositoryReferencesElemRepositoryReferenceType: + enum: + - dependency + - fork + - framework + - infrastructure + - library + - related + - template + - tool + - vendor + type: string + RepocontextProjectContextRole: + enum: + - application + - cli + - infrastructure + - library + - other + - package + - service + - shared_component + - tests + type: string + RepocontextProjectContextSecurityImportance: + enum: + - HIGH + - LOW + - MEDIUM + type: string + RepocontextProjectContextShippedArtifact: properties: - active: + dependenciesShipped: + nullable: true type: boolean - awsIntegration: - $ref: '#/components/schemas/ModelsAWSIntegrationAssetInventoryHost' - codeLocation: - $ref: '#/components/schemas/ModelsAssetInventoryHostCodeLocation' - createdAt: - type: string - dnsNames: + devDependenciesShipped: + nullable: true + type: boolean + evidence: + items: + type: string + nullable: true + type: array + kind: + $ref: '#/components/schemas/RepocontextProjectContextShippedArtifactKind' + type: object + RepocontextProjectContextShippedArtifactKind: + enum: + - container_image + - function_package + - iac_template + - library + - none + - unknown + type: string + RepocontextProjectContextTestCoverage: + properties: + hasIntegrationTests: + nullable: true + type: boolean + hasTests: + nullable: true + type: boolean + testFileCount: + nullable: true + type: integer + testFrameworks: + items: + type: string + type: array + type: object + RepocontextProjectEntrypoint: + properties: + affinityHints: items: type: string + type: array + apiSpecs: + items: + $ref: '#/components/schemas/RepocontextAPISchema' + type: array + applicationTypes: + items: + $ref: '#/components/schemas/GraphCodeArtifactType' nullable: true type: array - firstScanAt: - type: string - host: - type: string - id: - type: string - ipAddresses: + artifacts: items: - type: string + $ref: '#/components/schemas/RepocontextProjectArtifact' nullable: true type: array - isAuthenticated: - type: boolean - isLatest: + authMethods: + items: + $ref: '#/components/schemas/RepocontextProjectEntrypointAuthMethodsElem' + type: array + boundaryIds: + items: + type: string + type: array + buildArtifacts: + items: + additionalProperties: {} + type: object + type: array + cloudInternetFacing: + nullable: true type: boolean - lastScanAt: + cloudInternetFacingConfidence: + $ref: '#/components/schemas/RepocontextConfidence' + cloudInternetFacingConfidenceReason: + nullable: true type: string - ports: + confidence: + nullable: true + type: number + dataFlowIds: items: - $ref: '#/components/schemas/ModelsAssetInventoryPort' + type: string + type: array + deploymentTargets: + items: + type: string type: array - resourceCategory: - type: string - resourceType: - type: string - sourceType: - $ref: '#/components/schemas/ModelsHostSourceType' - updatedAt: - type: string - required: - - host - - dnsNames - - ipAddresses - - sourceType - - createdAt - - updatedAt - - awsIntegration - - active - - firstScanAt - - lastScanAt - - codeLocation - - isLatest - - id - - resourceType - - resourceCategory - type: object - ModelsAssetInventoryHostCodeLocation: - properties: description: + nullable: true type: string - ownerId: + detectionConfidence: + $ref: '#/components/schemas/RepocontextConfidence' + frameworkName: + nullable: true type: string - ownerName: + id: type: string - platform: + kind: + $ref: '#/components/schemas/RepocontextProjectEntrypointKind' + nullable: true + lineNumber: + nullable: true + type: integer + name: + nullable: true type: string - projectName: + nodeId: + nullable: true type: string - repositoryId: + path: type: string - repositoryName: + ports: + items: + type: integer + type: array + projectPath: + nullable: true type: string - required: - - ownerId - - ownerName - - repositoryId - - repositoryName - - projectName - - description + protocols: + items: + $ref: '#/components/schemas/RepocontextProjectEntrypointProtocolsElem' + type: array + routes: + items: + $ref: '#/components/schemas/RepocontextEntrypointRoute' + type: array + servedHostnames: + items: + $ref: '#/components/schemas/RepocontextProjectEntrypointServedHostnamesElem' + type: array + sessionMechanism: + $ref: '#/components/schemas/RepocontextProjectEntrypointSessionMechanism' + nullable: true + symbolId: + nullable: true + type: string + trustedServiceIds: + items: + type: string + type: array type: object - ModelsAssetInventoryPort: + RepocontextProjectEntrypointAuthMethodsElem: + enum: + - API_KEY + - BASIC_AUTH + - IAM + - JWT + - LDAP + - MFA + - MTLS + - NONE + - OAUTH2 + - OPENID + - PASSWORD + - SAML + - SESSION_COOKIE + type: string + RepocontextProjectEntrypointKind: + enum: + - CLI + - LIBRARY_EXPORT + - NETWORK + - OTHER + - SCHEDULED + - WORKER + type: string + RepocontextProjectEntrypointProtocolsElem: + enum: + - GRAPHQL + - GRPC + - HTTP + - HTTPS + - MQTT + - TCP + - UDP + - WEBSOCKET + type: string + RepocontextProjectEntrypointServedHostnamesElem: properties: - active: - type: boolean - createdAt: - type: string - port: - type: integer - protocol: + evidence: type: string - transportProtocol: + hostname: type: string - updatedAt: + pathPrefix: type: string - required: - - port - - transportProtocol - - active type: object - ModelsAssetInventoryResource: + RepocontextProjectEntrypointSessionMechanism: + enum: + - cookie + - none + - server_session + - stateless_token + type: string + RepocontextReachabilityPath: properties: - accountId: - type: string - active: - type: boolean - cloudProvider: - type: string - createdAt: + artifactLinkId: + nullable: true type: string - deletedAt: + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + confidenceReason: + nullable: true type: string - dnsNames: + coverageGaps: + items: + $ref: '#/components/schemas/RepocontextCoverageGap' + type: array + entrypointIds: items: type: string type: array - firstSeenAt: + exposureRoot: + $ref: '#/components/schemas/RepocontextReachabilityPathExposureRoot' + exposureSummary: + nullable: true type: string id: type: string - isPublicFacing: - type: boolean - lastSeenAt: - type: string - lastSeenScanId: - type: string - name: - type: string - privateIPs: + networkControls: items: type: string type: array - properties: - additionalProperties: {} - type: object - providerType: - type: string - publicIPs: + pathEdgeTypes: + items: + $ref: '#/components/schemas/GraphEdgeType' + type: array + pathNodeIds: items: type: string + nullable: true type: array - region: - type: string - resourceCategory: - type: string - resourceId: - type: string - resourceType: - type: string - subnet: + privateJustification: + nullable: true type: string - tags: - additionalProperties: - type: string - type: object - updatedAt: + projectId: + nullable: true type: string - vpc: + publicRoutes: + items: + $ref: '#/components/schemas/RepocontextReachabilityPathPublicRoutesElem' + type: array + workloadKind: + $ref: '#/components/schemas/RepocontextReachabilityPathWorkloadKind' + workloadNodeId: type: string - required: - - id - - resourceId - - name - - resourceType - - resourceCategory - - providerType - - cloudProvider - - accountId - - active - - createdAt - - updatedAt type: object - ModelsCDXAuthors: + RepocontextReachabilityPathExposureRoot: + enum: + - cross_account + - internet + - peered_vpc + - private + - unknown + - vpn + type: string + RepocontextReachabilityPathPublicRoutesElem: properties: - email: + entrypointId: + nullable: true type: string - name: + isAuthenticated: + nullable: true + type: boolean + method: + type: string + path: type: string - required: - - name - - email type: object - ModelsCDXComponents: + RepocontextReachabilityPathWorkloadKind: + enum: + - AWS_APP_RUNNER + - AWS_EC2 + - AWS_ECS + - AWS_EKS + - AWS_FARGATE + - AWS_LAMBDA + - OTHER + type: string + RepocontextRepoContext: properties: - author: - type: string - bom-ref: + artifactLinkCoverage: + $ref: '#/components/schemas/RepocontextArtifactLinkCoverage' + artifactLinks: + items: + $ref: '#/components/schemas/RepocontextArtifactLink' + type: array + authenticationMethods: + items: + type: string + type: array + buildCoverage: + $ref: '#/components/schemas/RepocontextBuildCoverage' + businessFunctions: + items: + $ref: '#/components/schemas/RepocontextBusinessFunction' + type: array + cacheKey: + nullable: true type: string + callEdges: + items: + $ref: '#/components/schemas/RepocontextCallEdge' + type: array + cicdPipelineSummary: + $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummary' + cloudAccounts: + items: + $ref: '#/components/schemas/RepocontextAccountInfrastructureSummary' + type: array + codeConventions: + items: + $ref: '#/components/schemas/RepocontextCodeConvention' + type: array + commitPatterns: + $ref: '#/components/schemas/RepocontextRepoContextCommitPatterns' + complianceFrameworks: + items: + $ref: '#/components/schemas/RepocontextComplianceFramework' + type: array + contextSummary: + $ref: '#/components/schemas/RepocontextRepoContextContextSummary' + dataDomains: + items: + $ref: '#/components/schemas/RepocontextDataDomain' + type: array + dataFlows: + items: + $ref: '#/components/schemas/RepocontextDataFlow' + type: array + databases: + items: + $ref: '#/components/schemas/RepocontextRepoContextDatabasesElem' + type: array + deploymentTargetDetails: + items: + $ref: '#/components/schemas/RepocontextDeploymentTargetDetail' + type: array + deploymentTargets: + items: + type: string + type: array description: type: string - externalReferences: + developmentGuidelines: + $ref: '#/components/schemas/RepocontextRepoContextDevelopmentGuidelines' + graph: + $ref: '#/components/schemas/GraphGraph' + iacCloudLinkCoverage: + $ref: '#/components/schemas/RepocontextRepoContextIacCloudLinkCoverage' + iacCloudLinks: items: - $ref: '#/components/schemas/ModelsCDXReferences' - nullable: true + $ref: '#/components/schemas/RepocontextIaCCloudLink' type: array - group: + iacCoverageGaps: + items: + $ref: '#/components/schemas/RepocontextCoverageGap' + type: array + id: type: string - hashes: + infrastructureMatches: items: - $ref: '#/components/schemas/ModelsCDXHashes' - nullable: true + $ref: '#/components/schemas/RepocontextInfrastructureMatch' type: array - licenses: + inputValidationFrameworks: items: - $ref: '#/components/schemas/ModelsCDXLicenseEntry' + type: string + type: array + internalDependencies: + additionalProperties: + items: + type: string + type: array + type: object + isInitializedOnly: + type: boolean + isMonorepo: + nullable: true + type: boolean + isOpenAPISpecAvailable: + type: boolean + isTruncatedAnalysis: + type: boolean + mermaidDiagram: nullable: true + type: string + metadata: + $ref: '#/components/schemas/RepocontextMetadata' + monitoringTooling: + items: + type: string type: array name: type: string - properties: - items: - $ref: '#/components/schemas/ModelsCDXProperties' + networkExposure: + $ref: '#/components/schemas/RepocontextRepoContextNetworkExposure' nullable: true + nonSecurityImportantPaths: + items: + $ref: '#/components/schemas/RepocontextRepoContextNonSecurityImportantPathsElem' type: array - publisher: - type: string - purl: - type: string - scope: - type: string - type: - type: string - version: - type: string - required: - - author - - publisher - - group - - name - - version - - description - - hashes - - licenses - - purl - - type - - bom-ref - - properties - - externalReferences - - scope - type: object - ModelsCDXDeps: - properties: - dependsOn: + openAPISpecPath: items: type: string - nullable: true type: array - ref: - type: string - required: - - ref - - dependsOn - type: object - ModelsCDXGen: - properties: - bomFormat: - type: string - components: + projects: items: - $ref: '#/components/schemas/ModelsCDXComponents' + $ref: '#/components/schemas/RepocontextProjectContext' nullable: true type: array - dependencies: + public: + type: boolean + reachabilityPaths: items: - $ref: '#/components/schemas/ModelsCDXDeps' + $ref: '#/components/schemas/RepocontextReachabilityPath' + type: array + repositoryClassification: + $ref: '#/components/schemas/RepocontextRepoContextRepositoryClassification' nullable: true + repositoryReferences: + items: + $ref: '#/components/schemas/RepocontextRepoContextRepositoryReferencesElem' type: array - metadata: - $ref: '#/components/schemas/ModelsCDXMetaData' - serialNumber: - type: string - services: + rootDirectorySummary: + $ref: '#/components/schemas/RepocontextRepoContextDirectorySummary' + secretsSurface: items: - $ref: '#/components/schemas/ModelsCDXService' - nullable: true + $ref: '#/components/schemas/RepocontextSecretUsage' type: array - specVersion: - type: string - version: - type: integer - required: - - bomFormat - - specVersion - - serialNumber - - version - - metadata - - components - - services - - dependencies - type: object - ModelsCDXGenAtCommit: - properties: - cdxGen: - $ref: '#/components/schemas/ModelsCDXGen' - commitSha: - type: string - commitTimestamp: - format: date-time - type: string - detectedEcosystems: + securityBoundaries: items: - type: string + $ref: '#/components/schemas/RepocontextSecurityBoundary' type: array - detectedLockfiles: + securityPosture: + $ref: '#/components/schemas/RepocontextRepoContextSecurityPosture' + securityTooling: items: - type: string + $ref: '#/components/schemas/RepocontextRepoContextSecurityToolingElem' type: array - detectedManifests: + sourceSinks: items: - type: string + $ref: '#/components/schemas/RepocontextSourceSink' + type: array + submodules: + items: + $ref: '#/components/schemas/RepocontextRepoContextSubmodulesElem' + type: array + technologyStack: + items: + $ref: '#/components/schemas/RepocontextRepoContextTechnologyStackElem' + type: array + toxicCombinations: + items: + $ref: '#/components/schemas/RepocontextToxicCombination' + type: array + trustedServices: + items: + $ref: '#/components/schemas/RepocontextTrustedService' type: array - lockfileClassification: - type: string - manifestRangeSources: - additionalProperties: - $ref: '#/components/schemas/ModelsManifestRangeSource' - type: object - manifestRanges: - additionalProperties: - type: string - type: object - required: - - commitSha - - commitTimestamp - type: object - ModelsCDXHashes: - properties: - alg: - type: string - content: - type: string - required: - - alg - - content type: object - ModelsCDXLicenseEntry: + RepocontextRepoContextCicdPipelineSummary: properties: - expression: + prWorkflowCount: + nullable: true + type: integer + summary: + nullable: true type: string - license: - $ref: '#/components/schemas/ModelsCDXLicenseInfo' + workflows: + items: + $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummaryWorkflowsElem' + type: array type: object - ModelsCDXLicenseInfo: + RepocontextRepoContextCicdPipelineSummaryWorkflowsElem: properties: - id: + jobs: + items: + $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElem' + type: array + name: + nullable: true type: string - url: + path: + nullable: true type: string - type: object - ModelsCDXMetaData: - properties: - authors: - items: - $ref: '#/components/schemas/ModelsCDXAuthors' + platform: nullable: true - type: array - component: - $ref: '#/components/schemas/ModelsCDXComponents' - timestamp: - format: date-time type: string - tools: - additionalProperties: - items: - $ref: '#/components/schemas/ModelsCDXTool' - type: array + runsOnPr: nullable: true - type: object - required: - - timestamp - - tools - - authors - - component + type: boolean type: object - ModelsCDXProperties: + RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElem: properties: name: + nullable: true type: string - value: - type: string - required: - - name - - value + steps: + items: + $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElemStepsElem' + type: array type: object - ModelsCDXReferences: + RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElemStepsElem: properties: - type: + command: + nullable: true type: string - url: + name: + nullable: true + type: string + uses: + nullable: true type: string - required: - - type - - url type: object - ModelsCDXService: + RepocontextRepoContextCommitPatterns: properties: - bom-ref: - type: string - endpoints: + exampleMessages: items: type: string type: array - group: - type: string - name: - type: string - provider: - type: string - version: - type: string - type: object - ModelsCDXTool: - properties: - group: - type: string - name: - type: string - version: + lastUpdated: + format: date-time + nullable: true type: string - required: - - group - - name - - version + learnedFromCommits: + nullable: true + type: integer + messageFormat: + $ref: '#/components/schemas/RepocontextRepoContextCommitPatternsMessageFormat' + nullable: true + prefixPatterns: + items: + type: string + type: array type: object - ModelsCloudProvider: + RepocontextRepoContextCommitPatternsMessageFormat: enum: - - AWS - - AZURE - - GCP - - K8S + - conventional + - descriptive + - imperative + - ticket-prefixed type: string - ModelsComponentDiscovery: + RepocontextRepoContextContextSummary: properties: - apiSpecs: + complianceDrivers: items: - $ref: '#/components/schemas/ModelsAPISpecRef' + type: string type: array - endpoints: + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + executiveSummary: + nullable: true + type: string + reasoning: + nullable: true + type: string + recommendedFollowups: items: type: string type: array - frontendAssets: - $ref: '#/components/schemas/ModelsFrontendAssets' - technologies: + technicalSummary: + nullable: true + type: string + topRisks: items: type: string type: array type: object - ModelsComponentSource: + RepocontextRepoContextDatabasesElem: properties: - path: - type: string - projectId: - type: string - repositoryId: + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + databaseType: + $ref: '#/components/schemas/RepocontextRepoContextDatabasesElemDatabaseType' + evidence: + items: + $ref: '#/components/schemas/RepocontextRepoContextEvidence' + type: array + name: type: string - type: + reasoning: + nullable: true type: string type: object - ModelsContentReference: + RepocontextRepoContextDatabasesElemDatabaseType: + enum: + - CASSANDRA + - DYNAMODB + - ELASTICSEARCH + - MONGODB + - MSSQL + - MYSQL + - OTHER + - POSTGRESQL + - REDIS + - SQLITE + type: string + RepocontextRepoContextDevelopmentGuidelines: properties: - hash: - type: string - location: - type: string - size: - format: int64 - type: integer - type: + summary: + nullable: true type: string - required: - - size - - hash + tools: + items: + $ref: '#/components/schemas/RepocontextRepoContextDevelopmentGuidelinesToolsElem' + type: array type: object - ModelsContextProject: + RepocontextRepoContextDevelopmentGuidelinesToolsElem: properties: - createdAt: - format: date-time + category: + $ref: '#/components/schemas/RepocontextRepoContextDevelopmentGuidelinesToolsElemCategory' + filePath: type: string - deletedAt: - format: date-time + summary: nullable: true type: string - dependencies: + tool: + type: string + type: object + RepocontextRepoContextDevelopmentGuidelinesToolsElemCategory: + enum: + - ai_coding_assistant + - code_review_bot + - linter_formatter + type: string + RepocontextRepoContextDirectorySummary: + properties: + childPaths: items: type: string type: array - description: - type: string - framework: - type: string - id: - type: string - isDeleted: - type: boolean - language: - type: string - metadata: - additionalProperties: {} - type: object - name: - type: string - path: - type: string - repositoryId: - type: string - tags: + keyFiles: items: type: string type: array - updatedAt: - format: date-time + kind: + $ref: '#/components/schemas/RepocontextRepoContextDirectorySummaryKind' + path: type: string - required: - - id - - repositoryId - - name - - description - - path - - isDeleted - - createdAt - - updatedAt - type: object - ModelsDependencyDiff: - properties: - added: - items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' - nullable: true - type: array - removed: + publicInterfaces: items: - $ref: '#/components/schemas/ModelsDependencyOccurrence' - nullable: true + type: string type: array - upgraded: + responsibilities: items: - $ref: '#/components/schemas/ModelsDependencyUpgrade' - nullable: true + type: string type: array - required: - - added - - removed - - upgraded + summary: + type: string type: object - ModelsDependencyOccurrence: + RepocontextRepoContextDirectorySummaryKind: + enum: + - application + - config + - directory + - docs + - infrastructure + - library + - module + - other + - package + - root + - service + - tests + type: string + RepocontextRepoContextEvidence: properties: - bomRef: - nullable: true - type: string - depth: + line: nullable: true type: integer - direct: - nullable: true - type: boolean - ecosystem: - type: string - introducedAt: - format: date-time - nullable: true - type: string - introducedByCommit: - nullable: true - type: string - name: - type: string - parents: - items: - type: string - type: array - projectId: - type: string - projectName: - type: string - purl: - type: string - removedAt: - format: date-time - nullable: true - type: string - removedByCommit: + nodeId: nullable: true type: string - repoId: - type: string - repositoryName: - type: string - requestedRange: + path: nullable: true type: string - requestedRangeSource: + quote: nullable: true type: string - version: - type: string - required: - - repoId - - projectId - - ecosystem - - name - - version type: object - ModelsDependencyUpgrade: + RepocontextRepoContextIacCloudLinkCoverage: properties: - ecosystem: - type: string - from: - type: string - fromCommit: + capped: nullable: true - type: string - name: - type: string - projectId: - type: string - projectName: - type: string - repoId: - type: string - repositoryName: - type: string - to: - type: string - required: - - repoId - - projectId - - ecosystem - - name - - from - - to - type: object - ModelsDependencyWindow: - properties: - ecosystem: - type: string - fromCommit: - type: string - fromTime: - format: date-time - type: string - isArchived: - description: Whether the repository is archived on its source platform type: boolean - lastScannedAt: - description: Last SBOM scan timestamp for the project - format: date-time + indexFailed: nullable: true - type: string - name: - type: string - projectId: - type: string - projectName: - type: string - repoId: - type: string - repositoryName: - type: string - resolvedWithoutLockfile: - description: Whether this dependency was resolved without a committed lockfile type: boolean - toCommit: - nullable: true - type: string - toTime: - format: date-time + inventoryUnread: nullable: true + type: boolean + reason: type: string - version: - type: string - required: - - repoId - - projectId - - ecosystem - - name - - version - - fromTime - type: object - ModelsEscalationPolicy: - properties: - citations: + unreadAccounts: items: - $ref: '#/components/schemas/ModelsEscalationPolicyCitationsElem' + type: string type: array - description: - nullable: true - type: string - escalationChain: + type: object + RepocontextRepoContextNetworkExposure: + enum: + - internal + - internet_facing + - library + type: string + RepocontextRepoContextNonSecurityImportantPathsElem: + properties: + confidence: + $ref: '#/components/schemas/RepocontextRepoContextNonSecurityImportantPathsElemConfidence' + evidence: items: - $ref: '#/components/schemas/ModelsEscalationPolicyEscalationChainElem' + type: string nullable: true type: array - id: - type: string - name: + path: type: string - scope: - $ref: '#/components/schemas/ModelsEscalationPolicyScope' - severitySLAs: + projectIds: items: - $ref: '#/components/schemas/ModelsEscalationPolicySeveritySLAsElem' + type: string type: array + reason: + $ref: '#/components/schemas/RepocontextRepoContextNonSecurityImportantPathsElemReason' type: object - ModelsEscalationPolicyCitationsElem: + RepocontextRepoContextNonSecurityImportantPathsElemConfidence: + enum: + - high + type: string + RepocontextRepoContextNonSecurityImportantPathsElemReason: + enum: + - docs + - eval + - fixture + - generated + - sample + - test + - vendored + type: string + RepocontextRepoContextProjectImportance: + enum: + - high + - low + - medium + type: string + RepocontextRepoContextProjectRole: + enum: + - admin_surface + - batch_job + - ci_plugin + - cli_tool + - data_pipeline + - editor_extension + - frontend_app + - infrastructure + - internal_api + - prototype + - public_api + - shared_library + - test_harness + - unknown + - worker + type: string + RepocontextRepoContextRepositoryClassification: + enum: + - application + - infrastructure + - library + - mixed + type: string + RepocontextRepoContextRepositoryReferencesElem: properties: - documentId: + description: nullable: true type: string - documentName: + isCloudToCodeConnected: nullable: true + type: boolean + name: type: string - page: - nullable: true + repositoryReferenceType: + $ref: '#/components/schemas/RepocontextRepoContextRepositoryReferencesElemRepositoryReferenceType' + url: type: string type: object - ModelsEscalationPolicyEscalationChainElem: + RepocontextRepoContextRepositoryReferencesElemRepositoryReferenceType: + enum: + - dependency + - fork + - framework + - infrastructure + - library + - related + - template + - tool + - vendor + type: string + RepocontextRepoContextSecurityPosture: properties: - contact: - $ref: '#/components/schemas/ModelsEscalationPolicyEscalationChainElemContact' - escalateAfterHours: + authCoverage: + $ref: '#/components/schemas/RepocontextRepoContextSecurityPostureAuthCoverage' nullable: true - type: number - level: - type: integer - type: object - ModelsEscalationPolicyEscalationChainElemContact: - properties: - channel: + hasDependencyScanning: nullable: true - type: string - name: + type: boolean + hasInputValidation: nullable: true - type: string - type: object - ModelsEscalationPolicyScope: - properties: - services: + type: boolean + hasSecretScanning: + nullable: true + type: boolean + hasStaticAnalysis: + nullable: true + type: boolean + mitigatingFactors: items: type: string type: array - teams: + riskFactors: items: type: string type: array type: object - ModelsEscalationPolicySeveritySLAsElem: - properties: - resolutionTimeHours: - nullable: true - type: number - responseTimeHours: - nullable: true - type: number - severity: - $ref: '#/components/schemas/ModelsEscalationPolicySeveritySLAsElemSeverity' - type: object - ModelsEscalationPolicySeveritySLAsElemSeverity: + RepocontextRepoContextSecurityPostureAuthCoverage: enum: - - CRITICAL - - HIGH - - LOW - - MEDIUM + - FULL + - NONE + - PARTIAL type: string - ModelsFrontendAssets: + RepocontextRepoContextSecurityToolingElem: properties: - apiEndpoints: - items: - type: string - type: array - exposedValues: - type: integer - routes: - items: - type: string - type: array + category: + $ref: '#/components/schemas/RepocontextRepoContextSecurityToolingElemCategory' + name: + type: string type: object - ModelsHostSourceType: + RepocontextRepoContextSecurityToolingElemCategory: enum: - - UserUploadHost - - CodeScanHost - - AWSIntegrationHost - - BugHuntHost - - ManualHost + - CONTAINER_SECURITY + - DAST + - DEPENDENCY_UPDATE + - IAC_SECURITY + - SAST + - SCA + - SECRETS_SCANNING type: string - ModelsManifestRangeSource: + RepocontextRepoContextSubmodulesElem: properties: - filePath: + branch: + nullable: true type: string - range: + name: + nullable: true + type: string + path: + type: string + url: type: string - required: - - range type: object - ModelsMemory: + RepocontextRepoContextTechnologyStackElem: properties: - citations: - items: - $ref: '#/components/schemas/ModelsMemoryCitationsElem' - type: array - classification: - $ref: '#/components/schemas/ModelsMemoryClassification' - commentIds: - items: - type: string - type: array - confidence: - nullable: true - type: number - content: + category: + $ref: '#/components/schemas/RepocontextRepoContextTechnologyStackElemCategory' + name: type: string - createdAt: - format: date-time + type: object + RepocontextRepoContextTechnologyStackElemCategory: + enum: + - CACHE + - DATABASE + - FRAMEWORK + - MESSAGE_QUEUE + - MONITORING + - SEARCH_ENGINE + type: string + RepocontextRouteParameter: + properties: + in: + $ref: '#/components/schemas/RepocontextRouteParameterIn' + name: type: string - createdBy: + required: + nullable: true + type: boolean + sensitive: + nullable: true + type: boolean + type: + $ref: '#/components/schemas/RepocontextRouteParameterType' + nullable: true + type: object + RepocontextRouteParameterIn: + enum: + - cookie + - header + - path + - query + type: string + RepocontextRouteParameterType: + enum: + - array + - boolean + - integer + - number + - object + - string + type: string + RepocontextSecretUsage: + properties: + cloudNodeId: nullable: true type: string - crossReferences: + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + consumerQualifiedNames: items: - $ref: '#/components/schemas/ModelsMemoryCrossReferencesElem' + type: string type: array id: type: string - isUserCreated: - type: boolean - memoryLineage: - $ref: '#/components/schemas/ModelsMemoryMemoryLineage' - memoryType: - $ref: '#/components/schemas/ModelsMemoryMemoryType' - metadata: - $ref: '#/components/schemas/ModelsMemoryMetadata' - priority: - $ref: '#/components/schemas/ModelsMemoryPriority' - questionId: - nullable: true - type: string - resourceId: + name: type: string - resourceType: - $ref: '#/components/schemas/ModelsMemoryResourceType' - scope: - $ref: '#/components/schemas/ModelsMemoryScope' + projectId: nullable: true - scopeResourceId: + type: string + purpose: nullable: true type: string - tags: + readEvidence: items: - type: string + $ref: '#/components/schemas/RepocontextSecretUsageReadEvidenceElem' + nullable: true type: array - title: + rotationEvidence: + $ref: '#/components/schemas/RepocontextSecretUsageRotationEvidence' nullable: true - type: string - updatedAt: - format: date-time + sensitivity: + $ref: '#/components/schemas/RepocontextDataClassification' + nullable: true + source: + $ref: '#/components/schemas/RepocontextSecretUsageSource' + trustedServiceId: nullable: true type: string type: object - ModelsMemoryCitationsElem: + RepocontextSecretUsageReadEvidenceElem: properties: - citation_id: - type: string - document_id: - type: string - document_name: + filePath: type: string - page: + line: + type: integer + qualifiedName: + nullable: true type: string - title: + symbol: nullable: true type: string type: object - ModelsMemoryClassification: + RepocontextSecretUsageRotationEvidence: + enum: + - automatic + - manual + - none_observed + - unknown + type: string + RepocontextSecretUsageSource: + enum: + - aws_secrets_manager + - aws_ssm_parameter_store + - azure_key_vault + - config_file + - env_var + - gcp_secret_manager + - hardcoded + - hashicorp_vault + - kubernetes_secret + - other + type: string + RepocontextSecurityBoundary: properties: - businessImpact: - $ref: '#/components/schemas/ModelsMemoryClassificationBusinessImpact' + cloudReconBoundaryId: nullable: true - computePlatforms: + type: string + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + description: + type: string + evidencePaths: items: - $ref: '#/components/schemas/ModelsMemoryClassificationComputePlatformsElem' + type: string type: array - containsSensitiveData: - nullable: true - type: boolean - criticality: - $ref: '#/components/schemas/ModelsMemoryClassificationCriticality' - nullable: true - dataClassification: - $ref: '#/components/schemas/ModelsMemoryClassificationDataClassification' + exposure: + $ref: '#/components/schemas/RepocontextExposureLevel' nullable: true - environments: + id: + type: string + mechanismTypes: items: - $ref: '#/components/schemas/ModelsMemoryClassificationEnvironmentsElem' + $ref: '#/components/schemas/RepocontextSecurityBoundaryMechanismTypesElem' type: array - networkExposure: - $ref: '#/components/schemas/ModelsMemoryClassificationNetworkExposure' - nullable: true - organizationalEntityType: - $ref: '#/components/schemas/ModelsMemoryClassificationOrganizationalEntityType' - nullable: true - riskLevel: - $ref: '#/components/schemas/ModelsMemoryClassificationRiskLevel' + name: + type: string + nodeIds: + items: + type: string + type: array + reasoning: nullable: true - securityDomains: + type: string + relatedDataDomainIds: items: - $ref: '#/components/schemas/ModelsMemoryClassificationSecurityDomainsElem' + type: string type: array - systemTypes: + relatedEntrypointIds: items: - $ref: '#/components/schemas/ModelsMemoryClassificationSystemTypesElem' + type: string + type: array + relatedProjectIds: + items: + type: string + type: array + trustedServiceIds: + items: + type: string type: array + type: + $ref: '#/components/schemas/RepocontextSecurityBoundaryType' type: object - ModelsMemoryClassificationBusinessImpact: - enum: - - CUSTOMER_FACING - - INTERNAL_OPERATIONS - - REVENUE_CRITICAL - - SUPPORT_FUNCTION - type: string - ModelsMemoryClassificationComputePlatformsElem: - enum: - - BARE_METAL - - CLOUD_FUNCTION - - CONTAINER - - DOCKER - - KUBERNETES - - SERVERLESS - - VIRTUAL_MACHINE - type: string - ModelsMemoryClassificationCriticality: - enum: - - CRITICAL - - HIGH - - LOW - - MEDIUM - type: string - ModelsMemoryClassificationDataClassification: - enum: - - CONFIDENTIAL - - INTERNAL - - PUBLIC - - RESTRICTED - type: string - ModelsMemoryClassificationEnvironmentsElem: + RepocontextSecurityBoundaryMechanismTypesElem: enum: - - DEVELOPMENT + - AUTHENTICATION + - AUTHORIZATION + - ENCRYPTION + - IAM + - MTLS + - NETWORK_POLICY - OTHER - - PREPRODUCTION - - PRODUCTION - - STAGING - - TEST - type: string - ModelsMemoryClassificationNetworkExposure: - enum: - - AIR_GAPPED - - INTERNAL_NETWORK - - ISOLATED - - PUBLIC_INTERNET - - VPN_ONLY - type: string - ModelsMemoryClassificationOrganizationalEntityType: - enum: - - BUSINESS_UNIT - - CONTRACTOR - - DEPARTMENT - - DIVISION - - EXTERNAL_PARTNER - - GROUP - - ROLE - - SERVICE_ACCOUNT - - TEAM - - USER - - VENDOR - type: string - ModelsMemoryClassificationRiskLevel: - enum: - - CRITICAL - - HIGH - - LOW - - MEDIUM - - MINIMAL + - PRIVATE_NETWORK + - QUEUE_ISOLATION + - SECURITY_GROUP + - TENANT_SCOPING type: string - ModelsMemoryClassificationSecurityDomainsElem: + RepocontextSecurityBoundaryType: enum: - - APPLICATION_SECURITY - - CLOUD_SECURITY - - COMPLIANCE - - DATA_PROTECTION - - INCIDENT_RESPONSE - - INFRASTRUCTURE_SECURITY - - SECURITY_ARCHITECTURE - - SUPPLY_CHAIN_SECURITY - - THREAT_INTELLIGENCE + - account + - admin_surface + - background_processing + - data_perimeter + - data_plane + - identity_boundary + - kubernetes_cluster + - kubernetes_namespace + - network_boundary + - other + - private_network + - private_service + - public_edge + - secrets_boundary + - security_group + - service_perimeter + - subnet + - tenant_boundary + - vpc type: string - ModelsMemoryClassificationSystemTypesElem: + RepocontextServiceCategory: enum: - - API - - APPLICATION + - CACHE - DATABASE - - ENDPOINT - - INFRASTRUCTURE - - SERVICE + - EVENT_BUS + - EXTERNAL_API + - FILE_STORAGE + - KEY_MANAGEMENT + - MESSAGE_QUEUE + - NOTIFICATION + - OBJECT_STORAGE + - OTHER + - SEARCH + - SECRETS + - WORKFLOW type: string - ModelsMemoryCrossReferencesElem: - properties: - description: - nullable: true - type: string - id: - type: string - type: object - ModelsMemoryMemoryLineage: + RepocontextSourceSink: properties: - agentVersion: - nullable: true - type: string - generationReason: - $ref: '#/components/schemas/ModelsMemoryMemoryLineageGenerationReason' - nullable: true - isLatest: - type: boolean - parentMemoryId: - nullable: true - type: string - parentSessionId: + argumentDigest: nullable: true type: string - sessionId: - type: string - timestamp: - format: date-time - type: string - type: object - ModelsMemoryMemoryLineageGenerationReason: - enum: - - AGENT_UPGRADED - - DOCUMENT_UPDATED - - OTHER - - USER_TRIGGERED - type: string - ModelsMemoryMemoryType: - enum: - - ANALYSIS - - AUTOFIX - - DISCOVERY - - ESCALATION - - FOLLOW_UP - - HISTORICAL - - KNOWLEDGE - - OTHER - - REMEDIATION - - TRIAGE - - VALIDATION - type: string - ModelsMemoryMetadata: - properties: - documentMetadata: - $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadata' - findingId: + category: + $ref: '#/components/schemas/RepocontextSourceSinkCategory' + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + dataClassHint: + $ref: '#/components/schemas/RepocontextDataClassification' + nullable: true + dataDomainHint: nullable: true type: string - type: object - ModelsMemoryMetadataDocumentMetadata: - properties: - documentDescription: + detector: nullable: true type: string - documentId: + endLine: nullable: true + type: integer + filePath: type: string - documentName: + framework: nullable: true type: string - documentType: - $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadataDocumentType' + id: + type: string + isExternal: nullable: true - documentVersion: + type: boolean + kind: + $ref: '#/components/schemas/RepocontextSourceSinkKind' + language: + $ref: '#/components/schemas/LanguageCodeLanguage' nullable: true - type: string - source: + projectId: nullable: true type: string - structuralInfo: - $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadataStructuralInfo' - type: object - ModelsMemoryMetadataDocumentMetadataDocumentType: - enum: - - API_SPEC - - ARCHITECTURE - - AUDIT_REPORT - - COMPLIANCE_REPORT - - DOCUMENTATION - - OTHER - - POLICY - - SECURITY_REPORT - - TEST_RESULT - - VULNERABILITY_REPORT - type: string - ModelsMemoryMetadataDocumentMetadataStructuralInfo: - properties: - encoding: - nullable: true + qualifiedName: type: string - sections: + resolvedUrls: items: - $ref: '#/components/schemas/ModelsMemoryMetadataDocumentMetadataStructuralInfoSectionsElem' + $ref: '#/components/schemas/RepocontextSourceSinkResolvedUrlsElem' type: array - totalCharacters: - nullable: true - type: integer - totalLines: - nullable: true - type: integer - type: object - ModelsMemoryMetadataDocumentMetadataStructuralInfoSectionsElem: - properties: - endLine: - nullable: true + startLine: type: integer - name: + symbol: nullable: true type: string - startLine: - nullable: true - type: integer - type: + symbolId: nullable: true type: string type: object - ModelsMemoryPriority: - enum: - - CRITICAL - - HIGH - - INFO - - LOW - - MEDIUM - type: string - ModelsMemoryResourceType: + RepocontextSourceSinkCategory: enum: - - AGENT_REASONING - - APP_CONTEXT - - BUGHUNT_SCAN - - BUGHUNT_TRIAGE - - CHAT_SESSION - - CLOUD_CONTEXT - - CODE_AUTOFIX - - CODE_TRIAGE - - COMPLIANCE_FRAMEWORK - - CONTAINERS_TRIAGE - - DEPENDENCIES_AUTOFIX - - DEPENDENCIES_TRIAGE - - MANAGER_CAMPAIGN - - NETWORK_REACHABILITY - - ORGANIZATION - - ORG_CONTEXT - - OTHER - - PENTEST_AUTH_MATRIX - - PENTEST_EXPLOIT_ANALYSIS - - PENTEST_TOOLS - - PROJECT - - QUESTION_ANSWER - - REPO_CONTEXT - - SCHEMA_REVERSING - - SECRETS_TRIAGE - - STANDOUT_ASSESSMENT - - TEAM - - USER - - VAULT - - VULNERABILITY_FINDING + - cache_read + - cache_write + - cli_entry + - config_read + - database_read + - database_write + - encrypt + - env_read + - event_handler + - external_api_call + - file_read + - file_write + - hash + - http_request_handler + - llm_input + - llm_output + - log_write + - notification_send + - object_storage_read + - object_storage_write + - other + - outbound_http + - queue_consumer + - queue_publish + - redact + - response_write + - scheduled_task + - secret_read + - tokenize + - validate type: string - ModelsMemoryScope: + RepocontextSourceSinkKind: enum: - - CLOUD - - ORGANIZATION - - REPOSITORY + - sanitizer + - sink + - source type: string - ModelsOrgContext: + RepocontextSourceSinkResolvedUrlsElem: properties: - cacheKey: + configKey: + type: string + filePath: + type: string + line: + type: integer + url: + type: string + type: object + RepocontextToxicCombination: + properties: + componentFindings: + $ref: '#/components/schemas/RepocontextToxicCombinationComponentFindings' + confidence: + $ref: '#/components/schemas/RepocontextConfidence' + description: nullable: true type: string - complianceRequirements: + evidencePaths: items: type: string type: array - description: + id: type: string - detailedOverview: + name: + type: string + pattern: + $ref: '#/components/schemas/RepocontextToxicCombinationPattern' + recommendedRemediation: nullable: true type: string - documentCitations: + severity: + $ref: '#/components/schemas/RepocontextToxicCombinationSeverity' + type: object + RepocontextToxicCombinationComponentFindings: + properties: + artifactLinkIds: items: - $ref: '#/components/schemas/ModelsOrgContextDocumentCitationsElem' + type: string type: array - escalationPolicies: + dataFlowIds: items: - $ref: '#/components/schemas/ModelsEscalationPolicy' + type: string type: array - industries: + entrypointIds: items: - $ref: '#/components/schemas/ModelsOrgContextIndustriesElem' - nullable: true + type: string type: array - name: - type: string - notes: + reachabilityPathIds: items: - $ref: '#/components/schemas/ModelsMemory' + type: string type: array - onboarded: - nullable: true - type: boolean - otherIndustries: + routeReferences: + items: + $ref: '#/components/schemas/RepocontextToxicCombinationComponentFindingsRouteReferencesElem' + type: array + secretUsageIds: items: type: string type: array - products: + securityBoundaryIds: items: - $ref: '#/components/schemas/ModelsOrgContextProductsElem' + type: string type: array - questionnaire: - $ref: '#/components/schemas/ModelsSecurityOnboardingAnswers' - timeZone: - nullable: true - type: string - vaultFiles: + trustedServiceIds: items: - $ref: '#/components/schemas/ModelsOrgContextVaultFilesElem' + type: string type: array type: object - ModelsOrgContextDocumentCitationsElem: + RepocontextToxicCombinationComponentFindingsRouteReferencesElem: properties: - citation_id: - type: string - document_id: - nullable: true - type: string - document_name: + entrypointId: nullable: true type: string - page: - nullable: true + method: type: string - source_type: - $ref: '#/components/schemas/ModelsOrgContextDocumentCitationsElemSourceType' - title: - nullable: true + path: type: string type: object - ModelsOrgContextDocumentCitationsElemSourceType: + RepocontextToxicCombinationPattern: enum: - - document - - questionnaire + - cross_boundary_flow_without_sanitizer + - hardcoded_credential_write_access + - internet_reachable_admin_endpoint + - internet_reachable_sensitive_sink + - missing_authz_on_tenant_isolation_boundary + - other + - privileged_role_internet_reachable + - public_workload_with_plaintext_secret + - sensitive_data_logged_in_plaintext + - unauthenticated_route_with_pii + - unencrypted_data_flow_over_internet type: string - ModelsOrgContextIndustriesElem: + RepocontextToxicCombinationSeverity: enum: - - AGRICULTURE - - CONSTRUCTION - - EDUCATION - - ENERGY - - ENTERTAINMENT - - FINANCIAL_SERVICES - - GOVERNMENT - - HEALTHCARE - - INFORMATION_TECHNOLOGY - - INSURANCE_SERVICES - - LOGISTICS - - MANUFACTURING - - MINING - - OTHER - - PROFESSIONAL_SERVICES - - REAL_ESTATE - - RETAIL - - TECHNOLOGY + - CRITICAL + - HIGH + - LOW + - MEDIUM type: string - ModelsOrgContextProductsElem: + RepocontextTrustedService: properties: + accessPatterns: + items: + $ref: '#/components/schemas/RepocontextTrustedServiceAccessPatternsElem' + type: array + boundaryIds: + items: + type: string + type: array + category: + $ref: '#/components/schemas/RepocontextServiceCategory' + cloudReconServiceId: + nullable: true + type: string + confidence: + $ref: '#/components/schemas/RepocontextConfidence' description: type: string + evidencePaths: + items: + type: string + type: array + id: + type: string name: type: string - productType: - $ref: '#/components/schemas/ModelsOrgContextProductsElemProductType' - url: + nodeIds: + items: + type: string + type: array + reasoning: + nullable: true type: string + relatedDataDomainIds: + items: + type: string + type: array + relatedEntrypointIds: + items: + type: string + type: array + relatedProjectIds: + items: + type: string + type: array + secretsAccessPattern: + $ref: '#/components/schemas/RepocontextTrustedServiceSecretsAccessPattern' + nullable: true + serviceType: + $ref: '#/components/schemas/RepocontextTrustedServiceType' type: object - ModelsOrgContextProductsElemProductType: + RepocontextTrustedServiceAccessPatternsElem: enum: - - B2B_ON_PREMISE - - B2B_SAAS - - B2B_SAAS_OSS - - B2C_SAAS - - DESKTOP_APPLICATION - - E_COMMERCE - - MARKETPLACE - - MEDIA_STREAMING - - SOCIAL + - DECRYPT + - ENCRYPT + - OTHER + - PUBLISH + - READ + - READ_SECRET + - READ_WRITE + - SIGN + - STORE_SECRET + - SUBSCRIBE + - VERIFY + - WRITE type: string - ModelsOrgContextVaultFilesElem: + RepocontextTrustedServiceSecretsAccessPattern: + enum: + - config_file + - env_var + - hardcoded + - sdk_call + - sidecar + - unknown + type: string + RepocontextTrustedServiceType: + enum: + - AWS_DYNAMODB + - AWS_EFS + - AWS_ELASTICACHE + - AWS_EVENTBRIDGE + - AWS_KMS + - AWS_MQ + - AWS_RDS + - AWS_S3 + - AWS_SECRETS_MANAGER + - AWS_SNS + - AWS_SQS + - AWS_STEPFUNCTIONS + - AZURE_BLOB_STORAGE + - AZURE_KEY_VAULT + - AZURE_SERVICE_BUS + - AZURE_SQL + - ELASTICSEARCH + - GCP_CLOUD_SQL + - GCP_CLOUD_STORAGE + - GCP_KMS + - GCP_PUBSUB + - GENERIC_HTTP_API + - KAFKA + - MONGODB + - MYSQL + - OTHER + - POSTGRESQL + - RABBITMQ + - REDIS + type: string + AgentsAgentLogs: + items: {} + nullable: true + type: array + AgentsGroupedAgentLog: + properties: + logs: + $ref: '#/components/schemas/AgentsAgentLogs' + summary: + type: string + type: object + AgentsGroupedAgentLogs: + items: + $ref: '#/components/schemas/AgentsGroupedAgentLog' + nullable: true + type: array + EndpointsAutofixActivityLogEntry: properties: content: type: string - description: + createdAt: type: string - documentId: + eventType: type: string - fileName: + id: + type: string + metadata: + nullable: true type: string type: object - ModelsProjectSummary: + EndpointsAutofixCoordination: properties: - description: - type: string - framework: - type: string - id: + entries: + items: + $ref: '#/components/schemas/EndpointsAutofixPRCoordination' + nullable: true + type: array + unavailable: + type: boolean + required: + - unavailable + - entries + type: object + EndpointsAutofixOutcome: + enum: + - '' + - declined + - stopped + type: string + EndpointsAutofixPRCoordination: + properties: + attemptId: type: string - isDeleted: + blocked: type: boolean - language: + message: type: string - name: + prIdentifier: type: string - path: + reasonCode: type: string repositoryId: type: string + requestId: + type: string + retryAllowed: + type: boolean + state: + type: string required: - - id - - name - repositoryId - - path - - description - - isDeleted + - prIdentifier + - requestId + - state + - blocked + - retryAllowed + - reasonCode + - message type: object - ModelsSBOMProject: + EndpointsAutofixStatusOutput: properties: - commits: - items: - type: string + autofixId: + type: string + autofixVerdictExplanation: + type: string + autofixVerdictReason: + $ref: '#/components/schemas/ModelsAutofixFailureReason' nullable: true + availableActions: + items: + $ref: '#/components/schemas/EndpointsAvailableAction' type: array - projectId: + coordination: + $ref: '#/components/schemas/EndpointsAutofixCoordination' + currentActivity: type: string - projectName: + currentPhase: + $ref: '#/components/schemas/ModelsAutofixPhase' + isAutoFixable: + nullable: true + type: boolean + iterations: + $ref: '#/components/schemas/EndpointsIterationSummary' + lastActivityAt: + type: string + outcome: + $ref: '#/components/schemas/EndpointsAutofixOutcome' + pullRequestState: + $ref: '#/components/schemas/ModelsPullRequestState' + pullRequestUrl: + type: string + pullRequests: + items: + $ref: '#/components/schemas/EndpointsPullRequestSummary' + type: array + reconciliationStale: + type: boolean + state: + $ref: '#/components/schemas/ModelsAutoFixState' + terminal: + type: boolean + updatedAt: type: string required: - - projectId - - commits + - state + - terminal type: object - ModelsSBOMRepository: + EndpointsAvailableAction: properties: - projects: - items: - $ref: '#/components/schemas/ModelsSBOMProject' - nullable: true - type: array - repositoryId: + body: + additionalProperties: {} + type: object + confirm: + type: string + href: + type: string + id: + type: string + kind: + $ref: '#/components/schemas/EndpointsAvailableActionKind' + label: type: string - repositoryName: + method: type: string required: - - repositoryId - - projects + - id + - label + - kind type: object - ModelsSchemaFormat: - enum: - - JSON - - PROTO - - SDL - - TEXT - - WSDL - - YAML - type: string - ModelsSchemaType: + EndpointsAvailableActionKind: enum: - - GRAPHQL - - GRPC - - OPENAPI - - SOAP + - command + - link type: string - ModelsSecurityOnboardingAnswers: + EndpointsDeleteTicketCSPMFindingOutput: properties: - additionalNotes: - nullable: true - type: string - companyName: + version: type: string - complianceStandards: + type: object + EndpointsGetAutofixActivityLogOutput: + properties: + entries: items: - type: string + $ref: '#/components/schemas/EndpointsAutofixActivityLogEntry' + nullable: true type: array - coreProductsServices: + nextCursor: type: string - dataTypes: - items: - type: string - type: array - files: - items: - $ref: '#/components/schemas/ModelsSecurityOnboardingAnswersFilesElem' - type: array - impactConcerns: - items: - type: string - type: array - perceivedThreatActors: - items: - type: string - type: array + required: + - entries type: object - ModelsSecurityOnboardingAnswersFilesElem: + EndpointsGetCSPMFindingAutofixStateOutput: properties: - content: + status: + $ref: '#/components/schemas/EndpointsAutofixStatusOutput' + version: type: string - description: + required: + - status + type: object + EndpointsGetCSPMFindingAutofixStatusOutput: + properties: + status: + $ref: '#/components/schemas/EndpointsAutofixStatusOutput' + version: type: string - fileName: + required: + - status + type: object + EndpointsGetCSPMFindingOutput: + properties: + finding: + $ref: '#/components/schemas/ModelsCSPMFinding' + version: + type: string + required: + - finding + - version + type: object + EndpointsGetCSPMFindingTriageOutput: + properties: + finding: + $ref: '#/components/schemas/ModelsTriagedCSPMFinding' + version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' type: object - ModelsSecurityProfile: + EndpointsGetCSPMFindingsOutput: properties: - exposedSecrets: - type: integer - recommendations: + findings: items: - type: string + $ref: '#/components/schemas/ModelsCSPMFindingPreview' + nullable: true type: array - riskScore: + nextToken: + type: string + numItems: type: integer + totalCount: + type: integer + version: + type: string required: - - riskScore - - exposedSecrets + - findings + - numItems + - totalCount + - version type: object - RepocontextAPISchema: + EndpointsGetCSPMScanOutput: properties: - content: - nullable: true - type: string - format: - $ref: '#/components/schemas/RepocontextAPISchemaFormat' - name: - type: string - origin: - $ref: '#/components/schemas/RepocontextAPISchemaOrigin' - nullable: true - path: - nullable: true - type: string - type: - $ref: '#/components/schemas/RepocontextAPISchemaType' + scan: + $ref: '#/components/schemas/ModelsCSPMScan' version: - nullable: true type: string + required: + - scan + - version type: object - RepocontextAPISchemaFormat: - enum: - - JSON - - PROTO - - SDL - - TEXT - - XML - - YAML - type: string - RepocontextAPISchemaOrigin: - enum: - - discovered - - generated - type: string - RepocontextAPISchemaType: - enum: - - ASYNCAPI - - GRAPHQL - - GRPC - - INSOMNIA - - OPENAPI - - POSTMAN - - RAML - - SWAGGER - - WADL - type: string - RepocontextAccountInfrastructureSummary: + EndpointsGetCSPMScansOutput: properties: - accountId: + nextToken: type: string - accountType: - $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryAccountType' - capabilities: - $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryCapabilities' - computeServices: + numItems: + type: integer + scans: items: - $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryComputeServicesElem' - type: array - internetFacingServiceCount: + $ref: '#/components/schemas/ModelsCSPMScanPreview' nullable: true + type: array + totalCount: type: integer - narrative: - nullable: true + version: type: string - regions: - items: - type: string - type: array - totalComputeServices: - nullable: true + required: + - scans + - numItems + - totalCount + - version + type: object + EndpointsIterationSummary: + properties: + count: + type: integer + durationSeconds: + type: integer + lastIterationAt: + type: string + totalCostUSD: + format: double + type: number + totalInputTokens: + type: integer + totalOutputTokens: type: integer + required: + - count + - totalCostUSD + - totalInputTokens + - totalOutputTokens + - durationSeconds type: object - RepocontextAccountInfrastructureSummaryAccountType: - enum: - - development - - network_services - - production - - staging - type: string - RepocontextAccountInfrastructureSummaryCapabilities: + EndpointsPatchCSPMFindingInput: properties: - hasApiGateway: - nullable: true - type: boolean - hasCdn: - nullable: true - type: boolean - hasContainerServices: - nullable: true - type: boolean - hasCrossAccountReferences: - nullable: true - type: boolean - hasDatabases: - nullable: true - type: boolean - hasDns: + clearPriorityOverride: + description: Remove the user-set priority override nullable: true type: boolean - hasKubernetes: + clearSeverityOverride: + description: Remove the user-set severity override, restoring the scanner severity nullable: true type: boolean - hasLoadBalancers: + priorityOverride: + $ref: '#/components/schemas/ModelsPriorityLabel' nullable: true - type: boolean - hasServerlessFunctions: + severityOverride: + $ref: '#/components/schemas/ModelsSeverity' nullable: true - type: boolean - hasTransitGateway: + userNotes: + description: Free-form user notes on the finding nullable: true - type: boolean + type: string type: object - RepocontextAccountInfrastructureSummaryComputeServicesElem: + EndpointsPatchCSPMFindingOutput: properties: - computeType: - $ref: '#/components/schemas/RepocontextAccountInfrastructureSummaryComputeServicesElemComputeType' - internetFacing: - type: boolean - name: - type: string - region: - nullable: true - type: string - trafficFlow: - nullable: true + version: type: string type: object - RepocontextAccountInfrastructureSummaryComputeServicesElemComputeType: - enum: - - container_service - - kubernetes_workload - - other - - serverless_function - - virtual_machine - type: string - RepocontextArtifactLink: + EndpointsPostAllowlistCSPMFindingInput: properties: - artifactId: - type: string - confidence: - $ref: '#/components/schemas/RepocontextConfidence' - description: - type: string - entrypointId: - nullable: true - type: string - evidencePaths: - items: - type: string - type: array - matchMethod: - $ref: '#/components/schemas/RepocontextArtifactLinkMatchMethod' - projectId: - nullable: true - type: string - targetKind: - $ref: '#/components/schemas/RepocontextArtifactLinkTargetKind' - targetNodeId: - nullable: true + allowlistReason: + description: The reason for allowlisting the finding type: string - targetRef: + allowlistType: + $ref: '#/components/schemas/ModelsAllowlistType' + userCanonicalId: + description: User who allowlisted the finding type: string + required: + - allowlistReason type: object - RepocontextArtifactLinkMatchMethod: - enum: - - affinity_hint - - build_config - - ci_pipeline - - container_image_name - - container_image_uri - - manual_label - - other - - registry_reference - - service_name_match - type: string - RepocontextArtifactLinkTargetKind: - enum: - - graph_node - - infrastructure_resource - - registry - - workload - type: string - RepocontextBusinessFunction: + EndpointsPostAllowlistCSPMFindingOutput: properties: - description: - type: string - id: - type: string - name: + version: type: string - ownedPaths: - items: - type: string - type: array type: object - RepocontextCallEdge: + EndpointsPostArchiveCSPMFindingInput: properties: - callSiteFilePath: + userCanonicalId: + description: User who archived the finding type: string - callSiteLine: - type: integer - calleeQualifiedName: + type: object + EndpointsPostArchiveCSPMFindingOutput: + properties: + version: type: string - calleeSymbolId: + type: object + EndpointsPostCSPMFindingAutofixInput: + properties: + force: nullable: true + type: boolean + gitRepositoryProvider: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + message: type: string - callerQualifiedName: - type: string - callerSymbolId: - nullable: true + originCampaignId: type: string - confidence: - $ref: '#/components/schemas/RepocontextConfidence' - detector: - nullable: true + useCachedFix: + deprecated: true + description: Deprecated and ignored. CSPM always generates a fresh fix. + type: boolean + type: object + EndpointsPostCSPMFindingAutofixOutput: + properties: + autoFixState: + $ref: '#/components/schemas/ModelsAutoFixState' + error: type: string - id: + runId: type: string - isExternal: - nullable: true - type: boolean - kind: - $ref: '#/components/schemas/RepocontextCallEdgeKind' - language: - $ref: '#/components/schemas/LanguageCodeLanguage' - nullable: true - projectId: - nullable: true + version: type: string + required: + - autoFixState type: object - RepocontextCallEdgeKind: - enum: - - callback - - direct - - dynamic - - framework - - interface - - method - - virtual - type: string - RepocontextCodeConvention: + EndpointsPostCreateTicketCSPMFindingInput: properties: - category: - $ref: '#/components/schemas/RepocontextCodeConventionCategory' - description: - type: string - evidencePaths: + assignees: items: - type: string + $ref: '#/components/schemas/ModelsUser' type: array - scope: - nullable: true + campaignId: type: string - type: object - RepocontextCodeConventionCategory: - enum: - - API_DESIGN - - ARCHITECTURE - - CODE_STYLE - - DATA_ACCESS - - DEPENDENCY_MANAGEMENT - - ERROR_HANDLING - - NAMING - - OBSERVABILITY - - OTHER - - RELEASE_PROCESS - - SECURITY - - TESTING - type: string - RepocontextCodeSymbol: - properties: - endLine: - nullable: true - type: integer - filePath: + campaignTitle: type: string - id: + message: type: string - kind: - $ref: '#/components/schemas/RepocontextCodeSymbolKind' - language: - $ref: '#/components/schemas/LanguageCodeLanguage' - nullable: true - name: + project: type: string - parentSymbolId: - nullable: true + userCanonicalId: type: string - qualifiedName: - nullable: true + type: object + EndpointsPostCreateTicketCSPMFindingOutput: + properties: + ticket: + $ref: '#/components/schemas/ModelsTicketProvider' + version: type: string - signature: - nullable: true + required: + - ticket + type: object + EndpointsPostMarkFalsePositiveCSPMFindingInput: + properties: + falsePositiveReason: + description: The reason the finding is not a real issue type: string - startLine: - type: integer - summary: - nullable: true + userCanonicalId: + description: User who marked the finding as false positive type: string - visibility: - $ref: '#/components/schemas/RepocontextCodeSymbolVisibility' - nullable: true + required: + - falsePositiveReason type: object - RepocontextCodeSymbolKind: - enum: - - class - - constant - - enum - - function - - interface - - macro - - method - - module - - type - - variable - type: string - RepocontextCodeSymbolVisibility: - enum: - - internal - - private - - protected - - public - type: string - RepocontextComplianceFramework: - enum: - - CCPA - - CIS - - FEDRAMP - - GDPR - - GLBA - - HIPAA - - ISO27001 - - NIST - - OTHER - - PCI-DSS - - SOC2 - type: string - RepocontextConfidence: - enum: - - confirmed - - high - - low - - medium - - speculative - type: string - RepocontextDataClassification: - enum: - - confidential - - highly_confidential - - internal - - public - - restricted - type: string - RepocontextDataDomain: + EndpointsPostMarkFalsePositiveCSPMFindingOutput: + properties: + version: + type: string + type: object + EndpointsPostUnallowlistCSPMFindingInput: properties: - availabilityRequirement: - $ref: '#/components/schemas/RepocontextImpactLevel' - nullable: true - complianceFrameworks: - items: - $ref: '#/components/schemas/RepocontextComplianceFramework' - type: array - description: + unallowlistReason: + description: Optional reason for unallowlisting the finding type: string - examplePaths: - items: - type: string - type: array - id: + userCanonicalId: + description: User who unallowlisted the finding type: string - integrityRequirement: - $ref: '#/components/schemas/RepocontextImpactLevel' - nullable: true - name: + type: object + EndpointsPostUnallowlistCSPMFindingOutput: + properties: + version: type: string - piiCategories: - items: - $ref: '#/components/schemas/RepocontextDataDomainPiiCategoriesElem' - type: array - sensitivity: - $ref: '#/components/schemas/RepocontextDataDomainSensitivity' type: object - RepocontextDataDomainPiiCategoriesElem: - enum: - - CREDENTIALS - - EMAIL - - FINANCIAL - - HEALTH - - NAME - - OTHER - - SSN - type: string - RepocontextDataDomainSensitivity: - enum: - - CRITICAL - - HIGH - - LOW - - MODERATE - type: string - RepocontextDataFlow: + EndpointsPostUnarchiveCSPMFindingInput: properties: - accessPattern: - $ref: '#/components/schemas/RepocontextDataFlowAccessPattern' - nullable: true - cloudReconDataFlowId: - nullable: true + userCanonicalId: + description: User who unarchived the finding type: string - codeHops: - items: - $ref: '#/components/schemas/RepocontextDataflowHop' - type: array - confidence: - $ref: '#/components/schemas/RepocontextConfidence' - crossedBoundaryIds: - items: - type: string - type: array - dataClassification: - $ref: '#/components/schemas/RepocontextDataClassification' - nullable: true - dataDomainIds: - items: - type: string - type: array - description: + type: object + EndpointsPostUnarchiveCSPMFindingOutput: + properties: + version: + type: string + type: object + EndpointsPostUnmarkFalsePositiveCSPMFindingInput: + properties: + userCanonicalId: + description: User who unmarked the finding as false positive + type: string + type: object + EndpointsPostUnmarkFalsePositiveCSPMFindingOutput: + properties: + version: + type: string + type: object + EndpointsPullRequestSummary: + properties: + ciCheckedAt: + format: date-time nullable: true type: string - entrypointId: + ciDetailUrl: nullable: true type: string - evidencePaths: - items: - type: string - type: array - exposure: - $ref: '#/components/schemas/RepocontextExposureLevel' + ciState: + $ref: '#/components/schemas/ModelsPullRequestCIState' nullable: true - id: + createdAt: type: string - infraConnections: - $ref: '#/components/schemas/RepocontextDataFlowInfraConnections' - name: + identifier: + type: integer + mergedAt: type: string - pathEdgeTypes: - items: - $ref: '#/components/schemas/GraphEdgeType' - type: array - pathNodeIds: - items: - type: string - type: array - projectId: - nullable: true + provider: + $ref: '#/components/schemas/ModelsProviderID' + recordId: type: string - protections: - items: - $ref: '#/components/schemas/RepocontextDataFlowProtectionsElem' - type: array - sink: - $ref: '#/components/schemas/RepocontextDataFlowSink' - source: - $ref: '#/components/schemas/RepocontextDataFlowSource' - sourceSinkIds: - items: - type: string - type: array - validationApplied: - $ref: '#/components/schemas/RepocontextDataFlowValidationApplied' - nullable: true + status: + $ref: '#/components/schemas/ModelsPullRequestState' + url: + type: string + required: + - identifier type: object - RepocontextDataFlowAccessPattern: - enum: - - DELETE - - OTHER - - PUBLISH - - READ - - READ_WRITE - - SUBSCRIBE - - WRITE - type: string - RepocontextDataFlowInfraConnections: + EndpointsStartCSPMScanOutput: properties: - fullPath: - nullable: true + executionArn: type: string - internalPath: - $ref: '#/components/schemas/RepocontextInfraPath' - internetPath: - $ref: '#/components/schemas/RepocontextInfraPath' - sinkPath: - $ref: '#/components/schemas/RepocontextInfraPath' + scanId: + type: string + statusCode: + type: integer type: object - RepocontextDataFlowProtectionsElem: + FrameworksConfidence: enum: - - ACCESS_CONTROLLED - - ANONYMIZED - - ENCRYPTED_AT_REST - - ENCRYPTED_IN_TRANSIT - - HASHED - - NONE_OBSERVED - - REDACTED - - SIGNED - - TOKENIZED + - exact + - heuristic + - default + - none type: string - RepocontextDataFlowSink: + FrameworksControlRef: properties: - description: - nullable: true + confidence: + $ref: '#/components/schemas/FrameworksConfidence' + id: type: string - identifier: + level: nullable: true type: string - isExternal: - nullable: true - type: boolean - kind: - $ref: '#/components/schemas/RepocontextDataFlowSinkKind' - nodeId: - nullable: true + relationship: type: string - trustedServiceId: - nullable: true + title: + type: string + url: type: string type: object - RepocontextDataFlowSinkKind: + FrameworksFrameworkID: enum: - - cache - - database - - external_api - - file_system - - llm_input - - logs - - notification - - object_storage - - other - - queue - - response + - cvss-3.1 + - cvss-4.0 + - owasp-top10-2021 + - owasp-asvs-5.0 + - pci-dss-4.0.1 + - nist-csf-2.0 + - au-ism type: string - RepocontextDataFlowSource: + FrameworksResult: properties: - description: + controls: + items: + $ref: '#/components/schemas/FrameworksControlRef' + type: array + framework: + $ref: '#/components/schemas/FrameworksFrameworkID' + mappingConfidence: + $ref: '#/components/schemas/FrameworksConfidence' + notes: + items: + type: string + type: array + rank: nullable: true type: string - entrypointId: - nullable: true + score: + $ref: '#/components/schemas/FrameworksScore' + version: type: string - identifier: - nullable: true + type: object + FrameworksScore: + properties: + baseScore: + format: double + type: number + nomenclature: type: string - isExternal: - nullable: true + qualitative: + type: string + synthesized: type: boolean - kind: - $ref: '#/components/schemas/RepocontextDataFlowSourceKind' - nodeId: - nullable: true + vector: type: string - trustedServiceId: + type: object + FrameworksVulnManagementFrameworks: + properties: + results: + items: + $ref: '#/components/schemas/FrameworksResult' nullable: true + type: array + type: object + ModelsAssessmentFactor: + properties: + description: + type: string + title: type: string type: object - RepocontextDataFlowSourceKind: + ModelsAutofixFailureReason: enum: - - cache_read - - database_read - - event - - external_api - - file_upload - - internal_config - - internal_service - - llm_output - - other - - scheduled - - user_input - - web_scraping - - webhook + - AGENT_ERROR + - AGENT_SURRENDERED + - CODE_NOT_FOUND + - ECOSYSTEM_NOT_SUPPORTED + - FIX_REJECTED + - MULTIPLE_SOURCE_FILES + - NO_FIX_AVAILABLE + - NO_PATCHED_VERSION + - PR_CREATE_FAILED type: string - RepocontextDataFlowValidationApplied: + ModelsAutofixPhase: enum: - - full - - none_observed - - partial - - unknown + - planning + - fixing + - reviewing + - creating_pr type: string - RepocontextDataflowHop: + ModelsCSPMExposureReason: + enum: + - attack_path_reachable + - attack_path_not_reachable + - attack_path_node_unresolved + - attack_path_node_ambiguous + - attack_path_set_empty + - attack_path_stale + type: string + ModelsCSPMFinding: properties: - boundaryId: - nullable: true + accountId: type: string - callEdgeId: - nullable: true + accountName: type: string - filePath: + aiDevTitle: type: string - index: - type: integer - line: - type: integer - notes: - nullable: true + aiTitle: type: string - qualifiedName: + allowlistReason: type: string - role: - $ref: '#/components/schemas/RepocontextDataflowHopRole' - symbol: - nullable: true + allowlistType: + $ref: '#/components/schemas/ModelsAllowlistType' + autoFixCurrentActivity: type: string - symbolId: + autoFixEndTime: + format: date-time nullable: true type: string - type: object - RepocontextDataflowHopRole: - enum: - - dispatcher - - sanitizer - - sink - - source - - transform - type: string - RepocontextEntrypointRoute: - properties: - authMethods: - items: - $ref: '#/components/schemas/RepocontextEntrypointRouteAuthMethodsElem' - type: array - dataDomainIds: - items: - type: string - type: array - dataFlowIds: - items: - type: string - type: array - filePath: + autoFixStartTime: + format: date-time nullable: true type: string - handlerSymbolId: + autoFixState: + $ref: '#/components/schemas/ModelsAutoFixState' + autofixVerdictAt: + format: date-time nullable: true type: string - isAuthenticated: + autofixVerdictExplanation: nullable: true - type: boolean - isInternal: + type: string + autofixVerdictReason: + $ref: '#/components/schemas/ModelsAutofixFailureReason' nullable: true + budgetExhausted: type: boolean - lineNumber: - nullable: true - type: integer - method: - $ref: '#/components/schemas/RepocontextEntrypointRouteMethod' - nullable: true - operationId: - nullable: true + budgetLimit: + format: double + type: number + budgetUsed: + format: double + type: number + category: type: string - parameters: + cloudProvider: + type: string + complianceFrames: items: - $ref: '#/components/schemas/RepocontextRouteParameter' + $ref: '#/components/schemas/ModelsComplianceFrame' type: array - path: + concurrencyLimit: + type: integer + createdAt: type: string - rateLimit: + currentConfig: + additionalProperties: {} + type: object + deletedAt: + format: date-time + type: string + description: + type: string + devDescription: + type: string + expectedConfig: + additionalProperties: {} + type: object + exploitabilityConfidence: + type: string + exploitabilityLabel: + type: string + failedTriage: + type: boolean + falsePositiveReason: + type: string + fixCommit: + type: string + fixEvidence: + type: string + fixSource: + type: string + fixedAt: + format: date-time nullable: true + type: string + id: + type: string + impactConfidence: + type: string + impactLabel: + type: string + installationId: + type: string + isAllowlisted: type: boolean - requestBodyFields: - items: - type: string - type: array - requiresPrivilegedAccess: + isArchived: + type: boolean + isAutoFixableAgentVerdict: nullable: true type: boolean - responseStatuses: + isFalsePositive: + type: boolean + isFixed: + type: boolean + isLatest: + type: boolean + isResolved: + type: boolean + message: + type: string + platform: + type: string + priorityLabel: + $ref: '#/components/schemas/ModelsPriorityLabel' + priorityLabelReason: + type: string + priorityOverride: + $ref: '#/components/schemas/ModelsPriorityLabel' + priorityScore: + type: integer + pullRequestsAutofix: items: - type: integer + $ref: '#/components/schemas/ModelsPullRequestInfo' type: array - summary: - nullable: true + region: type: string - validationApplied: - $ref: '#/components/schemas/RepocontextEntrypointRouteValidationApplied' - nullable: true - type: object - RepocontextEntrypointRouteAuthMethodsElem: - enum: - - API_KEY - - BASIC_AUTH - - IAM - - JWT - - LDAP - - MFA - - MTLS - - NONE - - OAUTH2 - - OPENID - - PASSWORD - - SAML - - SESSION_COOKIE - type: string - RepocontextEntrypointRouteMethod: - enum: - - CONSUME - - DELETE - - EVENT - - GET - - HEAD - - MUTATION - - OPTIONS - - PATCH - - POST - - PUT - - QUERY - - RPC - - SCHEDULE - - SUBSCRIPTION - type: string - RepocontextEntrypointRouteValidationApplied: - enum: - - full - - none_observed - - partial - - unknown - type: string - RepocontextExposureLevel: - enum: - - internal - - internet_reachable - - mixed - - private - - public - - unknown - type: string - RepocontextFileSummary: - properties: - id: + resolvedAt: + format: date-time + type: string + resourceArn: + type: string + resourceId: + type: string + resourceName: + type: string + resourceTags: + additionalProperties: + type: string + type: object + resourceType: + type: string + ruleId: + type: string + ruleUrl: + type: string + scanId: + type: string + severity: + $ref: '#/components/schemas/ModelsSeverity' + severityConfidence: + type: string + severityLabel: + $ref: '#/components/schemas/ModelsSeverity' + severityOverride: + $ref: '#/components/schemas/ModelsSeverity' + severityScore: + type: integer + tenantId: + type: string + ticket: + $ref: '#/components/schemas/ModelsTicketProvider' + ticketState: + type: string + title: + type: string + triageAgentVersion: + type: string + triageAttempts: + type: integer + triageDeferredUntil: + format: date-time nullable: true type: string - isGenerated: + triageDurationSeconds: + type: integer + triageEnd: + format: date-time nullable: true - type: boolean - isTest: + type: string + triageLlmCostUsd: nullable: true - type: boolean - language: - $ref: '#/components/schemas/LanguageCodeLanguage' + type: number + triageStart: + format: date-time nullable: true - path: type: string - projectId: + triageTokenCount: + nullable: true + type: integer + triageTraceId: nullable: true type: string - summary: + updatedAt: + type: string + userNotes: type: string + required: + - platform + - installationId + - resolvedAt + - triageDurationSeconds + - isResolved type: object - RepocontextImpactLevel: - enum: - - CRITICAL - - HIGH - - LOW - - MODERATE - type: string - RepocontextInfraNode: + ModelsCSPMFindingPreview: properties: - name: - nullable: true + accountId: type: string - nodeId: - nullable: true + accountName: type: string - type: - nullable: true + aiDevTitle: type: string - type: object - RepocontextInfraPath: - properties: - description: - nullable: true + aiTitle: type: string - exposure: - $ref: '#/components/schemas/RepocontextExposureLevel' - nullable: true - nodes: + allowlistReason: + type: string + allowlistType: + $ref: '#/components/schemas/ModelsAllowlistType' + category: + type: string + cloudProvider: + type: string + complianceFrames: items: - $ref: '#/components/schemas/RepocontextInfraNode' + $ref: '#/components/schemas/ModelsComplianceFrame' type: array - type: object - RepocontextInfrastructureMatch: - properties: - accountId: + createdAt: type: string - accountType: - $ref: '#/components/schemas/RepocontextInfrastructureMatchAccountType' - nullable: true - artifactName: - nullable: true + falsePositiveReason: type: string - computeType: - $ref: '#/components/schemas/RepocontextInfrastructureMatchComputeType' - isInternetFacing: - type: boolean - matchConfidence: - $ref: '#/components/schemas/RepocontextConfidence' - matchDetail: - nullable: true + id: type: string - matchMethod: - $ref: '#/components/schemas/RepocontextInfrastructureMatchMatchMethod' - nodeId: + isAllowlisted: + type: boolean + isArchived: + type: boolean + isFalsePositive: + type: boolean + isFixed: + type: boolean + isLatest: + type: boolean + isResolved: + type: boolean + message: type: string + priorityLabel: + $ref: '#/components/schemas/ModelsPriorityLabel' + priorityOverride: + $ref: '#/components/schemas/ModelsPriorityLabel' + priorityScore: + type: integer region: - nullable: true type: string - serviceName: + resourceArn: type: string - type: object - RepocontextInfrastructureMatchAccountType: - enum: - - development - - network_services - - production - - staging - type: string - RepocontextInfrastructureMatchComputeType: - enum: - - container_service - - kubernetes_workload - - other - - serverless_function - - virtual_machine - type: string - RepocontextInfrastructureMatchMatchMethod: - enum: - - affinity_hint - - aws_tag - - container_image_name - - container_image_uri - - k8s_label - - service_name_match - type: string - RepocontextMetadata: - properties: - generatedAt: - format: date-time - nullable: true + resourceId: type: string - generatorModel: - nullable: true + resourceName: type: string - generatorPromptVersion: - nullable: true + resourceType: type: string - warnings: - items: - type: string - type: array - type: object - RepocontextProjectArtifact: - properties: - artifactName: + ruleId: type: string - buildEvidencePaths: - items: - type: string - type: array - deploymentContext: - $ref: '#/components/schemas/RepocontextProjectArtifactDeploymentContext' - description: + ruleUrl: type: string - id: + severity: + $ref: '#/components/schemas/ModelsSeverity' + severityOverride: + $ref: '#/components/schemas/ModelsSeverity' + tenantId: type: string - name: + ticket: + $ref: '#/components/schemas/ModelsTicketProvider' + title: type: string - nonProduction: - type: boolean - otherArtifactType: + triageEnd: + format: date-time nullable: true type: string - registries: - items: - $ref: '#/components/schemas/RepocontextProjectArtifactRegistriesElem' - nullable: true - type: array - story: - items: - $ref: '#/components/schemas/RepocontextProjectArtifactStoryElem' - type: array - subArtifactPath: + triageStart: + format: date-time nullable: true type: string - subArtifactType: - $ref: '#/components/schemas/GraphBuildArtifactType' - nullable: true - type: - $ref: '#/components/schemas/GraphBuildArtifactType' - nullable: true - type: object - RepocontextProjectArtifactDeploymentContext: - properties: - isDeployed: - nullable: true - type: boolean + updatedAt: + type: string + userNotes: + type: string + required: + - createdAt + - updatedAt + - tenantId + - id + - title + - isResolved type: object - RepocontextProjectArtifactRegistriesElem: + ModelsCSPMScan: properties: - baseUrl: + accountId: type: string - id: + accountName: type: string - name: - nullable: true + cloudProvider: + $ref: '#/components/schemas/ModelsCloudProvider' + createdAt: type: string - otherType: + duration: + type: integer + endedAt: + format: date-time nullable: true type: string - path: + executionArn: type: string - type: - $ref: '#/components/schemas/GraphBuildArtifactRepositoryType' - type: object - RepocontextProjectArtifactStoryElem: - properties: - command: + failureReason: nullable: true type: string - description: - nullable: true + findingsCount: + type: integer + findingsS3Bucket: type: string - otherTool: - nullable: true + findingsS3Key: type: string - relatedFiles: - items: - type: string - type: array - tool: - $ref: '#/components/schemas/RepocontextProjectArtifactStoryElemTool' - nullable: true - type: - $ref: '#/components/schemas/RepocontextProjectArtifactStoryElemType' - nullable: true - type: object - RepocontextProjectArtifactStoryElemTool: - enum: - - bazel - - docker - - docker-compose - - go - - gradle - - make - - maven - - npm - - other - - pip - - yarn - type: string - RepocontextProjectArtifactStoryElemType: - enum: - - COPY_OR_MOVE_FILE - - DOCKER_BUILD_COMMAND - - DOCKER_COPY - - DOCKER_TAG_COMMAND - - EXECUTE_CI_STEP - - PACKAGE_MANAGER_BUILD - - RUN_SCRIPT - type: string - RepocontextProjectContext: - properties: - artifacts: - items: - $ref: '#/components/schemas/RepocontextProjectContextArtifactsElem' - type: array - boundaryIds: - items: - type: string - type: array - businessFunctionIds: - items: - $ref: '#/components/schemas/RepocontextProjectContextBusinessFunctionIdsElem' - type: array - cacheKey: - nullable: true + id: type: string - codeSymbols: - items: - $ref: '#/components/schemas/RepocontextCodeSymbol' - type: array - dataDomainIds: + installationId: + type: string + isArchived: + type: boolean + platform: + type: string + progress: + type: integer + region: + type: string + regionsToScan: items: type: string type: array - dataHandled: + resourceCoverage: + additionalProperties: {} + type: object + resourceTypes: items: - $ref: '#/components/schemas/RepocontextProjectContextDataHandledElem' + type: string type: array - dependencyManifests: + rulesToScan: items: type: string type: array - deploymentGraph: - $ref: '#/components/schemas/GraphGraph' - deploymentSummary: + scanConfig: additionalProperties: {} type: object - description: + scanType: + $ref: '#/components/schemas/ModelsCSPMScanType' + scannerConfig: type: string - directorySummaries: - items: - $ref: '#/components/schemas/RepocontextRepoContextDirectorySummary' - type: array - entrypoints: - items: - $ref: '#/components/schemas/RepocontextProjectEntrypoint' - type: array - fileSummaries: - items: - $ref: '#/components/schemas/RepocontextFileSummary' - type: array - frameworks: - items: - $ref: '#/components/schemas/RepocontextProjectContextFrameworksElem' - type: array - id: + scannerVersion: type: string - importanceReasoning: - nullable: true + startedAt: + format: date-time type: string - internalDependencyIds: - items: - type: string - type: array - isTruncatedAnalysis: - type: boolean - languages: - items: - $ref: '#/components/schemas/LanguageCodeLanguage' - nullable: true - type: array - name: + status: + $ref: '#/components/schemas/ModelsScanStatus' + summary: + $ref: '#/components/schemas/ModelsCSPMScanSummary' + tenantId: type: string - orgImportance: - $ref: '#/components/schemas/RepocontextRepoContextProjectImportance' - nullable: true - orgRole: - $ref: '#/components/schemas/RepocontextRepoContextProjectRole' - nullable: true - otherDataHandled: - items: - type: string - type: array - owners: - items: - $ref: '#/components/schemas/RepocontextProjectContextOwnersElem' - type: array - pathPrefix: + triageDeferredCount: + type: integer + triageEligibleCount: + type: integer + updatedAt: type: string - projectFiles: - items: - type: string - nullable: true - type: array - repositoryReferences: - items: - $ref: '#/components/schemas/RepocontextProjectContextRepositoryReferencesElem' - type: array - role: - $ref: '#/components/schemas/RepocontextProjectContextRole' - nullable: true - securityImportance: - $ref: '#/components/schemas/RepocontextProjectContextSecurityImportance' - nullable: true - testCoverage: - $ref: '#/components/schemas/RepocontextProjectContextTestCoverage' - trustedServiceIds: - items: - type: string - type: array + required: + - platform + - installationId + - startedAt + - summary type: object - RepocontextProjectContextArtifactsElem: + ModelsCSPMScanPreview: properties: - artifactType: - $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemArtifactType' - availabilityImportance: - $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemAvailabilityImportance' - dataConfidentialityImportance: - $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemDataConfidentialityImportance' - entrypointPath: + accountId: type: string - nonProduction: - type: boolean - otherType: - nullable: true + accountName: type: string - systemIntegrityImportance: - $ref: '#/components/schemas/RepocontextProjectContextArtifactsElemSystemIntegrityImportance' - type: object - RepocontextProjectContextArtifactsElemArtifactType: - enum: - - BROWSER_CLIENT - - BROWSER_EXTENSION - - CLI - - DESKTOP - - ETL_PIPELINE - - GRAPHQL_API - - IOT_FIRMWARE - - MOBILE_APP - - OTHER - - PLUGIN - - PRIVATE_LIBRARY - - PUBLIC_LIBRARY - - REST_API - - SPA_BROWSER_APP - - TEST_SUITE - - WEB_SERVER - type: string - RepocontextProjectContextArtifactsElemAvailabilityImportance: - enum: - - HIGH - - LOW - - MEDIUM - type: string - RepocontextProjectContextArtifactsElemDataConfidentialityImportance: - enum: - - HIGH - - LOW - - MEDIUM - type: string - RepocontextProjectContextArtifactsElemSystemIntegrityImportance: - enum: - - HIGH - - LOW - - MEDIUM - type: string - RepocontextProjectContextBusinessFunctionIdsElem: - properties: - description: + cloudProvider: + $ref: '#/components/schemas/ModelsCloudProvider' + createdAt: + type: string + duration: + type: integer + endedAt: + format: date-time nullable: true type: string + findingsCount: + type: integer id: type: string - implementation: - $ref: '#/components/schemas/RepocontextProjectContextBusinessFunctionIdsElemImplementation' - nullable: true - type: object - RepocontextProjectContextBusinessFunctionIdsElemImplementation: - enum: - - full - - partial - - supporting - type: string - RepocontextProjectContextDataHandledElem: - enum: - - ADDRESS - - BIRTHDATE - - CREDIT_CARD - - EMAIL - - NAME - - OTHER - - PASSWORD - - PERSONAL_MEDICAL - - PHONE - - PROPRIETARY_FINANCIAL - - SOCIAL_SECURITY - - TRADE_SECRET - type: string - RepocontextProjectContextFrameworksElem: - properties: - name: + isArchived: + type: boolean + progress: + type: integer + region: type: string - version: - nullable: true + regionsToScan: + items: + type: string + type: array + scanType: + $ref: '#/components/schemas/ModelsCSPMScanType' + scannerVersion: type: string - type: object - RepocontextProjectContextOwnersElem: - properties: - name: + startedAt: + format: date-time type: string - source: - nullable: true + status: + $ref: '#/components/schemas/ModelsScanStatus' + summary: + $ref: '#/components/schemas/ModelsCSPMScanSummary' + tenantId: type: string - type: - $ref: '#/components/schemas/RepocontextProjectContextOwnersElemType' - nullable: true + triageDeferredCount: + type: integer + triageEligibleCount: + type: integer + updatedAt: + type: string + required: + - startedAt + - summary type: object - RepocontextProjectContextOwnersElemType: + ModelsCSPMScanSummary: + properties: + criticalFindings: + type: integer + failedChecks: + type: integer + highFindings: + type: integer + infoFindings: + type: integer + lowFindings: + type: integer + mediumFindings: + type: integer + passedChecks: + type: integer + resourcesScanned: + type: integer + rulesEvaluated: + type: integer + totalFindings: + type: integer + required: + - totalFindings + - criticalFindings + - highFindings + - mediumFindings + - lowFindings + - infoFindings + - passedChecks + - failedChecks + - resourcesScanned + - rulesEvaluated + type: object + ModelsCSPMScanType: enum: - - individual - - team + - full + - incremental + - targeted + - scheduled-cloud-scan type: string - RepocontextProjectContextRepositoryReferencesElem: + ModelsComplianceFrame: properties: - description: - nullable: true - type: string - name: + control: type: string - repositoryReferenceType: - $ref: '#/components/schemas/RepocontextProjectContextRepositoryReferencesElemRepositoryReferenceType' - url: + framework: type: string version: - nullable: true type: string type: object - RepocontextProjectContextRepositoryReferencesElemRepositoryReferenceType: - enum: - - dependency - - fork - - framework - - infrastructure - - library - - related - - template - - tool - - vendor - type: string - RepocontextProjectContextRole: - enum: - - application - - cli - - infrastructure - - library - - other - - package - - service - - shared_component - - tests - type: string - RepocontextProjectContextSecurityImportance: - enum: - - HIGH - - LOW - - MEDIUM - type: string - RepocontextProjectContextTestCoverage: + ModelsCustomerQuestion: properties: - hasIntegrationTests: + answer: {} + answerMemoryId: nullable: true - type: boolean - hasTests: + type: string + answeredAt: + format: date-time nullable: true - type: boolean - testFileCount: + type: string + customMessage: nullable: true - type: integer - testFrameworks: + type: string + expiry: + $ref: '#/components/schemas/ModelsCustomerQuestionExpiry' + findingIds: items: type: string type: array - type: object - RepocontextProjectEntrypoint: - properties: - affinityHints: + gapCategories: items: type: string type: array - apiSpecs: - items: - $ref: '#/components/schemas/RepocontextAPISchema' - type: array - applicationTypes: - items: - $ref: '#/components/schemas/GraphCodeArtifactType' - nullable: true - type: array - artifacts: - items: - $ref: '#/components/schemas/RepocontextProjectArtifact' - nullable: true - type: array - authMethods: + id: + type: string + options: items: - $ref: '#/components/schemas/RepocontextProjectEntrypointAuthMethodsElem' + $ref: '#/components/schemas/ModelsCustomerQuestionOptionsElem' type: array - boundaryIds: + questionText: + type: string + questionType: + $ref: '#/components/schemas/ModelsCustomerQuestionQuestionType' + relatedMemoryIds: items: type: string type: array - dataFlowIds: + scope: + $ref: '#/components/schemas/ModelsCustomerQuestionScope' + scopeResourceId: + nullable: true + type: string + unknownIds: items: type: string type: array - description: - nullable: true - type: string - detectionConfidence: - $ref: '#/components/schemas/RepocontextConfidence' - frameworkName: - nullable: true - type: string - id: - type: string - kind: - $ref: '#/components/schemas/RepocontextProjectEntrypointKind' - nullable: true - lineNumber: + type: object + ModelsCustomerQuestionExpiry: + properties: + expiresInDays: nullable: true type: integer - name: - nullable: true - type: string - nodeId: - nullable: true - type: string - path: - type: string - ports: - items: - type: integer - type: array - protocols: - items: - $ref: '#/components/schemas/RepocontextProjectEntrypointProtocolsElem' - type: array - routes: - items: - $ref: '#/components/schemas/RepocontextEntrypointRoute' - type: array - sessionMechanism: - $ref: '#/components/schemas/RepocontextProjectEntrypointSessionMechanism' + followUpDays: nullable: true - symbolId: + type: integer + ifExpired: + $ref: '#/components/schemas/ModelsCustomerQuestionExpiryIfExpired' nullable: true + justification: type: string - trustedServiceIds: - items: - type: string - type: array + mode: + $ref: '#/components/schemas/ModelsCustomerQuestionExpiryMode' type: object - RepocontextProjectEntrypointAuthMethodsElem: + ModelsCustomerQuestionExpiryIfExpired: enum: - - API_KEY - - BASIC_AUTH - - IAM - - JWT - - LDAP - - MFA - - MTLS - - NONE - - OAUTH2 - - OPENID - - PASSWORD - - SAML - - SESSION_COOKIE + - escalate + - expire + - reask_once type: string - RepocontextProjectEntrypointKind: + ModelsCustomerQuestionExpiryMode: enum: - - CLI - - LIBRARY_EXPORT - - NETWORK - - OTHER - - SCHEDULED - - WORKER + - deadline + - until_resolved type: string - RepocontextProjectEntrypointProtocolsElem: + ModelsCustomerQuestionOptionsElem: + properties: + id: + type: string + label: + type: string + value: + type: string + type: object + ModelsCustomerQuestionQuestionType: enum: - - GRAPHQL - - GRPC - - HTTP - - HTTPS - - MQTT - - TCP - - UDP - - WEBSOCKET + - FREE_TEXT + - MULTI_SELECT + - SINGLE_SELECT + - YES_NO type: string - RepocontextProjectEntrypointSessionMechanism: + ModelsCustomerQuestionScope: enum: - - cookie - - none - - server_session - - stateless_token + - CLOUD + - ORGANIZATION + - REPOSITORY type: string - RepocontextReachabilityPath: + ModelsCustomerQuestionSet: properties: - artifactLinkId: + customMessage: nullable: true type: string - confidence: - $ref: '#/components/schemas/RepocontextConfidence' - entrypointIds: + generatedMemoryIds: items: type: string type: array - exposureRoot: - $ref: '#/components/schemas/RepocontextReachabilityPathExposureRoot' - exposureSummary: - nullable: true - type: string id: type: string - networkControls: - items: - type: string - type: array - pathEdgeTypes: + questions: items: - $ref: '#/components/schemas/GraphEdgeType' + $ref: '#/components/schemas/ModelsCustomerQuestion' + nullable: true type: array - pathNodeIds: + type: object + ModelsInvestigationStep: + properties: + details: items: type: string nullable: true type: array - privateJustification: - nullable: true - type: string - projectId: - nullable: true - type: string - publicRoutes: - items: - $ref: '#/components/schemas/RepocontextReachabilityPathPublicRoutesElem' - type: array - workloadKind: - $ref: '#/components/schemas/RepocontextReachabilityPathWorkloadKind' - workloadNodeId: + title: type: string type: object - RepocontextReachabilityPathExposureRoot: + ModelsScanStatus: enum: - - cross_account - - internet - - peered_vpc - - private - - unknown - - vpn + - queued + - in progress + - stopping + - completed + - cancelled + - failed + - aborted_config_error + - human_fallback + - awaiting_manual + - skipped type: string - RepocontextReachabilityPathPublicRoutesElem: + ModelsSeverityEnum: + enum: + - CRITICAL + - HIGH + - INFORMATIONAL + - LOW + - MEDIUM + type: string + ModelsTriage: properties: - entrypointId: + agentConfidence: + $ref: '#/components/schemas/ModelsTriageAgentConfidence' nullable: true - type: string - isAuthenticated: + budgetExhausted: nullable: true type: boolean - method: + campaignMetadata: + $ref: '#/components/schemas/ModelsTriageCampaignMetadata' + cloudContext: + $ref: '#/components/schemas/ModelsTriageCloudContext' + complianceImpact: + $ref: '#/components/schemas/ModelsTriageComplianceImpact' + containerAssessment: + $ref: '#/components/schemas/ModelsTriageContainerAssessment' + customerQuestions: + $ref: '#/components/schemas/ModelsCustomerQuestionSet' + description: + nullable: true type: string - path: + descriptionSummary: + nullable: true type: string - type: object - RepocontextReachabilityPathWorkloadKind: - enum: - - AWS_APP_RUNNER - - AWS_EC2 - - AWS_ECS - - AWS_EKS - - AWS_FARGATE - - AWS_LAMBDA - - OTHER - type: string - RepocontextRepoContext: - properties: - artifactLinks: - items: - $ref: '#/components/schemas/RepocontextArtifactLink' - type: array - authenticationMethods: - items: - type: string - type: array - businessFunctions: - items: - $ref: '#/components/schemas/RepocontextBusinessFunction' - type: array - cacheKey: + devDescription: nullable: true type: string - callEdges: - items: - $ref: '#/components/schemas/RepocontextCallEdge' - type: array - cicdPipelineSummary: - $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummary' - cloudAccounts: - items: - $ref: '#/components/schemas/RepocontextAccountInfrastructureSummary' - type: array - codeConventions: - items: - $ref: '#/components/schemas/RepocontextCodeConvention' - type: array - commitPatterns: - $ref: '#/components/schemas/RepocontextRepoContextCommitPatterns' - complianceFrameworks: - items: - $ref: '#/components/schemas/RepocontextComplianceFramework' - type: array - contextSummary: - $ref: '#/components/schemas/RepocontextRepoContextContextSummary' - dataDomains: - items: - $ref: '#/components/schemas/RepocontextDataDomain' - type: array - dataFlows: - items: - $ref: '#/components/schemas/RepocontextDataFlow' - type: array - databases: - items: - $ref: '#/components/schemas/RepocontextRepoContextDatabasesElem' - type: array - deploymentTargets: - items: - type: string - type: array - description: + devTitle: + nullable: true type: string - developmentGuidelines: - $ref: '#/components/schemas/RepocontextRepoContextDevelopmentGuidelines' - graph: + dismissalBasis: + nullable: true + type: string + dismissalEvidence: + nullable: true + type: string + evidence: $ref: '#/components/schemas/GraphGraph' + exploitHypothesis: + $ref: '#/components/schemas/GraphGraph' + exploitability: + $ref: '#/components/schemas/ModelsTriageExploitability' + failedTriage: + nullable: true + type: boolean + fixEffort: + $ref: '#/components/schemas/ModelsTriageFixEffort' id: + nullable: true type: string - infrastructureMatches: - items: - $ref: '#/components/schemas/RepocontextInfrastructureMatch' - type: array - inputValidationFrameworks: - items: - type: string - type: array - internalDependencies: - additionalProperties: - items: - type: string - type: array - type: object - isInitializedOnly: - type: boolean - isMonorepo: + impact: + $ref: '#/components/schemas/ModelsTriageImpact' + investigationConfidence: + $ref: '#/components/schemas/ModelsTriageInvestigationConfidence' nullable: true - type: boolean - isOpenAPISpecAvailable: - type: boolean - isTruncatedAnalysis: - type: boolean - metadata: - $ref: '#/components/schemas/RepocontextMetadata' - monitoringTooling: + investigationId: + nullable: true + type: string + investigationUnknowns: items: type: string type: array - name: - type: string - networkExposure: - $ref: '#/components/schemas/RepocontextRepoContextNetworkExposure' + lastTriagedAt: + format: date-time nullable: true - openAPISpecPath: + type: string + memoriesGenerated: items: type: string type: array - projects: - items: - $ref: '#/components/schemas/RepocontextProjectContext' - nullable: true - type: array - public: - type: boolean - reachabilityPaths: + memoriesUsed: items: - $ref: '#/components/schemas/RepocontextReachabilityPath' + type: string type: array - repositoryClassification: - $ref: '#/components/schemas/RepocontextRepoContextRepositoryClassification' + parentTriageId: nullable: true - repositoryReferences: + type: string + pentest: + $ref: '#/components/schemas/ModelsTriagePentest' + priority: + $ref: '#/components/schemas/ModelsPriorityEnum' + references: items: - $ref: '#/components/schemas/RepocontextRepoContextRepositoryReferencesElem' + $ref: '#/components/schemas/ModelsTriageReference' type: array - rootDirectorySummary: - $ref: '#/components/schemas/RepocontextRepoContextDirectorySummary' - secretsSurface: + retriageComparison: + $ref: '#/components/schemas/ModelsTriageRetriageComparison' + retriageMetadata: + $ref: '#/components/schemas/ModelsTriageRetriageMetadata' + retriageStatus: + $ref: '#/components/schemas/ModelsTriageRetriageStatus' + nullable: true + severity: + $ref: '#/components/schemas/ModelsTriageSeverity' + stopReason: + $ref: '#/components/schemas/ModelsTriageStopReason' + nullable: true + thoughts: + nullable: true + type: string + title: + nullable: true + type: string + verdictHoldReason: + nullable: true + type: string + version: + type: integer + type: object + ModelsTriageAgentConfidence: + enum: + - HIGH + - LOW + - MEDIUM + type: string + ModelsTriageCampaignMetadata: + properties: + id: + type: string + name: + nullable: true + type: string + type: object + ModelsTriageCloudContext: + properties: + confidence: + nullable: true + type: number + mode: + $ref: '#/components/schemas/ModelsTriageCloudContextMode' + nullable: true + ownershipBasis: + $ref: '#/components/schemas/ModelsTriageCloudContextOwnershipBasis' + nullable: true + repos: items: - $ref: '#/components/schemas/RepocontextSecretUsage' + type: string type: array - securityBoundaries: + thoughts: + nullable: true + type: string + type: object + ModelsTriageCloudContextMode: + enum: + - MODEA + - MODEB + type: string + ModelsTriageCloudContextOwnershipBasis: + enum: + - declared + - proven + type: string + ModelsTriageComplianceFramework: + properties: + clause: + nullable: true + type: string + framework: + $ref: '#/components/schemas/ModelsTriageComplianceFrameworkFramework' + obligation: + nullable: true + type: string + type: object + ModelsTriageComplianceFrameworkFramework: + enum: + - CCPA + - CIS + - FEDRAMP + - GDPR + - GLBA + - HIPAA + - ISO27001 + - NIST + - OTHER + - PCI-DSS + - SOC2 + type: string + ModelsTriageComplianceImpact: + properties: + citations: items: - $ref: '#/components/schemas/RepocontextSecurityBoundary' + $ref: '#/components/schemas/ModelsTriageReference' + nullable: true type: array - securityPosture: - $ref: '#/components/schemas/RepocontextRepoContextSecurityPosture' - securityTooling: + confidence: + $ref: '#/components/schemas/ModelsTriageComplianceImpactConfidence' + nullable: true + frameworks: items: - $ref: '#/components/schemas/RepocontextRepoContextSecurityToolingElem' + $ref: '#/components/schemas/ModelsTriageComplianceFramework' + nullable: true type: array - sourceSinks: + rationale: + type: string + type: object + ModelsTriageComplianceImpactConfidence: + enum: + - HIGH + - LOW + - MEDIUM + type: string + ModelsTriageContainerAssessment: + properties: + assessedCVEs: + type: integer + batches: items: - $ref: '#/components/schemas/RepocontextSourceSink' + $ref: '#/components/schemas/ModelsTriageContainerAssessmentBatchesElem' type: array - submodules: + failureReasons: items: - $ref: '#/components/schemas/RepocontextRepoContextSubmodulesElem' + type: string type: array - technologyStack: + inputHash: + type: string + status: + $ref: '#/components/schemas/ModelsTriageContainerAssessmentStatus' + totalCVEs: + type: integer + unassessedCVEs: items: - $ref: '#/components/schemas/RepocontextRepoContextTechnologyStackElem' + type: string type: array - toxicCombinations: + unassessedCount: + type: integer + type: object + ModelsTriageContainerAssessmentBatchesElem: + properties: + completedCVEs: items: - $ref: '#/components/schemas/RepocontextToxicCombination' + type: string type: array - trustedServices: + cves: items: - $ref: '#/components/schemas/RepocontextTrustedService' + type: string + nullable: true type: array + reason: + nullable: true + type: string + result: + nullable: true + type: string + status: + $ref: '#/components/schemas/ModelsTriageContainerAssessmentBatchesElemStatus' type: object - RepocontextRepoContextCicdPipelineSummary: + ModelsTriageContainerAssessmentBatchesElemStatus: + enum: + - completed + - failed + - incomplete + type: string + ModelsTriageContainerAssessmentStatus: + enum: + - completed + - failed + - incomplete + type: string + ModelsTriageExploitability: properties: - prWorkflowCount: + attackComplexity: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexity' + attackRequirements: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirements' + attackVector: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVector' + confidence: + $ref: '#/components/schemas/ModelsTriageExploitabilityConfidence' + description: nullable: true - type: integer - summary: + type: string + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityLabel' + privilegesRequired: + $ref: '#/components/schemas/ModelsTriageExploitabilityPrivilegesRequired' + title: nullable: true type: string - workflows: + unknowns: items: - $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummaryWorkflowsElem' + type: string type: array + userInteraction: + $ref: '#/components/schemas/ModelsTriageExploitabilityUserInteraction' type: object - RepocontextRepoContextCicdPipelineSummaryWorkflowsElem: + ModelsTriageExploitabilityAttackComplexity: properties: - jobs: - items: - $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElem' - type: array - name: + description: nullable: true type: string - path: + exploitChainRequired: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityExploitChainRequired' + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityLabel' + payloadDifficulty: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityPayloadDifficulty' + type: object + ModelsTriageExploitabilityAttackComplexityExploitChainRequired: + properties: + description: nullable: true type: string - platform: + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel' nullable: true - type: string - runsOnPr: + title: nullable: true - type: boolean + type: string type: object - RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElem: + ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel: + enum: + - HIGH + - LOW + - NONE + type: string + ModelsTriageExploitabilityAttackComplexityLabel: + enum: + - HIGH + - LOW + type: string + ModelsTriageExploitabilityAttackComplexityPayloadDifficulty: properties: - name: + description: nullable: true type: string - steps: - items: - $ref: '#/components/schemas/RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElemStepsElem' - type: array + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel' + nullable: true type: object - RepocontextRepoContextCicdPipelineSummaryWorkflowsElemJobsElemStepsElem: + ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel: + enum: + - EASY + - HARD + - NONE + type: string + ModelsTriageExploitabilityAttackRequirements: properties: - command: + description: nullable: true type: string - name: + environmentState: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsEnvironmentState' + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsLabel' nullable: true - type: string - uses: + mitm: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsMitm' + raceCondition: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsRaceCondition' + timeWindow: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsTimeWindow' + title: nullable: true type: string type: object - RepocontextRepoContextCommitPatterns: + ModelsTriageExploitabilityAttackRequirementsEnvironmentState: properties: - exampleMessages: - items: - type: string - type: array - lastUpdated: - format: date-time + description: nullable: true type: string - learnedFromCommits: + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel' nullable: true - type: integer - messageFormat: - $ref: '#/components/schemas/RepocontextRepoContextCommitPatternsMessageFormat' + title: nullable: true - prefixPatterns: - items: - type: string - type: array + type: string type: object - RepocontextRepoContextCommitPatternsMessageFormat: + ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel: enum: - - conventional - - descriptive - - imperative - - ticket-prefixed + - HIGH + - LOW + - NONE type: string - RepocontextRepoContextContextSummary: + ModelsTriageExploitabilityAttackRequirementsLabel: + enum: + - HIGH + - LOW + - NONE + type: string + ModelsTriageExploitabilityAttackRequirementsMitm: properties: - complianceDrivers: - items: - type: string - type: array - confidence: - $ref: '#/components/schemas/RepocontextConfidence' - executiveSummary: + description: nullable: true type: string - recommendedFollowups: - items: - type: string - type: array - technicalSummary: + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsMitmLabel' + nullable: true + title: nullable: true - type: string - topRisks: - items: - type: string - type: array - type: object - RepocontextRepoContextDatabasesElem: - properties: - databaseType: - $ref: '#/components/schemas/RepocontextRepoContextDatabasesElemDatabaseType' - name: type: string type: object - RepocontextRepoContextDatabasesElemDatabaseType: + ModelsTriageExploitabilityAttackRequirementsMitmLabel: enum: - - CASSANDRA - - DYNAMODB - - ELASTICSEARCH - - MONGODB - - MSSQL - - MYSQL - - OTHER - - POSTGRESQL - - REDIS - - SQLITE + - HIGH + - LOW + - NONE type: string - RepocontextRepoContextDevelopmentGuidelines: + ModelsTriageExploitabilityAttackRequirementsRaceCondition: properties: - summary: + description: + nullable: true + type: string + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel' + nullable: true + title: nullable: true type: string - tools: - items: - $ref: '#/components/schemas/RepocontextRepoContextDevelopmentGuidelinesToolsElem' - type: array type: object - RepocontextRepoContextDevelopmentGuidelinesToolsElem: + ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel: + enum: + - HIGH + - LOW + - NONE + type: string + ModelsTriageExploitabilityAttackRequirementsTimeWindow: properties: - category: - $ref: '#/components/schemas/RepocontextRepoContextDevelopmentGuidelinesToolsElemCategory' - filePath: - type: string - summary: + description: nullable: true type: string - tool: + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel' + nullable: true + title: + nullable: true type: string type: object - RepocontextRepoContextDevelopmentGuidelinesToolsElemCategory: + ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel: enum: - - ai_coding_assistant - - code_review_bot - - linter_formatter + - HIGH + - LOW + - NONE type: string - RepocontextRepoContextDirectorySummary: + ModelsTriageExploitabilityAttackVector: properties: - childPaths: - items: - type: string - type: array - keyFiles: - items: - type: string - type: array - kind: - $ref: '#/components/schemas/RepocontextRepoContextDirectorySummaryKind' - path: + description: + nullable: true type: string - publicInterfaces: - items: - type: string - type: array - responsibilities: + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVectorLabel' + subVectors: items: - type: string + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVectorSubVectorsElem' type: array - summary: - type: string type: object - RepocontextRepoContextDirectorySummaryKind: - enum: - - application - - config - - directory - - docs - - infrastructure - - library - - module - - other - - package - - root - - service - - tests - type: string - RepocontextRepoContextNetworkExposure: + ModelsTriageExploitabilityAttackVectorLabel: enum: - - internal - - internet_facing - - library + - ADJACENT + - LOCAL + - NETWORK + - PHYSICAL type: string - RepocontextRepoContextProjectImportance: + ModelsTriageExploitabilityAttackVectorSubVectorsElem: + properties: + description: + nullable: true + type: string + otherVector: + nullable: true + type: string + vector: + $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVectorSubVectorsElemVector' + nullable: true + type: object + ModelsTriageExploitabilityAttackVectorSubVectorsElemVector: enum: - - high - - low - - medium + - ADJACENT_ARP_SPOOFING + - ADJACENT_BLE_ADVERTISING + - ADJACENT_BLUETOOTH_CLASSIC + - ADJACENT_BLUETOOTH_KNOB + - ADJACENT_IPV6_NEIGHBOR_DISCOVERY + - ADJACENT_MDNS + - ADJACENT_NETBIOS + - ADJACENT_NFC + - ADJACENT_OTHER + - ADJACENT_SMB + - ADJACENT_SSDP + - ADJACENT_THREAD + - ADJACENT_WIFI_DIRECT + - ADJACENT_ZIGBEE + - LOCAL_COMMAND_LINE_ARGUMENT + - LOCAL_CONFIGURATION_FILE + - LOCAL_CRON_JOB + - LOCAL_D-BUS_MESSAGE + - LOCAL_DOCKER_SOCKET + - LOCAL_ENVIRONMENT_VARIABLE + - LOCAL_FILE_CONTENT + - LOCAL_FILE_NAME + - LOCAL_FILE_PATH + - LOCAL_IPC_SOCKET + - LOCAL_OTHER + - LOCAL_SCRIPT_PLUGIN + - LOCAL_SHARED_LIBRARY_LOAD + - LOCAL_SHARED_MEMORY + - LOCAL_SHELL_COMMAND + - LOCAL_SUID_EXECUTABLE + - NETWORK_DNS + - NETWORK_FTP + - NETWORK_GRAPHQL_QUERY + - NETWORK_GRE + - NETWORK_HTTP_BODY + - NETWORK_HTTP_COOKIE + - NETWORK_HTTP_FILE_UPLOAD + - NETWORK_HTTP_HEADER + - NETWORK_HTTP_METHOD + - NETWORK_HTTP_PATH_PARAMETER + - NETWORK_HTTP_QUERY_PARAMETER + - NETWORK_ICMP + - NETWORK_IMAP + - NETWORK_IPSEC + - NETWORK_L2TP + - NETWORK_LDAP + - NETWORK_MQTT + - NETWORK_NTP + - NETWORK_OTHER + - NETWORK_POP3 + - NETWORK_RDP + - NETWORK_REST_ENDPOINTHYPERLINK_CLICK + - NETWORK_SCTP + - NETWORK_SIP + - NETWORK_SMB + - NETWORK_SMTP + - NETWORK_SNMP + - NETWORK_SOAP_REQUEST + - NETWORK_SSH + - NETWORK_TCP_PORT + - NETWORK_UDP_PORT + - NETWORK_WEBSOCKET_MESSAGE + - PHYSICAL_BIOS_JTAG + - PHYSICAL_BLUETOOTH + - PHYSICAL_EVIL_MAID + - PHYSICAL_FIREWIRE + - PHYSICAL_IR + - PHYSICAL_NFC + - PHYSICAL_OTHER + - PHYSICAL_RFID + - PHYSICAL_SD_CARD + - PHYSICAL_SDIO + - PHYSICAL_SIDE_CHANNEL + - PHYSICAL_TEMPEST + - PHYSICAL_THUNDERBOLT + - PHYSICAL_USB type: string - RepocontextRepoContextProjectRole: + ModelsTriageExploitabilityConfidence: enum: - - admin_surface - - batch_job - - cli_tool - - frontend_app - - infrastructure - - internal_api - - prototype - - public_api - - shared_library - - test_harness - - unknown - - worker + - HIGH + - LOW + - MEDIUM type: string - RepocontextRepoContextRepositoryClassification: + ModelsTriageExploitabilityLabel: enum: - - application - - infrastructure - - library - - mixed + - LIKELY + - NEUTRAL + - UNLIKELY type: string - RepocontextRepoContextRepositoryReferencesElem: + ModelsTriageExploitabilityPrivilegesRequired: properties: description: nullable: true type: string - isCloudToCodeConnected: - nullable: true - type: boolean - name: - type: string - repositoryReferenceType: - $ref: '#/components/schemas/RepocontextRepoContextRepositoryReferencesElemRepositoryReferenceType' - url: - type: string - type: object - RepocontextRepoContextRepositoryReferencesElemRepositoryReferenceType: - enum: - - dependency - - fork - - framework - - infrastructure - - library - - related - - template - - tool - - vendor - type: string - RepocontextRepoContextSecurityPosture: - properties: - authCoverage: - $ref: '#/components/schemas/RepocontextRepoContextSecurityPostureAuthCoverage' - nullable: true - hasDependencyScanning: - nullable: true - type: boolean - hasInputValidation: - nullable: true - type: boolean - hasSecretScanning: + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityPrivilegesRequiredLabel' nullable: true - type: boolean - hasStaticAnalysis: + title: nullable: true - type: boolean - mitigatingFactors: - items: - type: string - type: array - riskFactors: + type: string + types: items: - type: string + $ref: '#/components/schemas/ModelsTriageExploitabilityPrivilegesRequiredTypesElem' type: array type: object - RepocontextRepoContextSecurityPostureAuthCoverage: + ModelsTriageExploitabilityPrivilegesRequiredLabel: enum: - - FULL + - HIGH + - LOW - NONE - - PARTIAL type: string - RepocontextRepoContextSecurityToolingElem: - properties: - category: - $ref: '#/components/schemas/RepocontextRepoContextSecurityToolingElemCategory' - name: - type: string - type: object - RepocontextRepoContextSecurityToolingElemCategory: + ModelsTriageExploitabilityPrivilegesRequiredTypesElem: enum: - - CONTAINER_SECURITY - - DAST - - DEPENDENCY_UPDATE - - IAC_SECURITY - - SAST - - SCA - - SECRETS_SCANNING + - PRIVILEGED_USER + - UNAUTHENTICATED + - UNVERIFIED_USER + - VERIFIED_USER type: string - RepocontextRepoContextSubmodulesElem: + ModelsTriageExploitabilityUserInteraction: properties: - branch: - nullable: true - type: string - name: + description: nullable: true type: string - path: - type: string - url: - type: string - type: object - RepocontextRepoContextTechnologyStackElem: - properties: - category: - $ref: '#/components/schemas/RepocontextRepoContextTechnologyStackElemCategory' - name: - type: string - type: object - RepocontextRepoContextTechnologyStackElemCategory: - enum: - - CACHE - - DATABASE - - FRAMEWORK - - MESSAGE_QUEUE - - MONITORING - - SEARCH_ENGINE - type: string - RepocontextRouteParameter: - properties: - in: - $ref: '#/components/schemas/RepocontextRouteParameterIn' - name: - type: string - required: - nullable: true - type: boolean - sensitive: + label: + $ref: '#/components/schemas/ModelsTriageExploitabilityUserInteractionLabel' nullable: true - type: boolean - type: - $ref: '#/components/schemas/RepocontextRouteParameterType' + otherTypes: + items: + type: string + type: array + title: nullable: true + type: string + types: + items: + $ref: '#/components/schemas/ModelsTriageExploitabilityUserInteractionTypesElem' + type: array type: object - RepocontextRouteParameterIn: + ModelsTriageExploitabilityUserInteractionLabel: enum: - - cookie - - header - - path - - query + - ACTIVE + - NONE + - PASSIVE type: string - RepocontextRouteParameterType: + ModelsTriageExploitabilityUserInteractionTypesElem: enum: - - array - - boolean - - integer - - number - - object - - string + - BROWSING + - FILE_DOWNLOAD + - FILE_UPLOAD + - HYPERLINK_CLICK + - SOCIAL_ENGINEERING type: string - RepocontextSecretUsage: + ModelsTriageFixEffort: properties: - cloudNodeId: - nullable: true - type: string confidence: - $ref: '#/components/schemas/RepocontextConfidence' - consumerQualifiedNames: - items: - type: string - type: array - id: - type: string - name: - type: string - projectId: + $ref: '#/components/schemas/ModelsTriageFixEffortConfidence' + description: nullable: true type: string - purpose: + label: + $ref: '#/components/schemas/ModelsTriageFixEffortLabel' + title: nullable: true type: string - readEvidence: + unknowns: items: - $ref: '#/components/schemas/RepocontextSecretUsageReadEvidenceElem' - nullable: true + type: string type: array - rotationEvidence: - $ref: '#/components/schemas/RepocontextSecretUsageRotationEvidence' - nullable: true - sensitivity: - $ref: '#/components/schemas/RepocontextDataClassification' - nullable: true - source: - $ref: '#/components/schemas/RepocontextSecretUsageSource' - trustedServiceId: - nullable: true - type: string - type: object - RepocontextSecretUsageReadEvidenceElem: - properties: - filePath: - type: string - line: - type: integer - qualifiedName: - nullable: true - type: string - symbol: - nullable: true - type: string type: object - RepocontextSecretUsageRotationEvidence: + ModelsTriageFixEffortConfidence: enum: - - automatic - - manual - - none_observed - - unknown + - HIGH + - LOW + - MEDIUM type: string - RepocontextSecretUsageSource: + ModelsTriageFixEffortLabel: enum: - - aws_secrets_manager - - aws_ssm_parameter_store - - azure_key_vault - - config_file - - env_var - - gcp_secret_manager - - hardcoded - - hashicorp_vault - - kubernetes_secret - - other + - EASY + - HARD + - MEDIUM type: string - RepocontextSecurityBoundary: + ModelsTriageImpact: properties: - cloudReconBoundaryId: - nullable: true - type: string + availability: + $ref: '#/components/schemas/ModelsTriageImpactAvailability' + businessCriticality: + $ref: '#/components/schemas/ModelsTriageImpactBusinessCriticality' confidence: - $ref: '#/components/schemas/RepocontextConfidence' + $ref: '#/components/schemas/ModelsTriageImpactConfidence' + confidentiality: + $ref: '#/components/schemas/ModelsTriageImpactConfidentiality' description: - type: string - evidencePaths: - items: - type: string - type: array - exposure: - $ref: '#/components/schemas/RepocontextExposureLevel' nullable: true - id: type: string - mechanismTypes: - items: - $ref: '#/components/schemas/RepocontextSecurityBoundaryMechanismTypesElem' - type: array - name: + integrity: + $ref: '#/components/schemas/ModelsTriageImpactIntegrity' + label: + $ref: '#/components/schemas/ModelsTriageImpactLabel' + title: + nullable: true type: string - nodeIds: - items: - type: string - type: array - relatedDataDomainIds: - items: - type: string - type: array - relatedEntrypointIds: + unknowns: items: type: string type: array - relatedProjectIds: + type: object + ModelsTriageImpactAvailability: + properties: + cause: items: - type: string + $ref: '#/components/schemas/ModelsTriageImpactAvailabilityCauseElem' type: array - trustedServiceIds: + description: + nullable: true + type: string + label: + $ref: '#/components/schemas/ModelsTriageImpactAvailabilityLabel' + title: + nullable: true + type: string + type: items: - type: string + $ref: '#/components/schemas/ModelsTriageImpactAvailabilityTypeElem' type: array - type: - $ref: '#/components/schemas/RepocontextSecurityBoundaryType' type: object - RepocontextSecurityBoundaryMechanismTypesElem: + ModelsTriageImpactAvailabilityCauseElem: enum: - - AUTHENTICATION - - AUTHORIZATION - - ENCRYPTION - - IAM - - MTLS - - NETWORK_POLICY - - OTHER - - PRIVATE_NETWORK - - QUEUE_ISOLATION - - SECURITY_GROUP - - TENANT_SCOPING + - BUFFER_OVERFLOW + - BUSINESS_LOGIC + - INFINITE_LOOP + - MEMORY_LEAK + - RESOURCE_EXHAUSTION type: string - RepocontextSecurityBoundaryType: + ModelsTriageImpactAvailabilityLabel: enum: - - account - - admin_surface - - background_processing - - data_perimeter - - data_plane - - identity_boundary - - kubernetes_cluster - - kubernetes_namespace - - network_boundary - - other - - private_network - - private_service - - public_edge - - secrets_boundary - - security_group - - service_perimeter - - subnet - - tenant_boundary - - vpc + - HIGH + - LOW + - NONE type: string - RepocontextServiceCategory: + ModelsTriageImpactAvailabilityTypeElem: enum: - - CACHE - - DATABASE - - EVENT_BUS - - EXTERNAL_API - - FILE_STORAGE - - KEY_MANAGEMENT - - MESSAGE_QUEUE - - NOTIFICATION - - OBJECT_STORAGE - - OTHER - - SEARCH - - SECRETS - - WORKFLOW + - COMPLETE_SERVICE_OUTAGE + - SERVICE_DEGRADATION + - USER_ACCESS_DISRUPTION type: string - RepocontextSourceSink: + ModelsTriageImpactBusinessCriticality: properties: - argumentDigest: - nullable: true - type: string - category: - $ref: '#/components/schemas/RepocontextSourceSinkCategory' - confidence: - $ref: '#/components/schemas/RepocontextConfidence' - dataClassHint: - $ref: '#/components/schemas/RepocontextDataClassification' - nullable: true - dataDomainHint: - nullable: true - type: string - detector: - nullable: true - type: string - endLine: - nullable: true - type: integer - filePath: - type: string - framework: - nullable: true - type: string - id: - type: string - isExternal: - nullable: true - type: boolean - kind: - $ref: '#/components/schemas/RepocontextSourceSinkKind' - language: - $ref: '#/components/schemas/LanguageCodeLanguage' - nullable: true - projectId: + description: nullable: true type: string - qualifiedName: - type: string - startLine: - type: integer - symbol: + label: + $ref: '#/components/schemas/ModelsTriageImpactBusinessCriticalityLabel' nullable: true - type: string - symbolId: + title: nullable: true type: string type: object - RepocontextSourceSinkCategory: + ModelsTriageImpactBusinessCriticalityLabel: enum: - - cache_read - - cache_write - - cli_entry - - config_read - - database_read - - database_write - - encrypt - - env_read - - event_handler - - external_api_call - - file_read - - file_write - - hash - - http_request_handler - - llm_input - - llm_output - - log_write - - notification_send - - object_storage_read - - object_storage_write - - other - - outbound_http - - queue_consumer - - queue_publish - - redact - - response_write - - scheduled_task - - secret_read - - tokenize - - validate + - HIGH + - LOW + - MEDIUM + type: string + ModelsTriageImpactConfidence: + enum: + - HIGH + - LOW + - MEDIUM + type: string + ModelsTriageImpactConfidentiality: + properties: + dataLeaked: + items: + $ref: '#/components/schemas/ModelsTriageImpactConfidentialityDataLeakedElem' + type: array + label: + $ref: '#/components/schemas/ModelsTriageImpactConfidentialityLabel' + type: object + ModelsTriageImpactConfidentialityDataLeakedElem: + enum: + - ACCESS_TOKEN + - ADDRESS + - AGE + - API_KEY + - AUTHENTICATION_DATA + - BANK_ACCOUNT_INFORMATION + - BIOMETRIC_DATA + - CALL_LOGS + - CERTIFICATE + - CLIENT_AND_VENDOR_INFORMATION + - COMPLIANCE_RECORDS + - CREDIT_DEBIT_CARD_DETAILS + - DATABASE_CREDENTIALS + - DEVICE_IDENTIFIERS + - DRIVERS_LICENSE + - EDUCATION_RECORDS + - EMAIL_ADDRESS + - EMAILS_AND_MESSAGES + - EMPLOYMENT_HISTORY + - ENCRYPTION_KEY + - GENDER + - INCOME_AND_TAX_INFORMATION + - INTELLECTUAL_PROPERTY + - INVENTORY_DATA + - INVESTMENT_INFORMATION + - IP_ADDRESSES + - LEGAL_DOCUMENTS + - MEDICAL_DATA + - NAME + - OTHER_PRIVATE_NON_SENSITIVE_DATA + - OTHER_PRIVATE_SENSITIVE_DATA + - OTHER_PUBLIC_DATA + - PASSPORT + - PERFORMANCE_REVIEWS + - PHONE_NUMBER + - POLITICAL_OPINIONS + - RACIAL_OR_ETHNIC_ORIGIN + - RELIGIOUS_OR_PHILOSOPHICAL_BELIEFS + - SALARY_AND_BENEFITS_INFORMATION + - SECRET_KEY + - SEXUAL_ORIENTATION + - SOCIAL_MEDIA_INTERACTIONS + - SOCIAL_SECURITY_NUMBER + - STRATEGIC_PLANS_AND_FORECASTS + - SYSTEM_LOGS_AND_MONITORING_DATA + - TRADE_SECRETS + - TRANSACTION_HISTORY type: string - RepocontextSourceSinkKind: + ModelsTriageImpactConfidentialityLabel: enum: - - sanitizer - - sink - - source + - HIGH + - LOW + - NONE type: string - RepocontextToxicCombination: + ModelsTriageImpactIntegrity: properties: - componentFindings: - $ref: '#/components/schemas/RepocontextToxicCombinationComponentFindings' - confidence: - $ref: '#/components/schemas/RepocontextConfidence' description: nullable: true type: string - evidencePaths: - items: - type: string - type: array - id: - type: string - name: - type: string - pattern: - $ref: '#/components/schemas/RepocontextToxicCombinationPattern' - recommendedRemediation: + label: + $ref: '#/components/schemas/ModelsTriageImpactIntegrityLabel' + title: nullable: true type: string - severity: - $ref: '#/components/schemas/RepocontextToxicCombinationSeverity' - type: object - RepocontextToxicCombinationComponentFindings: - properties: - artifactLinkIds: - items: - type: string - type: array - dataFlowIds: - items: - type: string - type: array - entrypointIds: - items: - type: string - type: array - reachabilityPathIds: - items: - type: string - type: array - routeReferences: - items: - $ref: '#/components/schemas/RepocontextToxicCombinationComponentFindingsRouteReferencesElem' - type: array - secretUsageIds: - items: - type: string - type: array - securityBoundaryIds: - items: - type: string - type: array - trustedServiceIds: + type: items: - type: string - type: array - type: object - RepocontextToxicCombinationComponentFindingsRouteReferencesElem: - properties: - entrypointId: + $ref: '#/components/schemas/ModelsTriageImpactIntegrityTypeElem' nullable: true - type: string - method: - type: string - path: - type: string + type: array type: object - RepocontextToxicCombinationPattern: + ModelsTriageImpactIntegrityLabel: enum: - - cross_boundary_flow_without_sanitizer - - hardcoded_credential_write_access - - internet_reachable_admin_endpoint - - internet_reachable_sensitive_sink - - missing_authz_on_tenant_isolation_boundary - - other - - privileged_role_internet_reachable - - public_workload_with_plaintext_secret - - sensitive_data_logged_in_plaintext - - unauthenticated_route_with_pii - - unencrypted_data_flow_over_internet + - HIGH + - LOW + - NONE type: string - RepocontextToxicCombinationSeverity: + ModelsTriageImpactIntegrityTypeElem: + enum: + - DATABASE_ALTERED + - MALICIOUS_CODE_EXECUTED + - PRIVILEGE_ESCALATION + - SYSTEM_BEHAVIOUR_MANIPULATED + type: string + ModelsTriageImpactLabel: enum: - CRITICAL - HIGH - LOW + type: string + ModelsTriageInvestigationConfidence: + enum: + - HIGH + - LOW - MEDIUM type: string - RepocontextTrustedService: + ModelsTriagePentest: properties: - accessPatterns: - items: - $ref: '#/components/schemas/RepocontextTrustedServiceAccessPatternsElem' - type: array - boundaryIds: + attemptedCVEs: items: type: string type: array - category: - $ref: '#/components/schemas/RepocontextServiceCategory' - cloudReconServiceId: + browserEvidence: + $ref: '#/components/schemas/ModelsTriagePentestBrowserEvidence' + confidence: + nullable: true + type: number + cost: + nullable: true + type: number + duration: + nullable: true + type: number + exploitedCVE: nullable: true type: string - confidence: - $ref: '#/components/schemas/RepocontextConfidence' - description: + logs: + $ref: '#/components/schemas/AgentsGroupedAgentLogs' + mutationDisclosure: + $ref: '#/components/schemas/ModelsTriagePentestMutationDisclosure' + networkReachability: + $ref: '#/components/schemas/ModelsTriagePentestNetworkReachability' + outcome: + $ref: '#/components/schemas/ModelsTriagePentestOutcome' + report: type: string - evidencePaths: + reproductionScript: + nullable: true + type: string + sourceAvailability: + $ref: '#/components/schemas/ModelsTriagePentestSourceAvailability' + testedEndpoints: items: - type: string + $ref: '#/components/schemas/ModelsTriagePentestTestedEndpointsElem' type: array - id: + validatedBy: + $ref: '#/components/schemas/ModelsTriagePentestValidatedBy' + type: object + ModelsTriagePentestBrowserEvidence: + properties: + citation: + nullable: true type: string - name: + family: type: string - nodeIds: - items: - type: string - type: array - relatedDataDomainIds: - items: - type: string - type: array - relatedEntrypointIds: + reason: + type: string + screenshotRefs: items: type: string type: array - relatedProjectIds: + verdict: + type: string + type: object + ModelsTriagePentestMutationDisclosure: + properties: + writes: items: - type: string + $ref: '#/components/schemas/ModelsTriagePentestMutationDisclosureWritesElem' type: array - secretsAccessPattern: - $ref: '#/components/schemas/RepocontextTrustedServiceSecretsAccessPattern' + writesAttempted: nullable: true - serviceType: - $ref: '#/components/schemas/RepocontextTrustedServiceType' + type: boolean type: object - RepocontextTrustedServiceAccessPatternsElem: - enum: - - DECRYPT - - ENCRYPT - - OTHER - - PUBLISH - - READ - - READ_SECRET - - READ_WRITE - - SIGN - - STORE_SECRET - - SUBSCRIBE - - VERIFY - - WRITE - type: string - RepocontextTrustedServiceSecretsAccessPattern: - enum: - - config_file - - env_var - - hardcoded - - sdk_call - - sidecar - - unknown - type: string - RepocontextTrustedServiceType: + ModelsTriagePentestMutationDisclosureWritesElem: + properties: + method: + type: string + outcome: + type: string + statusCode: + nullable: true + type: integer + url: + type: string + type: object + ModelsTriagePentestNetworkReachability: + properties: + citation: + nullable: true + type: string + observedInternetReachable: + type: boolean + publicHost: + nullable: true + type: string + requiresAuth: + nullable: true + type: boolean + type: object + ModelsTriagePentestOutcome: enum: - - AWS_DYNAMODB - - AWS_EFS - - AWS_ELASTICACHE - - AWS_EVENTBRIDGE - - AWS_KMS - - AWS_MQ - - AWS_RDS - - AWS_S3 - - AWS_SECRETS_MANAGER - - AWS_SNS - - AWS_SQS - - AWS_STEPFUNCTIONS - - AZURE_BLOB_STORAGE - - AZURE_KEY_VAULT - - AZURE_SERVICE_BUS - - AZURE_SQL - - ELASTICSEARCH - - GCP_CLOUD_SQL - - GCP_CLOUD_STORAGE - - GCP_KMS - - GCP_PUBSUB - - GENERIC_HTTP_API - - KAFKA - - MONGODB - - MYSQL - - OTHER - - POSTGRESQL - - RABBITMQ - - REDIS + - CANNOT_DETERMINE + - CONFIRMED + - LIKELY + - NOT_EXPLOITABLE + - POTENTIAL type: string - EndpointsAutofixActivityLogEntry: + ModelsTriagePentestSourceAvailability: properties: - content: - type: string - createdAt: + apiSchema: + nullable: true + type: boolean + checkout: + nullable: true + type: boolean + codeSnippets: + nullable: true + type: boolean + type: object + ModelsTriagePentestTestedEndpointsElem: + properties: + method: + nullable: true type: string - eventType: + path: + nullable: true type: string - id: + type: object + ModelsTriagePentestValidatedBy: + properties: + engine: + $ref: '#/components/schemas/ModelsTriagePentestValidatedByEngine' + recordedAt: + format: date-time + nullable: true type: string - metadata: + runId: nullable: true type: string type: object - EndpointsAutofixStatusOutput: + ModelsTriagePentestValidatedByEngine: + enum: + - FINDING_EXPLOIT_VALIDATION + - PENTEST_EXPLOIT_ANALYSIS + type: string + ModelsTriageReference: properties: - autofixVerdictExplanation: + documentId: type: string - autofixVerdictReason: - $ref: '#/components/schemas/ModelsAutofixFailureReason' + endLine: + nullable: true + type: integer + fileName: nullable: true - currentActivity: type: string - currentPhase: - $ref: '#/components/schemas/ModelsAutofixPhase' - isAutoFixable: + nodeId: nullable: true - type: boolean - iterations: - $ref: '#/components/schemas/EndpointsIterationSummary' - lastActivityAt: type: string - pullRequestState: - $ref: '#/components/schemas/ModelsPullRequestState' - pullRequestUrl: + page: + nullable: true + type: integer + quote: type: string - pullRequests: + score: + nullable: true + type: number + startLine: + nullable: true + type: integer + title: + nullable: true + type: string + type: object + ModelsTriageRetriageComparison: + properties: + narrative: + type: string + newInformation: + $ref: '#/components/schemas/ModelsTriageRetriageComparisonNewInformation' + qualityAssessment: + $ref: '#/components/schemas/ModelsTriageRetriageComparisonQualityAssessment' + verdictChanges: items: - $ref: '#/components/schemas/EndpointsPullRequestSummary' + $ref: '#/components/schemas/ModelsTriageRetriageComparisonVerdictChangesElem' + nullable: true type: array - reconciliationStale: - type: boolean - state: - $ref: '#/components/schemas/ModelsAutoFixState' - terminal: - type: boolean - updatedAt: - type: string - required: - - state - - terminal type: object - EndpointsGetAutofixActivityLogOutput: + ModelsTriageRetriageComparisonNewInformation: properties: - entries: + cloudContextUpdated: + nullable: true + type: boolean + memoryChanges: items: - $ref: '#/components/schemas/EndpointsAutofixActivityLogEntry' + $ref: '#/components/schemas/ModelsTriageRetriageComparisonNewInformationMemoryChangesElem' + type: array + pentestResultAdded: nullable: true + type: boolean + userComments: + items: + $ref: '#/components/schemas/ModelsTriageRetriageComparisonNewInformationUserCommentsElem' type: array - nextCursor: + type: object + ModelsTriageRetriageComparisonNewInformationMemoryChangesElem: + properties: + description: type: string - required: - - entries + kind: + $ref: '#/components/schemas/ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKind' type: object - EndpointsGetCSPMFindingAutofixDiffOutput: + ModelsTriageRetriageComparisonNewInformationMemoryChangesElemKind: + enum: + - ADDED + - CORRECTED + - INVALIDATED + type: string + ModelsTriageRetriageComparisonNewInformationUserCommentsElem: properties: - commit: + commentId: type: string - diffs: + influence: + $ref: '#/components/schemas/ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence' + keyClaim: + type: string + type: object + ModelsTriageRetriageComparisonNewInformationUserCommentsElemInfluence: + enum: + - changed_verdict + - decreased_confidence + - increased_confidence + - no_effect + type: string + ModelsTriageRetriageComparisonQualityAssessment: + properties: + remainingUncertainties: items: - $ref: '#/components/schemas/ModelsDiffFile' - nullable: true + type: string type: array - explanation: + sufficientEvidence: + type: boolean + type: object + ModelsTriageRetriageComparisonVerdictChangesElem: + properties: + current: type: string - pullRequestBody: + field: type: string - pullRequestTitle: + previous: type: string - version: + reason: type: string - required: - - diffs - - pullRequestTitle - - pullRequestBody - - explanation - - commit type: object - EndpointsGetCSPMFindingAutofixStateOutput: + ModelsTriageRetriageMetadata: properties: - status: - $ref: '#/components/schemas/EndpointsAutofixStatusOutput' - version: + memoryChanges: + items: + $ref: '#/components/schemas/ModelsTriageRetriageMetadataMemoryChangesElem' + type: array + triggeredAt: + format: date-time + nullable: true type: string - required: - - status type: object - EndpointsGetCSPMFindingAutofixStatusOutput: + ModelsTriageRetriageMetadataMemoryChangesElem: properties: - status: - $ref: '#/components/schemas/EndpointsAutofixStatusOutput' - version: + memoryChangeType: + $ref: '#/components/schemas/ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType' + nullable: true + memoryId: + nullable: true type: string - required: - - status type: object - EndpointsGetCSPMFindingOutput: + ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType: + enum: + - MEMORY_ADDED + - MEMORY_CORRECTED + - MEMORY_INVALIDATED + - MEMORY_REMOVED + type: string + ModelsTriageRetriageStatus: + enum: + - NOT_RETRIAGED + - RETRIAGE_COMPLETED + - RETRIAGE_FAILED + - RETRIAGE_IN_PROGRESS + - RETRIAGE_REQUESTED + type: string + ModelsTriageSeverity: properties: - finding: - $ref: '#/components/schemas/ModelsCSPMFinding' - version: - type: string - required: - - finding - - version + confidence: + $ref: '#/components/schemas/ModelsTriageSeverityConfidence' + label: + $ref: '#/components/schemas/ModelsSeverityEnum' + score: + type: integer + unknowns: + items: + type: string + type: array type: object - EndpointsGetCSPMFindingsOutput: + ModelsTriageStopReason: + enum: + - cost_cap + - held_without_context + - no_submission + - provider_error + - reachability_unproven + - reachability_unproven_retried + - refusal + - tenant_budget + - wall_timeout + type: string + ModelsTriagedCSPMFinding: properties: - findings: + assessmentFactors: items: - $ref: '#/components/schemas/ModelsCSPMFindingPreview' - nullable: true + $ref: '#/components/schemas/ModelsAssessmentFactor' type: array - nextToken: + finding: + $ref: '#/components/schemas/ModelsCSPMFinding' + investigationSteps: + items: + $ref: '#/components/schemas/ModelsInvestigationStep' + type: array + isFalsePositive: + type: boolean + sourceAgentVersion: type: string - numItems: - type: integer - version: + sourceInputHash: + type: string + sourceTriageEnd: + format: date-time + nullable: true type: string + triage: + $ref: '#/components/schemas/ModelsTriage' required: - - findings - - numItems - - version + - isFalsePositive type: object - EndpointsGetCSPMScanOutput: + EndpointsBugHuntConfigInput: properties: - scan: - $ref: '#/components/schemas/ModelsCSPMScan' - version: - type: string + cadence: + $ref: '#/components/schemas/ModelsCadence' + credentials: + items: + $ref: '#/components/schemas/ModelsCredentialBinding' + nullable: true + type: array + enabled: + type: boolean + intensity: + $ref: '#/components/schemas/ModelsBugHuntScanIntensity' + ownershipProof: + $ref: '#/components/schemas/ModelsOwnershipProof' + roeAcknowledged: + type: boolean + rulesOfEngagement: + $ref: '#/components/schemas/ModelsRulesOfEngagement' + scope: + $ref: '#/components/schemas/ModelsScopePolicy' + scopeProvenance: + $ref: '#/components/schemas/ModelsScopeProvenance' + suites: + items: + $ref: '#/components/schemas/ModelsTestSuitePolicy' + nullable: true + type: array + vulnClasses: + items: + $ref: '#/components/schemas/ModelsVulnClassRule' + nullable: true + type: array required: - - scan - - version + - enabled + - scope + - vulnClasses + - suites + - credentials + - intensity type: object - EndpointsGetCSPMScansOutput: + EndpointsBugHuntFindingEvent: properties: - nextToken: + data: {} + id: type: string - numItems: - type: integer - scans: - items: - $ref: '#/components/schemas/ModelsCSPMScanPreview' - nullable: true - type: array - version: + time: + type: string + type: type: string required: - - scans - - numItems - - version + - id + - time + - type + - data type: object - EndpointsIterationSummary: + EndpointsBugHuntScanCostSummary: properties: - count: - type: integer - durationSeconds: - type: integer - lastIterationAt: - type: string - totalCostUSD: + totalCost: format: double type: number totalInputTokens: @@ -62128,642 +134612,417 @@ components: totalOutputTokens: type: integer required: - - count - - totalCostUSD + - totalCost - totalInputTokens - totalOutputTokens - - durationSeconds type: object - EndpointsPostCSPMFindingAutofixInput: + EndpointsBugHuntScanStatusOutput: properties: - force: - nullable: true - type: boolean - message: + cost: + $ref: '#/components/schemas/EndpointsBugHuntScanCostSummary' + currentActivity: type: string - originCampaignId: + findingsCount: + type: integer + lastActivityAt: type: string + phases: + items: + $ref: '#/components/schemas/EndpointsBugHuntScanStatusPhase' + type: array + progress: + type: integer + stage: + $ref: '#/components/schemas/ModelsBugHuntScanStage' + status: + $ref: '#/components/schemas/ModelsScanStatus' + terminal: + type: boolean + required: + - status + - stage + - progress + - terminal + - findingsCount type: object - EndpointsPostCSPMFindingAutofixOutput: + EndpointsBugHuntScanStatusPhase: properties: - autoFixState: - $ref: '#/components/schemas/ModelsAutoFixState' - error: + durationSeconds: + format: double + type: number + name: type: string - version: + status: type: string required: - - autoFixState + - name + - status type: object - EndpointsPostCreateTicketCSPMFindingInput: + EndpointsCreateDASTApplicationFromContextInput: properties: - assignees: - items: - $ref: '#/components/schemas/ModelsUser' - type: array - campaignId: - type: string - campaignTitle: - type: string - message: - type: string - project: + contextApplicationId: + minLength: 1 type: string - userCanonicalId: + name: + description: Defaults to the context application's name type: string + webServices: + items: + $ref: '#/components/schemas/EndpointsDASTAssessmentWebService' + maxItems: 20 + minItems: 1 + nullable: true + type: array + required: + - contextApplicationId + - webServices type: object - EndpointsPostCreateTicketCSPMFindingOutput: + EndpointsCreateDASTApplicationFromContextOutput: properties: - ticket: - $ref: '#/components/schemas/ModelsTicketProvider' - version: - type: string + application: + $ref: '#/components/schemas/ModelsDASTApplication' + created: + type: boolean + readiness: + $ref: '#/components/schemas/EndpointsDASTApplicationReadiness' + targets: + items: + $ref: '#/components/schemas/ModelsDASTTarget' + nullable: true + type: array required: - - ticket + - application + - created + - targets + - readiness type: object - EndpointsPullRequestSummary: + EndpointsDASTApplicationReadiness: properties: - createdAt: + applicationId: type: string - identifier: + blockers: + items: + $ref: '#/components/schemas/EndpointsDASTReadinessIssue' + nullable: true + type: array + deployments: type: integer - mergedAt: - type: string - provider: - $ref: '#/components/schemas/ModelsProviderID' - status: - $ref: '#/components/schemas/ModelsPullRequestState' - url: - type: string + ready: + type: boolean + warnings: + items: + $ref: '#/components/schemas/EndpointsDASTReadinessIssue' + nullable: true + type: array required: - - identifier + - applicationId + - ready + - deployments + - blockers + - warnings type: object - ModelsAutofixFailureReason: - enum: - - AGENT_ERROR - - AGENT_SURRENDERED - - CODE_NOT_FOUND - - DEPENDABOT_NO_OP - - ECOSYSTEM_NOT_SUPPORTED - - FIX_GENERATION_FAILED - - FIX_REVIEW_REJECTED - - NO_FIX_VERSION_AVAILABLE - - TIMEOUT - - TRANSITIVE_NO_PARENT_BUMP_PATH - type: string - ModelsAutofixPhase: - enum: - - planning - - fixing - - reviewing - - creating_pr - type: string - ModelsCSPMFinding: + EndpointsDASTAssessmentTarget: properties: - accountId: - type: string - accountName: - type: string - aiDevTitle: - type: string - aiTitle: - type: string - allowlistReason: + hostname: + minLength: 1 type: string - allowlistType: - $ref: '#/components/schemas/ModelsAllowlistType' - autoFixCurrentActivity: + name: type: string - autoFixEndTime: - format: date-time - nullable: true + path: + description: Base path the web service is mounted at; defaults to / type: string - autoFixStartTime: - format: date-time + port: nullable: true + type: integer + protocol: + description: Defaults to https + enum: + - http + - https type: string - autoFixState: - $ref: '#/components/schemas/ModelsAutoFixState' - autofixVerdictAt: - format: date-time - nullable: true + required: + - hostname + type: object + EndpointsDASTAssessmentWebService: + properties: + apiType: + $ref: '#/components/schemas/ModelsAPIType' + name: type: string - autofixVerdictExplanation: - nullable: true + projectId: type: string - autofixVerdictReason: - $ref: '#/components/schemas/ModelsAutofixFailureReason' - nullable: true - budgetExhausted: - type: boolean - budgetLimit: - format: double - type: number - budgetUsed: - format: double - type: number - category: + repoPath: type: string - cloudProvider: + repositoryId: + description: Repository of one of the context application's components + minLength: 1 type: string - complianceFrames: + targets: items: - $ref: '#/components/schemas/ModelsComplianceFrame' + $ref: '#/components/schemas/EndpointsDASTAssessmentTarget' + maxItems: 10 + minItems: 1 + nullable: true type: array - concurrencyLimit: - type: integer - createdAt: - type: string - currentConfig: - additionalProperties: {} - type: object - deletedAt: - format: date-time - type: string - description: - type: string - devDescription: - type: string - expectedConfig: - additionalProperties: {} - type: object - exploitabilityConfidence: - type: string - exploitabilityLabel: + required: + - repositoryId + - targets + type: object + EndpointsDASTCredentialValidationRun: + properties: + expiresAt: type: string - failedTriage: - type: boolean - fixCommit: + outcome: type: string - fixSource: + reasonCode: type: string - fixedAt: - format: date-time - nullable: true + retryAt: type: string - id: + runId: type: string - impactConfidence: + runStatus: type: string - impactLabel: + startedAt: type: string - installationId: + validation: + $ref: '#/components/schemas/ModelsDASTValidation' + required: + - runStatus + - runId + type: object + EndpointsDASTReadinessCode: + enum: + - dast_application_missing + - no_web_services + - web_service_no_targets + - target_missing + - invalid_configuration + - deployment_selection_required + - no_credentials + - credentials_unvalidated + type: string + EndpointsDASTReadinessIssue: + properties: + code: + $ref: '#/components/schemas/EndpointsDASTReadinessCode' + message: type: string - isAllowlisted: + required: + - code + - message + type: object + EndpointsDeleteCredentialOutput: + properties: + success: type: boolean - isArchived: + required: + - success + type: object + EndpointsDeleteDASTApplicationOutput: + properties: + success: type: boolean - isAutoFixableAgentVerdict: - nullable: true + required: + - success + type: object + EndpointsDeleteDASTExploitValidationPolicyOutput: + properties: + deleted: type: boolean - isFalsePositive: + required: + - deleted + type: object + EndpointsDeleteDASTTargetOutput: + properties: + success: type: boolean - isFixed: + required: + - success + type: object + EndpointsDeleteDASTWebServiceCredentialOutput: + properties: + success: type: boolean - isLatest: + required: + - success + type: object + EndpointsDeleteDASTWebServiceOutput: + properties: + success: type: boolean - isResolved: + required: + - success + type: object + EndpointsDeletePentestAppConfigOutput: + properties: + success: type: boolean - message: - type: string - platform: - type: string - priorityLabel: - $ref: '#/components/schemas/ModelsPriorityLabel' - priorityLabelReason: - type: string - priorityOverride: - $ref: '#/components/schemas/ModelsPriorityLabel' - priorityScore: - type: integer - pullRequestsAutofix: - items: - $ref: '#/components/schemas/ModelsPullRequestInfo' - type: array - region: - type: string - resolvedAt: - format: date-time - type: string - resourceArn: - type: string - resourceId: - type: string - resourceName: - type: string - resourceTags: - additionalProperties: - type: string - type: object - resourceType: - type: string - ruleId: - type: string - ruleUrl: - type: string - scanId: - type: string - severity: - $ref: '#/components/schemas/ModelsSeverity' - severityConfidence: - type: string - severityLabel: - $ref: '#/components/schemas/ModelsSeverity' - severityOverride: - $ref: '#/components/schemas/ModelsSeverity' - severityScore: - type: integer - tenantId: - type: string - ticket: - $ref: '#/components/schemas/ModelsTicketProvider' - ticketState: - type: string - title: - type: string - triageAgentVersion: - type: string - triageDurationSeconds: - type: integer - triageEnd: - format: date-time - nullable: true - type: string - triageLangfuseSessionId: - nullable: true - type: string - triageLangfuseTraceId: - nullable: true - type: string - triageLlmCostUsd: - nullable: true - type: number - triageStart: - format: date-time - nullable: true - type: string - triageTokenCount: - nullable: true - type: integer - triageTraceId: - nullable: true - type: string - updatedAt: - type: string - userNotes: - type: string required: - - platform - - installationId - - resolvedAt - - triageDurationSeconds - - isResolved + - success type: object - ModelsCSPMFindingPreview: + EndpointsDeleteTicketBugHuntFindingOutput: properties: - accountId: - type: string - accountName: - type: string - aiDevTitle: - type: string - aiTitle: - type: string - allowlistReason: - type: string - allowlistType: - $ref: '#/components/schemas/ModelsAllowlistType' - category: + version: type: string - cloudProvider: + type: object + EndpointsDeleteTicketPentestFindingOutput: + properties: + version: type: string - complianceFrames: + type: object + EndpointsExploitValidationAttempt: + properties: + attemptedCves: items: - $ref: '#/components/schemas/ModelsComplianceFrame' + type: string type: array - createdAt: - type: string - id: - type: string - isAllowlisted: - type: boolean - isArchived: - type: boolean - isFalsePositive: - type: boolean - isLatest: - type: boolean - isResolved: - type: boolean - message: - type: string - priorityLabel: - $ref: '#/components/schemas/ModelsPriorityLabel' - priorityOverride: - $ref: '#/components/schemas/ModelsPriorityLabel' - priorityScore: - type: integer - region: - type: string - resourceArn: - type: string - resourceId: - type: string - resourceName: - type: string - resourceType: - type: string - ruleId: - type: string - ruleUrl: - type: string - severity: - $ref: '#/components/schemas/ModelsSeverity' - tenantId: - type: string - ticket: - $ref: '#/components/schemas/ModelsTicketProvider' - title: + completedAt: type: string - triageEnd: - format: date-time + confidence: nullable: true - type: string - triageStart: - format: date-time + type: number + costUsd: nullable: true - type: string - updatedAt: - type: string - required: - - createdAt - - updatedAt - - tenantId - - id - - title - - isResolved - type: object - ModelsCSPMScan: - properties: - accountId: - type: string - accountName: - type: string - cloudProvider: - $ref: '#/components/schemas/ModelsCloudProvider' + type: number createdAt: type: string - duration: - type: integer - endedAt: - format: date-time - nullable: true - type: string - executionArn: - type: string - failureReason: + durationSeconds: nullable: true + type: number + exploitedCve: type: string - findingsCount: - type: integer - findingsS3Bucket: - type: string - findingsS3Key: - type: string - id: - type: string - installationId: + findingId: type: string - isArchived: - type: boolean - platform: + findingTitle: type: string - progress: - type: integer - region: + findingType: type: string - regionsToScan: - items: - type: string - type: array - resourceCoverage: - additionalProperties: {} - type: object - resourceTypes: - items: - type: string - type: array - rulesToScan: - items: - type: string - type: array - scanConfig: - additionalProperties: {} - type: object - scanType: - $ref: '#/components/schemas/ModelsCSPMScanType' - scannerConfig: + hasEndpointProof: + description: Whether this completed CONFIRMED attempt has a tested endpoint with a method and path + type: boolean + id: type: string - scannerVersion: + outcome: type: string startedAt: - format: date-time type: string status: - $ref: '#/components/schemas/ModelsScanStatus' - summary: - $ref: '#/components/schemas/ModelsCSPMScanSummary' - tenantId: + type: string + statusReason: type: string updatedAt: type: string required: - - platform - - installationId - - startedAt - - summary + - id + - findingId + - findingType + - status type: object - ModelsCSPMScanPreview: + EndpointsExploitValidationConsentOutput: properties: - accountId: + acceptedAt: + format: date-time + nullable: true type: string - accountName: + acceptedBy: type: string - cloudProvider: - $ref: '#/components/schemas/ModelsCloudProvider' - createdAt: + acceptedByKind: + enum: + - customer + - nullify_staff + - nullify_operator type: string - duration: - type: integer - endedAt: - format: date-time - nullable: true + acceptedByName: type: string - findingsCount: - type: integer - id: + acceptedWarningVersion: type: string - isArchived: + blockedReason: + enum: + - target_production + - target_not_confirmed_non_production + type: string + canAccept: type: boolean - progress: - type: integer - region: + classification: + enum: + - production + - non_production + - unknown type: string - scanType: - $ref: '#/components/schemas/ModelsCSPMScanType' - scannerVersion: + currentWarningVersion: type: string - startedAt: - format: date-time + effectiveForNewRuns: + type: boolean + endpoint: type: string - status: - $ref: '#/components/schemas/ModelsScanStatus' - summary: - $ref: '#/components/schemas/ModelsCSPMScanSummary' - tenantId: + evidenceUrl: type: string - updatedAt: + onBehalfOf: type: string - required: - - startedAt - - summary - type: object - ModelsCSPMScanSummary: - properties: - criticalFindings: - type: integer - failedChecks: - type: integer - highFindings: - type: integer - infoFindings: - type: integer - lowFindings: - type: integer - mediumFindings: - type: integer - passedChecks: - type: integer - resourcesScanned: - type: integer - rulesEvaluated: - type: integer - totalFindings: - type: integer - required: - - totalFindings - - criticalFindings - - highFindings - - mediumFindings - - lowFindings - - infoFindings - - passedChecks - - failedChecks - - resourcesScanned - - rulesEvaluated - type: object - ModelsCSPMScanType: - enum: - - full - - incremental - - targeted - - scheduled-cloud-scan - type: string - ModelsComplianceFrame: - properties: - control: + onBehalfRequired: + type: boolean + state: + enum: + - not_accepted + - accepted + - outdated_warning type: string - framework: + targetId: type: string - version: + warningText: type: string + required: + - targetId + - endpoint + - classification + - state + - effectiveForNewRuns + - canAccept + - currentWarningVersion + - warningText type: object - ModelsScanStatus: - enum: - - queued - - in progress - - stopping - - completed - - cancelled - - failed - - aborted_config_error - - human_fallback - type: string - AgentsAgentLogs: - items: {} - nullable: true - type: array - AgentsGroupedAgentLog: + EndpointsExploitValidationRunAttempt: properties: - logs: - $ref: '#/components/schemas/AgentsAgentLogs' - summary: + completedAt: type: string - type: object - AgentsGroupedAgentLogs: - items: - $ref: '#/components/schemas/AgentsGroupedAgentLog' - nullable: true - type: array - EndpointsBugHuntConfigInput: - properties: - credentials: - items: - $ref: '#/components/schemas/ModelsCredentialBinding' - nullable: true - type: array - enabled: - type: boolean - intensity: - $ref: '#/components/schemas/ModelsBugHuntScanIntensity' - scope: - $ref: '#/components/schemas/ModelsScopePolicy' - suites: - items: - $ref: '#/components/schemas/ModelsTestSuitePolicy' - nullable: true - type: array - vulnClasses: - items: - $ref: '#/components/schemas/ModelsVulnClassRule' + confidence: nullable: true - type: array - required: - - enabled - - scope - - vulnClasses - - suites - - credentials - - intensity - type: object - EndpointsBugHuntFindingEvent: - properties: - data: {} - id: + type: number + decidedAt: type: string - time: + decision: + enum: + - dispatched + - declined type: string - type: + error: + type: string + exploitedCve: + type: string + findingId: + type: string + findingType: + type: string + outcome: + type: string + reason: + type: string + report: + type: string + reproductionScript: + type: string + state: + $ref: '#/components/schemas/EndpointsRunState' + targetUrl: + type: string + webServiceId: type: string required: - - id - - time - - type - - data - type: object - EndpointsDeleteCredentialOutput: - properties: - success: - type: boolean - required: - - success - type: object - EndpointsDeletePentestAppConfigOutput: - properties: - success: - type: boolean - required: - - success + - findingId + - findingType + - decision + - reason + - state type: object EndpointsGetAuthMatrixHypothesesOutput: properties: @@ -62803,6 +135062,8 @@ components: properties: triage: $ref: '#/components/schemas/ModelsTriage' + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' type: object EndpointsGetBugHuntFindingsOutput: properties: @@ -62849,8 +135110,11 @@ components: $ref: '#/components/schemas/ModelsBugHuntFinding' nullable: true type: array + totalCount: + type: integer required: - findings + - totalCount type: object EndpointsGetBugHuntScanOutput: properties: @@ -62861,13 +135125,19 @@ components: type: object EndpointsGetBugHuntScansOutput: properties: + nextToken: + type: string scans: items: $ref: '#/components/schemas/ModelsBugHuntScan' nullable: true type: array + totalCount: + type: integer required: - scans + - nextToken + - totalCount type: object EndpointsGetBugHuntSuiteRunsOutput: properties: @@ -62893,8 +135163,64 @@ components: $ref: '#/components/schemas/ModelsCredential' nullable: true type: array + totalCount: + type: integer required: - credentials + - totalCount + type: object + EndpointsGetDASTApplicationOutput: + properties: + application: + $ref: '#/components/schemas/ModelsDASTApplication' + required: + - application + type: object + EndpointsGetDASTApplicationReadinessInput: + properties: + applicationIds: + description: DAST application ids; a context application id names the DAST application stored under it + items: + type: string + maxItems: 100 + minItems: 1 + nullable: true + type: array + required: + - applicationIds + type: object + EndpointsGetDASTApplicationReadinessOutput: + properties: + applications: + items: + $ref: '#/components/schemas/EndpointsDASTApplicationReadiness' + nullable: true + type: array + required: + - applications + type: object + EndpointsGetDASTApplicationsOutput: + properties: + applications: + items: + $ref: '#/components/schemas/ModelsDASTApplication' + nullable: true + type: array + nextToken: + type: string + required: + - applications + - nextToken + type: object + EndpointsGetDASTExploitValidationPoliciesOutput: + properties: + policies: + items: + $ref: '#/components/schemas/ModelsDASTExploitValidationPolicy' + nullable: true + type: array + required: + - policies type: object EndpointsGetDASTFindingAutofixStateOutput: properties: @@ -62921,10 +135247,124 @@ components: bughunt: $ref: '#/components/schemas/EndpointsLastScanStatus' type: object + EndpointsGetDASTTargetOutput: + properties: + target: + $ref: '#/components/schemas/ModelsDASTTarget' + required: + - target + type: object + EndpointsGetDASTTargetsOutput: + properties: + nextToken: + type: string + targets: + items: + $ref: '#/components/schemas/ModelsDASTTarget' + nullable: true + type: array + required: + - targets + - nextToken + type: object + EndpointsGetDASTWebServiceCredentialsOutput: + properties: + credentialIds: + items: + type: string + nullable: true + type: array + required: + - credentialIds + type: object + EndpointsGetDASTWebServiceOutput: + properties: + webService: + $ref: '#/components/schemas/ModelsDASTWebService' + required: + - webService + type: object + EndpointsGetDASTWebServicesOutput: + properties: + nextToken: + type: string + webServices: + items: + $ref: '#/components/schemas/ModelsDASTWebService' + nullable: true + type: array + required: + - webServices + - nextToken + type: object + EndpointsGetExploitEvidenceOutput: + properties: + contentType: + type: string + evidenceId: + type: string + expiresAt: + description: RFC3339 timestamp + type: string + kind: + type: string + url: + type: string + required: + - evidenceId + - kind + - contentType + - url + - expiresAt + type: object + EndpointsGetExploitValidationRunOutput: + properties: + attempts: + items: + $ref: '#/components/schemas/EndpointsExploitValidationRunAttempt' + nullable: true + type: array + completedAt: + type: string + error: + type: string + runId: + type: string + startedAt: + type: string + state: + enum: + - PENDING + - RUNNING + - SUCCEEDED + - FAILED + - SKIPPED + - TIMED_OUT + - ABORTED + type: string + terminal: + type: boolean + required: + - runId + - state + - attempts + type: object EndpointsGetLatestPentestPreflightOutput: properties: preflight: $ref: '#/components/schemas/ModelsPentestPreflight' + stale: + type: boolean + type: object + EndpointsGetMutationWarningOutput: + properties: + text: + type: string + version: + type: string + required: + - text + - version type: object EndpointsGetPentestAppConfigOutput: properties: @@ -62946,29 +135386,82 @@ components: - applications - nextToken type: object - EndpointsGetPentestFindingAutofixDiffOutput: + EndpointsGetPentestAuthMatrixCasesOutput: properties: - commit: + cases: + items: + $ref: '#/components/schemas/EndpointsPentestAuthMatrixCase' + nullable: true + type: array + limit: + type: integer + offset: + type: integer + total: + type: integer + required: + - cases + - total + - limit + - offset + type: object + EndpointsGetPentestAuthMatrixEvidenceOutput: + properties: + complete: + type: boolean + diagnostic: type: string - diffs: + evidence: items: - $ref: '#/components/schemas/ModelsDiffFile' + $ref: '#/components/schemas/EndpointsPentestAuthMatrixEvidenceRecord' nullable: true type: array - explanation: + excludedUnavailableMetadata: + type: integer + nextCursor: type: string - pullRequestBody: + version: type: string - pullRequestTitle: + required: + - evidence + - complete + type: object + EndpointsGetPentestBudgetOutput: + properties: + consumedUsd: + format: double + type: number + frozen: + type: boolean + heldUsd: + format: double + type: number + limitUsd: + format: double + type: number + remainingUsd: + format: double + type: number + timeWindow: type: string - version: + unlimited: + type: boolean + windowEnd: type: string required: - - diffs - - pullRequestTitle - - pullRequestBody - - explanation - - commit + - unlimited + - frozen + - limitUsd + - consumedUsd + - heldUsd + - remainingUsd + type: object + EndpointsGetPentestEstimateOutput: + properties: + estimate: + $ref: '#/components/schemas/EndpointsPentestEstimateResult' + required: + - estimate type: object EndpointsGetPentestFindingEventsOutput: properties: @@ -62988,6 +135481,8 @@ components: $ref: '#/components/schemas/ModelsPentestFinding' version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' required: - finding type: object @@ -63007,6 +135502,11 @@ components: $ref: '#/components/schemas/ModelsPentestFinding' nullable: true type: array + groups: + items: + $ref: '#/components/schemas/ModelsPentestFindingGroup' + nullable: true + type: array nextToken: type: string numItems: @@ -63015,6 +135515,7 @@ components: type: string required: - findings + - groups - numItems - nextToken type: object @@ -63057,6 +135558,46 @@ components: - limit - windowResetAt type: object + EndpointsGetPentestScanActivityOutput: + properties: + entries: + items: + $ref: '#/components/schemas/EndpointsPentestScanActivityLogEntry' + nullable: true + type: array + nextCursor: + type: string + required: + - entries + type: object + EndpointsGetPentestScanEventsOutput: + properties: + events: + items: + $ref: '#/components/schemas/ModelsDASTEventInterface' + nullable: true + type: array + highestSeq: + format: int64 + type: integer + version: + type: string + required: + - events + - highestSeq + type: object + EndpointsGetPentestScanFindingLinksOutput: + properties: + mappedFindings: + items: + $ref: '#/components/schemas/ModelsPentestMappedFinding' + nullable: true + type: array + version: + type: string + required: + - mappedFindings + type: object EndpointsGetPentestScanFindingsOutput: properties: findings: @@ -63069,19 +135610,97 @@ components: required: - findings type: object - EndpointsGetPentestScanOutput: + EndpointsGetPentestScanNetworkTransactionsOutput: + properties: + attempts: + items: + $ref: '#/components/schemas/EndpointsPentestCaptureAttempt' + nullable: true + type: array + captureState: + type: string + complete: + type: boolean + correlationAvailability: + type: string + diagnostic: + type: string + excludedMissingTime: + type: integer + nextCursor: + type: string + phase: + type: string + retryLater: + type: boolean + transactions: + items: + $ref: '#/components/schemas/ModelsNetworkTransaction' + nullable: true + type: array + unmatchedAttribution: + type: string + version: + type: string + required: + - transactions + - attempts + - captureState + - correlationAvailability + - unmatchedAttribution + - phase + - complete + - retryLater + - excludedMissingTime + type: object + EndpointsGetPentestScanOutput: + properties: + scan: + $ref: '#/components/schemas/ModelsPentestScan' + version: + type: string + required: + - scan + type: object + EndpointsGetPentestScanProgressStatusOutput: + properties: + currentActivity: + nullable: true + type: string + currentPhase: + nullable: true + type: string + lastActivityAt: + nullable: true + type: string + progress: + type: integer + status: + $ref: '#/components/schemas/ModelsScanStatus' + terminal: + type: boolean + required: + - status + - progress + - terminal + type: object + EndpointsGetPentestScanReportDownloadURLOutput: properties: - scan: - $ref: '#/components/schemas/ModelsPentestScan' + downloadUrl: + type: string + partial: + type: boolean version: type: string required: - - scan + - downloadUrl type: object - EndpointsGetPentestScanReportDownloadURLOutput: + EndpointsGetPentestScanReportExternalPDFOutput: properties: downloadUrl: type: string + partial: + type: boolean version: type: string required: @@ -63089,6 +135708,8 @@ components: type: object EndpointsGetPentestScanReportOutput: properties: + partial: + type: boolean report: $ref: '#/components/schemas/ModelsPentestReport' version: @@ -63100,6 +135721,8 @@ components: properties: downloadUrl: type: string + partial: + type: boolean version: type: string required: @@ -63114,11 +135737,14 @@ components: $ref: '#/components/schemas/ModelsPentestScan' nullable: true type: array + totalCount: + type: integer version: type: string required: - scans - nextToken + - totalCount type: object EndpointsGetSourceIPsOutput: properties: @@ -63135,12 +135761,12 @@ components: type: object EndpointsGetSubAgentNetworkLogOutput: properties: - networkLog: - $ref: '#/components/schemas/ModelsNetworkLog' + downloadUrl: + type: string version: type: string required: - - networkLog + - downloadUrl type: object EndpointsLastScanResults: properties: @@ -63168,6 +135794,35 @@ components: - status - startTime type: object + EndpointsListExploitValidationAttemptsOutput: + properties: + attempts: + items: + $ref: '#/components/schemas/EndpointsExploitValidationAttempt' + nullable: true + type: array + nextToken: + type: string + numItems: + type: integer + required: + - attempts + - numItems + - nextToken + type: object + EndpointsPaginatedValidations: + properties: + nextToken: + type: string + validations: + items: + $ref: '#/components/schemas/ModelsDASTValidation' + nullable: true + type: array + required: + - validations + - nextToken + type: object EndpointsPatchBugHuntFindingAllowlistInput: properties: allow: @@ -63185,6 +135840,226 @@ components: required: - success type: object + EndpointsPatchPentestAppConfigInput: + properties: + credentialIds: + items: + type: string + type: array + targets: + description: Omitted or null preserves existing target links; an empty array detaches all targets. + items: + $ref: '#/components/schemas/ModelsApplicationPentestTarget' + nullable: true + type: array + type: object + EndpointsPatchPentestAppConfigOutput: + properties: + application: + $ref: '#/components/schemas/ModelsApplicationPentestConfig' + required: + - application + type: object + EndpointsPentestAuthMatrixCase: + properties: + candidateId: + type: string + endpointId: + type: string + evidenceRefs: + items: + type: string + nullable: true + type: array + key: + type: string + lifecycle: + enum: + - not_started + - policy_skipped + - resolved + - inconclusive + - unrecognised + type: string + method: + type: string + operationId: + type: string + outcome: + type: string + ownerId: + type: string + path: + type: string + reason: + type: string + relationship: + type: string + required: + - key + - operationId + - endpointId + - method + - path + - candidateId + - ownerId + - relationship + - outcome + - reason + - lifecycle + - evidenceRefs + type: object + EndpointsPentestAuthMatrixEvidenceRecord: + properties: + assessmentDigest: + description: SHA-256 of the representation assessed during execution; absent when no body was assessed. + type: string + attempt: + $ref: '#/components/schemas/EndpointsPentestCaptureAttempt' + bodyState: + description: not_retained, stored, empty, unavailable, or failed; only stored bodies have download links. + type: string + bytes: + description: Bytes in the final retained decoded UTF-8 representation, at most 1 MiB. + format: int64 + type: integer + contentType: + type: string + diagnostic: + type: string + downloadHeaders: + additionalProperties: + type: string + description: Required request headers for the conditional body download; send If-Match unchanged. + type: object + downloadUrl: + description: Presigned body URL valid for 15 minutes; requires downloadHeaders. + type: string + method: + type: string + path: + type: string + preview: + description: At most 8 KiB of verified retained UTF-8 text. + type: string + redactionVersion: + description: credentials-v1 identifies final task credential scrubbing. + type: string + representationVersion: + description: decoded-text-v1 identifies decoded response text, not original wire bytes. + type: string + selectedResult: + type: boolean + storedDigest: + description: SHA-256 of final retained text after credential scrubbing; may differ from the assessment digest. + type: string + truncation: + description: none, read_cap, quota, unsupported, read_failed, scrub_failed, write_failed, or cleanup_failed. + type: string + required: + - attempt + - bodyState + - bytes + - selectedResult + type: object + EndpointsPentestCaptureAttempt: + properties: + attemptEvidenceRef: + type: string + attemptNumber: + format: int32 + type: integer + createdAt: + format: date-time + type: string + errorCode: + type: string + finalEvidenceRef: + type: string + finishedAt: + format: date-time + nullable: true + type: string + httpStatus: + nullable: true + type: integer + id: + type: string + identityId: + type: string + outcome: + type: string + replayId: + type: string + sessionGeneration: + format: int64 + type: integer + transactionId: + nullable: true + type: string + required: + - id + - replayId + - identityId + - attemptEvidenceRef + - attemptNumber + - sessionGeneration + - createdAt + - outcome + - errorCode + type: object + EndpointsPentestEstimateResult: + properties: + basedOnHistoricalRuns: + type: integer + confidence: + $ref: '#/components/schemas/ModelsPentestPreflightConfidence' + durationSeconds: + type: integer + inputTokens: + format: int64 + type: integer + llmCostUsdCents: + format: int64 + type: integer + outputTokens: + format: int64 + type: integer + source: + $ref: '#/components/schemas/EndpointsPentestEstimateSource' + required: + - durationSeconds + - llmCostUsdCents + - inputTokens + - outputTokens + - confidence + - basedOnHistoricalRuns + - source + type: object + EndpointsPentestEstimateSource: + enum: + - preflight + - heuristic + type: string + EndpointsPentestScanActivityLogEntry: + properties: + content: + type: string + createdAt: + type: string + eventType: + type: string + id: + type: string + metadata: + nullable: true + type: string + type: object + EndpointsPentestStartMode: + enum: + - self_serve_started + - manual_requested + type: string EndpointsPostAllowlistPentestFindingInput: properties: allowlistReason: @@ -63218,11 +136093,36 @@ components: $ref: '#/components/schemas/ModelsAutoFixState' error: type: string + runId: + type: string version: type: string required: - autoFixState type: object + EndpointsPostBugHuntProgramImportInput: + properties: + programType: + type: string + programUrl: + type: string + required: + - programType + - programUrl + type: object + EndpointsPostBugHuntProgramImportOutput: + properties: + rulesOfEngagement: + $ref: '#/components/schemas/ModelsRulesOfEngagement' + scope: + $ref: '#/components/schemas/ModelsScopePolicy' + scopeProvenance: + $ref: '#/components/schemas/ModelsScopeProvenance' + required: + - scope + - rulesOfEngagement + - scopeProvenance + type: object EndpointsPostBugHuntScanInput: properties: intensity: @@ -63252,6 +136152,26 @@ components: required: - scanId type: object + EndpointsPostCreateTicketBugHuntFindingInput: + properties: + assignees: + items: + $ref: '#/components/schemas/ModelsUser' + type: array + message: + type: string + project: + type: string + type: object + EndpointsPostCreateTicketBugHuntFindingOutput: + properties: + ticket: + $ref: '#/components/schemas/ModelsTicketProvider' + version: + type: string + required: + - ticket + type: object EndpointsPostCreateTicketPentestFindingInput: properties: assignees: @@ -63299,6 +136219,231 @@ components: required: - credential type: object + EndpointsPostDASTApplicationInput: + properties: + contextApplicationId: + type: string + description: + type: string + name: + type: string + scopeExcludePatterns: + description: >- + Case-insensitive [METHOD ] deny rules including subtrees. Target paths are relative to the target base + path; admitted target subdomains match both mounted and root paths, and other admitted hosts match root + paths. Omit METHOD to deny all methods. Ambiguous encoded paths are refused. + items: + type: string + type: array + webServiceIds: + items: + type: string + nullable: true + type: array + required: + - webServiceIds + type: object + EndpointsPostDASTApplicationOutput: + properties: + application: + $ref: '#/components/schemas/ModelsDASTApplication' + required: + - application + type: object + EndpointsPostDASTCredentialValidationInput: + properties: + testUrl: + type: string + type: object + EndpointsPostDASTExploitValidationPolicyArmInput: + properties: + capabilities: + items: + $ref: '#/components/schemas/ModelsDASTExploitValidationCapability' + type: array + expectedUpdatedAt: + format: date-time + type: string + safetyContractVersion: + type: integer + required: + - safetyContractVersion + - expectedUpdatedAt + type: object + EndpointsPostDASTExploitValidationPolicyArmOutput: + properties: + policy: + $ref: '#/components/schemas/ModelsDASTExploitValidationPolicy' + required: + - policy + type: object + EndpointsPostDASTExploitValidationPolicyDisarmOutput: + properties: + policy: + $ref: '#/components/schemas/ModelsDASTExploitValidationPolicy' + required: + - policy + type: object + EndpointsPostDASTExploitValidationPolicyInput: + properties: + daysOfWeek: + items: + type: integer + nullable: true + type: array + enabled: + type: boolean + endTime: + type: string + findingTypes: + items: + $ref: '#/components/schemas/ModelsDASTExploitValidationFindingType' + nullable: true + type: array + minimumExploitability: + type: string + minimumSeverity: + type: string + name: + type: string + revalidationCooldownDays: + maximum: 365 + minimum: 7 + type: integer + startTime: + type: string + timezone: + type: string + webServiceIds: + items: + type: string + nullable: true + type: array + required: + - name + - enabled + - findingTypes + - webServiceIds + - daysOfWeek + - startTime + - endTime + - timezone + - minimumSeverity + - minimumExploitability + - revalidationCooldownDays + type: object + EndpointsPostDASTExploitValidationPolicyOutput: + properties: + policy: + $ref: '#/components/schemas/ModelsDASTExploitValidationPolicy' + required: + - policy + type: object + EndpointsPostDASTTargetInput: + properties: + description: + type: string + hostname: + type: string + isProd: + type: boolean + name: + type: string + port: + nullable: true + type: integer + protocol: + type: string + required: + - hostname + type: object + EndpointsPostDASTTargetOutput: + properties: + target: + $ref: '#/components/schemas/ModelsDASTTarget' + required: + - target + type: object + EndpointsPostDASTTargetValidationOutput: + properties: + validation: + $ref: '#/components/schemas/ModelsDASTValidation' + required: + - validation + type: object + EndpointsPostDASTWebServiceAccessValidationInput: + properties: + credentialId: + type: string + required: + - credentialId + type: object + EndpointsPostDASTWebServiceAccessValidationOutput: + properties: + validation: + $ref: '#/components/schemas/ModelsDASTValidation' + required: + - validation + type: object + EndpointsPostDASTWebServiceCredentialInput: + properties: + credentialId: + type: string + required: + - credentialId + type: object + EndpointsPostDASTWebServiceCredentialOutput: + properties: + success: + type: boolean + required: + - success + type: object + EndpointsPostDASTWebServiceInput: + properties: + apiType: + $ref: '#/components/schemas/ModelsAPIType' + credentialIds: + items: + type: string + type: array + description: + type: string + name: + type: string + projectId: + type: string + repoPath: + type: string + repositoryId: + type: string + targets: + items: + $ref: '#/components/schemas/ModelsDASTWebServiceTarget' + nullable: true + type: array + required: + - targets + type: object + EndpointsPostDASTWebServiceOutput: + properties: + credentialIds: + items: + type: string + nullable: true + type: array + webService: + $ref: '#/components/schemas/ModelsDASTWebService' + required: + - webService + type: object + EndpointsPostDASTWebServiceStatusValidationOutput: + properties: + validation: + $ref: '#/components/schemas/ModelsDASTValidation' + required: + - validation + type: object EndpointsPostPentestAppConfigInput: properties: credentialIds: @@ -63330,44 +136475,236 @@ components: description: The reason for unallowlisting the finding type: string required: - - unallowlistReason - type: object - EndpointsPutBugHuntConfigInput: - properties: - config: - $ref: '#/components/schemas/EndpointsBugHuntConfigInput' - required: - - config + - unallowlistReason + type: object + EndpointsPutBugHuntConfigInput: + properties: + config: + $ref: '#/components/schemas/EndpointsBugHuntConfigInput' + required: + - config + type: object + EndpointsPutBugHuntConfigOutput: + properties: + config: + $ref: '#/components/schemas/ModelsBugHuntScanConfig' + required: + - config + type: object + EndpointsPutCredentialActiveInput: + properties: + isActive: + type: boolean + required: + - isActive + type: object + EndpointsPutCredentialActiveOutput: + properties: + credential: + $ref: '#/components/schemas/ModelsCredential' + required: + - credential + type: object + EndpointsPutCredentialInput: + properties: + config: + $ref: '#/components/schemas/ModelsCredentialConfig' + description: + type: string + name: + type: string + type: + $ref: '#/components/schemas/ModelsCredentialType' + required: + - name + - description + - type + - config + type: object + EndpointsPutCredentialOutput: + properties: + credential: + $ref: '#/components/schemas/ModelsCredential' + required: + - credential + type: object + EndpointsPutDASTApplicationInput: + properties: + description: + type: string + name: + type: string + scopeExcludePatterns: + description: >- + Case-insensitive [METHOD ] deny rules including subtrees. Target paths are relative to the target base + path; admitted target subdomains match both mounted and root paths, and other admitted hosts match root + paths. Omit METHOD to deny all methods. Ambiguous encoded paths are refused. Omitted or null preserves + stored rules; an empty array clears them. + items: + type: string + nullable: true + type: array + webServiceIds: + items: + type: string + nullable: true + type: array + required: + - webServiceIds + type: object + EndpointsPutDASTApplicationOutput: + properties: + application: + $ref: '#/components/schemas/ModelsDASTApplication' + required: + - application + type: object + EndpointsPutDASTExploitValidationPolicyInput: + properties: + daysOfWeek: + items: + type: integer + nullable: true + type: array + enabled: + type: boolean + endTime: + type: string + findingTypes: + items: + $ref: '#/components/schemas/ModelsDASTExploitValidationFindingType' + nullable: true + type: array + minimumExploitability: + type: string + minimumSeverity: + type: string + name: + type: string + revalidationCooldownDays: + maximum: 365 + minimum: 7 + type: integer + startTime: + type: string + timezone: + type: string + webServiceIds: + items: + type: string + nullable: true + type: array + required: + - name + - enabled + - findingTypes + - webServiceIds + - daysOfWeek + - startTime + - endTime + - timezone + - minimumSeverity + - minimumExploitability + - revalidationCooldownDays + type: object + EndpointsPutDASTExploitValidationPolicyOutput: + properties: + policy: + $ref: '#/components/schemas/ModelsDASTExploitValidationPolicy' + required: + - policy + type: object + EndpointsPutDASTTargetInput: + properties: + description: + type: string + hostname: + type: string + isProd: + nullable: true + type: boolean + name: + type: string + port: + nullable: true + type: integer + protocol: + type: string + required: + - hostname + type: object + EndpointsPutDASTTargetOutput: + properties: + target: + $ref: '#/components/schemas/ModelsDASTTarget' + required: + - target + type: object + EndpointsPutDASTWebServiceInput: + properties: + apiType: + $ref: '#/components/schemas/ModelsAPIType' + credentialIds: + items: + type: string + nullable: true + type: array + description: + type: string + name: + type: string + projectId: + type: string + repoPath: + type: string + repositoryId: + type: string + targets: + items: + $ref: '#/components/schemas/ModelsDASTWebServiceTarget' + nullable: true + type: array + required: + - targets type: object - EndpointsPutBugHuntConfigOutput: + EndpointsPutDASTWebServiceOutput: properties: - config: - $ref: '#/components/schemas/ModelsBugHuntScanConfig' + credentialIds: + items: + type: string + nullable: true + type: array + removedCredentialIds: + items: + type: string + type: array + webService: + $ref: '#/components/schemas/ModelsDASTWebService' required: - - config + - webService type: object - EndpointsPutCredentialInput: + EndpointsPutExploitValidationConsentInput: properties: - config: - $ref: '#/components/schemas/ModelsCredentialConfig' - description: + endpoint: type: string - name: + evidence: + type: string + onBehalfOf: + type: string + warningVersion: type: string - type: - $ref: '#/components/schemas/ModelsCredentialType' required: - - name - - description - - type - - config + - warningVersion + - endpoint type: object - EndpointsPutCredentialOutput: + EndpointsPutMutationConsentInput: properties: - credential: - $ref: '#/components/schemas/ModelsCredential' + enabled: + type: boolean + warningVersion: + type: string required: - - credential + - enabled type: object EndpointsPutPentestAppConfigInput: properties: @@ -63376,8 +136713,10 @@ components: type: string type: array targets: + description: Omitted or null preserves existing target links; an empty array detaches all targets. items: $ref: '#/components/schemas/ModelsApplicationPentestTarget' + nullable: true type: array type: object EndpointsPutPentestAppConfigOutput: @@ -63387,8 +136726,34 @@ components: required: - application type: object + EndpointsPutTargetClassificationInput: + properties: + classification: + $ref: '#/components/schemas/ModelsDASTTargetClassification' + required: + - classification + type: object + EndpointsStartExploitValidationOutput: + properties: + executionArn: + type: string + executionArns: + items: + type: string + type: array + reason: + type: string + runId: + type: string + started: + type: boolean + version: + type: string + type: object EndpointsStartPentestPreflightInput: properties: + deployment: + $ref: '#/components/schemas/ModelsPentestDeployment' triggeredByScan: type: boolean type: object @@ -63405,11 +136770,17 @@ components: type: string configOverrides: $ref: '#/components/schemas/ModelsApplicationPentestConfigOverrides' + deployment: + $ref: '#/components/schemas/ModelsPentestDeployment' + onboardingDispatch: + type: boolean required: - applicationId type: object EndpointsStartPentestScanFromApplicationOutput: properties: + mode: + $ref: '#/components/schemas/EndpointsPentestStartMode' scan: $ref: '#/components/schemas/ModelsPentestScan' version: @@ -63463,21 +136834,105 @@ components: required: - errors type: object + EndpointsValidateCredentialInput: + properties: + testUrl: + type: string + type: object EndpointsValidateCredentialOutput: properties: message: type: string + outcome: + type: string + reasonCode: + type: string + valid: + type: boolean + validatedAt: + type: string + validationEvidence: + $ref: '#/components/schemas/ModelsValidationEvidence' + validationId: + type: string + required: + - valid + - validationEvidence + - validatedAt + type: object + EndpointsValidateCredentialResult: + properties: + credentialId: + type: string + message: + type: string + outcome: + type: string + reasonCode: + type: string valid: type: boolean validatedAt: type: string validationEvidence: $ref: '#/components/schemas/ModelsValidationEvidence' + validationId: + type: string required: + - credentialId - valid - validationEvidence - validatedAt type: object + EndpointsValidateCredentialsInput: + properties: + credentialIds: + items: + type: string + nullable: true + type: array + testUrl: + type: string + required: + - credentialIds + type: object + EndpointsValidateCredentialsOutput: + properties: + results: + items: + $ref: '#/components/schemas/EndpointsValidateCredentialResult' + nullable: true + type: array + required: + - results + type: object + EndpointsValidateTargetsInput: + properties: + targetIds: + items: + type: string + nullable: true + type: array + required: + - targetIds + type: object + EndpointsValidateTargetsOutput: + properties: + results: + items: + $ref: '#/components/schemas/ModelsDASTValidation' + nullable: true + type: array + required: + - results + type: object + ModelsAPIKeyPlacement: + enum: + - header + - bearer + - query + - json_body + type: string ModelsAPIType: enum: - REST @@ -63512,6 +136967,8 @@ components: type: object ModelsApplicationPentestConfig: properties: + allowMutationTesting: + type: boolean createdAt: format: date-time type: string @@ -63524,6 +136981,16 @@ components: $ref: '#/components/schemas/ModelsPentestScanConfig' id: type: string + mutationAckAt: + format: date-time + nullable: true + type: string + mutationAckBy: + nullable: true + type: string + mutationWarningVersion: + nullable: true + type: string targets: items: $ref: '#/components/schemas/ModelsApplicationPentestTarget' @@ -63533,6 +137000,7 @@ components: format: date-time type: string required: + - allowMutationTesting - createdAt - updatedAt - targets @@ -63540,6 +137008,7 @@ components: ModelsApplicationPentestConfigOverrides: properties: apiSchema: + nullable: true type: string credentials: items: @@ -63556,7 +137025,6 @@ components: $ref: '#/components/schemas/ModelsApplicationPentestTarget' type: array required: - - apiSchema - enablePentestTools - enableAuthMatrix - enableExploitAnalysis @@ -63567,8 +137035,14 @@ components: type: string id: type: string + isProd: + type: boolean name: type: string + nonProductionConfirmedAt: + format: date-time + nullable: true + type: string port: nullable: true type: integer @@ -63580,8 +137054,16 @@ components: properties: endDate: type: string + endTime: + format: date-time + nullable: true + type: string startDate: type: string + startTime: + format: date-time + nullable: true + type: string type: object ModelsAssetID: properties: @@ -63614,6 +137096,394 @@ components: - asset_id - repository type: string + ModelsAuthMatrixAgentResponseCaseManifest: + properties: + cases: + items: + $ref: '#/components/schemas/ModelsAuthMatrixAgentResponseCaseManifestCasesElem' + nullable: true + type: array + counts: + $ref: '#/components/schemas/ModelsAuthMatrixCaseCounts' + digest: + type: string + experiments: + $ref: '#/components/schemas/ModelsAuthMatrixExperimentManifest' + version: + type: integer + type: object + ModelsAuthMatrixAgentResponseCaseManifestCasesElem: + properties: + candidateId: + type: string + endpointId: + type: string + evidenceRefs: + items: + type: string + nullable: true + type: array + key: + type: string + method: + type: string + operationId: + type: string + outcome: + $ref: '#/components/schemas/ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome' + ownerId: + type: string + path: + type: string + reason: + type: string + relationship: + type: string + type: object + ModelsAuthMatrixAgentResponseCaseManifestCasesElemOutcome: + enum: + - accepted + - authz_denied + - conflict + - not_found + - policy_skipped + - schema_rejected + - server_error + - unknown + type: string + ModelsAuthMatrixCaseCounts: + properties: + byLifecycle: + additionalProperties: + type: integer + nullable: true + type: object + byOutcome: + additionalProperties: + type: integer + nullable: true + type: object + total: + type: integer + type: object + ModelsAuthMatrixCredentialContext: + properties: + credentialId: + type: string + facts: + items: + $ref: '#/components/schemas/ModelsAuthMatrixFact' + nullable: true + type: array + sessionVersion: + nullable: true + type: integer + unauthenticated: + nullable: true + type: boolean + usable: + nullable: true + type: boolean + verificationEvidenceRefs: + items: + type: string + type: array + type: object + ModelsAuthMatrixDisposableData: + properties: + authorizationRef: + type: string + designation: + $ref: '#/components/schemas/ModelsAuthMatrixDisposableDataDesignation' + intendedEffects: + items: + type: string + nullable: true + type: array + resourceRefs: + items: + type: string + nullable: true + type: array + retention: + $ref: '#/components/schemas/ModelsAuthMatrixDisposableDataRetention' + type: object + ModelsAuthMatrixDisposableDataDesignation: + enum: + - created_fixture + - existing_disposable + - none + type: string + ModelsAuthMatrixDisposableDataRetention: + enum: + - intentionally_retain + - restore + type: string + ModelsAuthMatrixExpectation: + properties: + access: + $ref: '#/components/schemas/ModelsAuthMatrixExpectationAccess' + candidateIds: + items: + type: string + type: array + facts: + items: + $ref: '#/components/schemas/ModelsAuthMatrixFact' + nullable: true + type: array + id: + type: string + operationId: + type: string + ownerIds: + items: + type: string + type: array + restriction: + $ref: '#/components/schemas/ModelsAuthMatrixExpectationRestriction' + stateVersions: + items: + $ref: '#/components/schemas/ModelsAuthMatrixStateVersion' + type: array + statement: + type: string + type: object + ModelsAuthMatrixExpectationAccess: + enum: + - allowed + - denied + - unknown + type: string + ModelsAuthMatrixExpectationRestriction: + enum: + - authentication + - function + - object + type: string + ModelsAuthMatrixExperiment: + properties: + candidateId: + type: string + cleanup: + $ref: '#/components/schemas/ModelsAuthMatrixExperimentCleanup' + nullable: true + dispatchCount: + nullable: true + type: integer + disposableData: + $ref: '#/components/schemas/ModelsAuthMatrixDisposableData' + expectationId: + nullable: true + type: string + findingId: + nullable: true + type: string + id: + type: string + intendedEffects: + items: + type: string + type: array + observations: + items: + $ref: '#/components/schemas/ModelsAuthMatrixObservation' + nullable: true + type: array + observedEffects: + items: + $ref: '#/components/schemas/ModelsAuthMatrixFact' + type: array + operationId: + type: string + ownerId: + type: string + publication: + $ref: '#/components/schemas/ModelsAuthMatrixExperimentPublication' + requestDigest: + nullable: true + type: string + resourceRefs: + items: + type: string + type: array + stateVersions: + items: + $ref: '#/components/schemas/ModelsAuthMatrixStateVersion' + nullable: true + type: array + status: + $ref: '#/components/schemas/ModelsAuthMatrixExperimentStatus' + templateId: + type: string + verdict: + $ref: '#/components/schemas/ModelsAuthMatrixVerdict' + type: object + ModelsAuthMatrixExperimentCleanup: + enum: + - failed + - intentionally_retained + - not_required + - pending + - restored + - unknown + type: string + ModelsAuthMatrixExperimentManifest: + properties: + coverageGaps: + items: + type: string + nullable: true + type: array + credentialContexts: + items: + $ref: '#/components/schemas/ModelsAuthMatrixCredentialContext' + nullable: true + type: array + expectations: + items: + $ref: '#/components/schemas/ModelsAuthMatrixExpectation' + nullable: true + type: array + experiments: + items: + $ref: '#/components/schemas/ModelsAuthMatrixExperiment' + nullable: true + type: array + templates: + items: + $ref: '#/components/schemas/ModelsAuthMatrixRequestTemplate' + nullable: true + type: array + unfinishedExperimentIds: + items: + type: string + nullable: true + type: array + version: + type: integer + writesStoppedReason: + nullable: true + type: string + type: object + ModelsAuthMatrixExperimentPublication: + enum: + - none + - pending + - published + type: string + ModelsAuthMatrixExperimentStatus: + enum: + - blocked + - pending + - running + - terminal + type: string + ModelsAuthMatrixFact: + properties: + basis: + $ref: '#/components/schemas/ModelsAuthMatrixFactBasis' + name: + type: string + reference: + type: string + source: + $ref: '#/components/schemas/ModelsAuthMatrixFactSource' + stateVersion: + type: integer + value: + type: string + type: object + ModelsAuthMatrixFactBasis: + enum: + - asserted + - inferred + - observed + - unknown + type: string + ModelsAuthMatrixFactSource: + enum: + - customer + - runtime + - served_spec + - source + - unknown + type: string + ModelsAuthMatrixFailureIdentity: + properties: + boundaryId: + type: string + controlId: + type: string + restriction: + $ref: '#/components/schemas/ModelsAuthMatrixFailureIdentityRestriction' + version: + type: integer + type: object + ModelsAuthMatrixFailureIdentityRestriction: + enum: + - authentication + - function + - object + type: string + ModelsAuthMatrixObservation: + properties: + attemptId: + type: string + bodyComplete: + type: boolean + businessOutcome: + $ref: '#/components/schemas/ModelsAuthMatrixObservationBusinessOutcome' + evidenceRefs: + items: + type: string + nullable: true + type: array + facts: + items: + $ref: '#/components/schemas/ModelsAuthMatrixFact' + type: array + id: + type: string + phase: + $ref: '#/components/schemas/ModelsAuthMatrixObservationPhase' + principalId: + type: string + stateVersions: + items: + $ref: '#/components/schemas/ModelsAuthMatrixStateVersion' + nullable: true + type: array + statusCode: + nullable: true + type: integer + transport: + $ref: '#/components/schemas/ModelsAuthMatrixObservationTransport' + type: object + ModelsAuthMatrixObservationBusinessOutcome: + enum: + - accepted + - conflict + - denied + - not_found + - rejected + - unknown + type: string + ModelsAuthMatrixObservationPhase: + enum: + - candidate + - cleanup + - control + - effect + type: string + ModelsAuthMatrixObservationTransport: + enum: + - network_error + - not_sent + - response + - timeout + - unknown + type: string ModelsAuthMatrixOverride: properties: maxEndpoints: @@ -63621,6 +137491,58 @@ components: maxRoles: type: integer type: object + ModelsAuthMatrixRequestTemplate: + properties: + body: + nullable: true + type: string + contentType: + nullable: true + type: string + controlObservationIds: + items: + type: string + type: array + digest: + nullable: true + type: string + facts: + items: + $ref: '#/components/schemas/ModelsAuthMatrixFact' + nullable: true + type: array + id: + type: string + method: + type: string + omittedFieldEffects: + items: + type: string + type: array + operationId: + type: string + origin: + nullable: true + type: string + path: + type: string + permittedSubstitutions: + items: + type: string + type: array + query: + additionalProperties: + type: string + type: object + resourceRefs: + items: + type: string + type: array + writableFields: + items: + type: string + type: array + type: object ModelsAuthMatrixStage: properties: approach: @@ -63634,6 +137556,44 @@ components: - approach - hypothesesGenerated type: object + ModelsAuthMatrixStateVersion: + properties: + scope: + type: string + version: + type: integer + type: object + ModelsAuthMatrixVerdict: + properties: + expectationId: + nullable: true + type: string + failureIdentity: + $ref: '#/components/schemas/ModelsAuthMatrixFailureIdentity' + missingFacts: + items: + type: string + nullable: true + type: array + observationIds: + items: + type: string + nullable: true + type: array + reason: + type: string + status: + $ref: '#/components/schemas/ModelsAuthMatrixVerdictStatus' + type: object + ModelsAuthMatrixVerdictStatus: + enum: + - allowed + - candidate + - confirmed + - denied + - inconclusive + - skipped + type: string ModelsAuthenticatedWalkOverride: properties: maxDepth: @@ -63674,10 +137634,6 @@ components: items: $ref: '#/components/schemas/ModelsGroupedAgentLog' type: array - langfuseTraceId: - type: string - langfuseTraceUrl: - type: string logs: items: {} type: array @@ -63758,6 +137714,8 @@ components: $ref: '#/components/schemas/ModelsSeverity' tenantId: type: string + ticket: + $ref: '#/components/schemas/ModelsTicketProvider' title: type: string type: @@ -63850,6 +137808,8 @@ components: type: string intensity: $ref: '#/components/schemas/ModelsBugHuntScanIntensity' + localImport: + type: boolean metrics: $ref: '#/components/schemas/ModelsBugHuntScanMetrics' networkLogs: @@ -63860,6 +137820,8 @@ components: type: integer scope: $ref: '#/components/schemas/ModelsScopePolicy' + scopeVersion: + type: integer stage: $ref: '#/components/schemas/ModelsBugHuntScanStage' startTime: @@ -63902,6 +137864,8 @@ components: type: object ModelsBugHuntScanConfig: properties: + cadence: + $ref: '#/components/schemas/ModelsCadence' createdAt: format: date-time type: string @@ -63916,8 +137880,20 @@ components: type: string intensity: $ref: '#/components/schemas/ModelsBugHuntScanIntensity' + ownershipProof: + $ref: '#/components/schemas/ModelsOwnershipProof' + roeAcknowledgedAt: + format: date-time + nullable: true + type: string + rulesOfEngagement: + $ref: '#/components/schemas/ModelsRulesOfEngagement' scope: $ref: '#/components/schemas/ModelsScopePolicy' + scopeProvenance: + $ref: '#/components/schemas/ModelsScopeProvenance' + scopeVersion: + type: integer suites: items: $ref: '#/components/schemas/ModelsTestSuitePolicy' @@ -63936,8 +137912,6 @@ components: required: - id - tenantId - - createdAt - - updatedAt - enabled - scope - vulnClasses @@ -64074,12 +138048,17 @@ components: - '' - daily - weekly + - fortnightly - monthly - on_change - manual type: string ModelsCodeFinding: properties: + acceptableCwes: + items: + type: integer + type: array aiGenerated: nullable: true type: boolean @@ -64113,9 +138092,18 @@ components: type: string filePath: type: string + hasCachedFix: + nullable: true + type: boolean + hostEffectivePriorityLabel: + nullable: true + type: string id: nullable: true type: string + isAutoFixable: + nullable: true + type: boolean isCloudTriaged: nullable: true type: boolean @@ -64139,12 +138127,38 @@ components: repositoryId: nullable: true type: string + ruleConfidence: + nullable: true + type: number + ruleConfidenceLabel: + nullable: true + type: string ruleId: nullable: true type: string + ruleImpact: + nullable: true + type: number + ruleImpactLabel: + nullable: true + type: string + ruleLikelihood: + nullable: true + type: number + ruleLikelihoodLabel: + nullable: true + type: string + ruleSeverity: + nullable: true + type: number + ruleSeverityLabel: + nullable: true + type: string severity: nullable: true type: string + sinkAnchor: + $ref: '#/components/schemas/ModelsCodeFindingSinkAnchor' startLine: type: integer title: @@ -64408,6 +138422,13 @@ components: - DATABASE_ALTERED - MALWARE_IMPANTED type: string + ModelsCodeFindingSinkAnchor: + properties: + endLine: + type: integer + snippetSha256: + type: string + type: object ModelsConfigValidationError: properties: code: @@ -64430,6 +138451,9 @@ components: - unsupported_override - unsupported_selector_kind - forbidden_scope + - invalid_cadence + - scope_change_in_flight + - roe_not_acknowledged type: string ModelsCredential: properties: @@ -64448,6 +138472,9 @@ components: type: string id: type: string + isActive: + nullable: true + type: boolean isDeleted: type: boolean lastUsed: @@ -64483,6 +138510,64 @@ components: - usageCount - isDeleted type: object + ModelsCredentialAppSession: + properties: + authKitOrigin: + type: string + authorizationUrl: + type: string + blockedOptionalPosts: + items: + type: string + type: array + callbackUrl: + type: string + cookieIssuerOrigins: + items: + type: string + type: array + expectedOrganization: + type: string + expectedSubject: + type: string + identifierOrigins: + items: + type: string + type: array + mode: + type: string + organizationPath: + items: + type: string + type: array + probeUrl: + type: string + reachabilityOnly: + type: boolean + startSelector: + type: string + subjectPath: + items: + type: string + type: array + version: + type: integer + type: object + ModelsCredentialAuthPolicy: + properties: + credentialOrigins: + items: + type: string + type: array + mode: + type: string + navigationOrigins: + items: + type: string + type: array + version: + type: integer + type: object ModelsCredentialBinding: properties: credentialId: @@ -64508,18 +138593,60 @@ components: properties: apiKey: type: string + apiKeyParamName: + type: string + apiKeyPlacement: + $ref: '#/components/schemas/ModelsAPIKeyPlacement' + appSession: + $ref: '#/components/schemas/ModelsCredentialAppSession' + audience: + type: string + auth0Tenant: + type: string + authPolicy: + $ref: '#/components/schemas/ModelsCredentialAuthPolicy' authUrl: type: string clientId: type: string clientSecret: type: string + connection: + type: string + discovered: + $ref: '#/components/schemas/ModelsDiscoveredWiring' + enableLoginOptimization: + type: boolean + gateway: + $ref: '#/components/schemas/ModelsCredentialGateway' hints: type: string + idpType: + type: string + issuer: + type: string + loginBodyFormat: + $ref: '#/components/schemas/ModelsLoginBodyFormat' + loginStrategy: + $ref: '#/components/schemas/ModelsLoginStrategy' loginUrl: type: string + mfaType: + $ref: '#/components/schemas/ModelsMFAType' + oauthFlow: + $ref: '#/components/schemas/ModelsOAuthFlow' password: type: string + passwordField: + type: string + realm: + type: string + redirectUri: + type: string + refreshToken: + type: string + resource: + type: string scope: type: string token: @@ -64530,112 +138657,346 @@ components: type: string tokenUrl: type: string + totp: + $ref: '#/components/schemas/ModelsTOTPConfig' + username: + type: string + usernameField: + type: string + type: object + ModelsCredentialGateway: + properties: + hints: + type: string + loginUrl: + type: string + password: + type: string + totp: + $ref: '#/components/schemas/ModelsTOTPConfig' username: type: string type: object ModelsCredentialType: enum: - - basic - - bearer + - username_password - api_key + - basic_auth + - oidc - oauth2 + - basic + - bearer - browser - custom + - application_login + - application_login_mfa + - sso type: string - ModelsCustomerQuestion: + ModelsDASTApplication: properties: - answer: {} - answerMemoryId: - nullable: true + allowMutationTesting: + type: boolean + createdAt: + format: date-time type: string - answeredAt: + description: + type: string + id: + type: string + mutationAckAt: format: date-time nullable: true type: string - customMessage: + mutationAckBy: nullable: true type: string - findingIds: + mutationWarningVersion: + nullable: true + type: string + name: + type: string + scopeExcludePatterns: + description: >- + Case-insensitive [METHOD ] deny rules relative to the target base path; each path includes its + subtree. Omit METHOD to deny all methods. Ambiguous encoded paths are refused. items: type: string type: array + updatedAt: + format: date-time + type: string + webServices: + items: + $ref: '#/components/schemas/ModelsDASTWebService' + nullable: true + type: array + required: + - allowMutationTesting + - id + - webServices + - createdAt + - updatedAt + type: object + ModelsDASTEventInterface: + properties: + data: {} id: type: string - options: + time: + type: string + type: + $ref: '#/components/schemas/EventsEventType' + required: + - id + - time + - type + - data + type: object + ModelsDASTExploitValidationCapability: + enum: + - anonymous_read + - authenticated_session + type: string + ModelsDASTExploitValidationFindingType: + enum: + - sast + - sca_dependencies + type: string + ModelsDASTExploitValidationPolicy: + properties: + armed: + type: boolean + armedAt: + format: date-time + nullable: true + type: string + armedBy: + type: string + createdAt: + format: date-time + type: string + daysOfWeek: items: - $ref: '#/components/schemas/ModelsCustomerQuestionOptionsElem' + type: integer + nullable: true type: array - questionText: + enabled: + type: boolean + endTime: type: string - questionType: - $ref: '#/components/schemas/ModelsCustomerQuestionQuestionType' - relatedMemoryIds: + findingTypes: + items: + $ref: '#/components/schemas/ModelsDASTExploitValidationFindingType' + nullable: true + type: array + grantedCapabilities: items: type: string type: array - scope: - $ref: '#/components/schemas/ModelsCustomerQuestionScope' - scopeResourceId: + id: + type: string + minimumExploitability: + type: string + minimumSeverity: + type: string + name: + type: string + revalidationCooldownDays: + type: integer + safetyContractVersion: nullable: true + type: integer + startTime: type: string - unknownIds: + timezone: + type: string + updatedAt: + format: date-time + type: string + webServiceIds: items: type: string + nullable: true type: array + required: + - id + - name + - enabled + - findingTypes + - webServiceIds + - daysOfWeek + - startTime + - endTime + - timezone + - minimumSeverity + - minimumExploitability + - revalidationCooldownDays + - armed + - createdAt + - updatedAt type: object - ModelsCustomerQuestionOptionsElem: + ModelsDASTTarget: properties: + createdAt: + format: date-time + type: string + description: + type: string + exploitValidationRiskAcceptanceEvidenceUrl: + type: string + exploitValidationRiskAcceptanceVersion: + type: string + exploitValidationRiskAccepted: + type: boolean + exploitValidationRiskAcceptedAt: + format: date-time + nullable: true + type: string + exploitValidationRiskAcceptedBy: + type: string + exploitValidationRiskAcceptedByKind: + $ref: '#/components/schemas/ModelsExploitValidationAcceptorKind' + exploitValidationRiskAcceptedByName: + type: string + exploitValidationRiskAcceptedOnBehalfOf: + type: string + hostname: + type: string id: type: string - label: + isProd: + type: boolean + lastValidatedAt: + format: date-time + nullable: true type: string - value: + lastValidationMessage: + type: string + lastValidationStatus: + $ref: '#/components/schemas/ModelsValidationStatus' + name: type: string + nonProductionConfirmedAt: + format: date-time + nullable: true + type: string + port: + nullable: true + type: integer + protocol: + type: string + updatedAt: + format: date-time + type: string + required: + - id + - hostname + - protocol + - createdAt + - updatedAt type: object - ModelsCustomerQuestionQuestionType: + ModelsDASTTargetClassification: enum: - - FREE_TEXT - - MULTI_SELECT - - SINGLE_SELECT - - YES_NO + - production + - non_production + - unknown type: string - ModelsCustomerQuestionScope: + ModelsDASTTargetConsentBlockedReason: enum: - - CLOUD - - ORGANIZATION - - REPOSITORY + - target_production + - target_not_confirmed_non_production type: string - ModelsCustomerQuestionSet: + ModelsDASTTargetConsentState: + enum: + - not_accepted + - accepted + - outdated_warning + type: string + ModelsDASTValidation: properties: - customMessage: + credentialId: + type: string + durationMs: + format: int64 + type: integer + error: + type: string + hint: + type: string + id: + type: string + message: + type: string + reasonCode: + type: string + startedAt: + format: date-time nullable: true type: string - generatedMemoryIds: - items: - type: string - type: array + status: + $ref: '#/components/schemas/ModelsValidationStatus' + statusCode: + type: integer + targetId: + type: string + testUrl: + type: string + trigger: + $ref: '#/components/schemas/ModelsValidationTrigger' + validatedAt: + format: date-time + type: string + validatedBy: + type: string + webServiceId: + type: string + required: + - id + - status + - trigger + - validatedAt + type: object + ModelsDASTWebService: + properties: + apiType: + $ref: '#/components/schemas/ModelsAPIType' + createdAt: + format: date-time + type: string + description: + type: string id: type: string - questions: + name: + type: string + projectId: + type: string + repoPath: + type: string + repositoryId: + type: string + targets: items: - $ref: '#/components/schemas/ModelsCustomerQuestion' + $ref: '#/components/schemas/ModelsDASTWebServiceTarget' nullable: true type: array + updatedAt: + format: date-time + type: string + required: + - id + - targets + - createdAt + - updatedAt type: object - ModelsDASTEventInterface: + ModelsDASTWebServiceTarget: properties: - data: {} - id: + path: type: string - time: + targetId: type: string - type: - $ref: '#/components/schemas/EventsEventType' required: - - id - - time - - type - - data + - targetId type: object ModelsDNSEnumerationOverride: properties: @@ -64662,9 +139023,15 @@ components: type: string filePath: type: string + hasCachedFix: + nullable: true + type: boolean hasReachableCVEs: nullable: true type: boolean + hostEffectivePriorityLabel: + nullable: true + type: string id: nullable: true type: string @@ -64693,6 +139060,21 @@ components: packageFilePath: nullable: true type: string + perVersionCVEStatus: + additionalProperties: + additionalProperties: + properties: + fixedVersion: + nullable: true + type: string + introduced: + nullable: true + type: string + vulnerable: + type: boolean + type: object + type: object + type: object repository: nullable: true type: string @@ -64706,6 +139088,10 @@ components: $ref: '#/components/schemas/ModelsTriage' version: type: string + versions: + items: + type: string + type: array vulnerabilities: items: $ref: '#/components/schemas/ModelsDependencyFindingVulnerabilitiesElem' @@ -64713,6 +139099,8 @@ components: type: object ModelsDependencyFindingDossier: properties: + coverage: + $ref: '#/components/schemas/ModelsDependencyFindingDossierCoverage' cves: items: $ref: '#/components/schemas/ModelsDependencyFindingDossierCvesElem' @@ -64740,6 +139128,15 @@ components: version: type: string type: object + ModelsDependencyFindingDossierCoverage: + properties: + degraded: + type: boolean + gaps: + items: + type: string + type: array + type: object ModelsDependencyFindingDossierCvesElem: properties: has_fix: @@ -64813,6 +139210,7 @@ components: enum: - COMBINED - OSV + - SOURCE_PARSE - TIMEOUT - TREESITTER - UNSUPPORTED @@ -64847,16 +139245,34 @@ components: cisaKev: nullable: true type: boolean + cisaKevUnknown: + nullable: true + type: boolean cvss: nullable: true type: number + epss: + nullable: true + type: number + epssPercentile: + nullable: true + type: number exploitability: nullable: true type: string + exploitabilityScore: + nullable: true + type: number id: type: string + impactScore: + nullable: true + type: number osvReachability: $ref: '#/components/schemas/ModelsDependencyFindingVulnerabilitiesElemCvesElemOsvReachability' + priority: + nullable: true + type: string reachabilityConfidence: nullable: true type: string @@ -64869,15 +139285,65 @@ components: reachable: nullable: true type: boolean + severity: + nullable: true + type: string vectorString: nullable: true type: string + version: + nullable: true + type: string type: object ModelsDependencyFindingVulnerabilitiesElemCvesElemOsvReachability: properties: called: type: boolean type: object + ModelsDiscoveredWiring: + properties: + authorizeUrl: + type: string + discoveredAt: + type: string + fromLoginUrl: + type: string + tokenUrl: + type: string + tokenUrlSource: + type: string + type: object + ModelsDisprovenCandidate: + properties: + id: + type: string + outcome: + type: string + reason: + type: string + source: + type: string + title: + type: string + required: + - id + - title + - source + - outcome + type: object + ModelsExcludedRoute: + properties: + countsIncomplete: + type: boolean + matchedNothing: + type: boolean + refusals: + type: integer + rule: + type: string + required: + - rule + type: object ModelsExecutiveSummary: properties: executiveSummaryFirstParagraph: @@ -64913,12 +139379,24 @@ components: - approach - findingsAnalyzed type: object + ModelsExploitValidationAcceptorKind: + enum: + - customer + - nullify_staff + - nullify_operator + type: string ModelsFindingSummary: properties: affectedAsset: type: string id: type: string + lineage: + items: + type: string + type: array + owner: + type: string reference: nullable: true type: string @@ -64926,6 +139404,8 @@ components: $ref: '#/components/schemas/ModelsSeverity' source: type: string + status: + $ref: '#/components/schemas/ModelsPentestFindingStatus' title: type: string required: @@ -64935,6 +139415,15 @@ components: - severity - source type: object + ModelsFixEvidence: + enum: + - merged_fix_pr + - vulnerable_lines_changed + - file_removed + - dependency_version_changed + - dependency_removed + - base_image_changed + type: string ModelsFullBackendPentestOverride: properties: maxPortsPerHost: @@ -64961,6 +139450,22 @@ components: maxSeconds: type: integer type: object + ModelsLoginBodyFormat: + enum: + - form + - json + type: string + ModelsLoginStrategy: + enum: + - auto + - auth0_embedded + - browser + type: string + ModelsMFAType: + enum: + - totp + - email + type: string ModelsMalwareScanOverride: properties: heuristicOnly: @@ -65091,15 +139596,46 @@ components: severityFloor: $ref: '#/components/schemas/ModelsSeverityFloor' type: object + ModelsOAuthFlow: + enum: + - client_credentials + - authorization_code + type: string + ModelsOwnershipProof: + properties: + domains: + items: + type: string + type: array + method: + $ref: '#/components/schemas/ModelsOwnershipProofMethod' + token: + type: string + verifiedAt: + format: date-time + nullable: true + type: string + type: object + ModelsOwnershipProofMethod: + enum: + - '' + - dns_txt + - http_file + - meta_tag + - program_managed + type: string ModelsPentestAbortCategory: enum: - config_error - agent_crash + - budget_exhausted + - concurrency_limited type: string ModelsPentestAbortCode: enum: - credentials_invalid - target_unreachable + - target_blocked_internal - missing_app_context - missing_api_schema - agent_crash_pentest_tools @@ -65107,6 +139643,9 @@ components: - agent_crash_exploit_analysis - agent_crash_report - agent_crash_unknown + - budget_exhausted + - concurrency_limited + - mutation_capability_invalid type: string ModelsPentestAbortReason: properties: @@ -65133,6 +139672,8 @@ components: type: object ModelsPentestAssessmentPhase: properties: + degraded: + type: boolean durationSeconds: format: double type: number @@ -65148,15 +139689,13 @@ components: items: $ref: '#/components/schemas/ModelsPentestHypothesis' type: array - langfuseTraceId: - type: string - langfuseTraceUrl: - type: string logs: items: {} type: array name: type: string + reason: + type: string startTime: format: date-time type: string @@ -65168,6 +139707,39 @@ components: - name - startTime type: object + ModelsPentestAuthMatrixBatch: + properties: + attempts: + type: integer + cause: + type: string + disposition: + type: string + index: + type: integer + stopReason: + type: string + required: + - index + - attempts + - disposition + type: object + ModelsPentestAuthMatrixFailureIdentity: + properties: + boundaryId: + type: string + controlId: + type: string + restriction: + type: string + version: + type: integer + required: + - version + - controlId + - boundaryId + - restriction + type: object ModelsPentestAuthMatrixHypothesis: properties: falseReason: @@ -65186,8 +139758,29 @@ components: - hypothesis - isInsecure type: object + ModelsPentestAuthMatrixIdentityCoverage: + properties: + authenticated: + type: integer + distinctMaterial: + type: integer + duplicate: + type: integer + requested: + type: integer + unavailable: + type: integer + required: + - requested + - authenticated + - distinctMaterial + - duplicate + - unavailable + type: object ModelsPentestAuthMatrixResult: properties: + caseManifest: + $ref: '#/components/schemas/ModelsAuthMatrixAgentResponseCaseManifest' findings: items: $ref: '#/components/schemas/ModelsPentestFinding' @@ -65196,15 +139789,119 @@ components: items: $ref: '#/components/schemas/ModelsPentestAuthMatrixHypothesis' type: array + mutationSnapshot: + $ref: '#/components/schemas/ModelsPentestMutationSnapshot' + stageOutcome: + $ref: '#/components/schemas/ModelsPentestAuthMatrixStageOutcome' + type: object + ModelsPentestAuthMatrixStageOutcome: + properties: + assessed: + type: integer + batches: + items: + $ref: '#/components/schemas/ModelsPentestAuthMatrixBatch' + type: array + consentArmed: + type: boolean + degraded: + type: boolean + excluded: + type: integer + identities: + $ref: '#/components/schemas/ModelsPentestAuthMatrixIdentityCoverage' + mode: + type: string + operationsTotal: + type: integer + reason: + type: string + unassessed: + $ref: '#/components/schemas/ModelsPentestAuthMatrixUnassessed' + unauthenticatedTested: + nullable: true + type: boolean + required: + - operationsTotal + - assessed + - excluded + - unassessed + - mode + - consentArmed + - degraded + type: object + ModelsPentestAuthMatrixUnassessed: + properties: + degraded: + type: integer + failed: + type: integer + indeterminate: + type: integer + unresolved: + type: integer + required: + - degraded + - failed + - unresolved + - indeterminate + type: object + ModelsPentestDeployment: + properties: + targetId: + type: string + webServiceId: + type: string + required: + - webServiceId + - targetId + type: object + ModelsPentestDeploymentSnapshot: + properties: + credentialIds: + items: + type: string + type: array + isProd: + type: boolean + nonProductionConfirmed: + type: boolean + siblingPaths: + items: + type: string + type: array + sourceProjectId: + type: string + sourceRepoPath: + type: string + sourceRepositoryId: + type: string + targetId: + type: string + url: + type: string + webServiceId: + type: string + required: + - webServiceId + - targetId type: object ModelsPentestEndpointMetrics: properties: + degraded: + type: integer + failed: + type: integer fuzzed: type: integer + indeterminate: + type: integer tested: type: integer total: type: integer + unresolved: + type: integer vulnerable: type: integer required: @@ -65212,9 +139909,30 @@ components: - fuzzed - tested - vulnerable + - degraded + - failed + - unresolved + - indeterminate type: object ModelsPentestExploitAnalysisResult: properties: + endpointFindingIds: + items: + type: string + type: array + endpointFindings: + items: + $ref: '#/components/schemas/ModelsPentestFinding' + type: array + sourceFindingIds: + items: + type: string + nullable: true + type: array + sourceFindings: + items: + $ref: '#/components/schemas/ModelsPentestFinding' + type: array updatedCodeFindings: items: $ref: '#/components/schemas/ModelsCodeFinding' @@ -65234,6 +139952,9 @@ components: $ref: '#/components/schemas/ModelsPentestFindingAPI' authMatrix: $ref: '#/components/schemas/ModelsPentestFindingAuthMatrix' + authMatrixEvidenceUnavailable: + description: The finding's authentication evidence is no longer available, so authMatrix is absent + type: boolean autoFixCurrentActivity: type: string autoFixEndTime: @@ -65273,23 +139994,29 @@ components: type: integer endpoint: $ref: '#/components/schemas/ModelsPentestFindingEndpoint' + fixEvidence: + $ref: '#/components/schemas/ModelsFixEvidence' host: type: string id: type: string isAllowlisted: type: boolean + isArchived: + type: boolean isAutoFixable: type: boolean isAutoFixableAgentVerdict: nullable: true type: boolean + isFalsePositive: + type: boolean isFixed: type: boolean isLatest: type: boolean priorityLabel: - $ref: '#/components/schemas/ModelsPriorityEnum' + $ref: '#/components/schemas/ModelsPriorityLabel' priorityScore: type: integer pullRequestsAutofix: @@ -65298,10 +140025,14 @@ components: type: array repository: type: string + repositoryFullName: + type: string repositoryId: type: string repositoryName: type: string + repositoryPath: + type: string scanInfo: $ref: '#/components/schemas/ModelsPentestFindingScanInfo' source: @@ -65333,6 +140064,8 @@ components: - isLatest - isFixed - isAllowlisted + - isArchived + - isFalsePositive - allowlistedReason - createdAt - updatedAt @@ -65346,6 +140079,8 @@ components: type: string errorType: type: string + findingScope: + $ref: '#/components/schemas/ModelsPentestFindingScope' httpVersion: type: string method: @@ -65374,6 +140109,10 @@ components: type: string vulnerableParameterValue: type: string + zapAlertRef: + type: string + zapPluginId: + type: string required: - severity - solution @@ -65394,13 +140133,40 @@ components: type: object ModelsPentestFindingAuthMatrix: properties: + affectedPrincipalIds: + items: + type: string + type: array + evidenceRefs: + items: + type: string + type: array + experimentIds: + items: + type: string + type: array + failureIdentity: + $ref: '#/components/schemas/ModelsPentestAuthMatrixFailureIdentity' hypothesis: type: string + legacyFindingIds: + items: + type: string + type: array + principal: + $ref: '#/components/schemas/ModelsPentestFindingAuthMatrixPrincipal' user: $ref: '#/components/schemas/ModelsPentestFindingAuthMatrixUser' required: - hypothesis type: object + ModelsPentestFindingAuthMatrixPrincipal: + properties: + credentialId: + type: string + unauthenticated: + type: boolean + type: object ModelsPentestFindingAuthMatrixUser: properties: roleDescription: @@ -65424,20 +140190,47 @@ components: - method - path type: object + ModelsPentestFindingGroup: + properties: + cwes: + items: + type: integer + nullable: true + type: array + duplicateCount: + type: integer + memberIds: + items: + type: string + nullable: true + type: array + representativeId: + type: string + required: + - representativeId + - memberIds + - duplicateCount + - cwes + type: object ModelsPentestFindingMetrics: properties: - fixed: + carriedForward: type: integer new: type: integer + reconciled: + type: boolean total: type: integer + undetected: + type: integer unfixed: type: integer + validatedExternal: + type: integer required: - total - new - - fixed - unfixed type: object ModelsPentestFindingRESTQueryParameters: @@ -65452,6 +140245,10 @@ components: additionalProperties: type: string type: object + ModelsPentestFindingScanCoverage: + additionalProperties: + type: string + type: object ModelsPentestFindingScanInfo: properties: appId: @@ -65472,6 +140269,13 @@ components: enum: - API - AuthMatrix + - Source + - Endpoint + type: string + ModelsPentestFindingScope: + enum: + - endpoint + - host type: string ModelsPentestFindingSource: enum: @@ -65480,6 +140284,14 @@ components: - Nmap - ZAP - RESTler + - Other + type: string + ModelsPentestFindingStatus: + enum: + - new + - unfixed + - validated_external + - validated_external_unconfirmed type: string ModelsPentestHypothesis: properties: @@ -65517,18 +140329,26 @@ components: response: $ref: '#/components/schemas/ModelsNetworkResponse' type: object + ModelsPentestMappedFinding: + properties: + createdAt: + format: date-time + type: string + findingId: + type: string + findingType: + $ref: '#/components/schemas/ModelsFindingType' + required: + - findingId + - findingType + - createdAt + type: object ModelsPentestMetadata: properties: description: type: string - langfuseTraceIds: - items: - type: string - nullable: true - type: array required: - description - - langfuseTraceIds type: object ModelsPentestMetrics: properties: @@ -65549,6 +140369,92 @@ components: - findingMetrics - usageMetrics type: object + ModelsPentestMutationAttempt: + properties: + caseId: + type: string + cleanupOperationId: + type: string + cleanupReason: + type: string + dispatchOutcome: + type: string + dispatchState: + type: string + evidenceRefs: + items: + type: string + nullable: true + type: array + fixtureCreationId: + type: string + fixtureSlot: + type: string + id: + type: string + itemPath: + type: string + kind: + type: string + logicalOperationId: + type: string + method: + type: string + observedAt: + type: string + origin: + type: string + path: + type: string + phase: + type: string + principalId: + type: string + reason: + type: string + reservedAt: + type: string + resourceId: + type: string + undoKind: + type: string + undoStatus: + type: string + required: + - id + - logicalOperationId + - phase + - kind + - method + - path + - principalId + - dispatchState + - dispatchOutcome + - undoKind + - undoStatus + - evidenceRefs + type: object + ModelsPentestMutationSnapshot: + properties: + asOf: + type: string + attempts: + items: + $ref: '#/components/schemas/ModelsPentestMutationAttempt' + nullable: true + type: array + available: + type: boolean + error: + type: string + stageIncomplete: + type: boolean + required: + - asOf + - available + - stageIncomplete + - attempts + type: object ModelsPentestPhaseUsageMetrics: properties: cacheHitCost: @@ -65589,6 +140495,10 @@ components: properties: applicationId: type: string + configFingerprint: + type: string + deployment: + $ref: '#/components/schemas/ModelsPentestDeployment' endTime: format: date-time nullable: true @@ -65624,18 +140534,36 @@ components: ModelsPentestPreflightAppContextSnapshot: properties: apiEndpointCount: + nullable: true type: integer apiEndpointsSample: items: type: string type: array + apiSchemaPartial: + type: boolean apiSchemaSourceRef: type: string + apiSchemaType: + type: string + componentCount: + type: integer components: items: $ref: '#/components/schemas/ModelsPentestPreflightComponentSnapshot' nullable: true type: array + contextStatus: + type: string + coverage: + nullable: true + type: number + lastContextSyncTime: + format: date-time + nullable: true + type: string + resolved: + type: boolean type: object ModelsPentestPreflightCheck: properties: @@ -65812,10 +140740,18 @@ components: $ref: '#/components/schemas/ModelsAssessmentPeriod' authMatrixResult: $ref: '#/components/schemas/ModelsPentestAuthMatrixResult' + deliveredReportStale: + type: boolean + disprovenCandidates: + items: + $ref: '#/components/schemas/ModelsDisprovenCandidate' + type: array executiveSummary: $ref: '#/components/schemas/ModelsExecutiveSummary' exploitAnalysisResult: $ref: '#/components/schemas/ModelsPentestExploitAnalysisResult' + findingScanCoverage: + $ref: '#/components/schemas/ModelsPentestFindingScanCoverage' findingsSummary: items: $ref: '#/components/schemas/ModelsFindingSummary' @@ -65832,6 +140768,10 @@ components: $ref: '#/components/schemas/ModelsNetworkTransactionsSummary' pentestToolsResult: $ref: '#/components/schemas/ModelsPentestToolsResult' + producersRan: + items: + $ref: '#/components/schemas/ModelsPentestFindingSource' + type: array reportMetadata: $ref: '#/components/schemas/ModelsReportMetadata' retestPolicy: @@ -65845,6 +140785,11 @@ components: - metadata - metrics type: object + ModelsPentestReportFormat: + enum: + - '' + - v2 + type: string ModelsPentestRequestMetrics: properties: error: @@ -65854,6 +140799,12 @@ components: type: integer nullable: true type: object + refusedHosts: + items: + type: string + type: array + scopeRefused: + type: integer success: type: integer timeout: @@ -65873,10 +140824,29 @@ components: $ref: '#/components/schemas/ModelsPentestAbortReason' appId: type: string + appName: + type: string assessmentPhases: items: $ref: '#/components/schemas/ModelsPentestAssessmentPhase' type: array + captureBytes: + nullable: true + type: integer + captureScrubbed: + nullable: true + type: boolean + captureStatus: + nullable: true + type: string + captureTransactions: + nullable: true + type: integer + deployment: + $ref: '#/components/schemas/ModelsPentestDeploymentSnapshot' + discoveredCount: + nullable: true + type: integer endTime: format: date-time nullable: true @@ -65901,6 +140871,15 @@ components: type: array progress: type: integer + refusedHosts: + items: + type: string + type: array + reportFindingsCount: + nullable: true + type: integer + scopePolicy: + $ref: '#/components/schemas/ModelsPentestScopePolicy' startTime: format: date-time type: string @@ -65910,13 +140889,15 @@ components: type: string totalCost: $ref: '#/components/schemas/ModelsPentestScanCostSummary' + validatedExternalCount: + nullable: true + type: integer required: - id - tenantId - appId - progress - status - - startTime - findingIds - isExternal - executionArn @@ -66012,12 +140993,35 @@ components: - totalCacheWriteCost - totalCost type: object + ModelsPentestScopePolicy: + properties: + authority: + type: string + basePath: + type: string + excludePatterns: + items: + type: string + type: array + hash: + type: string + type: object ModelsPentestToolsResult: properties: findings: items: $ref: '#/components/schemas/ModelsPentestFinding' type: array + producersRan: + items: + $ref: '#/components/schemas/ModelsPentestFindingSource' + type: array + scanComplete: + type: boolean + scanDegraded: + type: boolean + scopeRefused: + type: boolean type: object ModelsPentestUsageMetrics: properties: @@ -66064,13 +141068,6 @@ components: threadCount: type: integer type: object - ModelsPriorityEnum: - enum: - - FALSE_POSITIVE - - IMPORTANT - - NEGLIGIBLE - - URGENT - type: string ModelsReportMetadata: properties: authors: @@ -66093,6 +141090,14 @@ components: type: object ModelsReportScope: properties: + excluded: + items: + $ref: '#/components/schemas/ModelsExcludedRoute' + type: array + outOfScopeHosts: + items: + type: string + type: array targetDescription: nullable: true type: string @@ -66107,6 +141112,21 @@ components: - targetUrl - users type: object + ModelsRulesOfEngagement: + properties: + eligibleForBounty: + type: boolean + policyText: + type: string + programUrl: + type: string + prohibitedActivities: + items: + type: string + type: array + testingAllowed: + type: boolean + type: object ModelsSPACheckOverride: properties: checkLeakedEnv: @@ -66127,8 +141147,31 @@ components: nullable: true type: array type: object + ModelsScopeProvenance: + properties: + importedAt: + format: date-time + type: string + programName: + type: string + programSlug: + type: string + programUrl: + type: string + source: + $ref: '#/components/schemas/ModelsScopeProvenanceSource' + type: object + ModelsScopeProvenanceSource: + enum: + - '' + - manual + - hackerone + - bugcrowd + type: string ModelsScopeUser: properties: + credentialId: + type: string name: type: string roleDescription: @@ -66137,14 +141180,6 @@ components: - name - roleDescription type: object - ModelsSeverityEnum: - enum: - - CRITICAL - - HIGH - - INFORMATIONAL - - LOW - - MEDIUM - type: string ModelsSeverityFloor: enum: - '' @@ -66154,6 +141189,17 @@ components: - high - critical type: string + ModelsTOTPConfig: + properties: + algorithm: + type: string + digits: + type: integer + period: + type: integer + secret: + type: string + type: object ModelsTagQueryAST: properties: children: @@ -66254,869 +141300,573 @@ components: - toolsUsed - coverage type: object - ModelsTriage: + ModelsValidationEvidence: properties: - budgetExhausted: - nullable: true - type: boolean - campaignMetadata: - $ref: '#/components/schemas/ModelsTriageCampaignMetadata' - cloudContext: - $ref: '#/components/schemas/ModelsTriageCloudContext' - customerQuestions: - $ref: '#/components/schemas/ModelsCustomerQuestionSet' - description: - nullable: true - type: string - devDescription: - nullable: true - type: string - devTitle: - nullable: true - type: string - evidence: - $ref: '#/components/schemas/GraphGraph' - exploitHypothesis: - $ref: '#/components/schemas/GraphGraph' - exploitability: - $ref: '#/components/schemas/ModelsTriageExploitability' - failedTriage: - nullable: true - type: boolean - fixEffort: - $ref: '#/components/schemas/ModelsTriageFixEffort' - id: - nullable: true - type: string - impact: - $ref: '#/components/schemas/ModelsTriageImpact' - lastTriagedAt: - format: date-time - nullable: true - type: string - memoriesGenerated: - items: - type: string - type: array - memoriesUsed: - items: - type: string - type: array - parentTriageId: - nullable: true - type: string - pentest: - $ref: '#/components/schemas/ModelsTriagePentest' - priority: - $ref: '#/components/schemas/ModelsPriorityEnum' - retriageMetadata: - $ref: '#/components/schemas/ModelsTriageRetriageMetadata' - retriageStatus: - $ref: '#/components/schemas/ModelsTriageRetriageStatus' - nullable: true - severity: - $ref: '#/components/schemas/ModelsTriageSeverity' - thoughts: - nullable: true - type: string - title: - nullable: true - type: string - version: + duration: + format: int64 type: integer - type: object - ModelsTriageCampaignMetadata: - properties: - id: - type: string - name: - nullable: true - type: string - type: object - ModelsTriageCloudContext: - properties: - confidence: - nullable: true - type: number - mode: - $ref: '#/components/schemas/ModelsTriageCloudContextMode' - nullable: true - repos: - items: - type: string - type: array - thoughts: - nullable: true + error: type: string - type: object - ModelsTriageCloudContextMode: - enum: - - MODEA - - MODEB - type: string - ModelsTriageExploitability: - properties: - attackComplexity: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexity' - attackRequirements: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirements' - attackVector: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVector' - confidence: - $ref: '#/components/schemas/ModelsTriageExploitabilityConfidence' - description: - nullable: true + message: type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityLabel' - privilegesRequired: - $ref: '#/components/schemas/ModelsTriageExploitabilityPrivilegesRequired' - title: - nullable: true + reasonCode: type: string - unknowns: - items: + responseHeaders: + additionalProperties: type: string - type: array - userInteraction: - $ref: '#/components/schemas/ModelsTriageExploitabilityUserInteraction' - type: object - ModelsTriageExploitabilityAttackComplexity: - properties: - description: - nullable: true - type: string - exploitChainRequired: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityExploitChainRequired' - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityLabel' - payloadDifficulty: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityPayloadDifficulty' - type: object - ModelsTriageExploitabilityAttackComplexityExploitChainRequired: - properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel' - nullable: true - title: - nullable: true - type: string - type: object - ModelsTriageExploitabilityAttackComplexityExploitChainRequiredLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageExploitabilityAttackComplexityLabel: - enum: - - HIGH - - LOW - type: string - ModelsTriageExploitabilityAttackComplexityPayloadDifficulty: - properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel' - nullable: true - type: object - ModelsTriageExploitabilityAttackComplexityPayloadDifficultyLabel: - enum: - - EASY - - HARD - - NONE - type: string - ModelsTriageExploitabilityAttackRequirements: - properties: - description: - nullable: true - type: string - environmentState: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsEnvironmentState' - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsLabel' - nullable: true - mitm: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsMitm' - raceCondition: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsRaceCondition' - timeWindow: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsTimeWindow' - title: - nullable: true - type: string - type: object - ModelsTriageExploitabilityAttackRequirementsEnvironmentState: - properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel' - nullable: true - title: - nullable: true - type: string - type: object - ModelsTriageExploitabilityAttackRequirementsEnvironmentStateLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageExploitabilityAttackRequirementsLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageExploitabilityAttackRequirementsMitm: - properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsMitmLabel' - nullable: true - title: - nullable: true - type: string - type: object - ModelsTriageExploitabilityAttackRequirementsMitmLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageExploitabilityAttackRequirementsRaceCondition: - properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel' - nullable: true - title: - nullable: true - type: string - type: object - ModelsTriageExploitabilityAttackRequirementsRaceConditionLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageExploitabilityAttackRequirementsTimeWindow: - properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel' - nullable: true - title: - nullable: true - type: string - type: object - ModelsTriageExploitabilityAttackRequirementsTimeWindowLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageExploitabilityAttackVector: - properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVectorLabel' - subVectors: - items: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVectorSubVectorsElem' - type: array - type: object - ModelsTriageExploitabilityAttackVectorLabel: - enum: - - ADJACENT - - LOCAL - - NETWORK - - PHYSICAL - type: string - ModelsTriageExploitabilityAttackVectorSubVectorsElem: - properties: - description: - nullable: true + type: object + status: + $ref: '#/components/schemas/ModelsValidationStatus' + statusCode: + type: integer + testUrl: type: string - otherVector: - nullable: true + validatedBy: type: string - vector: - $ref: '#/components/schemas/ModelsTriageExploitabilityAttackVectorSubVectorsElemVector' - nullable: true - type: object - ModelsTriageExploitabilityAttackVectorSubVectorsElemVector: - enum: - - ADJACENT_ARP_SPOOFING - - ADJACENT_BLE_ADVERTISING - - ADJACENT_BLUETOOTH_CLASSIC - - ADJACENT_BLUETOOTH_KNOB - - ADJACENT_IPV6_NEIGHBOR_DISCOVERY - - ADJACENT_MDNS - - ADJACENT_NETBIOS - - ADJACENT_NFC - - ADJACENT_OTHER - - ADJACENT_SMB - - ADJACENT_SSDP - - ADJACENT_THREAD - - ADJACENT_WIFI_DIRECT - - ADJACENT_ZIGBEE - - LOCAL_COMMAND_LINE_ARGUMENT - - LOCAL_CONFIGURATION_FILE - - LOCAL_CRON_JOB - - LOCAL_D-BUS_MESSAGE - - LOCAL_DOCKER_SOCKET - - LOCAL_ENVIRONMENT_VARIABLE - - LOCAL_FILE_CONTENT - - LOCAL_FILE_NAME - - LOCAL_FILE_PATH - - LOCAL_IPC_SOCKET - - LOCAL_OTHER - - LOCAL_SCRIPT_PLUGIN - - LOCAL_SHARED_LIBRARY_LOAD - - LOCAL_SHARED_MEMORY - - LOCAL_SHELL_COMMAND - - LOCAL_SUID_EXECUTABLE - - NETWORK_DNS - - NETWORK_FTP - - NETWORK_GRAPHQL_QUERY - - NETWORK_GRE - - NETWORK_HTTP_BODY - - NETWORK_HTTP_COOKIE - - NETWORK_HTTP_FILE_UPLOAD - - NETWORK_HTTP_HEADER - - NETWORK_HTTP_METHOD - - NETWORK_HTTP_PATH_PARAMETER - - NETWORK_HTTP_QUERY_PARAMETER - - NETWORK_ICMP - - NETWORK_IMAP - - NETWORK_IPSEC - - NETWORK_L2TP - - NETWORK_LDAP - - NETWORK_MQTT - - NETWORK_NTP - - NETWORK_OTHER - - NETWORK_POP3 - - NETWORK_RDP - - NETWORK_REST_ENDPOINTHYPERLINK_CLICK - - NETWORK_SCTP - - NETWORK_SIP - - NETWORK_SMB - - NETWORK_SMTP - - NETWORK_SNMP - - NETWORK_SOAP_REQUEST - - NETWORK_SSH - - NETWORK_TCP_PORT - - NETWORK_UDP_PORT - - NETWORK_WEBSOCKET_MESSAGE - - PHYSICAL_BIOS_JTAG - - PHYSICAL_BLUETOOTH - - PHYSICAL_EVIL_MAID - - PHYSICAL_FIREWIRE - - PHYSICAL_IR - - PHYSICAL_NFC - - PHYSICAL_OTHER - - PHYSICAL_RFID - - PHYSICAL_SD_CARD - - PHYSICAL_SDIO - - PHYSICAL_SIDE_CHANNEL - - PHYSICAL_TEMPEST - - PHYSICAL_THUNDERBOLT - - PHYSICAL_USB + required: + - status + - message + type: object + ModelsValidationStatus: + enum: + - unknown + - valid + - invalid + - expired + - error + - unreachable + - blocked type: string - ModelsTriageExploitabilityConfidence: + ModelsValidationTrigger: enum: - - HIGH - - LOW - - MEDIUM + - manual + - scheduled + - preflight + - scan type: string - ModelsTriageExploitabilityLabel: + ModelsVulnClass: enum: - - LIKELY - - NEUTRAL - - UNLIKELY + - '' + - open_port + - tls_weak + - unauthenticated_endpoint + - xss + - sqli + - subdomain_takeover + - malware_injection + - insecure_cookie + - missing_csp + - authz_bypass + - idor + - excessive_data_exposure + - verb_tampering + - secret_in_artifact + - dom_xss + - post_message_misuse + - implicit_oauth_flow type: string - ModelsTriageExploitabilityPrivilegesRequired: + ModelsVulnClassRule: properties: - description: - nullable: true - type: string - label: - $ref: '#/components/schemas/ModelsTriageExploitabilityPrivilegesRequiredLabel' - nullable: true - title: - nullable: true + class: + $ref: '#/components/schemas/ModelsVulnClass' + disabled: + type: boolean + floor: + $ref: '#/components/schemas/ModelsSeverityFloor' + type: object + ModelsWebFingerprintOverride: + properties: + cdnDetection: + type: boolean + followRedirects: + type: boolean + maxDepth: + type: integer + wafDetection: + type: boolean + type: object + ActionitemanswerAnswer: + properties: + assignments: + items: + $ref: '#/components/schemas/ActionitemanswerAssignment' + type: array + durationDays: + description: snooze or accept-risk duration in days + type: integer + optionId: + description: the chosen option, for single_choice, yes_no, approve_deny, confirm_fact and for a picker's non-team options type: string - types: + optionIds: + description: the chosen options, for multi_choice items: - $ref: '#/components/schemas/ModelsTriageExploitabilityPrivilegesRequiredTypesElem' + type: string type: array + other: + description: an answer outside the listed options, when the question allows it + type: string + reason: + type: string + teamId: + type: string + text: + description: free_text answer, or the correction on a confirm_fact + type: string + userId: + description: the chat-platform user chosen on a user_picker + type: string + value: + description: 'value answer: a YYYY-MM-DD date, a number or an http(s) URL' + type: string type: object - ModelsTriageExploitabilityPrivilegesRequiredLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageExploitabilityPrivilegesRequiredTypesElem: + ActionitemanswerAssignment: + properties: + targetId: + type: string + teamId: + type: string + required: + - targetId + - teamId + type: object + ActionitemanswerEffect: enum: - - PRIVILEDGED_USER - - UNAUTHENTICATED - - UNVERIFIED_USER - - VERIFIED_USER + - '' + - approve + - needs_changes + - false_positive + - snooze + - dismiss type: string - ModelsTriageExploitabilityUserInteraction: + ActionitemanswerOption: properties: + consequence: + type: string description: - nullable: true + type: string + effect: + $ref: '#/components/schemas/ActionitemanswerEffect' + exclusive: + description: 'multi-choice only: cannot be combined with another option' + type: boolean + id: type: string label: - $ref: '#/components/schemas/ModelsTriageExploitabilityUserInteractionLabel' - nullable: true - otherTypes: + type: string + recommended: + type: boolean + requiresReason: + type: boolean + snoozeDays: + type: integer + value: + description: the text recorded when this option is chosen; defaults to the label + type: string + required: + - id + - label + type: object + ActionitemanswerSpec: + properties: + allowOther: + description: a person may type an answer that is not one of the options + type: boolean + defaultOption: + description: the option assumed when nobody answers + type: string + durationsDays: + description: snooze or accept-risk durations a person may choose, in days items: - type: string + type: integer type: array - title: + ifUnanswered: + description: what Nullify does if nobody answers, in plain words + type: string + max: + description: largest accepted number nullable: true + type: number + maxDate: + description: latest accepted date, YYYY-MM-DD type: string - types: + maxLength: + type: integer + maxSelections: + type: integer + min: + description: smallest accepted number + nullable: true + type: number + minDate: + description: earliest accepted date, YYYY-MM-DD + type: string + minSelections: + type: integer + options: items: - $ref: '#/components/schemas/ModelsTriageExploitabilityUserInteractionTypesElem' + $ref: '#/components/schemas/ActionitemanswerOption' + type: array + pickerKind: + enum: + - team + - user + type: string + placeholder: + type: string + statement: + description: 'confirm_fact only: the fact Nullify believes' + type: string + suggested: + description: 'confirm_fact only: the value Nullify suggests' + type: string + targets: + items: + $ref: '#/components/schemas/ActionitemanswerTarget' type: array + unit: + type: string + valueType: + enum: + - date + - number + - url + - text + type: string + whyItMatters: + type: string type: object - ModelsTriageExploitabilityUserInteractionLabel: - enum: - - ACTIVE - - NONE - - PASSIVE - type: string - ModelsTriageExploitabilityUserInteractionTypesElem: - enum: - - BROWSING - - FILE_DOWNLOAD - - FILE_UPLOAD - - HYPERLINK_CLICK - - SOCIAL_ENGINEERING - type: string - ModelsTriageFixEffort: + ActionitemanswerTarget: properties: - confidence: - $ref: '#/components/schemas/ModelsTriageFixEffortConfidence' - description: - nullable: true + id: type: string label: - $ref: '#/components/schemas/ModelsTriageFixEffortLabel' - title: - nullable: true type: string - unknowns: - items: - type: string - type: array + required: + - id + - label type: object - ModelsTriageFixEffortConfidence: - enum: - - HIGH - - LOW - - MEDIUM - type: string - ModelsTriageFixEffortLabel: - enum: - - EASY - - HARD - - MEDIUM - type: string - ModelsTriageImpact: + AuditToolCallAuditRecord: + type: object + EndpointsActionItem: properties: - availability: - $ref: '#/components/schemas/ModelsTriageImpactAvailability' - businessCriticality: - $ref: '#/components/schemas/ModelsTriageImpactBusinessCriticality' - confidence: - $ref: '#/components/schemas/ModelsTriageImpactConfidence' - confidentiality: - $ref: '#/components/schemas/ModelsTriageImpactConfidentiality' - description: + answer: + $ref: '#/components/schemas/ActionitemanswerAnswer' + answerMemoryId: nullable: true type: string - integrity: - $ref: '#/components/schemas/ModelsTriageImpactIntegrity' - label: - $ref: '#/components/schemas/ModelsTriageImpactLabel' - title: + answerSpec: + $ref: '#/components/schemas/ActionitemanswerSpec' + answerType: + description: >- + what a person answers: a yes or no, one choice, several choices, free text, a team, teams for several + repositories, a chat account, an approve or deny decision, an accepted risk with a duration, a confirmed + fact, or a value such as a date, number or URL + enum: + - yes_no + - single_choice + - multi_choice + - free_text + - team_picker + - batch_team_picker + - user_picker + - approve_deny + - accept_risk + - confirm_fact + - value + type: string + blocked: + description: true when the item is parked behind unresolved depends_on blockers + type: boolean + chatId: nullable: true type: string - unknowns: + completedAt: + nullable: true + type: string + createdAt: + type: string + createdBy: + type: string + dedupKey: + type: string + dependsOnIds: items: type: string type: array - type: object - ModelsTriageImpactAvailability: - properties: - cause: - items: - $ref: '#/components/schemas/ModelsTriageImpactAvailabilityCauseElem' - type: array - description: + detailedQuestion: + type: string + disposition: + description: >- + how a dismissal was recorded: not_now (asked again after a cooldown) or decided (not asked again for the + same subject until someone reopens it); absent on an item that was never dismissed or predates dispositions nullable: true type: string - label: - $ref: '#/components/schemas/ModelsTriageImpactAvailabilityLabel' - title: + expiresAt: + description: >- + the deadline the item's creator set; absent when the creator set none, in which case only evidence, a person + or the portfolio review closes it nullable: true type: string - type: + expiryReason: + description: the creator's reason for its expiry decision, including for items with no deadline + type: string + findings: items: - $ref: '#/components/schemas/ModelsTriageImpactAvailabilityTypeElem' + $ref: '#/components/schemas/EndpointsActionItemFinding' + nullable: true type: array - type: object - ModelsTriageImpactAvailabilityCauseElem: - enum: - - BUFFER_OVERFLOW - - BUSINESS_LOGIC - - INFINITE_LOOP - - MEMORY_LEAK - - RESOURCE_EXHAUSTION - type: string - ModelsTriageImpactAvailabilityLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageImpactAvailabilityTypeElem: - enum: - - COMPLETE_SERVICE_OUTAGE - - SERVICE_DEGRADATION - - USER_ACCESS_DISRUPTION - type: string - ModelsTriageImpactBusinessCriticality: - properties: - description: + gitUser: + $ref: '#/components/schemas/EndpointsActionItemGitUser' + gitUserId: + description: UNMAPPED_USER kind anchor nullable: true type: string - label: - $ref: '#/components/schemas/ModelsTriageImpactBusinessCriticalityLabel' + groupKey: + description: sibling items with the same key can be shown or answered together nullable: true - title: + type: string + id: + type: string + ifExpired: + description: >- + what happens at expiresAt: expire closes the item, reask_once closes it and lets it be raised once more, + escalate reports it to central security first, escalated means that report was already made and the item + closes + enum: + - expire + - reask_once + - escalate + - escalated nullable: true type: string - type: object - ModelsTriageImpactBusinessCriticalityLabel: - enum: - - HIGH - - LOW - - MEDIUM - type: string - ModelsTriageImpactConfidence: - enum: - - HIGH - - LOW - - MEDIUM - type: string - ModelsTriageImpactConfidentiality: - properties: - dataLeaked: - items: - $ref: '#/components/schemas/ModelsTriageImpactConfidentialityDataLeakedElem' - type: array - label: - $ref: '#/components/schemas/ModelsTriageImpactConfidentialityLabel' - type: object - ModelsTriageImpactConfidentialityDataLeakedElem: - enum: - - ACCESS_TOKEN - - ADDRESS - - AGE - - API_KEY - - AUTHENTICATION_DATA - - BANK_ACCOUNT_INFORMATION - - BIOMETRIC_DATA - - CALL_LOGS - - CERTIFICATE - - CLIENT_AND_VENDOR_INFORMATION - - COMPLIANCE_RECORDS - - CREDIT_DEBIT_CARD_DETAILS - - DATABASE_CREDENTIALS - - DEVICE_IDENTIFIERS - - DRIVERS_LICENSE - - EDUCATION_RECORDS - - EMAIL_ADDRESS - - EMAILS_AND_MESSAGES - - EMPLOYMENT_HISTORY - - ENCRYPTION_KEY - - GENDER - - INCOME_AND_TAX_INFORMATION - - INTELLECTUAL_PROPERTY - - INVENTORY_DATA - - INVESTMENT_INFORMATION - - IP_ADDRESSES - - LEGAL_DOCUMENTS - - MEDICAL_DATA - - NAME - - OTHER_PRIVATE_NON_SENSITIVE_DATA - - OTHER_PRIVATE_SENSITIVE_DATA - - OTHER_PUBLIC_DATA - - PASSPORT - - PERFORMANCE_REVIEWS - - PHONE_NUMBER - - POLITICAL_OPINIONS - - RACIAL_OR_ETHNIC_ORIGIN - - RELIGIOUS_OR_PHILOSOPHICAL_BELIEFS - - SALARY_AND_BENEFITS_INFORMATION - - SECRET_KEY - - SEXUAL_ORIENTATION - - SOCIAL_MEDIA_INTERACTIONS - - SOCIAL_SECURITY_NUMBER - - STRATEGIC_PLANS_AND_FORECASTS - - SYSTEM_LOGS_AND_MONITORING_DATA - - TRADE_SECRETS - - TRANSACTION_HISTORY - type: string - ModelsTriageImpactConfidentialityLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageImpactIntegrity: - properties: - description: + kind: + $ref: '#/components/schemas/ModelsActionItemKind' + lastHumanActivityAt: + description: last time a person answered, snoozed, dismissed or reopened the item; automation never sets it nullable: true type: string - label: - $ref: '#/components/schemas/ModelsTriageImpactIntegrityLabel' - title: + lastNudgedAt: nullable: true type: string - type: - items: - $ref: '#/components/schemas/ModelsTriageImpactIntegrityTypeElem' + messageChannelId: nullable: true - type: array - type: object - ModelsTriageImpactIntegrityLabel: - enum: - - HIGH - - LOW - - NONE - type: string - ModelsTriageImpactIntegrityTypeElem: - enum: - - DATABASE_ALTERED - - MALICIOUS_CODE_EXECUTED - - PRIVILEDGE_ESCALATION - - SYSTEM_BEHAVIOUR_MANIPULATED - type: string - ModelsTriageImpactLabel: - enum: - - CRITICAL - - HIGH - - LOW - type: string - ModelsTriagePentest: - properties: - attemptedCVEs: + type: string + messageProvider: + $ref: '#/components/schemas/ModelsProviderID' + messageThreadRootId: + nullable: true + type: string + pullRequests: items: - type: string + $ref: '#/components/schemas/EndpointsActionItemPullRequest' type: array - confidence: + repositoryId: + description: UNASSIGNED_TEAM kind anchor nullable: true - type: number - cost: + type: string + resolutionMode: + $ref: '#/components/schemas/ModelsActionItemResolutionMode' + resolutionReason: + description: why Nullify closed the item itself; absent when a person did + enum: + - findings_gone + - repository_gone + - expired + - merged_duplicate + - subject_resolved + - no_longer_relevant nullable: true - type: number - duration: + type: string + resolvedByUserId: nullable: true - type: number - exploitedCVE: + type: string + response: nullable: true type: string - logs: - $ref: '#/components/schemas/AgentsGroupedAgentLogs' - outcome: - $ref: '#/components/schemas/ModelsTriagePentestOutcome' - report: + severity: + description: underlying need severity (may be empty) type: string - reproductionScript: + snoozedUntil: + description: while in the future the item is not nudged nullable: true type: string - testedEndpoints: - items: - $ref: '#/components/schemas/ModelsTriagePentestTestedEndpointsElem' - type: array + state: + description: >- + waiting on an answer, snoozed until snoozedUntil, blocked behind another item, being resolved, answered or + dismissed by a person, or closed by Nullify because the subject is gone + enum: + - waiting + - snoozed + - blocked + - resolving + - answered + - dismissed + - closed_by_nullify + type: string + status: + $ref: '#/components/schemas/ModelsActionItemStatus' + teamId: + description: null = central security + nullable: true + type: string + tenantId: + type: string + title: + description: one-line headline of the question, at most 140 characters + type: string + updatedAt: + type: string + waitingSince: + description: when the question was first asked (RFC 3339); never moved by automation + type: string + required: + - id + - tenantId + - kind + - status + - detailedQuestion + - dedupKey + - createdBy + - createdAt + - updatedAt + - title + - answerType + - state + - waitingSince type: object - ModelsTriagePentestOutcome: - enum: - - CANNOT_DETERMINE - - CONFIRMED - - LIKELY - - NOT_EXPLOITABLE - - POTENTIAL - type: string - ModelsTriagePentestTestedEndpointsElem: + EndpointsActionItemFinding: + properties: + findingId: + type: string + findingType: + $ref: '#/components/schemas/ModelsActionItemLinkType' + title: + type: string + required: + - findingId + - findingType + type: object + EndpointsActionItemGitUser: + properties: + avatarUrl: + type: string + email: + type: string + login: + type: string + name: + type: string + profileUrl: + type: string + required: + - login + type: object + EndpointsActionItemPullRequest: + properties: + findingId: + type: string + status: + description: PR status (open / draft) + type: string + title: + type: string + url: + type: string + required: + - findingId + - url + type: object + EndpointsAnswerActionItemInput: + properties: + answer: + $ref: '#/components/schemas/ActionitemanswerAnswer' + required: + - answer + type: object + EndpointsAnswerActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object + EndpointsAssignRepoActionItemInput: + properties: + teamId: + type: string + required: + - teamId + type: object + EndpointsAssignRepoActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object + EndpointsAssignTeamActionItemInput: + properties: + teamId: + type: string + required: + - teamId + type: object + EndpointsAssignTeamActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object + EndpointsCampaignEventPerson: properties: - method: - nullable: true + displayName: type: string - path: - nullable: true + login: + description: Git login the messaging user is mapped to type: string + required: + - displayName type: object - ModelsTriageRetriageMetadata: + EndpointsCampaignEventPullRequest: properties: - memoryChanges: - items: - $ref: '#/components/schemas/ModelsTriageRetriageMetadataMemoryChangesElem' - type: array - triggeredAt: + firstReviewedAt: + description: When the first review was recorded format: date-time nullable: true type: string - type: object - ModelsTriageRetriageMetadataMemoryChangesElem: - properties: - memoryChangeType: - $ref: '#/components/schemas/ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType' - nullable: true - memoryId: + mergedAt: + format: date-time nullable: true type: string - type: object - ModelsTriageRetriageMetadataMemoryChangesElemMemoryChangeType: - enum: - - MEMORY_ADDED - - MEMORY_CORRECTED - - MEMORY_INVALIDATED - - MEMORY_REMOVED - type: string - ModelsTriageRetriageStatus: - enum: - - NOT_RETRIAGED - - RETRIAGE_COMPLETED - - RETRIAGE_FAILED - - RETRIAGE_IN_PROGRESS - - RETRIAGE_REQUESTED - type: string - ModelsTriageSeverity: - properties: - confidence: - $ref: '#/components/schemas/ModelsTriageSeverityConfidence' - label: - $ref: '#/components/schemas/ModelsSeverityEnum' - score: - type: integer - unknowns: - items: - type: string - type: array - type: object - ModelsTriageSeverityConfidence: - enum: - - HIGH - - LOW - - MEDIUM - type: string - ModelsValidationEvidence: - properties: - duration: - format: int64 - type: integer - error: - type: string - message: + repository: type: string - responseHeaders: - additionalProperties: - type: string - type: object status: - $ref: '#/components/schemas/ModelsValidationStatus' - statusCode: - type: integer - testUrl: + enum: + - open + - merged + - closed + - draft type: string - validatedBy: + title: + type: string + url: type: string required: + - url - status - - message - type: object - ModelsValidationStatus: - enum: - - unknown - - valid - - invalid - - expired - - error - type: string - ModelsVulnClass: - enum: - - '' - - open_port - - tls_weak - - unauthenticated_endpoint - - xss - - sqli - - subdomain_takeover - - malware_injection - - insecure_cookie - - missing_csp - - authz_bypass - - idor - - excessive_data_exposure - - verb_tampering - - secret_in_artifact - - dom_xss - - post_message_misuse - - implicit_oauth_flow - type: string - ModelsVulnClassRule: - properties: - class: - $ref: '#/components/schemas/ModelsVulnClass' - disabled: - type: boolean - floor: - $ref: '#/components/schemas/ModelsSeverityFloor' - type: object - ModelsWebFingerprintOverride: - properties: - cdnDetection: - type: boolean - followRedirects: - type: boolean - maxDepth: - type: integer - wafDetection: - type: boolean - type: object - ActionsPendingAction: - type: object - AuditToolCallAuditRecord: type: object EndpointsCampaignRunDetail: properties: - agentCostCredits: - format: int64 - type: integer agentInputTokens: format: int64 type: integer @@ -67154,9 +141904,6 @@ components: type: object EndpointsCampaignRunSummary: properties: - agentCostCredits: - format: int64 - type: integer agentInputTokens: format: int64 type: integer @@ -67191,75 +141938,295 @@ components: - state - startedAt type: object - EndpointsCustomerQuestionSetResponse: + EndpointsChatSessionAction: properties: - createdAt: + actionId: type: string - customMessage: - nullable: true + description: type: string - generatedMemoryIds: - items: - type: string - type: array - id: + displayName: type: string - questions: - items: - $ref: '#/components/schemas/ModelsCustomerQuestion' + executable: + type: boolean + params: + additionalProperties: {} nullable: true - type: array - updatedAt: + type: object + resolvedByUserId: + type: string + result: + type: string + severity: type: string + status: + type: string + toolName: + type: string + required: + - actionId + - toolName + - displayName + - description + - params + - severity + - status + - result + - executable type: object - EndpointsDeleteAllCustomerQuestionSetsOutput: + EndpointsClassifyIdentityInput: properties: - deletedCount: - format: int64 - type: integer - version: + decision: + enum: + - service_account + - no_chat_account + type: string + provider: + $ref: '#/components/schemas/ModelsProviderID' + providerUserId: + description: the provider's id for the user, not the login + type: string + reason: + maxLength: 500 type: string required: - - deletedCount + - provider + - providerUserId + - decision type: object - EndpointsDeleteChatSessionOutput: + EndpointsClassifyIdentityOutput: properties: - success: - type: boolean + classification: + $ref: '#/components/schemas/EndpointsIdentityClassification' + version: + type: string + required: + - version + - classification type: object - EndpointsDeleteCustomerQuestionOutput: + EndpointsDeleteActionItemOutput: properties: success: type: boolean version: type: string required: + - version - success type: object - EndpointsDeleteCustomerQuestionSetOutput: + EndpointsDeleteChatSessionOutput: properties: success: type: boolean + type: object + EndpointsDeleteEventOutput: + properties: version: type: string + type: object + EndpointsDismissActionItemInput: + properties: + classify: + description: 'UNMAPPED_USER items only: also classify the git identity' + enum: + - service_account + - no_chat_account + type: string + disposition: + description: >- + not_now (default) is asked again after a cooldown; decided is not asked again for the same subject until + someone reopens it + enum: + - not_now + - decided + type: string + reason: + maxLength: 500 + type: string required: - - success + - reason type: object - EndpointsDeleteEventOutput: + EndpointsDismissActionItemOutput: properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' version: type: string + required: + - version + - actionItem + type: object + EndpointsEscalationRecipient: + properties: + id: + type: string + name: + type: string + required: + - id + - name + type: object + EndpointsFixPRNudgeCandidate: + properties: + available: + type: boolean + gitLogin: + type: string + name: + type: string + reason: + enum: + - unmapped + - unavailable + type: string + userId: + type: string + required: + - gitLogin + - available + type: object + EndpointsFixPRNudgeResult: + properties: + name: + type: string + outcome: + enum: + - sent + - already_nudged + - held_weekly_limit + - failed + - cap_reached + type: string + userId: + type: string + required: + - userId + - outcome type: object EndpointsGenerateDefaultCampaignsOutput: properties: + executionArn: + type: string message: type: string + runId: + type: string version: type: string required: - version - message type: object + EndpointsGetActionItemMessagesOutput: + properties: + hasMore: + type: boolean + messages: + items: + $ref: '#/components/schemas/ModelsComment' + nullable: true + type: array + replayFrames: + items: + $ref: '#/components/schemas/ModelsChatHistoryFrame' + type: array + replayTruncated: + type: boolean + version: + type: string + required: + - version + - messages + - hasMore + type: object + EndpointsGetActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object + EndpointsGetActionItemsOutput: + properties: + actionItems: + items: + $ref: '#/components/schemas/EndpointsActionItem' + nullable: true + type: array + numItems: + type: integer + version: + type: string + required: + - version + - actionItems + - numItems + type: object + EndpointsGetActionItemsSummaryOutput: + properties: + blocked: + description: OPEN items blocked behind another item, not counting snoozed ones + type: integer + byAnswerType: + additionalProperties: + type: integer + description: OPEN items by answer type, not counting snoozed or blocked ones + nullable: true + type: object + byKind: + additionalProperties: + type: integer + nullable: true + type: object + byStatus: + additionalProperties: + type: integer + nullable: true + type: object + byTeam: + additionalProperties: + type: integer + description: keyed by team id; empty string key = central security + nullable: true + type: object + snoozed: + description: OPEN items snoozed until a later date + type: integer + total: + description: Every item that is not deleted, in any status. + type: integer + totalOpen: + description: >- + Items with status OPEN across every kind, from the same response as byKind so the headline never depends on + the per-kind lists loading. RESOLVING items are not counted. + type: integer + totalStalled: + type: integer + unrouted: + description: >- + OPEN items marked undeliverable: the follow-up pass found no route for them (no messaging platform, or + neither a team nor a central channel) and no later pass has delivered or attempted them + type: integer + version: + type: string + waiting: + description: OPEN items waiting on an answer + type: integer + required: + - version + - byStatus + - byKind + - byTeam + - unrouted + - total + - totalOpen + - byAnswerType + - waiting + - snoozed + - blocked + type: object EndpointsGetAllCampaignsFindingsOutput: properties: findings: @@ -67288,10 +142255,18 @@ components: type: boolean numItems: type: integer + people: + additionalProperties: + $ref: '#/components/schemas/EndpointsCampaignEventPerson' + type: object pullRequestTitles: additionalProperties: type: string type: object + pullRequests: + additionalProperties: + $ref: '#/components/schemas/EndpointsCampaignEventPullRequest' + type: object version: type: string required: @@ -67320,12 +142295,21 @@ components: type: object EndpointsGetCampaignMetricsRefreshOutput: properties: + refreshed: + description: >- + Whether campaign metrics were actually recomputed. False means the refresh was declined because another + singleton manager process holds the tenant lock; the stored counts are unchanged. + type: boolean response: type: string + skipReason: + description: Why the refresh was declined, when refreshed is false. + type: string version: type: string required: - response + - refreshed type: object EndpointsGetCampaignOutput: properties: @@ -67341,6 +142325,8 @@ components: $ref: '#/components/schemas/ModelsFindingProgress' nullable: true type: array + touchLedger: + $ref: '#/components/schemas/ModelsCampaignTouchLedger' version: type: string required: @@ -67374,6 +142360,10 @@ components: type: array numItems: type: integer + portfolio: + $ref: '#/components/schemas/ModelsCampaignPortfolio' + total: + type: integer version: type: string required: @@ -67381,6 +142371,7 @@ components: - campaigns - findings - numItems + - total type: object EndpointsGetCampaignRunOutput: properties: @@ -67398,8 +142389,11 @@ components: $ref: '#/components/schemas/EndpointsCampaignRunSummary' nullable: true type: array + total: + type: integer required: - runs + - total type: object EndpointsGetCampaignSummariesOutput: properties: @@ -67437,9 +142431,11 @@ components: properties: actions: items: - $ref: '#/components/schemas/ActionsPendingAction' + $ref: '#/components/schemas/EndpointsChatSessionAction' nullable: true type: array + required: + - actions type: object EndpointsGetChatSessionAuditOutput: properties: @@ -67453,51 +142449,25 @@ components: type: object EndpointsGetChatSessionHistoryOutput: properties: + hasMore: + type: boolean messages: items: $ref: '#/components/schemas/ModelsComment' nullable: true type: array + replayFrames: + items: + $ref: '#/components/schemas/ModelsChatHistoryFrame' + type: array + replayTruncated: + type: boolean type: object EndpointsGetChatSessionOutput: properties: session: $ref: '#/components/schemas/SessionsChatSession' type: object - EndpointsGetCreditsOutput: - properties: - credits: - $ref: '#/components/schemas/ModelsCredits' - version: - type: string - required: - - version - - credits - type: object - EndpointsGetCustomerQuestionSetOutput: - properties: - questionSet: - $ref: '#/components/schemas/EndpointsCustomerQuestionSetResponse' - version: - type: string - required: - - questionSet - type: object - EndpointsGetCustomerQuestionSetsOutput: - properties: - numItems: - type: integer - questionSets: - items: - $ref: '#/components/schemas/EndpointsCustomerQuestionSetResponse' - nullable: true - type: array - version: - type: string - required: - - questionSets - - numItems - type: object EndpointsGetDefaultCampaignsOutput: properties: campaigns: @@ -67514,21 +142484,33 @@ components: - campaigns - numItems type: object - EndpointsGetEscalationsOutput: + EndpointsGetEngagementUsersOutput: properties: - escalations: + nextCursor: + type: string + users: items: - $ref: '#/components/schemas/ModelsEscalation' + $ref: '#/components/schemas/ModelsDeveloperEngagement' + nullable: true + type: array + windowStart: + type: string + required: + - users + - windowStart + type: object + EndpointsGetEscalationRecipientsOutput: + properties: + recipients: + items: + $ref: '#/components/schemas/EndpointsEscalationRecipient' nullable: true type: array - numItems: - type: integer version: type: string required: - version - - escalations - - numItems + - recipients type: object EndpointsGetEventsOutput: properties: @@ -67564,6 +142546,65 @@ components: - events - numItems type: object + EndpointsGetFixPRNudgeOutput: + properties: + candidates: + items: + $ref: '#/components/schemas/EndpointsFixPRNudgeCandidate' + nullable: true + type: array + disabledReason: + enum: + - not_github + - not_open + - direct_messages_disabled + - messaging_unavailable + - no_mapped_recipient + - reviewers_excluded + - cap_reached + type: string + draft: + type: boolean + kind: + enum: + - autofix + - allowlist + - manual_fix + type: string + message: + type: string + number: + type: integer + prUrl: + type: string + repository: + type: string + sendsLeft: + description: DMs this PR can still receive in the 30-day window, across every nudge + type: integer + state: + type: string + variant: + enum: + - review + - approval + - draft + type: string + version: + type: string + required: + - version + - prUrl + - repository + - number + - kind + - state + - draft + - variant + - message + - candidates + - sendsLeft + type: object EndpointsGetManagerConfigOutput: properties: config: @@ -67573,6 +142614,13 @@ components: required: - config type: object + EndpointsGetManagerEscalationConfigOutput: + properties: + escalation: + $ref: '#/components/schemas/ModelsEscalationRouting' + version: + type: string + type: object EndpointsGetManagerGroundRulesOutput: properties: groundRules: @@ -67582,68 +142630,20 @@ components: type: object EndpointsGetManagerMetricsOutput: properties: - autofixDuration: - minimum: 0 - type: integer backlogSearches: minimum: 0 type: integer - detectionDuration: - minimum: 0 - type: integer escalatedFindings: minimum: 0 type: integer escalations: minimum: 0 type: integer - findingsInBacklog: - type: integer - findingsInProgress: - type: integer - findingsResolved: - type: integer + findingsAnalysis: + $ref: '#/components/schemas/ModelsFindingsMetrics' internetSearchCount: minimum: 0 type: integer - mappedFindings: - items: - $ref: '#/components/schemas/ModelsFindingProgress' - nullable: true - type: array - meanTimeAutofixToInProgress: - minimum: 0 - type: integer - meanTimeInProgressToResolved: - minimum: 0 - type: integer - meanTimeToAutofix: - minimum: 0 - type: integer - meanTimeToDetectAndTriage: - minimum: 0 - type: integer - meanTimeToResolve: - minimum: 0 - type: integer - meanTimeToTriage: - minimum: 0 - type: integer - medianTimeAutofixToInProgress: - minimum: 0 - type: integer - medianTimeInProgressToResolved: - minimum: 0 - type: integer - medianTimeToAutofix: - minimum: 0 - type: integer - medianTimeToDetectAndTriage: - minimum: 0 - type: integer - medianTimeToTriage: - minimum: 0 - type: integer messageCount: minimum: 0 type: integer @@ -67659,6 +142659,9 @@ components: prCreateCount: minimum: 0 type: integer + prMergedCount: + minimum: 0 + type: integer previewMessageCount: minimum: 0 type: integer @@ -67677,28 +142680,62 @@ components: ticketCreateCount: minimum: 0 type: integer - timeSaved: + ticketsResolvedCount: minimum: 0 type: integer timeSavedAssigning: minimum: 0 type: integer - totalRemediationDuration: - minimum: 0 - type: integer - triageDuration: - minimum: 0 - type: integer version: type: string required: - - findingsInBacklog - - findingsInProgress - - findingsResolved - - meanTimeToResolve - - mappedFindings + - findingsAnalysis - version type: object + EndpointsGetManagerRunOutput: + properties: + campaignIds: + items: + type: string + type: array + campaignRunIds: + items: + type: string + type: array + completedAt: + type: string + detail: + type: string + error: + type: string + executionArn: + type: string + mode: + type: string + runId: + type: string + startedAt: + type: string + state: + enum: + - PENDING + - RUNNING + - SUCCEEDED + - FAILED + - SKIPPED + - TIMED_OUT + - ABORTED + type: string + strategyId: + type: string + strategyVersion: + type: integer + terminal: + type: boolean + required: + - runId + - state + type: object EndpointsGetManagerStateOutput: properties: currentState: @@ -67735,24 +142772,93 @@ components: - plans - numItems type: object + EndpointsGetProposalsOutput: + properties: + proposals: + items: + $ref: '#/components/schemas/ModelsProposalView' + nullable: true + type: array + type: object + EndpointsGetSecurityProgramOutput: + properties: + program: + $ref: '#/components/schemas/ModelsSecurityProgram' + type: object EndpointsGetStrategyOutput: properties: + acceptedAt: + format: date-time + nullable: true + type: string + acceptedBy: + nullable: true + type: string createdAt: format: date-time type: string + editSource: + type: string + editedBy: + nullable: true + type: string id: type: string quarters: items: - $ref: '#/components/schemas/ModelsStrategyQuarterGoal' + $ref: '#/components/schemas/ModelsStrategyQuarterGoal' + nullable: true + type: array + status: + type: string + updatedAt: + format: date-time + nullable: true + type: string + version: + type: integer + type: object + EndpointsGetStrategyProposalOutput: + properties: + proposal: + $ref: '#/components/schemas/ModelsStrategy' + type: object + EndpointsGetThreatCatalogOutput: + properties: + appliedFilters: + description: The verdict, kind and publishedAfter/publishedBefore filters this response applied + items: + type: string nullable: true type: array - updatedAt: - format: date-time - nullable: true + numItems: + type: integer + pageableTotal: + description: How many of total the catalog pages through at this page size; deeper pages need narrower filters + type: integer + sort: + description: The order the threats are listed in + enum: + - published + - researched type: string - version: + threats: + items: + $ref: '#/components/schemas/EndpointsThreatCatalogEntry' + nullable: true + type: array + total: + description: >- + Matching published threats. Past pageableTotal it is a floor: the catalog stops counting one past the + deepest page it serves type: integer + version: + type: string + required: + - threats + - total + - pageableTotal + - numItems type: object EndpointsGetThreatInvestigationOutput: properties: @@ -67760,6 +142866,10 @@ components: items: $ref: '#/components/schemas/ModelsManagerEvent' type: array + investigationVersions: + items: + $ref: '#/components/schemas/ModelsThreatInvestigation' + type: array threatInvestigation: $ref: '#/components/schemas/ModelsThreatInvestigation' version: @@ -67767,8 +142877,35 @@ components: required: - threatInvestigation type: object + EndpointsGetThreatInvestigationProgressOutput: + properties: + runId: + description: The run the stages belong to + type: string + stages: + items: + $ref: '#/components/schemas/EndpointsThreatInvestigationProgressStage' + nullable: true + type: array + terminal: + type: boolean + version: + type: string + required: + - stages + - terminal + type: object EndpointsGetThreatInvestigationsOutput: properties: + affectedInvestigations: + description: Investigations with at least one affected repository, across every page + type: integer + affectedRepos: + description: Distinct repositories affected by any investigation in the filtered set + type: integer + linkedFindings: + description: Distinct findings linked to any investigation in the filtered set + type: integer numItems: type: integer threatInvestigations: @@ -67776,11 +142913,45 @@ components: $ref: '#/components/schemas/ModelsThreatInvestigation' nullable: true type: array + total: + type: integer version: type: string required: - threatInvestigations - numItems + - total + - affectedInvestigations + - affectedRepos + - linkedFindings + type: object + EndpointsIdentityClassification: + properties: + createdAt: + type: string + createdBy: + description: a user id, service#operator-cli or service#automation + type: string + decision: + enum: + - service_account + - no_chat_account + type: string + provider: + $ref: '#/components/schemas/ModelsProviderID' + providerUserId: + type: string + reason: + type: string + username: + description: the login in the tenant directory, when the identity is a synced user + type: string + required: + - provider + - providerUserId + - decision + - createdBy + - createdAt type: object EndpointsListChatSessionsOutput: properties: @@ -67792,6 +142963,19 @@ components: nullable: true type: array type: object + EndpointsListIdentityClassificationsOutput: + properties: + classifications: + items: + $ref: '#/components/schemas/EndpointsIdentityClassification' + nullable: true + type: array + version: + type: string + required: + - version + - classifications + type: object EndpointsListStrategyVersionsOutput: properties: numItems: @@ -67802,6 +142986,27 @@ components: nullable: true type: array type: object + EndpointsListThreatReportsOutput: + properties: + page: + type: integer + pageSize: + type: integer + reports: + items: + $ref: '#/components/schemas/EndpointsThreatReportEntry' + nullable: true + type: array + totalCount: + type: integer + version: + type: string + required: + - reports + - totalCount + - page + - pageSize + type: object EndpointsManagerConfigInput: properties: enableActions: @@ -67811,8 +143016,86 @@ components: required: - initialized type: object + EndpointsMapUserActionItemInput: + properties: + messageUserId: + type: string + serviceAccount: + type: boolean + type: object + EndpointsMapUserActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object + EndpointsNudgeActionItemInput: + properties: + message: + maxLength: 4000 + type: string + recipientUserId: + type: string + type: object + EndpointsNudgeActionItemOutput: + properties: + sent: + type: boolean + version: + type: string + required: + - version + - sent + type: object + EndpointsNudgeFixPRInput: + properties: + recipientUserIds: + items: + type: string + maxItems: 10 + type: array + type: object + EndpointsNudgeFixPROutput: + properties: + results: + items: + $ref: '#/components/schemas/EndpointsFixPRNudgeResult' + nullable: true + type: array + version: + type: string + required: + - version + - results + type: object + EndpointsPatchActionItemInput: + properties: + teamId: + nullable: true + type: string + required: + - teamId + type: object + EndpointsPatchActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object EndpointsPatchCampaignInput: properties: + clearExploitValidated: + type: boolean + confirmWholeBacklog: + type: boolean createdAfter: format: date-time nullable: true @@ -67828,6 +143111,9 @@ components: format: date-time nullable: true type: string + exploitValidated: + nullable: true + type: boolean findingIds: items: type: string @@ -67853,11 +143139,18 @@ components: owner: nullable: true type: string + prBudgetPerWeek: + nullable: true + type: integer priorityLabels: items: type: string type: array - repositoryNames: + repositoryIds: + items: + type: string + type: array + severityConfidence: items: type: string type: array @@ -67878,10 +143171,6 @@ components: items: type: string type: array - teamNames: - items: - type: string - type: array title: nullable: true type: string @@ -67924,30 +143213,6 @@ components: success: type: boolean type: object - EndpointsPatchCustomerQuestionAnswerInput: - properties: - answer: {} - required: - - answer - type: object - EndpointsPatchCustomerQuestionAnswerOutput: - properties: - success: - type: boolean - version: - type: string - required: - - success - type: object - EndpointsPatchEscalationsInput: - properties: - reasoning: - nullable: true - type: string - status: - $ref: '#/components/schemas/ModelsEscalationStatus' - nullable: true - type: object EndpointsPatchGroundRulesInput: properties: groundRules: @@ -67960,6 +143225,46 @@ components: version: type: string type: object + EndpointsPatchSecurityProgramInput: + properties: + announceWindowDays: + minimum: 1 + type: integer + autonomy: + enum: + - explicit + - announce_with_window + - auto_within_boundaries + type: string + capacityPerWeek: + minimum: 1 + nullable: true + type: integer + defaultCampaignDays: + minimum: 1 + type: integer + maxConcurrentCampaigns: + minimum: 1 + type: integer + minCoveragePerGoal: + minimum: 1 + type: integer + reviewCadenceDays: + minimum: 1 + type: integer + required: + - autonomy + - announceWindowDays + - minCoveragePerGoal + - maxConcurrentCampaigns + - defaultCampaignDays + - reviewCadenceDays + type: object + EndpointsPatchSecurityProgramOutput: + properties: + program: + $ref: '#/components/schemas/ModelsSecurityProgram' + type: object EndpointsPatchStrategyInput: properties: quarters: @@ -67970,9 +143275,21 @@ components: type: object EndpointsPatchStrategyOutput: properties: + acceptedAt: + format: date-time + nullable: true + type: string + acceptedBy: + nullable: true + type: string createdAt: format: date-time type: string + editSource: + type: string + editedBy: + nullable: true + type: string id: type: string quarters: @@ -67980,6 +143297,8 @@ components: $ref: '#/components/schemas/ModelsStrategyQuarterGoal' nullable: true type: array + status: + type: string updatedAt: format: date-time nullable: true @@ -68020,6 +143339,9 @@ components: format: date-time nullable: true type: string + exploitValidated: + nullable: true + type: boolean findingIds: items: type: string @@ -68045,244 +143367,890 @@ components: owner: nullable: true type: string + prBudgetPerWeek: + nullable: true + type: integer priorityLabels: items: type: string type: array - repositoryNames: + repositoryIds: + items: + type: string + type: array + severityConfidence: items: type: string type: array sortByColumns: nullable: true type: string - sortByDirection: - nullable: true + sortByDirection: + nullable: true + type: string + startDate: + format: date-time + nullable: true + type: string + summary: + nullable: true + type: string + teamIDs: + items: + type: string + type: array + title: + nullable: true + type: string + types: + items: + type: string + type: array + userNames: + items: + type: string + type: array + vulnerabilityCVEIds: + items: + type: string + type: array + vulnerabilityCWEIds: + items: + type: string + type: array + type: object + EndpointsPostCampaignOutput: + properties: + campaign: + $ref: '#/components/schemas/ModelsCampaign' + campaignId: + type: string + mappedFindingCount: + type: integer + version: + type: string + required: + - version + - campaignId + - mappedFindingCount + type: object + EndpointsPostDeduplicateEventsInput: + properties: + dryRun: + type: boolean + from: + format: date-time + nullable: true + type: string + keep: + type: string + statuses: + items: + type: string + type: array + timeoutSeconds: + nullable: true + type: integer + to: + format: date-time + nullable: true + type: string + type: object + EndpointsPostDeduplicateEventsOutput: + properties: + dryRun: + type: boolean + message: + type: string + pagesProcessed: + format: int64 + type: integer + totalDeleted: + format: int64 + type: integer + totalDupes: + format: int64 + type: integer + totalOmitted: + format: int64 + type: integer + totalProtected: + format: int64 + type: integer + totalScanned: + format: int64 + type: integer + totalUnique: + format: int64 + type: integer + version: + type: string + required: + - message + type: object + EndpointsPostManagerConfigInput: + properties: + config: + $ref: '#/components/schemas/EndpointsManagerConfigInput' + required: + - config + type: object + EndpointsPostManagerConfigOutput: + properties: + config: + $ref: '#/components/schemas/ModelsManagerConfig' + version: + type: string + required: + - config + type: object + EndpointsPostManagerGroundRulesInput: + properties: + expectedUpdatedAt: + nullable: true + type: string + groundRules: + $ref: '#/components/schemas/ModelsManagerGroundRules' + type: object + EndpointsPostManagerGroundRulesOutput: + properties: + groundRules: + $ref: '#/components/schemas/ModelsManagerGroundRules' + version: + type: string + type: object + EndpointsPostProposalDecisionInput: + properties: + decision: + enum: + - accept + - reject + type: string + proposalId: + type: string + required: + - proposalId + - decision + type: object + EndpointsPostProposalDecisionOutput: + properties: + proposal: + $ref: '#/components/schemas/ModelsProposal' + type: object + EndpointsPostStrategyProposalDecisionInput: + properties: + decision: + enum: + - accept + - reject + type: string + strategyId: + type: string + required: + - strategyId + - decision + type: object + EndpointsPostStrategyProposalDecisionOutput: + properties: + strategy: + $ref: '#/components/schemas/ModelsStrategy' + type: object + EndpointsPostThreatCatalogInvestigationInput: + properties: + action: + enum: + - investigate + - retry + - reinvestigate + type: string + required: + - action + type: object + EndpointsPostThreatInvestigationInput: + properties: + advice: + type: string + affectedPackages: + items: + $ref: '#/components/schemas/ModelsThreatInvestigationAffectedPackage' + type: array + articleLinks: + items: + type: string + type: array + cveIds: + items: + type: string + nullable: true + type: array + cvss: + format: double + type: number + description: + type: string + ecosystem: + type: string + keywords: + type: string + severity: + type: string + title: + type: string + required: + - title + type: object + EndpointsPostThreatInvestigationOutput: + properties: + existing: + type: boolean + threatInvestigation: + $ref: '#/components/schemas/ModelsThreatInvestigation' + version: + type: string + required: + - threatInvestigation + type: object + EndpointsPostThreatReportInput: + properties: + advisoryUrl: + type: string + campaign: + $ref: '#/components/schemas/EndpointsThreatReportCampaign' + cveId: + type: string + ecosystem: + type: string + packageName: + type: string + requestId: + type: string + required: + - requestId + type: object + EndpointsPostThreatReportOutput: + properties: + advisoryId: + type: string + aliases: + items: + type: string + nullable: true + type: array + existing: + type: boolean + investigationId: + type: string + researchVersion: + type: string + resubmittable: + description: The report's submission failed and the reporter may resubmit it once. + type: boolean + significance: + description: >- + What the report's research did for every customer: published_to_all (every exposed customer is + investigated), catalog_only (catalogued, not judged significant enough to investigate everyone), + operator_review (judged significant, awaiting Nullify's confirmation) or not_published. + enum: + - published_to_all + - catalog_only + - operator_review + - not_published + type: string + status: + description: >- + Advisory reports move queued to published or a failure; campaign reports move pending to matched, not_found + or not_verifiable; reporter_withdrawn is a report its reporter withdrew before research started; + unavailable, expired and submission_failed are manager-side reads. + enum: + - queued + - researching + - published + - existing + - withdrawn + - verification_failed + - no_verified_packages + - research_unavailable + - pending + - matched + - not_found + - not_verifiable + - reporter_withdrawn + - unavailable + - expired + - submission_failed + type: string + threatId: + type: string + verification: + enum: + - pending + - verified + - known + - unverified + - withdrawn + type: string + verificationReason: + type: string + version: + type: string + required: + - advisoryId + - aliases + - threatId + - status + - existing + - verification + type: object + EndpointsPutActionItemChatOutput: + properties: + chatId: + type: string + type: object + EndpointsPutGeneralChatOutput: + properties: + chatId: + type: string + type: object + EndpointsPutManagerEscalationConfigInput: + properties: + escalation: + $ref: '#/components/schemas/ModelsEscalationRouting' + required: + - escalation + type: object + EndpointsPutManagerEscalationConfigOutput: + properties: + version: + type: string + type: object + EndpointsReopenActionItemInput: + properties: + reason: + type: string + required: + - reason + type: object + EndpointsReopenActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object + EndpointsRevokeIdentityClassificationOutput: + properties: + reopenedActionItemId: + nullable: true + type: string + version: + type: string + required: + - version + type: object + EndpointsSnoozeActionItemInput: + properties: + durationDays: + maximum: 365 + minimum: 1 + type: integer + reason: + maxLength: 500 + type: string + required: + - durationDays + - reason + type: object + EndpointsSnoozeActionItemOutput: + properties: + actionItem: + $ref: '#/components/schemas/EndpointsActionItem' + version: + type: string + required: + - version + - actionItem + type: object + EndpointsThreatCatalogEntry: + properties: + failureCategory: + description: Why the latest investigation attempt failed, set only when jobStatus is FAILED + enum: + - transient_upstream + - budget_denied + - cancelled + - timeout + - research_unavailable + - inventory_unavailable + - invalid_input + - internal_error + type: string + failureMessage: + description: A fixed sentence describing failureCategory, set only when jobStatus is FAILED + type: string + inventoryFreshness: + type: string + investigationId: + type: string + isOutdated: + type: boolean + jobStatus: + description: >- + State of the newest run of this threat for the tenant, set while it is queued, running or stopped; Status + keeps a stored assessment's verdict + enum: + - QUEUED + - INVESTIGATING + - FAILED + - NOT_RUN + - DISABLED + - UNKNOWN + type: string + researchVersion: + type: string + runStatus: + type: string + status: + enum: + - NOT_ASSESSED + - QUEUED + - INVESTIGATING + - AFFECTED + - NOT_AFFECTED + - UNKNOWN + - FAILED + - DISABLED + - WITHDRAWN + - NOT_RUN + type: string + threat: + $ref: '#/components/schemas/EndpointsVulnDBThreatSummary' + required: + - threat + - status + - isOutdated + - inventoryFreshness + type: object + EndpointsThreatInvestigationProgressCounts: + properties: + affectedRepositories: + type: integer + packages: + type: integer + repositoriesChecked: + type: integer + type: object + EndpointsThreatInvestigationProgressStage: + properties: + attempt: + format: int32 + type: integer + counts: + $ref: '#/components/schemas/EndpointsThreatInvestigationProgressCounts' + createdAt: + type: string + failureCategory: + enum: + - transient_upstream + - budget_denied + - cancelled + - timeout + - research_unavailable + - inventory_unavailable + - invalid_input + - internal_error type: string - startDate: - format: date-time - nullable: true + failureMessage: + description: Tenant-safe sentence for the failure category type: string - summary: - nullable: true + id: type: string - teamIDs: - items: - type: string - type: array - teamNames: - items: - type: string - type: array - title: - nullable: true + runId: type: string - types: + stage: + enum: + - queued + - admitted + - research + - extracting_packages + - checking_inventory + - assessing_impact + - writing_report + - notifying + - retrying + - done + - failed + type: string + required: + - id + - stage + - runId + - counts + - createdAt + type: object + EndpointsThreatReportCampaign: + properties: + cveIds: items: type: string + maxItems: 10 type: array - userNames: + description: + maxLength: 4000 + type: string + packages: items: - type: string + $ref: '#/components/schemas/EndpointsThreatReportPackage' + maxItems: 20 type: array - vulnerabilityCVEIds: + referenceUrls: items: type: string + maxItems: 5 + minItems: 1 + nullable: true type: array - vulnerabilityCWEIds: + title: + maxLength: 200 + type: string + required: + - title + - description + - referenceUrls + type: object + EndpointsThreatReportEntry: + properties: + advisoryId: + type: string + advisoryUrl: + type: string + aliases: items: type: string + nullable: true type: array - type: object - EndpointsPostCampaignOutput: - properties: - campaign: - $ref: '#/components/schemas/ModelsCampaign' - campaignId: + existing: + type: boolean + investigationId: type: string - version: + kind: + enum: + - advisory + - campaign + type: string + requestId: + type: string + researchVersion: + type: string + resubmittable: + description: The report's submission failed and the reporter may resubmit it once. + type: boolean + significance: + description: >- + What the report's research did for every customer: published_to_all (every exposed customer is + investigated), catalog_only (catalogued, not judged significant enough to investigate everyone), + operator_review (judged significant, awaiting Nullify's confirmation) or not_published. + enum: + - published_to_all + - catalog_only + - operator_review + - not_published + type: string + status: + description: >- + Advisory reports move queued to published or a failure; campaign reports move pending to matched, not_found + or not_verifiable; reporter_withdrawn is a report its reporter withdrew before research started; + unavailable, expired and submission_failed are manager-side reads. + enum: + - queued + - researching + - published + - existing + - withdrawn + - verification_failed + - no_verified_packages + - research_unavailable + - pending + - matched + - not_found + - not_verifiable + - reporter_withdrawn + - unavailable + - expired + - submission_failed + type: string + submittedAt: + type: string + threatId: + type: string + title: + type: string + verification: + enum: + - pending + - verified + - known + - unverified + - withdrawn + type: string + verificationReason: type: string required: - - version - - campaignId - type: object - EndpointsPostCreditsInput: - properties: - credits: - $ref: '#/components/schemas/ModelsCreditsUpdate' - required: - - credits + - requestId + - advisoryId + - aliases + - submittedAt + - kind + - advisoryUrl + - threatId + - researchVersion + - status + - existing + - verification type: object - EndpointsPostCreditsOutput: + EndpointsThreatReportPackage: properties: - credits: - $ref: '#/components/schemas/ModelsCredits' - version: + ecosystem: + type: string + name: + type: string + versions: + description: Affected versions as a list or range type: string required: - - version - - credits + - ecosystem + - name type: object - EndpointsPostDeduplicateEventsInput: + EndpointsTriggerCampaignsOrchestratorInput: properties: - dryRun: - type: boolean - from: - format: date-time - nullable: true - type: string - keep: + campaignId: type: string - statuses: - items: - type: string - type: array - timeoutSeconds: - nullable: true - type: integer - to: + evaluationTime: format: date-time nullable: true type: string + mode: + type: string type: object - EndpointsPostDeduplicateEventsOutput: + EndpointsTriggerCampaignsOrchestratorOutput: properties: - dryRun: - type: boolean + executionArn: + type: string message: type: string - pagesProcessed: - format: int64 - type: integer - totalDeleted: - format: int64 - type: integer - totalDupes: - format: int64 - type: integer - totalOmitted: - format: int64 - type: integer - totalScanned: - format: int64 - type: integer - totalUnique: - format: int64 - type: integer + response: + type: string + runId: + type: string version: type: string required: - message type: object - EndpointsPostManagerConfigInput: + EndpointsTriggerManagerDailySummaryInput: properties: - config: - $ref: '#/components/schemas/EndpointsManagerConfigInput' + audience: + enum: + - internal + - customer + type: string required: - - config + - audience type: object - EndpointsPostManagerConfigOutput: + EndpointsTriggerManagerDailySummaryOutput: properties: - config: - $ref: '#/components/schemas/ModelsManagerConfig' - version: + executionArn: + type: string + runId: type: string required: - - config + - runId type: object - EndpointsPostManagerGroundRulesInput: + EndpointsTriggerStrategyOutput: properties: - groundRules: - $ref: '#/components/schemas/ModelsManagerGroundRules' + executionArn: + type: string + message: + type: string + runId: + type: string + version: + type: string type: object - EndpointsPostManagerGroundRulesOutput: + EndpointsTriggerTacitKnowledgeOutput: properties: - groundRules: - $ref: '#/components/schemas/ModelsManagerGroundRules' + message: + type: string version: type: string type: object - EndpointsPostThreatInvestigationInput: + EndpointsVulnDBThreatSummary: properties: - advice: - type: string - affectedPackages: + advisory_ids: items: - $ref: '#/components/schemas/ModelsThreatInvestigationAffectedPackage' + $ref: '#/components/schemas/ModelsAdvisoryReference' type: array - articleLinks: + alias_cve_ids: items: type: string type: array - cveIds: + created_at: + type: string + cve_ids: items: type: string nullable: true type: array cvss: - format: double + nullable: true type: number - description: + discovered_at: + description: When the advisory was published, when known type: string ecosystem: type: string - keywords: + enrichment_pending: + type: boolean + evidence_complete: + type: boolean + evidence_degraded: + type: boolean + evidence_quarantine: + type: string + id: + type: string + kind: + enum: + - malware + - vulnerability + - campaign + type: string + nullify_advisory_id: + type: string + research_version: type: string severity: type: string + source_links: + items: + $ref: '#/components/schemas/ModelsThreatSource' + type: array title: type: string - required: - - title - type: object - EndpointsPostThreatInvestigationOutput: - properties: - existing: - type: boolean - threatInvestigation: - $ref: '#/components/schemas/ModelsThreatInvestigation' - version: + trigger_reason: type: string - required: - - threatInvestigation + withdrawn: + type: boolean type: object - EndpointsTriggerCampaignsOrchestratorInput: + EndpointsWizardProgressInput: properties: - campaignId: - type: string - mode: + detail: type: string + step: + $ref: '#/components/schemas/ModelsOnboardingWizardStep' + required: + - step type: object - EndpointsTriggerCampaignsOrchestratorOutput: + EndpointsWizardProgressOutput: properties: - message: - type: string - response: + posted: + type: boolean + skipReason: type: string version: type: string required: - - message + - version + - posted + - skipReason type: object - EndpointsTriggerStrategyOutput: + ModelsActionItemKind: + enum: + - ESCALATED_FINDING + - TACIT_KNOWLEDGE + - UNMAPPED_USER + - UNASSIGNED_TEAM + - CONTEXT_CLARIFICATION + - STRATEGY_PROPOSAL + - CAMPAIGN_PROPOSAL + type: string + ModelsActionItemLinkType: + enum: + - sast + - sca_dependency + - sca_containerfile + - secrets_credentials + - secrets_sensitive_data + - cspm + - dast_bughunt + - dast_pentest + - scpm + type: string + ModelsActionItemResolutionMode: + enum: + - CHAT + - WIDGET_TEAM_PICKER + - WIDGET_USER_MAPPING + type: string + ModelsActionItemStatus: + enum: + - OPEN + - RESOLVING + - COMPLETED + - DISMISSED + type: string + ModelsActorKind: + enum: + - customer + - nullify_staff + - agent + type: string + ModelsAdvisoryIDSource: + enum: + - NULLIFY + - CVE + - GHSA + - MAL + - OSV + - VENDOR + type: string + ModelsAdvisoryReference: properties: - message: - type: string - version: + id: type: string + source: + $ref: '#/components/schemas/ModelsAdvisoryIDSource' + required: + - source + - id type: object - EndpointsTriggerTacitKnowledgeOutput: + ModelsAsanaCommentProvider: properties: - message: - type: string - version: + storyGid: + description: The Asana story GID type: string + required: + - storyGid type: object + ModelsAutonomyPolicy: + enum: + - explicit + - announce_with_window + - auto_within_boundaries + type: string ModelsAzureCommentProvider: properties: commentId: description: The Azure comment ID type: integer + pullRequestId: + description: The Azure pull request ID owning the comment + type: integer + repositoryId: + description: The Azure repository ID owning the comment + type: string threadId: description: The Azure thread ID type: integer @@ -68318,12 +144286,14 @@ components: type: boolean generatedReasoning: type: string + grounding: + $ref: '#/components/schemas/ModelsCampaignGrounding' id: type: string - immediateRemediation: - type: boolean isActive: type: boolean + lifecycle: + $ref: '#/components/schemas/ModelsCampaignLifecycle' metrics: $ref: '#/components/schemas/ModelsMetrics' noEndDate: @@ -68345,6 +144315,108 @@ components: format: date-time type: string type: object + ModelsCampaignCounts: + properties: + accepted: + format: int64 + type: integer + backlog: + format: int64 + type: integer + computedAt: + type: string + dismissed: + format: int64 + type: integer + duplicate: + format: int64 + type: integer + findingsWithOpenPullRequest: + format: int64 + type: integer + fixPendingVerification: + format: int64 + type: integer + fixed: + format: int64 + type: integer + fixedRatio: + $ref: '#/components/schemas/MetricdefsRatio' + inProgress: + format: int64 + type: integer + matchedAtLastRun: + format: int64 + type: integer + noLongerDetected: + format: int64 + type: integer + pullRequests: + $ref: '#/components/schemas/ModelsCampaignPullRequestCounts' + resolvedRatio: + $ref: '#/components/schemas/MetricdefsRatio' + scope: + format: int64 + type: integer + timeToFix: + $ref: '#/components/schemas/ModelsDurationStats' + required: + - scope + - matchedAtLastRun + - fixed + - fixPendingVerification + - accepted + - duplicate + - noLongerDetected + - dismissed + - inProgress + - backlog + - findingsWithOpenPullRequest + - fixedRatio + - resolvedRatio + - timeToFix + - pullRequests + - computedAt + type: object + ModelsCampaignGrounding: + properties: + evaluatedAt: + format: date-time + type: string + goalKey: + type: string + strategyId: + type: string + type: object + ModelsCampaignLifecycle: + enum: + - DRAFT + - PROPOSED + - SCHEDULED + - ACTIVE + - COMPLETED + - EXPIRED + - PAUSED + - CANCELLED + - SUPERSEDED + type: string + ModelsCampaignPortfolio: + properties: + campaigns: + format: int64 + type: integer + counts: + $ref: '#/components/schemas/ModelsCampaignCounts' + lifecycles: + items: + $ref: '#/components/schemas/ModelsCampaignLifecycle' + nullable: true + type: array + required: + - lifecycles + - campaigns + - counts + type: object ModelsCampaignPreview: properties: autofixTimeTotal: @@ -68353,6 +144425,8 @@ components: backlogSearches: minimum: 0 type: integer + counts: + $ref: '#/components/schemas/ModelsCampaignCounts' createdAt: type: string description: @@ -68376,24 +144450,9 @@ components: type: string nullable: true type: array - findingsAllowlistedCount: - minimum: 0 - type: integer - findingsCount: - minimum: 0 - type: integer - findingsInBacklogCount: - minimum: 0 - type: integer - findingsResolvedCount: - minimum: 0 - type: integer findingsWithAllowlistPRCount: minimum: 0 type: integer - findingsWithOpenAutoFixPRCount: - minimum: 0 - type: integer findingsWithOpenTicketCount: minimum: 0 type: integer @@ -68408,6 +144467,8 @@ components: type: integer isActive: type: boolean + lifecycle: + $ref: '#/components/schemas/ModelsCampaignLifecycle' mappedFindingIds: items: type: string @@ -68424,9 +144485,6 @@ components: meanTimeToPullRequestCreation: minimum: 0 type: integer - meanTimeToResolve: - minimum: 0 - type: integer meanTimeToReview: minimum: 0 type: integer @@ -68439,9 +144497,6 @@ components: medianTimeToPullRequestCreation: minimum: 0 type: integer - medianTimeToResolve: - minimum: 0 - type: integer medianTimeToReview: minimum: 0 type: integer @@ -68453,15 +144508,12 @@ components: plansGenerated: minimum: 0 type: integer - prCloseCount: - minimum: 0 + prBudgetPerWeek: + nullable: true type: integer prCommentCount: minimum: 0 type: integer - prCreateCount: - minimum: 0 - type: integer previewMessageCount: minimum: 0 type: integer @@ -68470,6 +144522,11 @@ components: $ref: '#/components/schemas/ModelsPriorityLabel' nullable: true type: array + repositoryIds: + items: + type: string + nullable: true + type: array repositoryNames: items: type: string @@ -68494,9 +144551,6 @@ components: ticketCreateCount: minimum: 0 type: integer - timeSaved: - minimum: 0 - type: integer timeSavedAssigning: minimum: 0 type: integer @@ -68520,6 +144574,82 @@ components: - isActive - mappedFindingIds type: object + ModelsCampaignPullRequestCounts: + properties: + closedUnmerged: + format: int64 + type: integer + mergeRate: + $ref: '#/components/schemas/MetricdefsRatio' + mergeReady: + $ref: '#/components/schemas/MetricdefsRatio' + merged: + format: int64 + type: integer + mergedUnclassified: + format: int64 + type: integer + opened: + format: int64 + type: integer + stillOpen: + format: int64 + type: integer + required: + - opened + - merged + - stillOpen + - closedUnmerged + - mergeRate + - mergeReady + - mergedUnclassified + type: object + ModelsCampaignTouchLedger: + properties: + githubCount: + minimum: 0 + type: integer + glanceCount: + minimum: 0 + type: integer + handsOnCount: + minimum: 0 + type: integer + mergedCount: + minimum: 0 + type: integer + mergedReviewedCount: + minimum: 0 + type: integer + mergedUnclassifiedCount: + minimum: 0 + type: integer + rejectedCount: + minimum: 0 + type: integer + reviewCount: + minimum: 0 + type: integer + stillOpenCount: + minimum: 0 + type: integer + totalCount: + minimum: 0 + type: integer + unresolvedReviewedCount: + minimum: 0 + type: integer + type: object + ModelsChatHistoryFrame: + properties: + messageId: + type: string + payload: + type: string + required: + - messageId + - payload + type: object ModelsComment: properties: body: @@ -68534,6 +144664,9 @@ components: id: description: Unique ID for the comment type: string + isBot: + description: Whether the comment author is a bot (non-Nullify automation such as dependabot or a CI bot) + type: boolean isNullify: description: Whether this is a Nullify comment type: boolean @@ -68557,6 +144690,8 @@ components: type: object ModelsCommentProvider: properties: + asana: + $ref: '#/components/schemas/ModelsAsanaCommentProvider' azure: $ref: '#/components/schemas/ModelsAzureCommentProvider' bitbucket: @@ -68576,127 +144711,74 @@ components: teams: $ref: '#/components/schemas/ModelsTeamsCommentProvider' type: object - ModelsCredits: + ModelsDeveloperEngagement: properties: - balance: - minimum: 0 + awaitingReply: + type: boolean + closedItems: + format: int64 type: integer - updatedAt: - format: date-time + displayName: type: string - required: - - balance - type: object - ModelsCreditsUpdate: - properties: - increment: + dmsFailed: format: int64 type: integer - type: object - ModelsEscalation: - properties: - campaignIds: - items: - type: string - nullable: true - type: array - createdAt: - format: date-time - type: string - findingId: - type: string - id: - type: string - pullRequestIds: - items: - type: string - type: array - reasoning: - type: string - status: - $ref: '#/components/schemas/ModelsEscalationStatus' - ticketIds: - items: - type: string - type: array - updatedAt: - format: date-time - type: string - required: - - createdAt - - updatedAt - - campaignIds - - findingId - - reasoning - - status - type: object - ModelsEscalationStatus: - enum: - - OPEN - - RESOLVED - type: string - ModelsFindingProgress: - properties: - autofixDuration: - nullable: true + dmsSent: + format: int64 type: integer - autofixedAt: - format: date-time - nullable: true - type: string - createdAt: - format: date-time - type: string - detectionDuration: - nullable: true + dmsSuppressed: + format: int64 type: integer - discoveredAt: - format: date-time + lastInteractionAt: nullable: true type: string - findingId: - type: string - findingType: - $ref: '#/components/schemas/ModelsFindingType' - inProgressAt: - format: date-time + lastReplyAt: nullable: true type: string - resolvedAt: - format: date-time + lastSentAt: nullable: true type: string - status: - $ref: '#/components/schemas/ModelsFindingStatus' - timeSaved: - nullable: true + nudgesReceived: + format: int64 type: integer - totalRemediationDuration: - nullable: true + openItems: + format: int64 type: integer - triageDuration: - nullable: true + replies: + format: int64 type: integer - triagedAt: - format: date-time - nullable: true + userId: type: string - updatedAt: - format: date-time + username: type: string required: - - createdAt - - updatedAt - - findingId - - findingType - - status - type: object - ModelsFindingStatus: + - userId + - displayName + - username + - dmsSent + - dmsSuppressed + - dmsFailed + - nudgesReceived + - replies + - openItems + - closedItems + - awaitingReply + type: object + ModelsEscalationMode: enum: - - BACKLOG - - IN_PROGRESS - - RESOLVED + - dm + - channel + - both type: string + ModelsEscalationRouting: + properties: + channelId: + type: string + channelName: + type: string + mode: + $ref: '#/components/schemas/ModelsEscalationMode' + type: object ModelsGitHubCommentProvider: properties: commentId: @@ -68739,6 +144821,13 @@ components: required: - commentId type: object + ModelsManagerCampaignStatus: + enum: + - AT_RISK + - BLOCKED + - OK + - UNKNOWN + type: string ModelsManagerConfig: properties: createdAt: @@ -68894,6 +144983,9 @@ components: prCreateCount: minimum: 0 type: integer + prMergedCount: + minimum: 0 + type: integer previewMessageCount: minimum: 0 type: integer @@ -68912,10 +145004,39 @@ components: ticketCreateCount: minimum: 0 type: integer + ticketsResolvedCount: + minimum: 0 + type: integer timeSavedAssigning: minimum: 0 type: integer type: object + ModelsOnboardingWizardStep: + enum: + - connect-codebases + - select-repositories + - connect-workflows + - configure-cloud + - questionnaire + - ready-to-start + type: string + ModelsPaceEstimate: + properties: + observedPerWeek: + format: double + type: number + requiredPerWeek: + format: double + type: number + verdict: + $ref: '#/components/schemas/ModelsPaceVerdict' + type: object + ModelsPaceVerdict: + enum: + - ACHIEVABLE + - STRETCH + - UNREALISTIC + type: string ModelsPlan: properties: createdAt: @@ -68991,6 +145112,8 @@ components: type: object ModelsPlanResponseCampaignSummary: properties: + campaignDeleted: + type: boolean campaignId: type: string content: @@ -69264,6 +145387,143 @@ components: - userId - reason type: object + ModelsProposal: + properties: + actorKind: + $ref: '#/components/schemas/ModelsActorKind' + campaignId: + nullable: true + type: string + createdAt: + format: date-time + type: string + createdBy: + nullable: true + type: string + decidedAt: + format: date-time + nullable: true + type: string + decidedBy: + nullable: true + type: string + decisionReason: + type: string + editSource: + type: string + goalKeys: + items: + type: string + nullable: true + type: array + id: + type: string + kind: + $ref: '#/components/schemas/ModelsProposalKind' + ordinal: + type: integer + pace: + $ref: '#/components/schemas/ModelsPaceEstimate' + reasoning: + type: string + revision: + type: integer + runId: + type: string + status: + $ref: '#/components/schemas/ModelsProposalStatus' + strategyId: + nullable: true + type: string + title: + type: string + updatedAt: + format: date-time + type: string + type: object + ModelsProposalCampaign: + properties: + findingsTotal: + type: integer + id: + type: string + repositories: + items: + type: string + nullable: true + type: array + severities: + items: + $ref: '#/components/schemas/ModelsSeverityCount' + nullable: true + type: array + type: object + ModelsProposalGoal: + properties: + objective: + type: string + quarter: + type: string + type: object + ModelsProposalKind: + enum: + - STRATEGY + - CAMPAIGN + type: string + ModelsProposalStatus: + enum: + - PROPOSED + - REVISED + - ACCEPTED + - REJECTED + - SUPERSEDED + - EXPIRED + type: string + ModelsProposalView: + properties: + campaign: + $ref: '#/components/schemas/ModelsProposalCampaign' + goal: + $ref: '#/components/schemas/ModelsProposalGoal' + proposal: + $ref: '#/components/schemas/ModelsProposal' + type: object + ModelsSecurityProgram: + properties: + acceptedStrategyId: + nullable: true + type: string + actorKind: + $ref: '#/components/schemas/ModelsActorKind' + announceWindowDays: + type: integer + autonomy: + $ref: '#/components/schemas/ModelsAutonomyPolicy' + capacityPerWeek: + nullable: true + type: integer + createdAt: + format: date-time + type: string + createdBy: + nullable: true + type: string + defaultCampaignDays: + type: integer + editSource: + type: string + id: + type: string + maxConcurrentCampaigns: + type: integer + minCoveragePerGoal: + type: integer + reviewCadenceDays: + type: integer + updatedAt: + format: date-time + type: string + type: object ModelsSelectionCriteria: properties: createdAfter: @@ -69274,6 +145534,9 @@ components: format: date-time nullable: true type: string + exploitValidated: + nullable: true + type: boolean findingIds: items: type: string @@ -69288,16 +145551,23 @@ components: minPriority: nullable: true type: number + prBudgetPerWeek: + nullable: true + type: integer priorityLabels: items: $ref: '#/components/schemas/ModelsPriorityLabel' nullable: true type: array - repositoryNames: + repositoryIds: items: type: string nullable: true type: array + severityConfidence: + items: + type: string + type: array sortByColumns: nullable: true type: string @@ -69309,10 +145579,6 @@ components: type: string nullable: true type: array - teamNames: - items: - type: string - type: array types: items: $ref: '#/components/schemas/ModelsFindingType' @@ -69334,6 +145600,13 @@ components: nullable: true type: array type: object + ModelsSeverityCount: + properties: + count: + type: integer + severity: + type: string + type: object ModelsSlackCommentProvider: properties: channelId: @@ -69348,9 +145621,21 @@ components: type: object ModelsStrategy: properties: + acceptedAt: + format: date-time + nullable: true + type: string + acceptedBy: + nullable: true + type: string createdAt: format: date-time type: string + editSource: + type: string + editedBy: + nullable: true + type: string id: type: string quarters: @@ -69358,6 +145643,8 @@ components: $ref: '#/components/schemas/ModelsStrategyQuarterGoal' nullable: true type: array + status: + type: string updatedAt: format: date-time nullable: true @@ -69388,6 +145675,64 @@ components: - messageId - chatId type: object + ModelsThreatCILogCheck: + properties: + checkedAt: + description: When the check ran, RFC 3339. + type: string + omittedRepos: + type: integer + repos: + items: + $ref: '#/components/schemas/ModelsThreatCILogRepo' + nullable: true + type: array + version: + type: integer + required: + - version + - checkedAt + - repos + type: object + ModelsThreatCILogRepo: + properties: + ciProvider: + description: Empty when no CI system could be read for the repository. + enum: + - github_actions + - gitlab_ci + - bitbucket_pipelines + - azure_pipelines + - buildkite + type: string + logsRead: + type: integer + reasons: + description: Why the verdict is unknown or not checked. + items: + type: string + type: array + repository: + type: string + runs: + type: integer + verdict: + enum: + - affected + - not_observed + - unknown + - not_checked + type: string + windowFrom: + description: Start of the compromise window searched, RFC 3339. + type: string + windowTo: + description: End of the compromise window searched, RFC 3339. + type: string + required: + - repository + - verdict + type: object ModelsThreatInvestigation: properties: advice: @@ -69396,20 +145741,96 @@ components: $ref: '#/components/schemas/ModelsThreatInvestigationClientImpact' createdAt: type: string + currentStage: + description: Newest recorded stage of an in-flight run, set on list reads + enum: + - queued + - admitted + - research + - extracting_packages + - checking_inventory + - assessing_impact + - writing_report + - notifying + - retrying + - done + - failed + type: string + currentStageAt: + description: When CurrentStage was recorded + format: date-time + type: string + failureCategory: + enum: + - transient_upstream + - budget_denied + - cancelled + - timeout + - research_unavailable + - inventory_unavailable + - invalid_input + - internal_error + type: string + failureMessage: + type: string generalInfo: $ref: '#/components/schemas/ModelsThreatInvestigationGeneralInfo' id: type: string + investigationVersion: + type: string keywords: type: string + legacyAssessment: + type: boolean + legacyAssessmentId: + type: string + legacyCveInvestigations: + items: + $ref: '#/components/schemas/ModelsThreatInvestigationLegacyCVE' + type: array remediation: $ref: '#/components/schemas/ModelsThreatInvestigationRemediation' report: $ref: '#/components/schemas/ModelsThreatInvestigationReport' + requestedBy: + type: string + researchVersion: + type: string + runId: + type: string + runQueued: + description: A pending dispatch job still holds the queued run + type: boolean + runRetryAt: + description: When a queued run deferred by billing or dispatch capacity is next attempted + format: date-time + type: string + runStatus: + enum: + - PENDING + - INVESTIGATING + - INVESTIGATED + - REMEDIATING + - RESOLVED + - FAILED + type: string + sourceVulnDbThreatId: + type: string status: + enum: + - PENDING + - INVESTIGATING + - INVESTIGATED + - REMEDIATING + - RESOLVED + - FAILED + - NEEDS_REINVESTIGATION type: string timeline: $ref: '#/components/schemas/ModelsThreatInvestigationTimeline' + triggerReason: + type: string type: type: string updatedAt: @@ -69422,6 +145843,8 @@ components: properties: affectedRange: type: string + attributionProvenance: + type: string attributionType: type: string ecosystem: @@ -69439,6 +145862,8 @@ components: properties: ciActivity: $ref: '#/components/schemas/ModelsThreatInvestigationCIActivity' + evidenceSource: + type: string findingId: type: string firstSeen: @@ -69447,12 +145872,18 @@ components: type: string introducedCommit: type: string + isArchived: + type: boolean isAutoFixable: type: boolean isDirect: type: boolean isRemediated: type: boolean + lastScannedAt: + format: date-time + nullable: true + type: string lastSeen: format: date-time nullable: true @@ -69472,6 +145903,8 @@ components: type: string repositoryOwner: type: string + resolvedWithoutLockfile: + type: boolean version: type: string type: object @@ -69495,17 +145928,45 @@ components: $ref: '#/components/schemas/ModelsThreatInvestigationAffectedRepo' nullable: true type: array + assessedRepoCount: + type: integer + ciLogCheck: + $ref: '#/components/schemas/ModelsThreatCILogCheck' findingIds: items: type: string type: array + impactIncomplete: + type: boolean + impactIncompleteReason: + type: string + inventoryCheckedAt: + type: string + inventoryFreshUntil: + type: string + inventoryFreshness: + type: string + outOfScopeRepoCount: + type: integer + packageVerdicts: + items: + $ref: '#/components/schemas/ModelsThreatInvestigationPackageVerdict' + type: array + pendingFindingRepoCount: + type: integer totalRepoCount: type: integer unaffectedRepoCount: type: integer + unknownRepoCount: + type: integer type: object ModelsThreatInvestigationGeneralInfo: properties: + advisoryIds: + items: + $ref: '#/components/schemas/ModelsAdvisoryReference' + type: array affectedPackages: items: $ref: '#/components/schemas/ModelsThreatInvestigationAffectedPackage' @@ -69533,10 +145994,70 @@ components: type: string history: type: string + nullifyAdvisoryId: + type: string severity: $ref: '#/components/schemas/ModelsSeverity' title: type: string + withdrawn: + type: boolean + type: object + ModelsThreatInvestigationLegacyCVE: + properties: + cveId: + type: string + failureCategory: + enum: + - transient_upstream + - budget_denied + - cancelled + - timeout + - research_unavailable + - inventory_unavailable + - invalid_input + - internal_error + type: string + investigationId: + type: string + runStatus: + enum: + - PENDING + - INVESTIGATING + - INVESTIGATED + - REMEDIATING + - RESOLVED + - FAILED + type: string + status: + enum: + - PENDING + - INVESTIGATING + - INVESTIGATED + - REMEDIATING + - RESOLVED + - FAILED + - NEEDS_REINVESTIGATION + type: string + required: + - cveId + - investigationId + - status + type: object + ModelsThreatInvestigationPackageVerdict: + properties: + checkedAt: + type: string + ecosystem: + type: string + error: + type: string + packageName: + type: string + unknownReason: + type: string + verdict: + type: string type: object ModelsThreatInvestigationRemediation: properties: @@ -69578,8 +146099,12 @@ components: type: object ModelsThreatInvestigationTimeline: properties: + customerNotifiedAt: + type: string impactAssessedAt: type: string + internalNotifiedAt: + type: string investigationCompletedAt: type: string investigationCreatedAt: @@ -69597,8 +146122,69 @@ components: threatDiscoveredAt: type: string type: object + ModelsThreatSource: + properties: + content_sha256: + type: string + domain: + type: string + extraction: + enum: + - budget_exhausted + - timed_out + - refused + - oversized + - source_conflict + type: string + fetched_at: + type: string + title: + type: string + url: + type: string + type: object SessionsChatSession: + properties: + createdAt: + description: The timestamp the chat session was created + type: string + id: + description: Unique ID for the chat session + type: string + platformId: + description: The git platform the chat was started from + type: string + tenantId: + description: The tenant that owns this chat session + type: string + title: + description: The chat session's title + type: string + updatedAt: + description: The timestamp the chat session was last updated + type: string + userId: + description: The ID of the user who owns this chat session + type: string + required: + - id + - tenantId + - userId + - createdAt + - updatedAt type: object + SessionsPurpose: + enum: + - STANDARD + - OPERATOR_GENERAL + type: string + EndpointsBackfillOnboardingDecisionSource: + enum: + - stack + - router + - prefer-router + - prefer-stack + type: string EndpointsBatchAutofixFailure: properties: errorCode: @@ -69645,52 +146231,156 @@ components: totalSucceeded: type: integer type: object - EndpointsCodeReviewsResponse: + EndpointsCheckRunResponse: properties: branch: type: string + checkName: + type: string + checkRunId: + type: string commitSha: type: string + completedAt: + format: date-time + nullable: true + type: string + conclusion: + type: string + detailsUrl: + type: string + durationSeconds: + nullable: true + type: integer + htmlUrl: + type: string id: type: string isDefaultBranch: type: boolean + overridable: + type: boolean pullRequest: $ref: '#/components/schemas/ModelsGitPullRequestProvider' + pullRequestNumber: + format: int64 + type: integer + pullRequestTitle: + type: string + pullRequestUrl: + type: string repository: $ref: '#/components/schemas/ModelsGitRepositoryProvider' + repositoryId: + type: string + repositoryName: + type: string + repositoryOwner: + type: string + result: + type: string + service: + type: string + startedAt: + format: date-time + nullable: true + type: string + state: + type: string + summary: + type: string required: - id - - branch + - checkName + - overridable + - state + - repository + - repositoryId + - repositoryName - isDefaultBranch - commitSha type: object - EndpointsCompleteOnboardingInput: + EndpointsCodeReviewsResponse: properties: - tenantId: + blockingFindings: + nullable: true + type: integer + branch: type: string - required: - - tenantId - type: object - EndpointsCompleteOnboardingOutput: - properties: - message: + checkName: type: string - status: + checkOverriddenAt: + format: date-time + nullable: true type: string - success: + checkOverriddenBy: + type: string + commitSha: + type: string + completedAt: + format: date-time + nullable: true + type: string + gateMode: + deprecated: true + description: >- + Deprecated: never_block is findingsPolicy none, block_on_confirmed_net_new is confirmed, + block_on_any_failure is confirmed with failOnIncompleteCoverage. never_block can coexist with + cvssEnforcement or failOnIncompleteCoverage, which this field does not show. Derived from gatePolicy. Read + gatePolicy instead. + enum: + - never_block + - block_on_confirmed_net_new + - block_on_any_failure + type: string + gatePolicy: + type: string + gateResult: + enum: + - clean + - findings + - incomplete + - incomplete_blocking + type: string + id: + type: string + incompleteScanners: + items: + type: string + type: array + isDefaultBranch: type: boolean - tenantId: + processedFindings: + nullable: true + type: integer + pullRequest: + $ref: '#/components/schemas/ModelsGitPullRequestProvider' + repository: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + repositoryId: type: string - timestamp: + scanConclusion: + type: string + skippedScanners: + items: + type: string + type: array + startedAt: format: date-time type: string + status: + type: string + totalFindings: + nullable: true + type: integer required: - - success - - tenantId + - id + - repositoryId + - branch + - isDefaultBranch + - commitSha - status - - message - - timestamp + - startedAt type: object EndpointsFindingTypeQuery: enum: @@ -69744,6 +146434,33 @@ components: - executionId - status type: object + EndpointsGetCheckRunsOutput: + properties: + checkRuns: + items: + $ref: '#/components/schemas/EndpointsCheckRunResponse' + nullable: true + type: array + partial: + type: boolean + repositoriesRead: + type: integer + scopeTruncated: + type: boolean + unreadableRepositories: + items: + type: string + type: array + unreadableRepositoryIds: + items: + type: string + type: array + required: + - checkRuns + - repositoriesRead + - scopeTruncated + - partial + type: object EndpointsGetCodeReviewOutput: properties: id: @@ -69758,10 +146475,19 @@ components: properties: nextToken: type: string + numItems: + type: integer reviews: - $ref: '#/components/schemas/EndpointsCodeReviewsResponse' + items: + $ref: '#/components/schemas/EndpointsCodeReviewsResponse' + nullable: true + type: array + totalCount: + type: integer required: - reviews + - numItems + - totalCount type: object EndpointsGetFindingAutofixIterationsOutput: properties: @@ -69772,17 +146498,190 @@ components: type: array version: type: string - required: - - iterations - type: object - EndpointsGetOnboardingStatusOutput: - properties: + required: + - iterations + type: object + EndpointsGetOnboardingStatusOutput: + properties: + status: + $ref: '#/components/schemas/EndpointsOnboardingStatusResponse' + version: + type: string + required: + - status + type: object + EndpointsGetRepositoryScanOutput: + properties: + branch: + type: string + commitSha: + type: string + completedAt: + type: string + error: + type: string + incompleteScanners: + items: + type: string + type: array + pullRequestNumber: + nullable: true + type: integer + repositoryId: + type: string + runId: + type: string + scanConclusion: + type: string + scanRuns: + items: + $ref: '#/components/schemas/EndpointsRepositoryScanRun' + nullable: true + type: array + services: + items: + $ref: '#/components/schemas/EndpointsRepositoryScanService' + nullable: true + type: array + skippedScanners: + items: + type: string + type: array + startedAt: + type: string + state: + enum: + - PENDING + - RUNNING + - SUCCEEDED + - FAILED + - SKIPPED + - TIMED_OUT + - ABORTED + type: string + terminal: + type: boolean + required: + - runId + - state + - repositoryId + - branch + - commitSha + - services + - scanRuns + type: object + EndpointsGetRetriageActivityOutput: + properties: + activityId: + type: string + findings: + items: + $ref: '#/components/schemas/EndpointsRetriageActivityFinding' + nullable: true + type: array + retryOfActivityId: + type: string + status: + $ref: '#/components/schemas/EndpointsRunState' + terminal: + type: boolean + version: + type: string + required: + - activityId + - status + - findings + type: object + EndpointsGetRunControlCapabilitiesOutput: + properties: + approve: + type: boolean + steer: + type: boolean + stop: + description: The generic control path can stop this run + type: boolean + stopVia: + enum: + - control_row + - stop_endpoint + type: string + required: + - stop + - steer + - approve + - stopVia + type: object + EndpointsManualOnboardingCompletion: + properties: + completedAt: + format: date-time + type: string + completedBy: + type: string + previousCompletionType: + type: string + previousStatus: + type: string + reason: + type: string + source: + type: string + required: + - completedBy + - source + - reason + - completedAt + - previousStatus + type: object + EndpointsOnboardingRequirementsOutput: + properties: + customized: + description: Nullify staff set these requirements; false means the default applies + type: boolean + required: + description: Setup items the tenant must finish before submitting onboarding + items: + type: string + nullable: true + type: array + unmet: + description: Required items the tenant's current connections do not satisfy + items: + type: string + nullable: true + type: array + required: + - required + - unmet + - customized + type: object + EndpointsOnboardingStageOutcome: + properties: + at: + format: date-time + type: string + counts: + additionalProperties: + format: int64 + type: integer + type: object + detail: + type: string + reason: + type: string + stage: + type: string status: - $ref: '#/components/schemas/EndpointsOnboardingStatusResponse' - version: + enum: + - success + - skipped + - failed type: string required: + - stage - status + - at type: object EndpointsOnboardingStatusResponse: properties: @@ -69794,6 +146693,8 @@ components: items: type: string type: array + completionType: + type: string currentPhase: type: string currentStep: @@ -69804,10 +146705,28 @@ components: type: string failedStep: type: string + isOnboarded: + type: boolean + lastCompletedStep: + type: string + manualCompletion: + $ref: '#/components/schemas/EndpointsManualOnboardingCompletion' + onboardingApprovalSet: + type: boolean progressPct: type: integer + recordMissing: + type: boolean + repositories: + items: + type: string + type: array repositoriesProcessed: type: integer + stageOutcomes: + items: + $ref: '#/components/schemas/EndpointsOnboardingStageOutcome' + type: array startedAt: format: date-time type: string @@ -69825,9 +146744,12 @@ components: format: date-time type: string required: + - isOnboarded + - onboardingApprovalSet - tenantId - startedAt - updatedAt + - recordMissing type: object EndpointsPostBatchAutofixInput: properties: @@ -69871,38 +146793,90 @@ components: - executionArn - message type: object - EndpointsPostRetriageFindingsAggregation: + EndpointsPostCheckRunOverrideInput: properties: - comments: - items: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsComment' - type: array - requestCount: - type: integer + checkName: + description: The exact name of the check run to override + type: string + commitSha: + description: The commit the check run is on + type: string + reason: + description: Why the check is being overridden + maxLength: 1000 + type: string + repository: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + required: + - repository + - commitSha + - checkName type: object - EndpointsPostRetriageFindingsAuthor: + EndpointsPostCheckRunOverrideOutput: properties: - id: + auditRecorded: + description: Whether the override was stored in Nullify's audit log + type: boolean + checkRun: + $ref: '#/components/schemas/EndpointsCheckRunResponse' + required: + - checkRun + - auditRecorded + type: object + EndpointsPostCloseFindingTicketInput: + properties: + actorId: + type: string + findingType: + $ref: '#/components/schemas/EndpointsFindingTypeQuery' + reason: + type: string + resolution: type: string + required: + - findingType type: object - EndpointsPostRetriageFindingsComment: + EndpointsPostCloseFindingTicketOutput: properties: - content: + alreadyClosed: + type: boolean + message: type: string - findingId: + success: + type: boolean + ticketIdentifier: type: string - id: + version: type: string - memoryId: - nullable: true + required: + - success + type: object + EndpointsPostIterateAutofixPRInput: + properties: + ownerProvider: + $ref: '#/components/schemas/ModelsOwnerProvider' + pullRequest: + $ref: '#/components/schemas/ModelsGitPullRequestProvider' + reason: type: string - nodeId: - nullable: true + repository: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + required: + - ownerProvider + - repository + - pullRequest + type: object + EndpointsPostIterateAutofixPROutput: + properties: + accepted: + type: boolean + message: type: string - timestamp: + version: type: string - user: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsUser' + required: + - accepted + - message type: object EndpointsPostRetriageFindingsInput: properties: @@ -69915,27 +146889,24 @@ components: findingType: type: string message: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsMessage' + $ref: '#/components/schemas/ModelsRetriageMessage' platformProvider: type: string + retryOfActivityId: + type: string triggerSource: $ref: '#/components/schemas/ModelsRetriageTriggerSource' required: - findingType type: object - EndpointsPostRetriageFindingsMessage: - properties: - aggregation: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsAggregation' - author: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsAuthor' - comment: - $ref: '#/components/schemas/EndpointsPostRetriageFindingsComment' - gitOwnerProvider: - $ref: '#/components/schemas/ModelsOwnerProvider' - type: object EndpointsPostRetriageFindingsOutput: properties: + activityId: + type: string + failedFindingIds: + items: + type: string + type: array message: type: string messageId: @@ -69946,15 +146917,137 @@ components: - messageId - message type: object - EndpointsPostRetriageFindingsUser: + EndpointsPostRunControlInput: properties: - id: + action: + description: What to do to the run + enum: + - stop + - steer + - approve + - deny type: string - name: + approvalId: + description: The approval.requested id an approve or deny answers + type: string + idempotencyKey: + description: Client-generated key; a retry with the same key records one control row + maxLength: 64 + minLength: 8 + type: string + message: + description: Steering instruction, sent to the agent as a user message + maxLength: 2000 + type: string + required: + - action + - idempotencyKey + type: object + EndpointsPostRunControlOutput: + properties: + controlId: + description: The idempotency key the control row was recorded under + type: string + duplicate: + description: True when the key had already been recorded + type: boolean + required: + - controlId + - duplicate + type: object + EndpointsRepositoryScanRun: + properties: + completedAt: + type: string + errorMessage: + type: string + fixedFindingsCount: + type: integer + liveFindingsCount: + type: integer + newFindingsCount: + type: integer + scanRunId: + type: string + scanType: + type: string + service: + $ref: '#/components/schemas/EndpointsRepositoryScanService' + severity: + $ref: '#/components/schemas/EndpointsScanSeverityCounts' + startedAt: + type: string + status: + type: string + terminal: + type: boolean + required: + - service + - scanType + - scanRunId + - status + type: object + EndpointsRepositoryScanService: + enum: + - sast + - sca + - secrets + - scpm + type: string + EndpointsRepositoryScanTriage: + enum: + - 'on' + - 'off' + type: string + EndpointsRetriageActivityFinding: + properties: + executionArn: + type: string + findingId: + type: string + findingType: + type: string + reason: + type: string + status: + $ref: '#/components/schemas/EndpointsRetriageFindingStatus' + updatedAt: type: string + required: + - findingId + - findingType + - status + type: object + EndpointsRetriageFindingStatus: + enum: + - queued + - dispatched + - completed + - incomplete + - failed + - denied + - deferred + - not_needed + type: string + EndpointsScanSeverityCounts: + properties: + critical: + type: integer + high: + type: integer + low: + type: integer + medium: + type: integer type: object EndpointsStartOnboardingInput: properties: + allRepositories: + type: boolean + bypassRequirements: + type: boolean + force: + type: boolean gitOwnerProvider: $ref: '#/components/schemas/ModelsOwnerProvider' repositoryIds: @@ -69975,6 +147068,105 @@ components: required: - message type: object + EndpointsStartPullRequestReviewOutput: + properties: + alreadyRunning: + type: boolean + commitSha: + type: string + pullRequestNumber: + type: integer + repositoryId: + type: string + runId: + description: Pipeline run id to poll + type: string + sourceBranch: + type: string + targetBranch: + type: string + required: + - runId + - repositoryId + - pullRequestNumber + - sourceBranch + - commitSha + type: object + EndpointsStartRepositoryScanInput: + properties: + branch: + description: Branch to scan; must be the default branch, which is also the default + type: string + commitSha: + description: Expected head commit; the scan is refused when the branch head differs + type: string + fullHistory: + description: >- + Run the secrets scan over the repository's full git history, even when a baseline exists, instead of the + head commit alone. Requires the secrets scanner; Nullify staff and services only. Other scanners ignore it + type: boolean + regenerateContext: + description: >- + Regenerate the commit's repo context and SBOM instead of reusing stored ones. Requires scopeBackfill; + Nullify service callers only + type: boolean + scopeBackfill: + description: Marks a scan scope widening's backfill. Nullify service callers only; refused for anyone else + type: boolean + services: + description: 'Scanners to run: sast, sca, secrets, scpm' + items: + $ref: '#/components/schemas/EndpointsRepositoryScanService' + minItems: 1 + nullable: true + type: array + triage: + $ref: '#/components/schemas/EndpointsRepositoryScanTriage' + required: + - services + type: object + EndpointsStartRepositoryScanOutput: + properties: + alreadyRunning: + description: The branch already had a run in flight; runId names that run + type: boolean + branch: + type: string + commitSha: + type: string + queued: + description: >- + A scan scope backfill found a run in flight and was queued to start after it, retrying with bounded backoff; + runId is empty until the push pipeline claims a run + type: boolean + repositoryId: + type: string + runId: + description: Pipeline run id to poll + type: string + services: + items: + $ref: '#/components/schemas/EndpointsRepositoryScanService' + nullable: true + type: array + sideEffects: + description: >- + What the started run does besides the chosen scanners once the push handler dispatches it: commit-check-run, + repo-context-preflight, sbom-generation. A run the handler skips (onboarding gate, a review already in + progress) does none of them. Empty when alreadyRunning: this request started nothing, and the in-flight run + carries its own triage setting + items: + type: string + nullable: true + type: array + required: + - runId + - repositoryId + - branch + - commitSha + - services + - sideEffects + type: object ModelsAutofixIteration: properties: agentVersion: @@ -70002,12 +147194,6 @@ components: type: integer iterationNumber: type: integer - langfuseSessionID: - nullable: true - type: string - langfuseTraceID: - nullable: true - type: string llmCostUSD: nullable: true type: number @@ -70027,6 +147213,9 @@ components: $ref: '#/components/schemas/ModelsAutofixIterationStatus' tenantID: type: string + terminalReason: + nullable: true + type: string triggerEventID: nullable: true type: string @@ -70053,12 +147242,428 @@ components: type: string ModelsAutofixIterationTriggerType: enum: + - generate_preview - create_pr - ci_failure - code_review - user_comment - rerun type: string + ModelsAzureGitBuildProvider: + properties: + commitSha: + description: The Azure build commit SHA + type: string + genre: + description: The Azure commit status genre (GitStatusContext.Genre) + type: string + name: + description: The Azure commit status name (GitStatusContext.Name) + type: string + pullRequestId: + description: The Azure pull request ID the status is also published on + type: integer + targetUrl: + description: The Azure commit status target URL, which names the pipeline run + type: string + required: + - commitSha + type: object + ModelsBitbucketGitBuildProvider: + properties: + checkId: + description: The Bitbucket check run ID + type: string + commitSha: + description: The Bitbucket build commit SHA + type: string + required: + - checkId + - commitSha + type: object + ModelsBuildkiteGitBuildProvider: + properties: + buildNumber: + description: Buildkite build number + type: integer + commitSha: + description: The commit SHA the build ran on + type: string + completedAt: + description: Build completion time + format: date-time + type: string + jobId: + description: Buildkite job UUID + type: string + orgSlug: + description: Buildkite organization slug + type: string + pipelineSlug: + description: Buildkite pipeline slug + type: string + startedAt: + description: Build start time + format: date-time + type: string + required: + - orgSlug + - pipelineSlug + - buildNumber + - commitSha + - startedAt + - completedAt + type: object + ModelsChatCommentReference: + properties: + content: + type: string + findingId: + type: string + id: + type: string + memoryId: + nullable: true + type: string + nodeId: + nullable: true + type: string + timestamp: + type: string + user: + $ref: '#/components/schemas/ModelsUser' + required: + - id + - content + - user + - timestamp + - findingId + type: object + ModelsCommit: + properties: + author: + $ref: '#/components/schemas/ModelsUser' + coAuthoredByNullify: + description: Whether Nullify co-authored this commit + type: boolean + committedAt: + description: >- + When the commit was committed, which differs from the authored time for a rebased, amended or cherry-picked + commit. Zero where the provider does not expose a committer date + format: date-time + type: string + createdAt: + description: The commit timestamp + format: date-time + type: string + message: + description: The commit message + type: string + sha: + description: The commit SHA + type: string + timestamp: + description: The commit timestamp + format: date-time + type: string + required: + - sha + - message + - author + - createdAt + - timestamp + - coAuthoredByNullify + type: object + ModelsGitBuild: + type: object + ModelsGitBuildProvider: + properties: + azure: + $ref: '#/components/schemas/ModelsAzureGitBuildProvider' + bitbucket: + $ref: '#/components/schemas/ModelsBitbucketGitBuildProvider' + buildkite: + $ref: '#/components/schemas/ModelsBuildkiteGitBuildProvider' + gitHub: + $ref: '#/components/schemas/ModelsGitHubGitBuildProvider' + gitLab: + $ref: '#/components/schemas/ModelsGitLabGitBuildProvider' + id: + $ref: '#/components/schemas/ModelsProviderID' + statusApi: + $ref: '#/components/schemas/ModelsStatusAPIGitBuildProvider' + type: object + ModelsGitHubGitBuildProvider: + properties: + buildId: + description: The GitHub build ID + format: int64 + type: integer + checkId: + description: The GitHub check run ID + format: int64 + type: integer + commitSha: + description: The commit SHA the build was run on + type: string + completedAt: + description: The GitHub build completion time + format: date-time + type: string + executionIdentity: + $ref: '#/components/schemas/ModelsGitHubExecutionIdentity' + startedAt: + description: The GitHub build start time + format: date-time + type: string + required: + - checkId + - buildId + - startedAt + - completedAt + - commitSha + type: object + ModelsGitLabGitBuildProvider: + properties: + commitSha: + description: The GitLab build commit SHA + type: string + jobId: + description: The GitLab job ID + type: integer + pipelineId: + description: The GitLab build pipeline ID + type: integer + required: + - commitSha + - jobId + - pipelineId + type: object + ModelsPullRequest: + properties: + additions: + type: integer + branchName: + type: string + builds: + items: + $ref: '#/components/schemas/ModelsGitBuild' + nullable: true + type: array + changed_files: + type: integer + closed_at: + type: string + commits: + items: + $ref: '#/components/schemas/ModelsCommit' + nullable: true + type: array + creationTime: + format: date-time + type: string + deletions: + type: integer + description: + type: string + diff: + type: string + diffThreads: + items: + $ref: '#/components/schemas/ModelsPullRequestReviewDiffThread' + nullable: true + type: array + discussionComments: + items: + $ref: '#/components/schemas/ModelsComment' + nullable: true + type: array + gitPullRequestProvider: + $ref: '#/components/schemas/ModelsGitPullRequestProvider' + gitRepositoryProvider: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + id: + type: integer + isCreatedByNullify: + type: boolean + isDraft: + type: boolean + isMerged: + type: boolean + isOpen: + type: boolean + link: + type: string + merge_commit_sha: + type: string + mergeable: + type: boolean + mergeable_state: + type: string + merged_at: + type: string + merged_by: + $ref: '#/components/schemas/ModelsUser' + numCommits: + type: integer + ownerProvider: + $ref: '#/components/schemas/ModelsOwnerProvider' + rebaseable: + type: boolean + reviewers: + items: + $ref: '#/components/schemas/ModelsUser' + nullable: true + type: array + reviews: + items: + $ref: '#/components/schemas/ModelsPullRequestReview' + nullable: true + type: array + reviewsIncomplete: + type: boolean + sourceBranch: + type: string + sourceHead: + type: string + targetBranch: + type: string + targetHead: + type: string + title: + type: string + updatedAt: + format: date-time + type: string + required: + - id + - ownerProvider + - gitRepositoryProvider + - gitPullRequestProvider + - link + - title + - reviewers + - description + - creationTime + - isCreatedByNullify + - isOpen + - isMerged + - isDraft + - branchName + - sourceBranch + - sourceHead + - targetBranch + - targetHead + - numCommits + - commits + - builds + - diffThreads + - discussionComments + type: object + ModelsPullRequestReview: + properties: + Body: + type: string + ID: + format: int64 + type: integer + IsBot: + type: boolean + IsNullify: + type: boolean + NodeID: + type: string + ReviewerUsername: + type: string + State: + $ref: '#/components/schemas/ModelsPullRequestReviewState' + SubmittedAt: + format: date-time + type: string + UpdatedAt: + format: date-time + type: string + type: object + ModelsPullRequestReviewDiffThread: + properties: + commentHistory: + description: The history of comments + items: + $ref: '#/components/schemas/ModelsComment' + nullable: true + type: array + diffHunk: + description: The diff hunk being discussed + type: string + endLine: + description: The ending line number + type: integer + filePath: + description: The file path being commented on + type: string + isNullifyAuthored: + description: Whether Nullify authored the root comment of this thread + type: boolean + isResolved: + description: Whether the thread is resolved + type: boolean + newComment: + $ref: '#/components/schemas/ModelsComment' + provider: + $ref: '#/components/schemas/ModelsCommentProvider' + snapshotIncomplete: + type: boolean + startLine: + description: The starting line number + type: integer + required: + - provider + - filePath + - startLine + - endLine + - isResolved + - diffHunk + - commentHistory + type: object + ModelsPush: + properties: + after: + type: string + before: + type: string + commits: + items: + $ref: '#/components/schemas/ModelsCommit' + type: array + ref: + type: string + repository: + type: string + required: + - ref + - before + - after + - repository + type: object + ModelsRetriageAggregationInfo: + properties: + comments: + items: + $ref: '#/components/schemas/ModelsChatCommentReference' + type: array + messageIds: + items: + type: string + type: array + requestCount: + type: integer + triggerSources: + items: + $ref: '#/components/schemas/ModelsRetriageTriggerSource' + type: array + required: + - requestCount + type: object ModelsRetriageFilters: properties: branch: @@ -70095,23 +147700,127 @@ components: required: - findingIds type: object + ModelsRetriageMessage: + properties: + activityIds: + items: + type: string + type: array + aggregation: + $ref: '#/components/schemas/ModelsRetriageAggregationInfo' + author: + $ref: '#/components/schemas/ModelsUser' + cloneUrl: + type: string + comment: + $ref: '#/components/schemas/ModelsChatCommentReference' + contextPresignedURL: + type: string + entrypoints: + additionalProperties: + items: + type: string + type: array + type: object + gitBuildProvider: + $ref: '#/components/schemas/ModelsGitBuildProvider' + gitOwnerProvider: + $ref: '#/components/schemas/ModelsOwnerProvider' + gitRepositoryProvider: + $ref: '#/components/schemas/ModelsGitRepositoryProvider' + headCommit: + $ref: '#/components/schemas/ModelsCommit' + pullRequestProvider: + $ref: '#/components/schemas/ModelsGitPullRequestProvider' + pullrequest: + $ref: '#/components/schemas/ModelsPullRequest' + push: + $ref: '#/components/schemas/ModelsPush' + repoSizeGiB: + format: int32 + type: integer + requester: + $ref: '#/components/schemas/ModelsRetriageRequester' + scanCommitSHA: + type: string + skipScanHistory: + type: boolean + ticketProvider: + $ref: '#/components/schemas/ModelsTicketProvider' + timestamp: + type: string + tool: + type: string + toolGroup: + $ref: '#/components/schemas/ModelsFindingType' + traceAttributes: + additionalProperties: + type: string + type: object + required: + - headCommit + - ticketProvider + type: object + ModelsRetriageRequester: + enum: + - human + type: string ModelsRetriageTriggerSource: enum: - api + - admin_manual - chat_comment - scheduled - webhook - node_memory - qa_answer + - cli - mixed - other type: string + ModelsStatusAPIGitBuildProvider: + properties: + commitSha: + description: The commit SHA the build ran on + type: string + context: + description: GitHub status context string identifying the CI provider and pipeline + type: string + createdAt: + description: When the status was created + format: date-time + type: string + targetUrl: + description: URL to the CI build page + type: string + required: + - commitSha + - createdAt + type: object + EndpointsDeleteTicketSASTFindingOutput: + properties: + version: + type: string + type: object + EndpointsFindingCorrectionOperation: + enum: + - reopen + - fix_attribution + - delete_event + type: string EndpointsFindingSortBy: enum: - '' - time - priority type: string + EndpointsFindingTriageStatus: + enum: + - pending + - completed + - incomplete + - failed + type: string EndpointsGetSASTEventsOutput: properties: events: @@ -70155,6 +147864,8 @@ components: $ref: '#/components/schemas/ModelsSASTEventInterface' nullable: true type: array + nextToken: + type: string numItems: type: integer version: @@ -70203,11 +147914,20 @@ components: properties: finding: $ref: '#/components/schemas/ModelsTriagedSASTFinding' + hasCurrentExploitProof: + type: boolean presignedUrl: type: string + stopReason: + type: string + triageStatus: + $ref: '#/components/schemas/EndpointsFindingTriageStatus' version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' required: + - triageStatus - presignedUrl type: object EndpointsGetSASTFindingUsersOutput: @@ -70374,6 +148094,8 @@ components: $ref: '#/components/schemas/ModelsAutoFixState' error: type: string + runId: + type: string version: type: string required: @@ -70411,6 +148133,67 @@ components: required: - unallowlistReason type: object + EndpointsSCAScanRunOutcome: + properties: + coverageGaps: + items: + $ref: '#/components/schemas/ModelsSCAScanCoverageGap' + nullable: true + type: array + degraded: + type: boolean + failureStage: + enum: + - clone + - entrypoints + - sbom_resolve + - sbom_download + - vuln_lookup + - metadata + - baseline + - persist + nullable: true + type: string + keptLiveCoverage: + nullable: true + type: integer + keptLiveNotSeenInSbom: + nullable: true + type: integer + keptLivePackageGate: + nullable: true + type: integer + keptLiveUnchangedManifests: + nullable: true + type: integer + sbomAuthoritative: + nullable: true + type: boolean + sbomFailureClass: + enum: + - oom + - disk_full + - timeout + - cdxgen_error + - no_components + - input_too_large + - guest_error + - unstable + - unsupported + - registry_auth + - other + nullable: true + type: string + sbomIncomplete: + nullable: true + type: boolean + sbomSource: + nullable: true + type: string + ticketsReopenSkipped: + nullable: true + type: integer + type: object EndpointsScanRunSort: enum: - newest @@ -70440,6 +148223,8 @@ components: type: integer reintroducedFindingsCount: type: integer + scaOutcome: + $ref: '#/components/schemas/EndpointsSCAScanRunOutcome' scanCompletedAt: nullable: true type: string @@ -70461,13 +148246,6 @@ components: triggerType: type: string type: object - ModelsAssessmentFactor: - properties: - description: - type: string - title: - type: string - type: object ModelsCandidate: properties: reason: @@ -70510,6 +148288,25 @@ components: nullable: true type: string type: object + ModelsExploitEvidenceAttachment: + properties: + contentType: + type: string + id: + type: string + kind: + type: string + required: + - id + - kind + - contentType + type: object + ModelsFindingResolution: + enum: + - false_positive + - fixed + - not_latest + type: string ModelsFixSource: enum: - nullify_autofix @@ -70517,16 +148314,6 @@ components: - ai_code_review - auto_resolved type: string - ModelsInvestigationStep: - properties: - details: - items: - type: string - nullable: true - type: array - title: - type: string - type: object ModelsSASTEventInterface: properties: data: {} @@ -70624,6 +148411,10 @@ components: type: string cwe: type: integer + cweIds: + items: + type: integer + type: array deletedAt: format: date-time type: string @@ -70633,6 +148424,10 @@ components: type: string endLine: type: integer + endLines: + items: + type: integer + type: array entrypoint: type: string exploitabilityConfidence: @@ -70651,6 +148446,8 @@ components: type: string fixCommit: type: string + fixEvidence: + $ref: '#/components/schemas/ModelsFixEvidence' fixSource: $ref: '#/components/schemas/ModelsFixSource' fixedAt: @@ -70679,6 +148476,8 @@ components: type: boolean isFixed: type: boolean + isInternetReachable: + type: boolean isLatest: type: boolean isResolved: @@ -70711,6 +148510,8 @@ components: items: $ref: '#/components/schemas/ModelsPullRequestInfo' type: array + pureInsertion: + type: boolean repository: type: string repositoryId: @@ -70718,10 +148519,40 @@ components: resolvedAt: format: date-time type: string + ruleConfidence: + format: double + type: number + ruleConfidenceLabel: + type: string + ruleHash: + type: string ruleId: type: string + ruleIds: + items: + type: string + type: array + ruleImpact: + format: double + type: number + ruleImpactLabel: + type: string + ruleLikelihood: + format: double + type: number + ruleLikelihoodLabel: + type: string + ruleSeverity: + format: double + type: number + ruleSeverityLabel: + type: string ruleUrl: type: string + ruleUrls: + items: + type: string + type: array severity: $ref: '#/components/schemas/ModelsSeverity' severityConfidence: @@ -70734,6 +148565,10 @@ components: type: integer startLine: type: integer + startLines: + items: + type: integer + type: array tenantId: type: string ticket: @@ -70750,12 +148585,6 @@ components: format: date-time nullable: true type: string - triageLangfuseSessionId: - nullable: true - type: string - triageLangfuseTraceId: - nullable: true - type: string triageLlmCostUsd: nullable: true type: number @@ -70766,6 +148595,9 @@ components: format: date-time nullable: true type: string + triageStopReason: + nullable: true + type: string triageTokenCount: nullable: true type: integer @@ -70816,8 +148648,16 @@ components: type: string cwe: type: integer + cweIds: + items: + type: integer + type: array endLine: type: integer + endLines: + items: + type: integer + type: array entrypoint: type: string fileOwners: @@ -70837,6 +148677,9 @@ components: type: boolean isArchived: type: boolean + isAutoFixable: + nullable: true + type: boolean isCloudTriaged: type: boolean isFalsePositive: @@ -70875,12 +148718,24 @@ components: type: string ruleId: type: string + ruleIds: + items: + type: string + type: array ruleUrl: type: string + ruleUrls: + items: + type: string + type: array severity: $ref: '#/components/schemas/ModelsSeverity' startLine: type: integer + startLines: + items: + type: integer + type: array tenantId: type: string ticket: @@ -70944,6 +148799,50 @@ components: - graphExists - isCloudTriaged type: object + ModelsSCAScanCoverageGap: + properties: + ecosystems: + items: + type: string + type: array + packageAuth: + items: + $ref: '#/components/schemas/ModelsSBOMPackageAuth' + type: array + reason: + type: string + scope: + type: string + side: + enum: + - source + - target + type: string + source: + enum: + - sbom + - vulndb + - container + type: string + status: + type: string + suspect: + $ref: '#/components/schemas/ModelsSCASuspectSBOM' + touchedByChange: + type: boolean + type: object + ModelsSCASuspectSBOM: + properties: + firstSeen: + format: date-time + type: string + loss: + type: string + sha256: + type: string + version: + type: integer + type: object ModelsTriagedSASTFinding: properties: agentVersion: @@ -70955,6 +148854,10 @@ components: type: array codeContext: $ref: '#/components/schemas/ModelsCodeContext' + exploitEvidence: + items: + $ref: '#/components/schemas/ModelsExploitEvidenceAttachment' + type: array falsePositiveReason: nullable: true type: string @@ -70988,6 +148891,11 @@ components: - orgContextVersion - repoContextVersion type: object + EndpointsDeleteTicketSCAFindingOutput: + properties: + version: + type: string + type: object EndpointsGetSCAContainerFindingAutofixStateOutput: properties: status: @@ -71013,6 +148921,8 @@ components: $ref: '#/components/schemas/ModelsSCAEventInterface' nullable: true type: array + nextToken: + type: string numItems: type: integer version: @@ -71034,12 +148944,23 @@ components: properties: finding: $ref: '#/components/schemas/ModelsTriagedContainerFinding' + historicalReportUrl: + type: string presignedUrl: type: string + stopReason: + type: string + supportAssessment: + $ref: '#/components/schemas/ModelsAssessment' + triageStatus: + $ref: '#/components/schemas/EndpointsFindingTriageStatus' version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' required: - presignedUrl + - triageStatus type: object EndpointsGetSCAContainerFindingUsersOutput: properties: @@ -71114,6 +149035,8 @@ components: $ref: '#/components/schemas/ModelsSCAEventInterface' nullable: true type: array + nextToken: + type: string numItems: type: integer version: @@ -71124,6 +149047,8 @@ components: type: object EndpointsGetSCADependencyFindingFixOutput: properties: + commit: + type: string diffs: items: $ref: '#/components/schemas/ModelsDiffFile' @@ -71153,15 +149078,37 @@ components: properties: finding: $ref: '#/components/schemas/ModelsTriagedDependencyFinding' + hasCurrentExploitProof: + type: boolean + historicalReportUrl: + type: string presignedUrl: type: string + stopReason: + type: string + supportAssessment: + $ref: '#/components/schemas/ModelsAssessment' + triageStatus: + $ref: '#/components/schemas/EndpointsFindingTriageStatus' version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' required: - presignedUrl + - triageStatus type: object EndpointsGetSCADependencyFindingUsersOutput: properties: + sourceOwner: + $ref: '#/components/schemas/ModelsCandidate' + sourceOwnerCommitSha: + type: string + sourceOwnerStatus: + enum: + - available + - unavailable + type: string users: items: $ref: '#/components/schemas/ModelsCandidate' @@ -71253,14 +149200,100 @@ components: required: - repository type: object - EndpointsGetSCARepositorySBOMOutput: + EndpointsGetSCAThreatFeedOutput: properties: - sbom: - $ref: '#/components/schemas/ModelsCDXGen' - version: + nextOffset: + nullable: true + type: integer + threats: + items: + $ref: '#/components/schemas/EndpointsSCAThreatFeedEntry' + nullable: true + type: array + required: + - threats + type: object + EndpointsGetSCAThreatFeedThreatOutput: + properties: + threat: + $ref: '#/components/schemas/EndpointsSCAThreatFeedThreat' + required: + - threat + type: object + EndpointsGetSCAVulnerabilitiesOutput: + properties: + evaluatedAt: type: string + kevOverlayApplied: + type: boolean + nextOffset: + nullable: true + type: integer + repositoriesInScope: + type: boolean + reviewedRepositoryCount: + type: integer + totalCount: + type: integer + vulnerabilities: + items: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityFleetEntry' + nullable: true + type: array required: - - sbom + - vulnerabilities + - totalCount + - kevOverlayApplied + - repositoriesInScope + - reviewedRepositoryCount + type: object + EndpointsGetSCAVulnerabilityFindingsOutput: + properties: + containerFindings: + items: + $ref: '#/components/schemas/ModelsSCAContainerfileFindingPreview' + type: array + dependencyFindings: + items: + $ref: '#/components/schemas/ModelsSCADependencyFindingPreview' + type: array + nextOffset: + nullable: true + type: integer + type: object + EndpointsGetSCAVulnerabilityOutput: + properties: + cveId: + type: string + exposure: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityExposure' + intel: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityIntel' + required: + - cveId + - exposure + type: object + EndpointsGetSCAVulnerabilityPackagesOutput: + properties: + packages: + items: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityPackage' + nullable: true + type: array + required: + - packages + type: object + EndpointsGetTriageActivityLogOutput: + properties: + entries: + items: + $ref: '#/components/schemas/EndpointsTriageActivityLogEntry' + nullable: true + type: array + nextCursor: + type: string + required: + - entries type: object EndpointsPatchSCAContainerFindingInput: properties: @@ -71318,6 +149351,21 @@ components: - allowlistReason - allowlistType type: object + EndpointsPostCreateTicketContainerFindingInput: + properties: + assignees: + items: + $ref: '#/components/schemas/ModelsUser' + type: array + campaignId: + type: string + campaignTitle: + type: string + message: + type: string + project: + type: string + type: object EndpointsPostCreateTicketDependencyFindingInput: properties: assignees: @@ -71362,6 +149410,8 @@ components: $ref: '#/components/schemas/ModelsAutoFixState' error: type: string + runId: + type: string version: type: string required: @@ -71387,6 +149437,8 @@ components: $ref: '#/components/schemas/ModelsAutoFixState' error: type: string + runId: + type: string version: type: string required: @@ -71406,10 +149458,400 @@ components: required: - unallowlistReason type: object + EndpointsSCAThreatFeedAffectedPackage: + properties: + affectedRange: + type: string + ecosystem: + type: string + name: + type: string + required: + - name + - ecosystem + type: object + EndpointsSCAThreatFeedEntry: + properties: + createdAt: + type: string + cveIds: + items: + type: string + nullable: true + type: array + cvss: + nullable: true + type: number + discoveredAt: + type: string + ecosystem: + type: string + id: + type: string + severity: + type: string + title: + type: string + required: + - id + - title + - severity + - cveIds + - createdAt + type: object + EndpointsSCAThreatFeedThreat: + properties: + affectedPackages: + items: + $ref: '#/components/schemas/EndpointsSCAThreatFeedAffectedPackage' + nullable: true + type: array + articleLinks: + items: + type: string + type: array + createdAt: + type: string + cveIds: + items: + type: string + nullable: true + type: array + cvss: + nullable: true + type: number + description: + type: string + discoveredAt: + type: string + ecosystem: + type: string + id: + type: string + severity: + type: string + title: + type: string + required: + - id + - title + - severity + - cveIds + - createdAt + - affectedPackages + type: object + EndpointsSCAVulnerabilityCVSS: + properties: + baseScore: + format: double + type: number + exploitabilityScore: + format: double + type: number + impactScore: + format: double + type: number + vectorString: + type: string + version: + type: string + required: + - version + - baseScore + - vectorString + type: object + EndpointsSCAVulnerabilityDataSource: + enum: + - nvd_mirror + - vuln_database + - finding_snapshot + - epss_live + type: string + EndpointsSCAVulnerabilityEPSS: + properties: + percentile: + format: double + type: number + score: + format: double + type: number + scoredAt: + type: string + source: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityDataSource' + required: + - score + - source + type: object + EndpointsSCAVulnerabilityExposure: + properties: + containerFindingCount: + type: integer + dependencyFindingCount: + type: integer + evaluatedAt: + type: string + findingCount: + type: integer + firstSeenAt: + type: string + fixableCount: + description: Open findings that have a fix available + type: integer + kev: + type: boolean + kevUnknown: + description: No finding records this CVE as KEV-listed and at least one Review could not check the catalog + type: boolean + maxCvss: + format: double + type: number + maxEpss: + format: double + type: number + maxSeverity: + $ref: '#/components/schemas/ModelsSeverity' + openFindingCount: + type: integer + packageCount: + description: Distinct packages or artifacts carried by open findings + type: integer + reachableCount: + description: Open findings with a reachable call path + type: integer + repositoryCount: + description: Repositories with an open finding for this CVE + type: integer + resolvedFindingCount: + type: integer + reviewedRepositoryCount: + type: integer + totalRepositoryCount: + type: integer + verdict: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityVerdict' + required: + - verdict + - findingCount + - openFindingCount + - resolvedFindingCount + - dependencyFindingCount + - containerFindingCount + - repositoryCount + - packageCount + - reachableCount + - fixableCount + - reviewedRepositoryCount + - totalRepositoryCount + - kev + type: object + EndpointsSCAVulnerabilityFindingType: + enum: + - dependency + - container + type: string + EndpointsSCAVulnerabilityFleetEntry: + properties: + cveId: + type: string + findingCount: + type: integer + firstSeenAt: + type: string + hasFix: + type: boolean + kev: + type: boolean + kevUnknown: + description: >- + No finding records this CVE as KEV-listed, at least one Review could not check the catalog, and the live + catalog was not applied + type: boolean + maxCvss: + format: double + type: number + maxEpss: + format: double + type: number + maxSeverity: + $ref: '#/components/schemas/ModelsSeverity' + openFindingCount: + type: integer + packageCount: + type: integer + reachableCount: + type: integer + repositoryCount: + type: integer + title: + description: An advisory title recorded on the CVE's dependency findings; absent when none records one + type: string + required: + - cveId + - kev + - hasFix + - findingCount + - openFindingCount + - repositoryCount + - packageCount + - reachableCount + type: object + EndpointsSCAVulnerabilityIntel: + properties: + cvss: + items: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityCVSS' + type: array + cwes: + items: + type: string + type: array + description: + type: string + epss: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityEPSS' + kev: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityKEV' + modifiedAt: + type: string + publishedAt: + type: string + references: + items: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityReference' + type: array + source: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityDataSource' + title: + type: string + required: + - source + type: object + EndpointsSCAVulnerabilityKEV: + properties: + dateAdded: + type: string + dueDate: + type: string + knownRansomwareUse: + type: boolean + product: + type: string + requiredAction: + type: string + vendorProject: + type: string + vulnerabilityName: + type: string + required: + - dateAdded + - knownRansomwareUse + type: object + EndpointsSCAVulnerabilityPackage: + properties: + ecosystem: + type: string + findingCount: + type: integer + fixedVersions: + items: + type: string + type: array + name: + type: string + repositoryCount: + type: integer + type: + $ref: '#/components/schemas/EndpointsSCAVulnerabilityPackageType' + versions: + items: + type: string + nullable: true + type: array + required: + - type + - name + - versions + - findingCount + - repositoryCount + type: object + EndpointsSCAVulnerabilityPackageType: + enum: + - dependency + - container_artifact + type: string + EndpointsSCAVulnerabilityReference: + properties: + tags: + items: + type: string + type: array + url: + type: string + required: + - url + type: object + EndpointsSCAVulnerabilityVerdict: + enum: + - affected + - remediated + - no_exposure_found + - unknown + type: string + EndpointsTriageActivityLogEntry: + properties: + content: + type: string + createdAt: + type: string + eventType: + type: string + id: + type: string + metadata: + nullable: true + type: string + type: object + EndpointsTriageStatusOutput: + properties: + currentActivity: + type: string + currentPhase: + type: string + lastActivityAt: + type: string + status: + type: string + terminal: + type: boolean + type: object + ModelsAssessment: + properties: + complete: + nullable: true + type: boolean + containerCoverage: + $ref: '#/components/schemas/ModelsTriageContainerAssessment' + executionFailed: + nullable: true + type: boolean + recovery: + type: string + reportedUnknowns: + items: + type: string + type: array + requiredEvidence: + items: + type: string + type: array + type: object ModelsCVE: properties: cisaKev: type: boolean + cisaKevUnknown: + type: boolean cvss: format: double type: number @@ -71419,6 +149861,8 @@ components: epssPercentile: format: double type: number + epssUnknown: + type: boolean exploitabilityScore: format: double type: number @@ -71429,6 +149873,18 @@ components: type: number osvReachability: $ref: '#/components/schemas/ModelsOSVReachability' + priorTriageConfidence: + format: double + type: number + priorTriageExploitability: + format: double + type: number + priorTriageImpact: + format: double + type: number + priorTriageSeverity: + format: double + type: number priority: $ref: '#/components/schemas/ModelsPriorityLabel' reachabilityConfidence: @@ -71461,9 +149917,15 @@ components: type: object ModelsCVEDigest: properties: + aliases: + items: + type: string + type: array cvss: format: float type: number + details: + type: string epss_pct: format: float type: number @@ -71477,6 +149939,14 @@ components: type: string kev: type: boolean + kev_unknown: + type: boolean + malicious: + type: boolean + osv_analysed: + type: boolean + osv_called: + type: boolean published_at: format: date-time type: string @@ -71484,6 +149954,10 @@ components: $ref: '#/components/schemas/ModelsSeverity' title: type: string + vulnerable_imports: + items: + $ref: '#/components/schemas/ModelsVulnerableImport' + type: array type: object ModelsCVEReachConfidence: enum: @@ -71497,6 +149971,8 @@ components: - symbol_grep - package_only - ai_judgment + - build_stage_excluded + - osv_call_analysis type: string ModelsCallSite: properties: @@ -71507,6 +149983,29 @@ components: symbol: type: string type: object + ModelsContainerTriageTruncation: + properties: + omittedPackageCves: + type: integer + omittedSuggestionVulnerabilities: + type: integer + omittedVulnerabilities: + type: integer + omittedVulnerablePackages: + type: integer + reason: + type: string + required: + - reason + type: object + ModelsDepOrigin: + enum: + - REGISTRY + - FIRST_PARTY_GIT + - FOREIGN_GIT + - LOCAL + - UNKNOWN + type: string ModelsDepScope: enum: - PROD @@ -71517,6 +150016,8 @@ components: type: string ModelsDepTreeFacts: properties: + bundled_by: + type: string depth: nullable: true type: integer @@ -71526,6 +150027,10 @@ components: items: type: string type: array + origin: + $ref: '#/components/schemas/ModelsDepOrigin' + origin_ref: + type: string scope: $ref: '#/components/schemas/ModelsDepScope' type: object @@ -71533,6 +150038,8 @@ components: properties: cisaKev: type: boolean + cisaKevUnknown: + type: boolean cvss: format: double type: number @@ -71569,6 +150076,8 @@ components: type: object ModelsDossier: properties: + coverage: + $ref: '#/components/schemas/ModelsDossierCoverage' cves: items: $ref: '#/components/schemas/ModelsCVEDigest' @@ -71579,6 +150088,10 @@ components: emitted_at: format: date-time type: string + framework_provided: + items: + type: string + type: array input_hash: type: string package: @@ -71609,6 +150122,15 @@ components: - LOW - AMBIGUOUS type: string + ModelsDossierCoverage: + properties: + degraded: + type: boolean + gaps: + items: + type: string + type: array + type: object ModelsDossierTier: enum: - L0_POLICY @@ -71642,8 +150164,16 @@ components: - fullReference - distro type: object + ModelsInstanceReachabilityEvidence: + enum: + - reachable + - not_observed + - unsupported + type: string ModelsOSVReachability: properties: + analysed: + type: boolean called: type: boolean required: @@ -71702,12 +150232,17 @@ components: enum: - OSV - TREESITTER + - SOURCE_PARSE - COMBINED - UNSUPPORTED - TIMEOUT type: string ModelsSCAContainerfileArtifact: properties: + locations: + items: + type: string + type: array name: type: string purl: @@ -71778,6 +150313,8 @@ components: type: string exploitabilityLabel: type: string + failedTriage: + type: boolean fileOwners: items: $ref: '#/components/schemas/ModelsFileOwner' @@ -71804,6 +150341,8 @@ components: isAutoFixableAgentVerdict: nullable: true type: boolean + isCloudTriaged: + type: boolean isFalsePositive: type: boolean isLatest: @@ -71832,6 +150371,8 @@ components: $ref: '#/components/schemas/ModelsPriorityLabel' priorityScore: type: integer + prioritySource: + $ref: '#/components/schemas/ModelsPrioritySource' projectId: type: string projectName: @@ -71884,20 +150425,13 @@ components: triageLLMCostUSD: format: double type: number - triageLangfuseSessionIds: - items: - type: string - nullable: true - type: array - triageLangfuseTraceIds: - items: - type: string - nullable: true - type: array triageStart: format: date-time nullable: true type: string + triageStopReason: + nullable: true + type: string triageTraceIds: items: type: string @@ -71967,8 +150501,6 @@ components: - triageAgentVersion - triageDurationSeconds - triageLLMCostUSD - - triageLangfuseTraceIds - - triageLangfuseSessionIds - triageTraceIds - vulnerabilities - owner @@ -72014,6 +150546,8 @@ components: type: string createdAt: type: string + failedTriage: + type: boolean fileOwners: items: $ref: '#/components/schemas/ModelsFileOwner' @@ -72058,6 +150592,8 @@ components: $ref: '#/components/schemas/ModelsPriorityLabel' priorityScore: type: integer + prioritySource: + $ref: '#/components/schemas/ModelsPrioritySource' projectId: type: string projectName: @@ -72237,6 +150773,8 @@ components: type: string concurrencyLimit: type: integer + createPRRequested: + type: boolean createdAt: type: string description: @@ -72249,6 +150787,8 @@ components: type: string exploitabilityLabel: type: string + failedTriage: + type: boolean fileOwners: items: $ref: '#/components/schemas/ModelsFileOwner' @@ -72270,6 +150810,14 @@ components: type: string installationId: type: string + instanceAssessments: + items: + $ref: '#/components/schemas/ModelsSCADependencyInstanceAssessment' + type: array + instances: + items: + $ref: '#/components/schemas/ModelsSCADependencyInstance' + type: array isAllowlisted: type: boolean isArchived: @@ -72289,6 +150837,8 @@ components: type: boolean isResolved: type: boolean + latestKnownPatchedVersion: + type: string line: type: integer nonAIPriorityLabel: @@ -72309,6 +150859,12 @@ components: type: string packageFilePath: type: string + perVersionCVEStatus: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/ModelsVersionCVEStatus' + type: object + type: object priorityLabel: $ref: '#/components/schemas/ModelsPriorityLabel' priorityLabelReason: @@ -72317,8 +150873,12 @@ components: $ref: '#/components/schemas/ModelsPriorityLabel' priorityScore: type: integer + prioritySource: + $ref: '#/components/schemas/ModelsPrioritySource' projectId: type: string + projectKey: + type: string projectName: type: string pullRequestsAutofix: @@ -72326,6 +150886,8 @@ components: $ref: '#/components/schemas/ModelsPullRequestInfo' nullable: true type: array + reachableSuggestedVersion: + type: string repository: type: string repositoryId: @@ -72343,6 +150905,10 @@ components: $ref: '#/components/schemas/ModelsSeverity' severityScore: type: integer + sourceFilePaths: + items: + type: string + type: array suggestedVersion: type: string tenantId: @@ -72363,20 +150929,13 @@ components: triageLLMCostUSD: format: double type: number - triageLangfuseSessionIds: - items: - type: string - nullable: true - type: array - triageLangfuseTraceIds: - items: - type: string - nullable: true - type: array triageStart: format: date-time nullable: true type: string + triageStopReason: + nullable: true + type: string triageTraceIds: items: type: string @@ -72388,6 +150947,11 @@ components: type: string version: type: string + versions: + items: + type: string + nullable: true + type: array vulnerabilities: items: $ref: '#/components/schemas/ModelsSCADependencyVulnerability' @@ -72418,6 +150982,7 @@ components: - packageFilePath - nonAIPriorityLabel - version + - versions - filePath - line - numCritical @@ -72464,8 +151029,6 @@ components: - triageAgentVersion - triageDurationSeconds - triageLLMCostUSD - - triageLangfuseTraceIds - - triageLangfuseSessionIds - triageTraceIds - fileOwners - vulnerabilitiesMaxSeverity @@ -72506,6 +151069,8 @@ components: type: string createdAt: type: string + failedTriage: + type: boolean fileOwners: items: $ref: '#/components/schemas/ModelsFileOwner' @@ -72523,6 +151088,8 @@ components: type: string installationId: type: string + instanceScope: + $ref: '#/components/schemas/ModelsSCADependencyInstanceScope' isAllowlisted: type: boolean isArchived: @@ -72568,6 +151135,8 @@ components: $ref: '#/components/schemas/ModelsPriorityLabel' priorityScore: type: integer + prioritySource: + $ref: '#/components/schemas/ModelsPrioritySource' projectId: type: string projectName: @@ -72577,6 +151146,8 @@ components: $ref: '#/components/schemas/ModelsPullRequestInfo' nullable: true type: array + reachableSuggestedVersion: + type: string repository: type: string repositoryId: @@ -72601,6 +151172,11 @@ components: type: string version: type: string + versions: + items: + type: string + nullable: true + type: array vulnerabilitiesCVEIds: items: type: string @@ -72625,6 +151201,8 @@ components: - aiTitle - aiDevTitle - version + - versions + - instanceScope - filePath - line - numCritical @@ -72665,6 +151243,99 @@ components: - graphExists - isCloudTriaged type: object + ModelsSCADependencyInstance: + properties: + filePath: + type: string + hasReachableCVEs: + type: boolean + isDirect: + type: boolean + isReachabilitySupported: + type: boolean + line: + type: integer + packageFilePath: + type: string + version: + type: string + required: + - filePath + - version + - isDirect + - isReachabilitySupported + - hasReachableCVEs + type: object + ModelsSCADependencyInstanceAssessment: + properties: + advisoryPriority: + $ref: '#/components/schemas/ModelsPriorityLabel' + affected: + type: boolean + affectedAdvisoryIds: + items: + type: string + type: array + affectedCveIds: + items: + type: string + type: array + filePath: + type: string + fixVersion: + type: string + hasReachableCVEs: + type: boolean + isDirect: + type: boolean + isReachabilitySupported: + type: boolean + line: + type: integer + maxSeverity: + $ref: '#/components/schemas/ModelsSeverity' + packageFilePath: + type: string + reachabilityEvidence: + $ref: '#/components/schemas/ModelsInstanceReachabilityEvidence' + representative: + type: boolean + supportsPriority: + type: boolean + version: + type: string + versionUnknown: + type: boolean + required: + - filePath + - version + - isDirect + - isReachabilitySupported + - hasReachableCVEs + - representative + - affected + - supportsPriority + - reachabilityEvidence + type: object + ModelsSCADependencyInstanceScope: + properties: + affected: + type: integer + files: + type: integer + instances: + type: integer + reachable: + type: integer + versions: + type: integer + required: + - instances + - files + - versions + - affected + - reachable + type: object ModelsSCADependencyVulnerability: properties: cves: @@ -72698,6 +151369,10 @@ components: type: string version: type: string + vulnerableImports: + items: + $ref: '#/components/schemas/ModelsVulnerableImport' + type: array required: - id - hasFix @@ -72740,11 +151415,17 @@ components: type: object ModelsSCAVulnerableContainerPackage: properties: + artifactType: + type: string cves: items: $ref: '#/components/schemas/ModelsDisplayCVE' nullable: true type: array + locations: + items: + type: string + type: array name: type: string namespace: @@ -72769,6 +151450,9 @@ components: type: string codeContext: $ref: '#/components/schemas/ModelsCodeContext' + deploymentExposure: + nullable: true + type: string finding: $ref: '#/components/schemas/ModelsSCAContainerfileFinding' fixStoryPointEstimate: @@ -72786,6 +151470,8 @@ components: $ref: '#/components/schemas/ModelsTriage' triagedCommitSha: type: string + truncation: + $ref: '#/components/schemas/ModelsContainerTriageTruncation' required: - investigationSteps - agentVersion @@ -72797,8 +151483,19 @@ components: properties: agentVersion: type: string + assessmentFactors: + items: + $ref: '#/components/schemas/ModelsAssessmentFactor' + type: array codeContext: $ref: '#/components/schemas/ModelsCodeContext' + deploymentExposure: + nullable: true + type: string + exploitEvidence: + items: + $ref: '#/components/schemas/ModelsExploitEvidenceAttachment' + type: array finding: $ref: '#/components/schemas/ModelsSCADependencyFinding' fixStoryPointEstimate: @@ -72823,24 +151520,25 @@ components: - orgContextVersion - repoContextVersion type: object - DependenciesDependencyUsage: + ModelsVersionCVEStatus: properties: - isPinned: - type: boolean - name: - type: string - platform: - type: string - repositoryId: - type: string - stepName: - type: string - tenantId: + fixedVersion: type: string - versionRef: + introduced: type: string - workflowFile: + vulnerable: + type: boolean + required: + - vulnerable + type: object + ModelsVulnerableImport: + properties: + path: type: string + symbols: + items: + type: string + type: array type: object EndpointsAnalyzeContainerInput: properties: @@ -72924,6 +151622,8 @@ components: type: object EndpointsBatchQueryDependenciesOutput: properties: + integrityBudgetExhausted: + type: boolean results: items: $ref: '#/components/schemas/EndpointsBatchQueryDependencyResult' @@ -72936,8 +151636,16 @@ components: properties: ecosystem: type: string + integrity: + type: string name: type: string + provenance: + type: string + registryHost: + type: string + resolvedUrl: + type: string version: type: string required: @@ -72947,14 +151655,48 @@ components: type: object EndpointsBatchQueryDependencyResult: properties: + advisoriesUnavailable: + type: boolean + allowlistExpiresAt: + format: date-time + nullable: true + type: string + allowlistReason: + type: string + allowlisted: + type: boolean + analysisStatus: + enum: + - complete + - queued + - tier2_running + - none + - unknown + type: string ecosystem: type: string + found: + type: boolean + identityMismatch: + type: boolean + identityMismatchReason: + type: string + integrityUnchecked: + type: boolean + integrityUncheckedReason: + type: string + integrityVerified: + type: boolean isMalicious: type: boolean malwareVerdict: type: string name: type: string + provenanceMissing: + type: boolean + provenanceVerified: + type: boolean version: type: string vulnerabilities: @@ -72985,15 +151727,8 @@ components: summary: type: string type: object - EndpointsGetDependenciesOutput: + EndpointsDeleteTicketSCPMFindingOutput: properties: - dependencies: - items: - $ref: '#/components/schemas/DependenciesDependencyUsage' - nullable: true - type: array - numItems: - type: integer version: type: string type: object @@ -73004,6 +151739,8 @@ components: $ref: '#/components/schemas/ModelsSCPMEventInterface' nullable: true type: array + nextToken: + type: string numItems: type: integer version: @@ -73011,6 +151748,7 @@ components: required: - events - numItems + - nextToken type: object EndpointsGetSCPMFindingAutofixStateOutput: properties: @@ -73037,6 +151775,8 @@ components: $ref: '#/components/schemas/ModelsSCPMEventInterface' nullable: true type: array + nextToken: + type: string numItems: type: integer version: @@ -73045,34 +151785,14 @@ components: - events - numItems type: object - EndpointsGetSCPMFindingFixOutput: - properties: - commit: - type: string - diffs: - items: - $ref: '#/components/schemas/ModelsDiffFile' - nullable: true - type: array - explanation: - type: string - pullRequestBody: - type: string - pullRequestTitle: - type: string - version: - type: string - required: - - diffs - - pullRequestTitle - - pullRequestBody - - explanation - - commit - type: object EndpointsGetSCPMFindingOutput: properties: finding: $ref: '#/components/schemas/ModelsSCPMFinding' + movements: + items: + $ref: '#/components/schemas/ModelsSCPMFindingMovement' + type: array presignedUrl: type: string version: @@ -73089,11 +151809,27 @@ components: type: string version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' required: - presignedUrl type: object + EndpointsGetSCPMFindingUsersOutput: + properties: + users: + items: + $ref: '#/components/schemas/ModelsCandidate' + nullable: true + type: array + version: + type: string + required: + - users + type: object EndpointsGetSCPMFindingsDetailedOutput: properties: + cooldownWarnOnly: + type: boolean findings: items: $ref: '#/components/schemas/ModelsSCPMFinding' @@ -73103,6 +151839,8 @@ components: type: string numItems: type: integer + scannedBaseline: + type: boolean version: type: string required: @@ -73128,14 +151866,65 @@ components: - numItems - nextToken type: object + EndpointsGetSCPMRepositoriesOutput: + properties: + nextToken: + type: string + numItems: + type: integer + repositories: + additionalProperties: + $ref: '#/components/schemas/ModelsRepositoryPublic' + nullable: true + type: object + version: + type: string + required: + - repositories + - numItems + - nextToken + type: object + EndpointsGetSCPMSettingsOutput: + properties: + acceptedLicenses: + items: + type: string + type: array + cooldownDays: + type: integer + cooldownEnabled: + type: boolean + cooldownOverrides: + additionalProperties: + type: integer + type: object + cooldownWarnOnly: + type: boolean + packageAllowlist: + items: + $ref: '#/components/schemas/ModelsSCPMPackageAllowlistEntry' + type: array + version: + type: string + required: + - cooldownEnabled + - cooldownDays + - cooldownWarnOnly + type: object EndpointsPatchSCPMFindingInput: properties: + isFalsePositive: + nullable: true + type: boolean priorityOverride: $ref: '#/components/schemas/ModelsPriorityLabel' nullable: true severityOverride: $ref: '#/components/schemas/ModelsSeverity' nullable: true + userNotes: + nullable: true + type: string type: object EndpointsPatchSCPMFindingOutput: properties: @@ -73206,33 +151995,38 @@ components: $ref: '#/components/schemas/ModelsAutoFixState' error: type: string + runId: + type: string version: type: string required: - autoFixState type: object - EndpointsPostCacheAutofixSCPMFindingInput: - properties: - force: - nullable: true - type: boolean - type: object - EndpointsPostCreatePullRequestSCPMFindingInput: + EndpointsPostCreateTicketSCPMFindingInput: properties: + assignees: + items: + $ref: '#/components/schemas/ModelsUser' + type: array + campaignId: + type: string + campaignTitle: + type: string message: - description: Appended to the PR description body + type: string + project: + type: string + userCanonicalId: type: string type: object - EndpointsPostCreatePullRequestSCPMFindingOutput: + EndpointsPostCreateTicketSCPMFindingOutput: properties: - autoFixState: - $ref: '#/components/schemas/ModelsAutoFixState' - error: - type: string + ticket: + $ref: '#/components/schemas/ModelsTicketProvider' version: type: string required: - - autoFixState + - ticket type: object EndpointsPostGetUploadSCPMFindingsURLInput: properties: @@ -73250,57 +152044,75 @@ components: required: - s3UploadURL type: object - EndpointsPostRetriageSCPMFindingsInput: + EndpointsPostUnallowlistSCPMFindingInput: properties: - branch: - nullable: true + unallowlistReason: + description: The reason for unallowlisting the finding type: string - continueOnError: - nullable: true - type: boolean - findingIds: + required: + - unallowlistReason + type: object + EndpointsPostUnmarkFalsePositiveSCPMFindingOutput: + properties: + version: + type: string + type: object + EndpointsPutSCPMSettingsInput: + properties: + acceptedLicenses: items: type: string nullable: true type: array - forceRetriage: - nullable: true + cooldownDays: + maximum: 365 + minimum: 0 + type: integer + cooldownEnabled: type: boolean - priorityMinimum: - nullable: true - type: string - repositoryIds: - items: - type: string + cooldownOverrides: + additionalProperties: + type: integer nullable: true - type: array - reprocessFailedTriages: + type: object + cooldownWarnOnly: nullable: true type: boolean - reprocessFalsePositives: + packageAllowlist: + items: + $ref: '#/components/schemas/ModelsSCPMPackageAllowlistEntry' nullable: true - type: boolean + type: array required: - - findingIds - - repositoryIds + - cooldownEnabled + - cooldownDays type: object - EndpointsPostRetriageSCPMFindingsOutput: + EndpointsPutSCPMSettingsOutput: properties: - message: - type: string + acceptedLicenses: + items: + type: string + type: array + cooldownDays: + type: integer + cooldownEnabled: + type: boolean + cooldownOverrides: + additionalProperties: + type: integer + type: object + cooldownWarnOnly: + type: boolean + packageAllowlist: + items: + $ref: '#/components/schemas/ModelsSCPMPackageAllowlistEntry' + type: array version: type: string required: - - message - - version - type: object - EndpointsPostUnallowlistSCPMFindingInput: - properties: - unallowlistReason: - description: The reason for unallowlisting the finding - type: string - required: - - unallowlistReason + - cooldownEnabled + - cooldownDays + - cooldownWarnOnly type: object ModelsSCPMEventInterface: properties: @@ -73373,6 +152185,14 @@ components: type: string concurrencyLimit: type: integer + cooldownExpiresAt: + format: date-time + nullable: true + type: string + cooldownPublishedAt: + format: date-time + nullable: true + type: string createdAt: type: string deletedAt: @@ -73380,8 +152200,22 @@ components: type: string description: type: string + endLine: + type: integer + enforcement: + $ref: '#/components/schemas/ModelsSCPMEnforcement' + failedTriage: + type: boolean + falsePositiveReason: + type: string + fileOwners: + items: + $ref: '#/components/schemas/ModelsFileOwner' + type: array filePath: type: string + findingType: + $ref: '#/components/schemas/ModelsSCPMFindingType' firstSeenCommit: type: string id: @@ -73397,22 +152231,36 @@ components: type: boolean isFalsePositive: type: boolean + isFixed: + type: boolean isLatest: type: boolean isResolved: type: boolean language: type: string + lockfilePath: + type: string + manifestPath: + type: string message: type: string owner: type: string + packageManager: + type: string + packageName: + type: string + packageVersion: + type: string platform: type: string priorityLabel: $ref: '#/components/schemas/ModelsPriorityLabel' priorityLabelReason: type: string + priorityOverride: + $ref: '#/components/schemas/ModelsPriorityLabel' priorityScore: format: double type: number @@ -73428,26 +152276,39 @@ components: items: $ref: '#/components/schemas/ModelsPullRequestInfo' type: array + pureInsertion: + type: boolean repository: type: string repositoryId: type: string + resolvedAt: + format: date-time + type: string ruleId: type: string + ruleSourceId: + type: string ruleUrl: type: string severity: $ref: '#/components/schemas/ModelsSeverity' + severityOverride: + $ref: '#/components/schemas/ModelsSeverity' + startLine: + type: integer tenantId: type: string ticket: - type: string + $ref: '#/components/schemas/ModelsTicketProvider' ticketState: type: string title: type: string updatedAt: type: string + userNotes: + type: string workflow: type: string required: @@ -73479,8 +152340,14 @@ components: type: string description: type: string + enforcement: + $ref: '#/components/schemas/ModelsSCPMEnforcement' + falsePositiveReason: + type: string filePath: type: string + findingType: + $ref: '#/components/schemas/ModelsSCPMFindingType' id: type: string installationId: @@ -73491,12 +152358,18 @@ components: type: boolean isFalsePositive: type: boolean + isFixed: + type: boolean isLatest: type: boolean isResolved: type: boolean language: type: string + lockfilePath: + type: string + manifestPath: + type: string message: type: string owasp: @@ -73506,12 +152379,20 @@ components: type: array owner: type: string + packageManager: + type: string + packageName: + type: string + packageVersion: + type: string platform: type: string priorityLabel: $ref: '#/components/schemas/ModelsPriorityLabel' priorityLabelReason: type: string + priorityOverride: + $ref: '#/components/schemas/ModelsPriorityLabel' priorityScore: format: double type: number @@ -73536,8 +152417,12 @@ components: type: string ruleName: type: string + ruleSourceId: + type: string severity: $ref: '#/components/schemas/ModelsSeverity' + severityOverride: + $ref: '#/components/schemas/ModelsSeverity' tags: items: type: string @@ -73547,6 +152432,10 @@ components: type: string title: type: string + triageEnd: + format: date-time + nullable: true + type: string updatedAt: type: string required: @@ -73589,7 +152478,133 @@ components: - priorityLabel - priorityScore - priorityLabelReason + - findingType + - packageName + - packageManager + - packageVersion + - manifestPath + - lockfilePath + - ruleSourceId + - isFixed + type: object + ModelsSCPMFindingType: + enum: + - known_malware + - typosquat + - license_violation + - unpinned_dependency + - lockfile_missing + - install_script + - dependency_confusion + - cicd_unpinned_action + - cicd_malicious_action + - cicd_script_injection + - cicd_excessive_permissions + - cicd_dangerous_trigger + - cicd_artifact_token_leak + - cicd_secrets_exposure + - cicd_bot_conditions + - cicd_cache_poisoning + - cicd_github_env + - cicd_hardcoded_credentials + - cicd_insecure_commands + - cicd_secrets_inherit + - cicd_overprovisioned_secrets + - cicd_unredacted_secrets + - cicd_unpinned_images + - cicd_unsound_condition + - cicd_concurrency_limits + - cicd_use_trusted_publishing + - cicd_unsound_contains + - cicd_obfuscation + - cicd_ref_version_mismatch + - cicd_self_hosted_runner + - cicd_workflow_run_risk + - cicd_privileged_checkout + - cicd_docker_socket + - cicd_github_script_injection + - cicd_unprotected_deployment + - cicd_default_branch_push + - cicd_oidc_overscope + - cicd_missing_permissions + - cicd_unverified_action + - cicd_missing_attestation + - cicd_dispatch_toctou + - cicd_environment_bypass + - cicd_ai_risk + - cicd_include_injection + - cicd_unpinned_include + - cicd_service_connection + - unmaintained_package + - deprecated_package + - trivial_package + - dependency_hijack + - ai_hallucination_hijack + - phantom_package + - rapid_publish + - copyleft_license + - license_mismatch + - unlicensed_package + - git_dependency + - unpinned_docker_base + - unpinned_docker_image + - insecure_registry + - cooldown_recent_publish + - cooldown_updater_missing + - cooldown_updater_below_threshold + - cooldown_updater_partial + - cooldown_updater_disabled + - cooldown_updater_unparseable + - cooldown_unverifiable_ecosystem + - cooldown_pm_unsupported + - cooldown_absolute_pin_stale + - updater_unsafe_automation + - shell_access + - unmanaged_dependency + - star_jacking + - non_existent_author + - unpopular_package + - allow_scripts_enabled + - http_dependency + - no_license + - non_permissive_license + - scan_manifest_unreadable + - suppression_file_changed + - non_public_default_registry + - patched_dependency + - weak_integrity + - lockfile_removed + - lockfile_version_drift + type: string + ModelsSCPMPackageAllowlistEntry: + properties: + createdBy: + type: string + ecosystem: + type: string + expiresAt: + format: date-time + nullable: true + type: string + namespace: + type: string + packageName: + type: string + reason: + type: string + versionRange: + type: string + required: + - ecosystem + - packageName type: object + ModelsSCPMRiskLevel: + enum: + - CRITICAL + - HIGH + - MEDIUM + - LOW + type: string ModelsTriagedSCPMFinding: properties: falsePositiveReason: @@ -73612,6 +152627,16 @@ components: - fixStoryPointEstimate - repoContextVersion type: object + EndpointsDeleteTicketSecretsFindingOutput: + properties: + version: + type: string + type: object + EndpointsDeleteTicketSecretsSensitiveDataFindingOutput: + properties: + version: + type: string + type: object EndpointsGetSecretsEventsOutput: properties: events: @@ -73637,6 +152662,8 @@ components: $ref: '#/components/schemas/ModelsSecretsEventInterface' nullable: true type: array + nextToken: + type: string numItems: type: integer version: @@ -73662,6 +152689,8 @@ components: $ref: '#/components/schemas/ModelsTriagedSecretsCredentialsFinding' version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' type: object EndpointsGetSecretsFindingUsersOutput: properties: @@ -73728,6 +152757,8 @@ components: $ref: '#/components/schemas/ModelsTriagedSecretsSensitiveDataFinding' version: type: string + vulnManagementFrameworks: + $ref: '#/components/schemas/FrameworksVulnManagementFrameworks' type: object EndpointsGetSecretsSensitiveDataFindingUsersOutput: properties: @@ -74037,6 +153068,8 @@ components: type: string ruleId: type: string + scannedCommitSha: + type: string scanner: type: string scopes: @@ -74079,12 +153112,6 @@ components: format: date-time nullable: true type: string - triageLangfuseSessionId: - nullable: true - type: string - triageLangfuseTraceId: - nullable: true - type: string triageLlmCostUsd: nullable: true type: number @@ -74095,6 +153122,9 @@ components: format: date-time nullable: true type: string + triageStopReason: + nullable: true + type: string triageTokenCount: nullable: true type: integer @@ -74444,6 +153474,8 @@ components: type: boolean isResolved: type: boolean + isTriaged: + type: boolean owner: type: string ownerType: @@ -74469,6 +153501,8 @@ components: resolvedAt: format: date-time type: string + scannedCommitSha: + type: string secretValue: type: string tenantId: @@ -74486,10 +153520,19 @@ components: format: date-time nullable: true type: string + triageLlmCostUsd: + nullable: true + type: number triageStart: format: date-time nullable: true type: string + triageStopReason: + nullable: true + type: string + triageTokenCount: + nullable: true + type: integer updatedAt: type: string userId: @@ -74649,12 +153692,6 @@ components: result: $ref: '#/components/schemas/ModelsSecretsValidationResult' type: object - ModelsSecretsValidationResult: - enum: - - INVALID - - UNKNOWN - - VALID - type: string ModelsTriagedSecretsCredentialsFinding: properties: agentVersion: @@ -74745,54 +153782,11 @@ components: - orgContextVersion - repoContextVersion type: object - EndpointsGetJiraConnectDescriptorOutput: - properties: - apiVersion: - type: integer - authentication: - $ref: '#/components/schemas/ModelsAuthentication' - baseUrl: - type: string - contexts: - items: - type: string - type: array - definitions: - additionalProperties: {} - type: object - description: - type: string - enableLicensing: - type: boolean - key: - type: string - lifecycle: - $ref: '#/components/schemas/ModelsLifecycle' - links: - $ref: '#/components/schemas/ModelsLinks' - modules: - $ref: '#/components/schemas/ModelsModules' - name: - type: string - scopes: - items: - type: string - type: array - vendor: - $ref: '#/components/schemas/ModelsVendor' - version: - type: string - required: - - name - - key - - description - - vendor - - links - - baseUrl - - lifecycle - - modules - - authentication - type: object + EndpointsGitHubCredentialMode: + enum: + - dedicated + - shared + type: string EndpointsPostBitbucketConnectDescriptorOutput: properties: apiVersion: @@ -74983,69 +153977,6 @@ components: - principal - user type: object - EndpointsPostJiraInstalledInput: - properties: - baseUrl: - type: string - clientKey: - type: string - description: - type: string - displayUrl: - type: string - eventType: - type: string - key: - type: string - productType: - type: string - publicKey: - type: string - sharedSecret: - type: string - required: - - key - - clientKey - - productType - - eventType - - sharedSecret - - baseUrl - - displayUrl - - description - type: object - EndpointsPostJiraUninstalledInput: - properties: - accountId: - type: string - baseUrl: - type: string - clientKey: - type: string - description: - type: string - displayUrl: - type: string - eventType: - type: string - key: - type: string - productType: - type: string - publicKey: - type: string - sharedSecret: - type: string - required: - - key - - clientKey - - productType - - eventType - - sharedSecret - - baseUrl - - displayUrl - - description - - accountId - type: object ModelsActor: properties: account_id: